text
stringlengths
8
1.28M
token_count
int64
3
432k
Civ/Social Engineering. Social Engineering is equivalent to what the Civilization games refer to as "form of government". However, Alpha Centauri's system is the most flexible of any Civ game (until Civilization IV): you can not only choose the form of government, but fine-tune its economy, values, and how it embraces advanced technology. In Civ games, it is usually the rule that you must switch out of your starting form of government as soon as you can get any other form. This is not always true in this game. It is surely important to adjust your Social Engineering choices, but the time must be ripe. Would you want to switch to a Police State if you're already inefficient? No! You should only use Police State if your empire is reasonably efficient and will remain so. Diplomacy. Your Social Engineering choices affect the AI factions' attitudes toward you. Each faction has a "preferred" choice and an "aversion" choice. For example, Morgan will begin to like you if your economy is a Free Market (his preferred choice), and will hate you for running Planned (his aversion). Likewise, Deirdre will hate you for running Free Market, and love you if you're Green. Factions will dislike you slightly if you use any other choice in the category of their preferred choice. To use the previous examples, Morgan will be wary of you if you are using Green economics, and Deirdre if you are running Planned. Listed under each socio/economic model are the factions whose attitudes are affected if you are using that model. A faction may not select its aversion as a current engineering choice, regardless of whether it is AI-controlled or human-controlled. Politics. Frontier. No advantages or disadvantages. While it is balanced, it lacks focus. Yang will want to switch to Police State as soon as possible because it will grant him great advantages with the only penalty being the upheaval cost, due to his immunity to inefficiency. Police State. +2 Support, +2 Police, -2 Efficiency (except Yang) Yang's best option because he incurs no penalty from it, and he starts with the option to boot. Everybody else is likely to suffer great inefficiency, so for them, Police State "must" either be balanced with other Social Engineering choices with positive Efficiency modifiers (e.g., Green) or with being a faction with bonus efficiency (e.g., Deirdre). This is the Hive's preferred choice, and the Peacekeepers' aversion. Democratic. +2 Efficiency, +2 Growth, -2 Support Not a good idea for militaristic players, but great for pacifists. The extra efficiency will strengthen the economy, while the growth will help the faction expand, both horizontally and vertically. Watch out when sprawling those bases, though – you lose the 10 free minerals for new bases under a Democracy. This is the preferred choice of the Peacekeepers' and the Data Angels, and is the aversion of the Hive and the Usurpers. Fundamentalist. +2 Probe, +1 Morale, -2 Research When a faction switches to Fundamentalist, they mean business! This choice was designed for one thing: kicking butt. Your research will be crippled, so forget about it unless you can balance it (with Knowledge or your faction's traits), or you wish to start the war to end all wars. This is the preferred choice of the Lord's Believers, and the aversion of both the University of Planet and the Cybernetic Consciousness. Economics. Simple. No advantages or disadvantages. While it is balanced, it lacks focus. Yang will want to switch to Planned as soon as possible because it will grant him advantages with the only penalty being the upheaval cost, due to his immunity to inefficiency. Free Market. +2 Economy, -3 Planet, -5 Police This is only good for one thing: bringing in lots of money. This is best if your faction already has an economy bonus; it will help the benefits balance against what you lose: control of both your people and Planet. Forget about balancing out the -5 Police; reversing or minimizing the -3 Planet is doable. The penalty isn't too bad if you know what you're doing. It is if you don't. Advanced players may want to switch to Free Market as early as possible by researching Industrial Economics at the first opportunity. The base tile of each base is free from early game restrictions, and not much energy is being produced elsewhere because the focus is on creating Colony Pods, therefore the energy output of each base can often be doubled, or nearly so. This strategy is not universally accepted, however. This is the preferred choice of the Morganites, and is the Gaians' aversion. Planned. +2 Growth, +1 Industry, -2 Efficiency (except Yang) Again, Yang will usually want this because he suffers no disadvantages. Otherwise, the efficiency hit can be crippling. The combination of Police State with Planned is signing your faction's death certificate — unless you're Yang, in which case it's your most optimal combination! Otherwise, it is often good for a Democratic faction (in order to give a further boost to Growth), especially because the efficiency of Democratic will balance perfectly against the inefficiency of Planned. This is the preferred choice of both the Caretakers and the Usurpers, and is the Morganites' aversion. Green. +2 Efficiency, +2 Planet, -2 Growth Best if you wish to fight with Mind Worms — both in the sense of fighting against them and fighting using them. Otherwise, the +2 Efficiency is often not worth the -2 Growth. However, keep in mind that once you have many many bases, +2 efficiency will benefit your economy as much as FM's +2 economy without all the drawbacks. This is the preferred choice of the Gaians and the Planet Cult, and the aversion of the Free Drones. Values. Survival. No advantages or disadvantages. All other Values will hurt you militarily in some way or other, but Power will more than counterbalance that. The others will not; therefore, choosing a Value can be the most determining factor in whether or not you will play a military-focused middlegame. Power. +2 Support, +2 Morale, -2 Industry Another choice that warmongers will want, although the -2 Industry can also hurt their cause. There is no reason to choose Power unless you wish to use your military might extensively. The Cloning Vats removes the penalty to Industry, making this choice much more feasible. This is the Spartans' and the Pirates' preferred choice, and the aversion of the Data Angels. Knowledge. +2 Research, +1 Efficiency, -2 Probe This choice is good either for boosting your Research through the roof or making Fundamentalist more practical. While The Hunter-Seeker Algorithm does not improve your Probe teams, it does make you immune to being Probed, so the defensive half of the penalty is removed. This is the University of Planet's preferred choice, and the Lord's Believers' aversion. Wealth. +1 Economy, +1 Industry, -2 Morale As the name implies, this is for the money-grubber. Especially useful for Morgan, as he can run Wealth instead of Free Market and get the much-desired +1 energy per square. This is the Spartans' and the Pirates' aversion. Future Society. None. No advantages or disadvantages. As with Values, "all" other options will hurt you militarily, but Thought Control will counterbalance it by far if you have enough positive modifiers to Support elsewhere. Future Society is geared towards helping you bring the game toward the end, and selecting one will likely be the final Social Engineering choice you make. Cybernetic. +2 Efficiency, +2 Planet, +2 Research, -3 Police Mind Worm lovers will love this. This is the preferred choice of the Cybernetic Consciousness (who else?). Additionally, the Consciousness is immune to the Police penalty, as is any faction that has built The Network Backbone. Eudaimonic. +2 Economy, +2 Growth, +2 Industry, -2 Morale A boost to infrastructure, for those who like to make use of newly-conquered empires near the endgame. This is the Free Drones' preferred choice. Thought Control. +2 Morale, +2 Probe, +2 Police, -3 Support An all-military option, despite the -3 Support. The Cloning Vats removes the -3 Support penalty.
2,010
Civ/Sid Meier's Alpha Centauri/Understanding the game. Playing styles. The detailed descriptions of each faction refer to three playing styles: Builder, Hybrid, and Momentum. These will be defined here. But first, it must be recognized that there are as many different approaches to the game as there are players who love the game, but these (often wildly varying) approaches can, in at least a general sense, be grouped into the three basic styles of play. They are basic archetypes rather than full styles. Recognizing them is vitally important in effective planning. Builder. Builders don't care much for fighting, preferring to cloister themselves off on some small to mid-sized continent, terraform, build infrastructure, and research new technologies. The hallmarks of Builder style play are: To maximize the strengths of this playstyle, you must head straight to Industrial Automation for the acquisition of Supply Crawlers, and from there move right on into the lifting of your resource restrictions. You live and die by the following five techs: Centauri Ecology, Industrial Automation, Gene Splicing, Ecological Engineering, and Environmental Economics. The goal of the early Builder game is to reach Environmental Economics as quickly as possible and create such a vast economy in terms of total outputs, relative to the opposition, that when the combat techs arrive (and wise Builders will begin pursuing them the moment they get Environmental Economics), their superior economic sub-structure will enable them to out-produce and out-tech everyone else in the game. Hybrid. The Hybrid's main watch-word is "flexibility". He's the guy who wants to be ready for anything that might come up, and while he greatly admires the Builder's stunning efficiency and sterling industry, he also knows that somewhere out there on the map, and maybe closer than he thinks, are people who would like nothing better than to take it all away from him. To that end, the Hybrid player makes some "strategic sacrifices," developing a stout standing army as early as techs permit it, and upgrading and honing them constantly. Often, the Hybrid Player has half (or more) of his army on the prowl, looking for pods, and looking for potential enemies of the state. Yes, he's interested in developing an economy to rival his Builder counterparts, but not at the risk of being blind-sided by some fast-moving attacker. For Hybrids, the key technologies in the early game are: Centauri Ecology, Industrial Automation, , Gene Splicing, and Ecological Engineering. This gives you several of the key advantages of the Builder player, but also gives you more options in terms of exploration and response to incoming threats. Momentum. Fast and loose! The Momentum player's main goal is to expand with lightening speed, get a horde of small bases (production centers) up and running, and then use them to build a war machine that is second to none, and while he's getting his production centers geared up, his scouts are on the prowl, a sharp eye open for signs of anybody else. The moment he finds someone else, the real show begins, and the Momentum player is banking on the fact that, because he's so active, even if you have a technology edge, he'll be able to probe his way to technological parity and smash you with his relatively large standing force. Bases are seen as little more than barracks, and not much attention is given to infrastructural builds, beyond the absolutely essential (i.e., network nodes, to cash in artifacts found or stolen). Momentum players will want the biggest bang for their buck, and they'll want it as quickly as possible. For them, the key technologies are: Centauri Ecology, Industrial Automation, , Non-Linear Mathematics, and Ecological Engineering. They're willing to work around the mineral restrictions to get a decent army in the field, and many of the factions this group favors come with support bonuses, giving them a relatively large number of "free" troops anyway. A perfect example of this would be Miriam Godwinson's Believers. With their +2 Support rating, each of their bases gets four free units. Figure one former and one garrison, that still leaves her two attackers per base that can go out hunting. Multiplied out over ten or twelve bases, and it's no wonder she's so feared by the Builder crowd! Putting it together. As you can see, while there are key differences between the various styles of play, there are also some similarities between the three styles. Two techs in particular popped up all three times: Ecological Engineering and Industrial Automation. These may be the most critical techs in the entire game: if you have them and your opponent does not, you are in a "vastly" superior position. One final stylistic note to point out is this: Do not make the mistake of believing that Builders never fight and Momentum players never build infrastructure! All players of note will shift and change their strategies based on prevailing game conditions, and because of that, these "styles" mentioned are more archetypes than anything. They point to the tendencies and pre-dispositions of players toward one end of the spectrum or the other. The implication is not that Builders can only build, and Momentum players can only crank out an endless supply of troops. I don't know of anyone who plays that way, and even against an average player, such a strategy would come apart rather quickly. Essentially then, the stylistic approaches speak more to the timing than anything else. For Builders, the key to the game is the rapid development of infrastructure. They figure that the faster they can develop vast efficiencies, the better off they will be, and those greater efficiencies will enable them to quickly catch up militarily in the midgame. At the other end of the spectrum, the Momentum gamers recognize how much damage a few early game attackers can do, and seek to maximize that damage against their opponents, forcing their rivals to divert resources to deal with threats to hearth and home, while the Momentum player is free to build infrastructure without such threats. In the center are the Hybrids, who will strike opportunistically — and divert some portion of their early game resources to be ready to do that — but are unwilling to go full bore in that direction, lest they fall behind in infrastructural development. Phases of the game. The Early Game. The Early Game is the game up until the time all those annoying restrictions are lifted, and before you get the chance to start playing with the more interesting unit types. Specifically then, the techs that provide the boundary to the early game are: Resource-Wise: Gene Splicing, Ecological Engineering, and Environmental Economics. Weapon wise: Lasers (Applied Physics) and Impact (Non-linear Mathematics) will be most prevalent (with Missiles falling at the outer edge of the early game, much as Environmental Economics, developmentally). Defensively, you've got Synthmetal (Industrial Base), and Plasma (High Energy Chemistry) with some interesting variance provided by 3-res and 3-pulse armor, and of course, all units will be powered with the old-style Fission generators (weakest, and most expensive). Implications of the early game: 1) Stuff is expensive to build. The old generators are not cheap, to put it mildly, and that's bad news for you, because your mineral production is wretched, and while there are ways to improve that, none of them will happen quickly, or without a fair amount of planning on your part. 2) Terrain squares are not very productive. Pre-restriction lifting, you're faced with a limit of 2"r" ("r" being whatever resource you're harvesting) in each category, for an absolute maximum of six resources per square (i.e. - Monolith, 2r for each of the three resource-types). Taken together, that's a pretty punishing two-edged sword. Not only are you having to pay more for your early game units in terms of time to build, but you're also faced with terrain squares that have limited value. There is some good news though, in the form of special resource squares. These squares are not limited by the early game restrictions, and as such, they should receive your immediate attention. If you find one that's located in an unattractive base-building spot, that's no problem...the moment you get industrial automation, send a supply crawler out that direction and start taking advantage of the resource! (and more about this in particular on the section on Terraforming!) The Middle Game. The Middle Game is bounded on one side by the lifting of energy restrictions, the acquisition of Missile techs (with Air Power coming soon thereafter), and the discovery of Fusion Power and runs all the way to the acquisition of Habitation Domes and is where the bulk of your game will be played out. Terrain squares get more productive as more terraforming options become available, your formers get a ton of new things to do, and your units (both offensively and defensively) become vastly more dangerous. The Late Game. The late game is marked roughly by the introduction of the Habitation Dome. Generally, single player games don't last very long once you get here, and few multi-player games ever make it this far, so don't expect to see much of the late game, unless you really enjoy playing single-player mode, and really like to take your time.
2,149
The Cold War/Study Guide. Conflicts of the Cold War. Greece (1947). Communist successes in 1947-48 enabled them to move freely over much of mainland Greece, but with extensive reorganization and American material support, the Greek National Army was slowly able to regain control over most of the countryside. Yugoslavia closed its borders to the insurgent forces in 1949, after Marshal Tito of Yugoslavia broke with the Soviet Union. Berlin (1948-1949). The Soviet Union blocked Western rail and road access to Berlin from June 24, 1948 - May 1, 1949. This Berlin Blockade was one of the major crises of the Cold War. The crisis abated after the Soviet Union did not act to stop American, British and French airlifts (Berlin Airlift) of food and especially winter fuel for the winter of '48~'49, as well as other provisions to the Western-held sectors of Berlin following the Soviet land blockade. Korean War (1950-1953). The Korean War was a conflict between communist North and anti-communist South Korea. Both sides sabre-rattled incessantly, threatening military action. However, more importantly, Stalin's interest in an ice-free Pacific seaport for Russia ( Pusan ), was the key motivation for his encouragement of a " blitzkrieg " military reunification of the Korean peninsula. It was also a proxy war between the United States and the Soviet Union. Principal combatants were North and South Korea, the United States, Australia, Canada, the United Kingdom, and the People's Republic of China, although many other nations sent troops under the aegis of the United Nations. The Soviet Union also supplied combat advisors and aircraft pilots, as well as arms, for the North Korean and eventually Chinese troops. In U.S. parlance, Korea was officially termed a U.N. police action, not a war. Space Race (1957-1975). The Space Race was an unofficial competition between the United States and the USSR in space exploration and technology, and especially to the race between the two nations to land a human being on the moon in the second half of the 1960s. The Soviets beat the Americans in most firsts, but did not manage to beat them to the moon. Technology and especially aerospace technology advanced greatly during this period. In the sense that it was contested during the 1960s, the space race is usually considered to have been ended by the joint Apollo-Soyuz mission in 1975. Iran (1951-1953). In 1951, Prime Minister Muhammad Mussadegh, a militant nationalist, forced the parliament to nationalize the British-owned oil industry in Iran. Despite British pressure, including a economic blockade which caused real hardship, the nationalization continued. Mussadegh was briefly forced from power in 1952 but quickly returned and forced the Shah to flee. It was assumed Mussadegh would declare a republic, but a few days later the Shah returned and again forced Mussadegh from office on August 19 with U.S. CIA support. Mussadegh was arrested and a new prime minister was appointed. Guatemala (1954). In 1944, Gen. Jorge Ubico's dictatorship was overthrown by the "October Revolutionaries,"a group of dissident military officers, students, and liberal professionals. This started what is sometimes called The Ten Years of Spring, a period of rare free speech and political organizations, land reform, and a perception that great progress could be made in Guatemala. A civilian president, Juan Jose Arevalo, was elected in 1945 and held the presidency until 1951. Social reforms initiated by Arevalo were continued by his successor, Col. Jacobo Arbenz. Arbenz permitted the communist Guatemalan Labor Party to gain legal status in 1952. This greatly upset the American government which, under pressure from CIA Director Allen Dulles, brother of the U.S. Secretary of State John Foster Dulles, denounced the communist tendency of Guatemalan government and decided the Arbenz government had to be overthrown. Despite most Guatemalans' attachment to the original ideals of the 1944 uprising, some private sector leaders and the military adhered to the U.S.-imposed ideas about communist threat and started to view Arbenz's policies as a menace. The army refused to defend the Arbenz government when a United States and United Fruit -backed group led by Col. Carlos Castillo Armas invaded the country from Honduras in 1954 and quickly took over the government.
1,106
Civ/Sid Meier's Alpha Centauri/Unit Construction. Alpha Centauri features a Unit Design Workshop which is very flexible in comparison to other Civ games. For each unit, the workshop presents you with choices for each of a unit's weapon (attack strength), armor (defense strength), chassis (speed and terrain movement), reactor (hit points and build cost), and up to two special abilities (but only one until the discovery of Neural Grafting). Unit Cost. Unit cost is calculated using the following formula: C = W * (A + S) * 10 / (2 ^ (R + 1)) Where: C is the total unit cost in Minerals; W is the unit's Weapon value (Equipment for non-combat units); A is the unit's Armor value; S is the unit's Speed expressed in move points; R is the unit's Reactor value. It can be determined that units with a high value in all three areas (Weapon, Armor and Speed) will be much more expensive than units with a high value in just two. Therefore, it is advantageous to design your units for specific tasks rather than attempting to create all-round utility units. For example: a unit built for defending a base will need a high Armor value, but has little use for heavy Weapons or a high Speed, while for an attacker, a powerful Weapon is tantamount to effectiveness, while Armor may not be as important (the idea being that your opponent will be destroyed before they have a chance to fire back). The basic unit cost formula is subject to several modifiers: Chassis. The chassis is the most important part of the unit. It will determine where it can go (land/sea/air), how fast it goes, and what weapons or equipment it may use. 'Copter. The 'copter is like the needlejet, except that it can survive running out of fuel in a space without a city or airbase. Instead of being destroyed outright, it simply crash-lands, taking some damage. The 'copter can also attack as many times per turn as it has fuel remaining; however, attacking with the last unit of fuel will result in the unit crash-landing. Care must be taken when assigning go-to commands to a 'copter, as they will always end their turn upon entering a friendly base square, regardless of how many moves they have left. They are unique among non-land units in that they can blitz, or attack multiple times per turn. Cruiser. The cruiser is the ultimate transport unit. When fully upgraded, it can carry up to 16 units! In addition, it has the most movement points of any sea unit. Ideal for large maps, and long range transportation. For warships, it may be better to buy the cheaper foil, unless of course, the distance from your base to the target is a far away. Consider using for maritime probe team strikes, simply due to the large amounts of movement points. Do not engage in probe team warfare unless you can afford to lose the probe team. Just get to the target, do whatever sabotage you need to do, and do it quickly. Foil. The early waterborne unit isn't as fast as a cruiser. Gravship. Late-game chassis that is strictly superior to the needlejet, equal in speed but with no fuel limitations. Very valuable chassis when equipped with high-power weapons and armor. However, unlike the 'Copter, it can only attack once per turn. Hovertank. This is a middle-to-late-game unit that moves faster than the rover. One strategy that could be effective is building the ascent to transcendence at whatever city has the highest industry, then building these with a supply module attached to them at every other city you own and rushing them toward that city. Infantry. The default chassis for units. Some units (Crawlers, Formers, Colony Pods) do not display an actual infantryman in the unit graphic, instead using a custom chassis graphic sitting on enlarged treads. Infantry have a bonus to attacking cities. Missile. Middle-game chassis designed for kamikaze-style attacks. Cannot be equipped with weapons (except for special missile-only weapons) or armor and very few abilities. Can be very powerful if one uses it wisely. Needlejet. Though it can move an impressive distance, the needlejet will crash and burn if it ends a turn outside of a city or airbase. Also, the needlejet has the ability to attack twice in one turn, but if you choose to do this, it will die at the end of the second attack, as a bee dies after stinging something. Speeder. This creates a rover, which, in addition to its increased speed, also applies other properties, such as the loss of the infantry unit's bonus to city invasions. Also, it counts as a mobile unit for the purposes of special armor bonuses. Weapon. Weapons determine a unit's attack strength. Higher attack strengths give a unit better chances in battle. Missile payloads may only be equipped on the Missile chassis. Psi Attack. Units with the Psi Attack ability attack with psi instead of weapons. The most common and basic example of such an attacker is a Mind Worm boil. Resonance Laser. Provides a 25% bonus against units with Psi Defense. The most common such defender is a native unit. Resonance Bolt. Provides a 25% bonus against units with Psi Defense. The most common such defender is a native unit. Missile Payloads. Fungal Payload. Fungal Missles target a land square without a base or unit. Depending on reactor this plants an additional 1 – 4 squares of fungus, destroys most improvements and generates mindworms and a fungal tower in the detonation square. It leaves boreholes, bunkers, condensers, and solar mirrors. It destroys roads, forests, farms, soil enrichers, mines, and sensors. Tectonic Payload. Tectonic Missles target a land square without a base or unit. Depending on reactor level the land will be raised 1 – 4 levels, up to the maximum of 3500 m. This does not destroy improvements. Equipment. Units with equipment cannot attack – instead they are granted a number of special actions. Colony Module. A unit with a Colony Module can build a new base. Producing a unit with a colony module consumes one population. When deployed in a base, it will add one population to that base's total population. Probe Team. Units with probe equipment can perform a number of covert actions. Terraforming Unit. Terraforming units can create all manner of terrain improvements. The Terraforming Unit can be later enhanced with the special abilities Terraformers are the single most important unit in the game. The AI's poor use of them contributes greatly to its poor performance. Formers are the primary way to make your cities more productive, and are the only way to make tiles more productive (except fungus, which improves with the Centauri techs). Centauri Ecology should always be one of your first techs, or a competent opponent will defeat you. For comparison, a good unterraformed tile yields 2-1-1 (rolling and rainy, on a river), before nutrient/mineral/energy bonuses are considered. A good terraformed tile yields 0-6-6 (borehole) or 4-1-1 (condensor-farm). A fair unterraformed tile yields 1-1-0 (moist and rolling). A fair terraformed tile yields 1-2-1 (forest). Supply Transport. Supply units can extract one type of resource (either energy,mineral, or nutrient) from any non-cultivated square and convey it to its home base, and can also be brought to a base to apply its full production cost toward the production of a unit prototype or Secret Project. Supply crawlers are the second most important unit in the game (second to Terraformers). Since they allow you to harvest more tiles, they act like extra population units, but without the drone problems or the nutrient requirements. In effect, supply crawlers are constructed population points, and at 30 minerals are a bargain. Troop Transport. A Troop Transport, as the name implies, can transport land troops from one place to the other. In combination with the Carrier Deck ability, can also transport air units. The number of transported units depends on the chassis and reactor: Foils can transport twice the reactor strength, Cruisers can transport four times the reactor strength, all other units can only transport one unit at a time. Having a transport in a sea base along the coast allows units to freely enter and leave the base from the coast. Defense. A unit's defense determines how well it fights when it is attacked. Defense strength affects a unit's mineral cost. Some defenses affect a unit's cost by more than just their defensive strength. Psi Defense. Units equipped with a Psi Defense always engage in Psi combat when attacked, ignoring weapon and armor strengths. This is useful for defending against opponents whose weapon technology exceeds your defensive technology. Pulse 3 Armor. "Same as Plasma Steel Armor, but more expensive and with +25% bonus vs. mobile attackers. Alien Crossfire only." Generally a bad choice of armor, since it costs just as much as Photon Wall, yet is less effective than Silksteel Armor even against mobile attackers. Still, it comes earlier in the tech tree than Silksteel, and might make the difference against an Impact Rover. Provides no benefit to ships except perhaps when defending in a base against a mobile land attacker, since ships are never mobile attackers. The AI prefers Pulse-3 Armor, which needlessly pushes up its unit costs. Disable it or decrease its cost to help out the AI. Resonance 3 Armor. "Same as Plasma Steel Armor, but more expensive and with +25% bonus vs. Psi attacks. Alien Crossfire only." Mainly useful for combining with Hypnotic Trance on a foil for a great Psi defender. Other than that, see above. Pulse 8 Armor. "Same as Neutronium Armor, but more expensive and with +25% bonus vs. mobile attackers. Alien Crossfire only." Resonance 8 Armor. "Same as Neutronium Armor, but more expensive and with +25% bonus vs. Psi attacks. Alien Crossfire only." Reactor. Fission Plant. The default reactor for units. Later in the game, it is ideal for worm-killing units since psi combat ignores reactor strengths, and without a strong weapon, more advanced reactors will usually make the unit more expensive. Fusion Reactor. The first more powerful reactor you can get. The decrease in build costs is noticeable, and your units will be nearly unstoppable until your opponents discover Fusion as well. Quantum Chamber. Reactors beyond Fusion are of little use, since the game will probably be over by this point. Special Abilities. AAA Tracking. +100% defense vs air units. Air Superiority. Allows a unit to attack air units in flight. Air units with Air Superiority gain a +100% combat bonus versus other air units but suffer a -50% combat penalty against ground and sea units. Algorithmic Enhancement. Improves probe team success rate and decreases probe attack energy costs. Also allows a probe team to attempt an attack on a base or unit under the Hunter-Seeker Algorithm, though at an extremely low success rate. Amphibious Pods. Allows ground units to attack sea bases, and allows ground units to attack from on board a sea-going transport. Also allows ground units to cross the gap between a friendly sea base and dry land without needing a transport in the base. Antigrav Struts. +1 movement rate for ground units, and ignore terrain movement penalties. An air unit with Antigrav Struts gains a movement rate increase equal to its reactor level. Blink Displacer. Attacker ignores base defense bonuses. Carrier Deck. Transport may carry air units. Clean Reactor. Unit does not require support from its home base. Not to be confused with the unit's Reactor, the Clean Reactor trait eliminates the cost of support. Note that probe and supply units inherently do not incur support costs, hence do not need this ability. Cloaking Device. Ground unit ignores zones of control (may move past enemy units without stopping). Comm Jammer. +50% defense vs. fast units (rover, hovertank). Deep Radar. Unit can see two squares away instead of one. Note: units still cannot see into fungus (as sensor arrays do). Dissociative Wave. Halves all positive combat bonuses (such as the +25% defense against fast units conferred by the Comm Jammer special ability). Drop Pods. Allows a unit to make an Airdrop over a range of eight tiles, instantly moving from the tile of origin to the destination, provided that there are no air defenses near the destination tile, that the unit has not moved yet this turn, and that the unit is starting from a friendly base or airbase. Upon discovery of Applied Gravitonics (or upon completion of the Space Elevator, whichever comes first) any units with Drop Pods may instead make Orbital Insertions, which removes the eight-tile restriction. A unit that has made an Airdrop or Orbital Insertion may attack on the same turn, but will suffer a -50% combat penalty. Empath Song. +50% to psi offense. Fuel Nanocells. Adds +2 to an air unit's fuel supply, effectively increasing its range by 1. Fungicide Tanks. Formers remove fungus at double speed. Heavy Artillery. Ground unit can make long range bombardment attacks from up to two squares distant. It is important to note that artillery units are incapable of attacking any other way. High Morale. Unit gains one automatic Morale upgrade, in addition to any conferred by the unit's respective facility (ie. Command Center, Naval Yard or Aerospace Complex). Hypnotic Trance. +50% to psi defense. This is probably the most popular special ability in the game, perhaps rivaling Clean Reactor, putting defending land units on equal footing with attackers, and turning sea or air units into veritable psi fortresses. Marine Detachment. Allows an attacking unit to capture a severely damaged enemy sea unit. Nerve Gas Pods. +50% attack bonus. Additionally, when attacking a city, kills half of the city's population (round up) if the attacking unit wins. WARNING: using a unit equipped with this in combat is considered a Simple Atrocity. That means if the UN charter is in effect, sanctions will be imposed upon you (nullifying commerce for at least 10 years), and regardless of the UN charter, the opponent on whom you used nerve gas will hate you forever. Non-Lethal Methods. Unit counts as two for police purposes (suppressing two drones instead of one). Polymorphic Encryption. Doubles the energy cost incurred by an enemy probe team attempt to subvert the unit. Repair Bay. Transport acts as a bunker (units heal while on board). Soporific Gas Pods. Unit reduces Morale of non-native enemy units by two when attacking. Super Former. All terraforming orders except for Remove/Plant Fungus are executed at double speed.
3,655
Civ/Sid Meier's Alpha Centauri/Early Game Strategy. Economics. The very heart and soul of any empire is the economy. It supersedes the army, and even technological research and innovation. Do not misunderstand this. The production of war materials and research are vitally important to your survival and eventual dominance, but an empire's ability to produce quantities of either is driven by the force and stability of that empire's economy. You must understand that players who use a strictly militaristic focus are playing the game from the "Momentum" standpoint. Their key hope is that their program of relentless assault can end the game before some Builder or Hybrid player can build up a strong enough economy to stand against them. Never forget: Factors of production on Chiron. You've already been introduced to them, and here they are again, this time, with a slightly different treatment: Nutrients: Enables your population to expand. Minerals: Allows you to build stuff. Energy: Drives your research efforts and puts cash in your pocket. In order to build a healthy economy, attention must be paid to all three. Your economy is driven by the function of the passage of time acting against the three factors of production listed above. It's like plate tectonics, with time on one side and your productive factors on the other. You can vary your economy's effectiveness versus time (bigger or smaller "quakes" = speeding up or slowing down) by adjusting your three factors of production. Basic economic theory. The basics of economic theory are intuitive, but are outlined below: Makin' Big Cities: Maximize nutrient output over time. Note that without controls on growth (i.e., sufficient mineral production to produce anti-drone facilities), your base will suffer chronic rioting. Makin' Productive Cities: Maximize mineral output over time. Lets you build stuff very quickly. Too much mineral production leads to eco-damage, which in turn, leads to "worm rape" — something you don't want to see. Makin' Bill Gates Cities (lots of tech and cash): Maximize energy output over time. Generates money and research points very quickly, but comes with the ill effect that it takes a long time to build all the base facilities you need to get to this point (i.e., it will take even longer if you don't balance this with mineral production). Intermediate economic theory. As I said above, basic management of the factors of productive is intuitive (if you want the base to grow, give them lots of food), but since it is clear that taking any of the factors of production to their extreme is probably detrimental in some way (to say nothing of the inefficiency it creates), it becomes obvious that some balance needs to be struck. He who has a clearer understanding of when to focus on which of the factors of production will almost always be able to create a stronger economy than he who is content to let the computer make production decisions. Energy production is basically unimportant in the early game. You are starting from scratch. You have nothing. No infrastructure at all. What you need is a good balance of nutrients (to grow your population pretty rapidly), and minerals (to build your first, most basic facilities fairly quickly). Only when that has been accomplished should you begin to worry much over energy production or enhancement. For this reason, planting forests is probably the most important early-game terrain enhancing you can do. Due to mineral and energy restrictions, early forests will produce as much as early mines (and mines take 6-8 turns to build). Two forests (which tend to expand on their own), or one mine? You don't have to be a student of economics to see which is more efficient, and efficiency is the name of the game (and this provides something in the way of a specific explanation of the terraforming choices mentioned earlier in this guide). Of course, in the same breath, do not discount the value of mines and boreholes. Your spare formers should be working on both of these terrain enhancements as soon as you are able, planning for the day when the mineral restrictions come off, and enabling you to instantly shift your supply crawlers around to take advantage of new efficiencies brought about by your increasing tech-level. Once you get your most essential base facilities constructed you should probably shift into a more balanced mineral/nutrient mix (still not paying terribly much attention to energy) in order to facilitate population growth, while using your selected "focus" to heighten each base's per turn output of one of the factors of production in particular. Here though, certain base facilities can make this more efficient (don't kick up your nutrient harvesting until you finish your Children's Creche, otherwise you're just spinning your wheels). Also, monitor your growth constantly as your bases creep up on their maximum size, and adjust your nutrient output accordingly. You don't want any wasted effort if you can help it. Wasted effort and resource is an opportunity for your opponent to close the gap on you and possibly overtake you. Secret projects. A number of truly powerful Secret Projects become available amazingly early on in the game, and we'll take a brief look at each of them in turn. Evaluate them against your favored strategy and see which of them fit best with your game. When you have a list of projects that are "essential" to your strategy, pursue them with a vengeance in your games! Understand though (especially in multiplayer games) that you might not get all of the projects you'd like, so the important thing here is not to overcommit. That is to say, if there are currently six Secret Projects available to you, don't start working on all six at once! If you do, and someone beats you to a project, you are stuck with two options, neither of them very good. You can either opt to change the production in your base, losing half of the accumulated minerals you had built up toward that project, or you can have that base continue to build, with plans to switch over to a new project as soon as you get a tech that grants you one. The problem here though, is if you do that, you effectively tie that base up for a number of turns where no further developmental work can be accomplished at that base — not a good thing at all. So, take your project work in small slices, and try to only start a project when you are reasonably sure you can finish it ahead of everyone else. The very best way to rapidly complete a secret project is to have all the bases in the immediate vicinity of the "Project Base" build Supply Crawlers and have them start harvesting minerals. In all likelihood, you will begin to run some eco-damage, but don't worry, it won't be for long! Remember that each crawler you have costs you a base of 30 minerals. Remember too, that most of the early game projects cost between 200-300 minerals, which means that for a paltry ten crawlers (less than that, in practice), you can complete any of the early game projects! This is one reason why Industrial Automation is so important. Your goal here is to keep building crawlers at an ever increasing rate until you have enough to send them all to the "Project Base" and finish the project. Alternately, you could simply set your nearby bases to building crawlers and shuffle them into the Project base upon completion, but this is slightly less efficient, although the upshot is that you don't have to worry with eco-damage creating fungal blooms and the potential for worm-rape. Also note that, if you have the cash, you can get significantly more "bang for your buck" by spending some cash to upgrade the crawler to a more expensive variant, because when you cash the crawler in toward the Secret Project, you will get its full mineral value; note however that crawler-upgrading is regarded as a cheat in many circles, so check beforehand to make sure that's acceptable, and if not, just use "regular" Crawlers as described above. "This information was originally written by Velociryx in his SMAC FAQ. Used with permission."
1,804
Robotics/Stepper Motors. Stepper Motor Basics. What's a stepper motor? In robotics stepper motors are primarily used in stationary robots as they tend to consume quite a lot of power. They are ideal for movements that have to be accurate and are larger than 180°.
71
Quantum Mechanics/Symmetry and Quantum Mechanics. The idea of symmetry plays a huge role in physics. We have already used symmetry arguments in the theory of relativity -- applying the principle of relativity to obtain the dispersion relation for relativistic matter waves is just such an argument. In this section we begin to explore how symmetry can be used to increase our understanding of quantum mechanics. Free Particle. The wave function for a free particle of definite momentum, "P", and energy, "E" is given by For this wave function |ψ|²=1 everywhere, so the probability of finding the particle anywhere in space and time is uniform - just like the particle energy. This contrasts with the probability distribution which arises if we assume a free particle to have the wave function In this case the probability varies with position and time, which is inconsistent with a uniform probability distribution. This solution is less symmetric than the problem. Symmetry and Definiteness. Quantum mechanics is a probabilistic theory, in the sense that the predictions it makes tell us, for instance, the probability of finding a particle somewhere in space. If we know nothing about a particle's previous history, and if there are no physical constraints that would make it more likely for a particle to be at one point along the axis than any another, then the probability distribution must be "P"("x")="constant". This is an example of a symmetry argument. Expressed more formally, it states that if the above conditions apply, then the probability distribution ought to be subject to the condition "P"("x"+"d")="P"("x") for any constant value of "d" . This can only be true if "P"("x") is a constant. In the language of physics, if there is nothing that gives the particle a higher probability of being at one point rather than another, then the probability is independent of position and the system is invariant under displacement in the direction. The above argument doesn't suffice for quantum mechanics, since as we have learned, the fundamental quantity describing a particle is not the probability distribution, but the wave function . Thus, the wave function rather than the probability distribution ought to be the quantity which is invariant under displacement. This condition turns out to be too restrictive, because it implies that ψ is constant but we know that a one-dimensional plane wave, which describes a particle with a uniform probability of being found anywhere along the axis, has the form (For simplicity we temporarily ignore the time dependence.) If we make the substitution "x"→"x"+"d" in a plane wave, we get The wave function is thus technically not invariant under displacement, in that the displaced wave function is multiplied by the factor exp("ikd"). However, the probability distribution of the displaced wave function still equals one everywhere, so there is no change in what we observe. Thus, in determining invariance under displacement, we are allowed to ignore changes in the wave function which consist only of multiplying it by a complex constant with an absolute value of one; i.e one of the form exp("i"α) with α real. Such a multiplicative constant is called a phase factor, and α the phase. It is easy to convince oneself by trial and error or by more sophisticated means that the only form of wave function which satisfies this condition is where "A" is a (possibly complex) constant. This is just in the form of a complex exponential plane wave with wavenumber "k". Thus, not only is the complex exponential wave function invariant under displacements in the manner defined above, it is the only wave function which is invariant to displacements. Furthermore, the phase factor which appears for a displacement "d" of such a plane wave takes the form exp("ikd"), where "k" is the wavenumber of the plane wave. As an example, let us see if a wave packet is invariant under displacement. Let's define a wave packet consisting of two plane waves: Making the substitution "x"→"x"+"d" in this case results in no matter what value α has. The impossibility of writing the displaced wavefunction as the original multiplied by a phase factor lends plausibility to the assertion that a single complex exponential is the only possible form of the wave function that is invariant under displacement. Notice that the wave packet does not have definite wavenumber, and hence, momentum. In particular, non-zero amplitudes exist for the associated particle to have either momentum formula_8 or formula_9 . This makes sense from the point of view of the uncertainty principle -- for a single plane wave the uncertainty in position is complete and the uncertainty in momentum is zero. For a wave packet the uncertainty in position is reduced and the uncertainty in the momentum is non-zero. However, we see that this idea can be carried further: A definite value of momentum must be associated with a completely indefinite probability distribution in position. This corresponds to a wave function which has the form of a complex exponential plane wave. However, such a plane wave is invariant under a displacement "d", except for the multiplicative phase factor , which has no physical consequences since it disappears when the probability distribution is obtained. Thus, we see that invariance under displacement of the wave function and a definite value of the momentum are linked, in that each implies the other: We can compare this with classical mechanics, where we saw that if the energy is invariant under displacement then momentum is conserved, and similarly for generalised coordinates. The above equivalence can also be extended to arbitary coordinates. In particular, since the time dependence of a complex exponential plane wave is we have by analogy with the above argument that Thus, invariance of the wave function under a displacement in time implies a definite value of the energy of the associated particle. Another useful instance of this is since the same connection between rotation and angular momentum holds as in classical mechanics. In the previous chapter we assumed that the frequency (and hence the energy) was definite and constant for a particle passing through a region of variable potential energy. We now see that this assumption is justified only if the potential energy doesn't change with time. This is because a time-varying potential energy eliminates the possibility of invariance under time shift. Compatible Variables. We already know that definite values of certain pairs of variables cannot be obtained simultaneously in quantum mechanics. For instance, the indefiniteness of position and momentum are related by the uncertainty principle -- a definite value of position implies an indefinite value of the momentum and vice versa. If definite values of two variables can be simultaneously obtained, then we call these variables compatible. If not, the variables are incompatible. If the wave function of a particle is invariant under the transformations associated with both variables, then the variables are compatible. For instance, the complex exponential plane wave associated with a free particle is invariant under displacements in both space and time. Since momentum is associated with space displacements and energy with time displacements, the momentum and energy are compatible variables for a free particle. Compatibility and Conservation. Variables which are compatible with the energy have a special status. The wave function which corresponds to a definite value of such a variable is invariant to displacements in time. Thus, if the wave function is also invariant to some other transformation at a particular time, it is invariant to that transformation for all time. The variable associated with that transformation thus retains its definite value for all time -- i. e., it is conserved. For example, the complex exponential plane wave implies a definite value of energy, and is thus invariant under time displacements. At time "t'=0, it is also invariant under displacements, which corresponds to the fact that it represents a particle with a known value of momentum. However, since momentum and energy are compatible for a free particle, the wave function will represent the same value of momentum at all other times. In other words, if the momentum is definite at "t"=0, it will be definite at all later times, and furthermore will have the same value. This is how the conservation of momentum (and by extension, the conservation of any other variable compatible with energy) is expressed in quantum mechanics. We will see later how to describe this in terms of operators.
1,829
Genealogy/LDS. The Church of Jesus Christ of Latter-Day Saints has many, many genealogy resourcs. The church is in fact on the forefront when it comes to genealogical research, because of their beliefs in proxy, "postmortem" baptism and ordinances. Members of the church and those who work in the centers they run are extremely helpful to the genealogical community at large; almost every genealogist has come into contact with a member of the church one way or another. Personal Ancestral File (PAF). The Church of Jesus Christ of Latter-Day Saints (Mormons) has in the past offered a computer program for organization of genealogical records, but the program is no longer being offered or supported. "to be written:" usage guide, etc. FamilySearch.org. [FamilySearch.Net] domain was donated to the church by an individual who refused a large amount of money offered by a private interest. The church now maintains familysearch.org for the use of family history enthusiasts. The database of records on this site is derived from the Ancestral File (AF) project of the LDS Family History Department and from other sources. AF started as a collection of "4-generation" genealogical submissions from members of the LDS Church, but has grown substantially since the early 1980's when the project originally started. Many genealogy archivists and Family History Library patrons have contributed data to the collection. The total number of individuals listed in the database numbers in the millions. The quality of the information varies considerably within the database, as both professionals and amateurs participated in the submission of data. For some individuals the data is very well documented, and links to original records can be obtained. Some data is obviously of poor quality, with perhaps incorrect genders or with the same child listed 4 or 5 times, or having other obvious errors. Another problem with this database was the method used to match up comparable records, which was done "automagically", or in other words, through a completely automated process. When matching individuals with substantial amounts of accurate information (full birth date, place information, death dates, etc.), this works fairly smoothly, but a user can sometimes spot a situation in which a family line moves from one submission to another and has been patched together. The worst situations occur when there is a "flame war" going on between different branches of a family arguing over what the correct information should be on a common ancestor. To the credit of the Family History Library, there is a dispute resolution procedure to try and clean up messes of this nature, but it does require formal documentation in the form of birth certificates, wills, etc., that are not normally required for ordinary submissions. If a user spots errors, there are procedures to try and clean up the database, but it is somewhat bureaucratic to get through. It is still worth doing if you are cleaning up your own family lines. You can easily access this website and search its large database of records, and even download some of it as a GEDCOM for inclusion in whatever genealogy software you prefer that supports the GEDCOM format (it's the "de facto" exchange format between genealogy programs) "to be written:" exploring the site, etc.
720
Physics Study Guide/Thermodynamics. =Introduction= Thermodynamics deals with the movement of heat and its conversion to mechanical and electrical energy among others. =Laws of Thermodynamics= First Law. The First Law is a statement of conservation of energy law: The First Law can be expressed as the change in internal energy of a system (formula_1) equals the amount of energy added to a system (Q), such as heat, minus the work expended by the system on its surroundings (W). If Q is positive, the system has "gained" energy (by heating). If W is positive, the system has "lost" energy from doing work on its surroundings. As written the equations have a problem in that neither Q or W are state functions or quantities which can be known by direct measurement without knowing the history of the system. In a gas, the first law can be written in terms of state functions as Zero-th Law. After the first law of Thermodynamics had been named, physicists realised that there was another more fundamental law, which they termed the 'zero-th'. This is that: An alternate form of the 'zero-th' law can be described: This second statement, in turn, gives rise to a definition of Temperature (T): Second Law. This law states that heat will never flow from a cold object to a hot object. formula_2 where formula_3 is the Boltzmann constant (formula_4) and formula_5 is the partition function, i. e. the number of all possible states in the system. This was the statistical definition of entropy, there is also a "macroscopic" definition: formula_6 where "T" is the temperature and d"Q" is the increment in energy of the system. Third Law. The third law states that a temperature of absolute zero cannot be reached. =Temperature Scales= There are several different scales used to measure temperature. Those you will most often come across in physics are degrees Celsius and kelvins. Celsius temperatures use the symbol Θ. The symbol for degrees Celsius is °C. Kelvin temperatures use the symbol T. The symbol for kelvins is K. The Celsius Scale. The Celsius scale is based on the melting and boiling points of water. The temperature for freezing water is 0 °C. This is called the "freezing point" The temperature of boiling water is 100 °C. This is called the "steam point". The Celsius scale is sometimes known as 'Centigrade', but the CGPM chose "degrees Celsius" from among the three names then in use way back in 1948, and centesimal and centigrade should no longer be used. See Wikipedia for more details. The Kelvin Scale. The Kelvin scale is based on a more fundamental temperature than the melting point of ice. This is absolute zero (equivalent to −273.15 °C), the lowest possible temperature anything could be cooled to—where the kinetic energy of "any" system is at its minimum. The Kelvin scale was developed from an observation on how the pressure and volume of a sample of gas changes with temperature- PV/T is a constant. If the temperature ( T)was reduced, then the pressure ( P) exerted by Volume (V) the Gas would also reduce, in direct proportion. This is a simple experiment and can be carried out in most school labs. Gases were assumed to exert no pressure at -273 degree Celsius. ( In fact all gases will have condensed into liquids or solids at a somewhat higher temperature) Although the Kelvin scale starts at a different point to Celsius, its units are of exactly the same size. Therefore: =Specific Latent Heat= Energy is needed to break bonds when a substance changes state. This energy is sometimes called the "latent heat". Temperature remains constant during changes of state. To calculate the energy needed for a change of state, the following equation is used: The specific latent heat, "L", is the energy needed to change the state of 1 kg of the substance without changing the temperature. The latent heat of "fusion" refers to melting. The latent heat of "vapourisation" refers to boiling. =Specific Heat Capacity= The specific heat capacity is the energy needed to raise the temperature of a given mass by a certain temperature. The change in temperature of a substance being heated or cooled depends on the mass of the substance and on how much energy is put in. However, it also depends on the properties of that given substance. How this affects temperature variation is expressed by the substance's "specific heat capacity" ("c"). This is measured in J/(kg·K) in SI units.
1,100
Non-Programmer's Tutorial for Python 2.6/Front matter. Python 3 notice: it's not recommended to learn Python 2 since it has been deprecated and replaced by Python 3. If you're new to Python, start learning Python 3. There's a Python 3 version of this Wikibook. All example Python source code in this tutorial is granted to the public domain. Therefore, you may modify it and relicense it under any license you please. Since you are expected to learn programming, the GNU Free Documentation License would require you to keep all programs that are derived from the source code in this tutorial under that license. Since the python source code is granted to the public domain, that requirement is waived. This tutorial was originally written in LaTeX and was available at: http://www.honors.montana.edu/~jjc/easytut/. It was moved here because the other server is going away and it was being read at least ten times a day. This document is available as LaTeX, HTML, PDF, and Postscript. Go to http://jjc.freeshell.org/easytut/ (Also could try http://web.archive.org/web/*/http://www.honors.montana.edu/~jjc/easytut/ or http://www.geocities.com/jrincayc/easytut.tar.gz ) to see all these forms. There are also versions of this in Korean, Spanish, Italian and Greek in the tar file. The "Non-Programmers' Tutorial For Python" is a tutorial designed to be an introduction to the Python programming language. This guide is for someone with no programming experience. If you have programmed in other languages I recommend using Python Tutorial for Programmers written by Guido van Rossum. If you have any questions or comments please use the discussion pages or see ../Authors for author contact information. I welcome questions and comments about this tutorial. I will try to answer any questions you have as best I can. Thanks go to James A. Brown for writing most of the Windows install info. Thanks also to Elizabeth Cogliati for complaining enough : about the original tutorial (that is almost unusable for a non-programmer), for proofreading, and for many ideas and comments on it. Thanks to Joe Oppegaard for writing almost all the exercises. Thanks to everyone I have missed. Other resources. See also chapter The End for some more comments.
548
Non-Programmer's Tutorial for Python 2.6/Intro. First things first. So, you've never programmed before. As we go through this tutorial, I will attempt to teach you how to program. There really is only one way to learn to program. You must read "code" and write "code" (as computer programs are often called). I'm going to show you lots of code. You should type in code that I show you to see what happens. Play around with it and make changes. The worst that can happen is that it won't work. When I type in code it will be formatted like this: print "Hello, World!" That's so it is easy to distinguish from the other text. If you're reading this on the web, you'll notice the code is in color -- that's just to make it stand out, and to make the different parts of the code stand out from each other. The code you enter will probably not be colored, or the colors may be different, but it won't affect the code as long as you enter it the same way as it's printed here. If the computer prints something out it will be formatted like this: If you try this program out and you get a syntax error, check and see what version of python you have. If you have python 3.0, you should be using the Non-Programmer's Tutorial for Python 3.0. This article was made for Python 2.6 There will often be a mixture of the text you type (which is shown in bold) and the text the program prints to the screen, which would look like this: Halt! Who Goes there? Josh You may pass, Josh I will also introduce you to the terminology of programming - for example, that programming is often referred to as "coding". This will not only help you understand what programmers are talking about, but also help the learning process. Now, on to more important things. In order to program in Python you need the Python software. If you don't already have the Python software go to http://www.python.org/download/ and get the proper version for your platform. Download it, read the instructions and get it installed. Installing Python. For Python programming you need a working Python installation and a text editor. Python comes with its own editor "IDLE", which is quite nice and totally sufficient for the beginning. As you get more into programming, you will probably switch to some other editor like "emacs", "vi" or another. The Python download page is http://www.python.org/download. The most recent version is 3.1, but any "Python 2.x" version since 2.2 will work for this tutorial. Be careful with the upcoming "Python 3", though, as some major details will change and break this tutorial's examples. A version of this tutorial for Python 3 is at Non-Programmer's Tutorial for Python 3. There are various different installation files for different computer platforms available on the download site. Here are some specific instructions for the most common operating systems: Linux, BSD and Unix users. You are probably lucky and Python is already installed on your machine. To test it type python on a command line. If you see something like that in the following section, you are set. If you have to install Python, just use the operating system's package manager or go to the repository where your packages are available and get Python. Alternatively, you can compile Python from scratch after downloading the source code. If you get the source code make sure you compile in the Tk extension if you want to use IDLE. Mac users. Starting from Mac OS X (Tiger), Python ships by default with the operating system, but you might want to update to the newer version (check the version by starting python in a command line terminal). Also IDLE (the Python editor) might be missing in the standard installation. If you want to (re-)install Python, have a look at the Mac page on the Python download site. Windows users. Some computer manufacturers pre-install Python. To check if you already have it installed, open command prompt (cmd in run menu) or MS-DOS and type python. If it says "Bad command or file name" you will need to download the appropriate Windows installer (the normal one, if you do not have a 64-bit AMD or Intel chip). Start the installer by double-clicking it and follow the procedure. Python for windows can be downloaded from the official site of python Interactive Mode. Go into IDLE (also called the Python GUI). You should see a window that has some text like this: The codice_1 is Python's way of telling you that you are in interactive mode. In interactive mode what you type is immediately run. Try typing codice_2 in. Python will respond with codice_3. Interactive mode allows you to test out and see what Python will do. If you ever feel you need to play with new Python statements, go into interactive mode and try them out. Creating and Running Programs. Go into IDLE if you are not already. In the menu at the top, select codice_4 then codice_5. In the new window that appears, type the following: print "Hello, World!" Now save the program: select codice_4 from the menu, then codice_7. Save it as "codice_8" (you can save it in any folder you want). Now that it is saved it can be run. Next run the program by going to codice_9 then codice_10 (or if you have a older version of IDLE use codice_11 then codice_12). This will output codice_13 on the codice_14 window. For a more in-depth introduction to IDLE, a longer tutorial with screenshots can be found at http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html Running Python Programs in Unix. If you are using Unix (such as Linux, Mac OSX, or BSD), if you make the program executable with codice_15, and have as the first line: you can run the python program with codice_16 like any other command. Note: In some computer environments, you need to write: Example for Solaris: Program file names. It is very useful to stick to some rules regarding the file names of Python programs. Otherwise some things "might" go wrong unexpectedly. These don't matter as much for programs, but you can have weird problems if you don't follow them for module names (modules will be discussed later). Using Python from the command line. If you don't want to use Python from the command line, you don't have to, just use IDLE. To get into interactive mode just type codice_17 without any arguments. To run a program, create it with a text editor (Emacs has a good Python mode) and then run it with codice_18. Additionally, to use Python within Vim, you may want to visit Using vim as a Python IDE Where to get help. At some point in your Python career you will probably get stuck and have no clue about how to solve the problem you are supposed to work on. This tutorial only covers the basics of Python programming, but there is a lot of further information available. Python documentation. First of all, Python is very well documented. There might even be copies of these documents on your computer, which came with your Python installation: Python user community. There are a lot of other Python users out there, and usually they are nice and willing to help you. This very active user community is organised mostly through mailing lists and a newsgroup: In order not to reinvent the wheel and discuss the same questions again and again, people will appreciate very much if you "do a web search for a solution to your problem before contacting these lists!"
1,788
Non-Programmer's Tutorial for Python 2.6/Hello, World. What you should know. You should know how to edit programs in a text editor or IDLE, save the file and run the file once the files have been saved to your disk. Printing. Programming tutorials since the beginning of time have started with a little program called "Hello, World!" The syntax changed in Python 3.0. If you are using Python 3.0, you should be reading Non-Programmer's Tutorial for Python 3 instead. So here is the Python 2.6 example: print "Hello, World!" If you are using the command line to run programs then type it in with a text editor, save it as codice_1 and run it with codice_2 Otherwise go into IDLE, create a new window, and create the program as in section Creating and Running Programs. When this program is run here's what it prints: Hello, World! Now I'm not going to tell you this every time, but when I show you a program I recommend that you type it in and run it. I learn better when I type it in and you probably do too. Now here is a more complicated program: print "Jack and Jill went up a hill" print "to fetch a pail of water;" print "Jack fell down, and broke his crown," print "and Jill came tumbling after." When you run this program it prints out: Jack and Jill went up a hill to fetch a pail of water; Jack fell down, and broke his crown, and Jill came tumbling after. When the computer runs this program it first sees the line: print "Jack and Jill went up a hill" so the computer prints: Jack and Jill went up a hill Then the computer goes down to the next line and sees: print "to fetch a pail of water;" So the computer prints to the screen: to fetch a pail of water; The computer keeps looking at each line, follows the command and then goes on to the next line. The computer keeps running commands until it reaches the end of the program. Terminology. Now is probably a good time to give you a bit of an explanation of what is happening - and a little bit of programming terminology. What we were doing above was using a "command" called codice_3. The codice_3 command is followed by one or more "arguments". So in this example print "Hello, World!" there is one "argument", which is codice_5. Note that this argument is a group of characters enclosed in double quotes ("). This is commonly referred to as a "string of characters", or "string", for short. Another example of a string is codice_6. A command and its arguments are collectively referred to as a "statement", so print "Hello, World!" is an example of a statement. That's probably more than enough terminology for now. Expressions. Here is another program: print "2 + 2 is", 2 + 2 print "3 * 4 is", 3 * 4 print "100 - 1 is", 100 - 1 print "(33 + 2) / 5 + 11.5 is", (33 + 2) / 5 + 11.5 And here is the "output" when the program is run: 2 + 2 is 4 3 * 4 is 12 100 - 1 is 99 (33 + 2) / 5 + 11.5 is 18.5 As you can see, Python can turn your six hundred dollar computer into a 2 dollar calculator. In this example, the print command is followed by two arguments, with each of the arguments separated by a comma. So with the first line of the program print "2 + 2 is", 2 + 2 The first argument is the string codice_7 and the second argument is the "mathematical expression" codice_8, which is commonly referred to as an "expression". What is important to note is that a string is printed as is (the string is what is within the double quotes but doesn't include the double quotes themselves. So the string is printed without the enclosing double quotes.) But an "expression" is "evaluated", (in other words, converted) to its actual value. Python has six basic operations for numbers: Notice that division follows the rule, if there are no decimals to start with, there will be no decimals to end with. The following program shows this: print "14 / 3 = ", 14 / 3 print "14 % 3 = ", 14 % 3 print print "14.0 / 3.0 =", 14.0 / 3.0 print "14.0 % 3.0 =", 14.0 % 3.0 print print "14.0 / 3 =", 14.0 / 3 print "14.0 % 3 =", 14.0 % 3 print print "14 / 3.0 =", 14 / 3.0 print "14 % 3.0 =", 14 % 3.0 print With the output: 14 / 3 = 4 14 % 3 = 2 14.0 / 3.0 = 4.66666666667 14.0 % 3.0 = 2.0 14.0 / 3 = 4.66666666667 14.0 % 3 = 2.0 14 / 3.0 = 4.66666666667 14 % 3.0 = 2.0 Notice how Python gives different answers for some problems depending on whether or not decimal values are used. The order of operations is the same as in math: So use parentheses to structure your formulas when needed. Talking to humans (and other intelligent beings). Often in programming you are doing something complicated and may not in the future remember what you did. When this happens, the program should probably be commented. A "comment" is a note to you and other programmers explaining what is happening. For example: print 22.0 / 7.0 # 355/113 is even more incredible rational approx to PI Which outputs 3.14285714286 Notice that the comment starts with a hash: codice_16. Comments are used to communicate with others who read the program and your future self to make clear what is complicated. Note that any text can follow a comment, and that when the program is run, the text after the codice_16 through to the end of that line is ignored. The codice_16 does not have to be at the beginning of a new line: print 22.0 / 7.0 # Well, just a good approximation Examples. Each chapter (eventually) will contain examples of the programming features introduced in the chapter. You should at least look over them and see if you understand them. If you don't, you may want to type them in and see what happens. Mess around with them, change them and see what happens. Denmark.py print "Something's rotten in the state of Denmark." print " -- Shakespeare" Output: Something's rotten in the state of Denmark. -- Shakespeare School.py print "First Grade" print "1 + 1 =", 1 + 1 print "2 + 4 =", 2 + 4 print "5 - 2 =", 5 - 2 print print "Third Grade" print "243 - 23 =", 243 - 23 print "12 * 4 =", 12 * 4 print "12 / 3 =", 12 / 3 print "13 / 3 =", 13 / 3, "R", 13 % 3 print print "Junior High" print "123.56 - 62.12 =", 123.56 - 62.12 print "(4 + 3) * 2 =", (4 + 3) * 2 print "4 + 3 * 2 =", 4 + 3 * 2 print "3 ** 2 =", 3 ** 2 print Output: First Grade 1 + 1 = 2 2 + 4 = 6 5 - 2 = 3 Third Grade 243 - 23 = 220 12 * 4 = 48 12 / 3 = 4 13 / 3 = 4 R 1 Junior High 123.56 - 62.12 = 61.44 (4 + 3) * 2 = 14 4 + 3 * 2 = 10 3 ** 2 = 9
2,136
Non-Programmer's Tutorial for Python 2.6/Who Goes There?. Input and Variables. Now I feel it is time for a really complicated program. Here it is: print "Halt!" user_reply = raw_input("Who goes there? ") print "You may pass,", user_reply When I ran it, here is what my screen showed: Halt! Who goes there? Josh You may pass, Josh "Note: After running the code by pressing F5, the Python shell will only give the output:" Halt! Who goes there? "You need to enter your name in the Python shell, and then press Enter to get the rest of the output." Of course when you run the program your screen will look different because of the codice_1 statement. When you ran the program you probably noticed (you did run the program, right?) that you had to type in your name and then press Enter. Then the program printed out some more text and also your name. This is an example of "input". The program reaches a certain point and then waits for the user to input some data that the program can use later. Of course, getting information from the user would be useless if we didn't have anywhere to put that information and this is where variables come in. In the previous program, codice_2 is a "variable". Variables are like a box that can store some piece of data. Here is a program to show examples of variables: a = 123.4 b23 = 'Spam' first_name = "Bill" b = 432 c = a + b print "a + b is", c print "first_name is", first_name print "Sorted Parts, After Midnight or", b23 And here is the output: a + b is 555.4 first_name is Bill Sorted Parts, After Midnight or Spam The variables in the above program are codice_3, codice_4, codice_5, codice_6, and codice_7. A variable in Python can store any type of data - in this example we stored some strings (e.g. "Bill") and some numbers (e.g. 432). Note the difference between strings and variable names. Strings are marked with quotation marks, which tells the computer "don't try to understand, just take this text as it is": print "first_name" This would print the text: first_name as-is. Variable names are written without any quotation marks and instruct the computer "use the value I've previously stored under this name": print first_name which would print (after the previous example): Bill Assignment. Okay, so we have these boxes called variables and also data that can go into the variable. The computer will see a line like codice_8 and it reads it as "Put the string codice_9 into the box (or variable) codice_5". Later on it sees the statement codice_11 and it reads it as "put the sum of codice_12 or codice_13 which equals codice_14 into codice_7". The right hand side of the statement (codice_12) is "evaluated" and the result is stored in the variable on the left hand side (codice_7). This is called "assignment", and you should not confuse the assignment equal sign (codice_18) with "equality" in a mathematical sense here (that's what codice_19 will be used for later). Here is another example of variable usage: a = 1 print a a = a + 1 print a a = a * 2 print a And of course here is the output: 1 2 4 Even if it is the same variable on both sides the computer still reads it as "First find out the data to store and then find out where the data goes". One more program before I end this chapter: number = input("Type in a number: ") text = raw_input("Type in a string: ") print "number =", number print "number is a", type(number) print "number * 2 =", number * 2 print "text =", text print "text is a", type(text) print "text * 2 =", text * 2 The output I got was: Type in a Number: 12.34 Type in a String: Hello number = 12.34 number is a <type 'float'> number * 2 = 24.68 text = Hello text is a <type 'str'> text * 2 = HelloHello Notice that codice_20 was gotten with codice_21 while codice_22 was gotten with codice_1. codice_1 returns a string while codice_21 returns a number. When you want the user to type in a number use codice_21 but if you want the user to type in a string use codice_1. The second half of the program uses codice_28 which tells what a variable is. Numbers are of type codice_29 or codice_30, which are short for "integer" and "floating point" (mostly used for decimal numbers), respectively. Text strings are of type codice_31, short for "string". Integers and floats can be worked on by mathematical functions, strings cannot. Notice how when python multiplies a number by an integer the expected thing happens. However when a string is multiplied by an integer the result is that multiple copies of the string are produced (i.e., codice_32). The operations with strings do different things than operations with numbers. Here are some interactive mode examples to show that some more. This could also be done as a program: print "This" + " " + "is" + " joined." print "Ha, " * 5 print "Ha, " * 5 + "ha!" Here is the list of some string operations: Examples. Rate_times.py print "Input a rate and a distance" rate = input("Rate: ") distance = input("Distance: ") print "Time:", (distance / rate) Sample runs: Input a rate and a distance Rate: 5 Distance: 10 Time: 2 Input a rate and a distance Rate: 3.52 Distance: 45.6 Time: 12.9545454545 Area.py print "Calculate information about a rectangle" length = input("Length: ") width = input("Width: ") print "Area", length * width print "Perimeter", 2 * length + 2 * width Sample runs: Calculate information about a rectangle Length: 4 Width: 3 Area 12 Perimeter 14 Calculate information about a rectangle Length: 2.53 Width: 5.2 Area 13.156 Perimeter 15.46 temperature.py temp = input("Fahrenheit temperature: ") print (temp - 32.0) * 5.0 / 9.0 Sample runs: Fahrenheit temperature: 32 0.0 Fahrenheit temperature: -40 -40.0 Fahrenheit temperature: 212 100.0 Fahrenheit temperature: 98.6 37.0
1,746
Non-Programmer's Tutorial for Python 2.6/Count to 10. While loops. Here we present our first "control structure". Ordinarily, the computer starts with the first line and then goes down from there. However, control structures change the order of how the statements are executed and/or decide if a certain statement(s) will be run. Here's the source for a program that uses the codice_1 control structure: a = 0 while a < 10: a = a + 1 print (a) And here is the extremely exciting output: 1 2 3 4 5 6 7 8 9 10 And you thought it couldn't get any worse after turning your computer into a five dollar calculator? So what does the program do? First, it sees the line codice_2 which tells the computer to sets codice_3 to the value of zero. Then, it sees codice_4 which tells the computer to check whether codice_5. The first time the computer sees this while statement, codice_3 is equal to zero, which means codice_3 is less than 10, so the computer proceeds to run the succeeding indented, or tabbed in, statements. After the last statement, codice_8, within this while "loop" is run, the computer goes back up again to the codice_9 to check the current value of codice_3. In other words, as long as codice_3 is less than ten, the computer will run the tabbed in statements. With codice_12 repeatedly adding one to codice_3, eventually the while loop makes codice_3 equal to ten, and makes the codice_5 no longer true. Reaching that point, the program will not run the indented lines any longer. Always remember to put a colon ":" after the "while" statement! Here is another example of the use of codice_1: a = 1 s = 0 print ('Enter Numbers to add to the sum.') print ('Enter 0 to quit.') while a != 0: print 'Current Sum:', s a = input('Number? ') s = s + a print 'Total Sum =', round(s, 2) Enter Numbers to add to the sum. Enter 0 to quit. Current Sum: 0 Number? 200 Current Sum: 200 Number? -15.25 Current Sum: 184.75 Number? -151.85 Current Sum: 32.9 Number? 10.00 Current Sum: 42.9 Number? 0 Total Sum = 42.9 Notice how codice_17 is only run at the end. The codice_1 statement only affects the lines that are indented with whitespace. The codice_19 means "does not equal" so codice_20 means: "until codice_21 is zero, run the tabbed statements that follow." Infinite loops. Now that we have while loops, it is possible to have programs that run forever. An easy way to do this is to write a program like this: while 1 == 1: print "Help, I'm stuck in a loop." The "==" operator is used to test equality of the expressions on the two sides of the operator, just as "<" was used for "less than" before (you will get a complete list of all comparison operators in the next chapter). This program will output codice_22 until the heat death of the universe or until you stop it, because 1 will forever be equal to 1. The way to stop it is to hit the Control (or "Ctrl") button and "C" (the letter) at the same time. This will kill the program. (Note: sometimes you will have to hit enter after the Control-C.) Examples. Fibonacci.py a = 0 b = 1 count = 0 max_count = 20 while count < max_count: count = count + 1 # we need to keep track of a since we change it old_a = a old_b = b a = old_b b = old_a + old_b # Notice that the , at the end of a print statement keeps it # from switching to a new line print(old_a), Output: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 Note the output on a single line by use of a comma at the end of the codice_23 statement. Password.py password = "no password" while password != "unicorn": password = raw_input("Password: ") print "Welcome in" Sample run: Password: auo Password: y22 Password: password Password: open sesame Password: unicorn Welcome in Exercises. Write a program that asks the user for a Login Name and password. Then when they type "lock", they need to type in their name and password to unlock the program.
1,234
Non-Programmer's Tutorial for Python 2.6/Decisions. If statement. As always I believe I should start each chapter with a warm-up typing exercise, so here is a short program to compute the absolute value of a number: n = int(input("Type in a number: ")) if n < 0: print('The absolute value of', int(n), 'is: ', abs(-n)) else: print('The absolute value of', int(n), 'is: ', abs(n)) Here is the output from the two times that I ran this program: Type in a number: -14 The absolute value of -14 is: 14 Type in a number: 24 The absolute value of 24 is: 24 So what does the computer do when it sees this piece of code? First it prompts the user for a number with the statement "codice_1". Next it reads the line "codice_2". If codice_3 is less than zero Python runs the line "codice_4". Otherwise it runs the line "codice_5". More formally Python looks at whether the "expression" codice_6 is true or false. An codice_7 statement is followed by an indented "block" of statements that are run when the expression is true. Optionally after the codice_7 statement is an codice_9 statement and another indented "block" of statements. This second block of statements is run if the expression is false. There are a number of different tests that an expression can have. Here is a table of all of them: Another feature of the codice_10 command is the codice_11 statement. It stands for else if and means if the original codice_10 statement is false but the codice_13 part is true, then do the codice_14 part. And if neither the codice_7 or codice_14 expressions are true, then do what's in the codice_9 block. Here's an example: a = 0 while a < 10: a = a + 1 if a > 5: print a, ">", 5 elif a <= 7: print a, "<=", 7 else: print "Neither test was true" and the output: 1 <= 7 2 <= 7 3 <= 7 4 <= 7 5 <= 7 6 > 5 7 > 5 8 > 5 9 > 5 10 > 5 Notice how the codice_18 is only tested when the codice_7 statement fails to be true. There can be more than one codice_14 expression, allowing multiple tests to be done in a single codice_7 statement. Examples. print 5 == 6 x = 5 y = 8 print x == y And the output False False High_low.py number = 78 guess = 0 while guess != number: guess = input("Guess a number: ") if guess > number: print "Too high" elif guess < number: print "Too low" print "Just right" Sample run: Guess a number: 100 Too high Guess a number: 50 Too low Guess a number: 75 Too low Guess a number: 87 Too high Guess a number: 81 Too high Guess a number: 78 Just right even.py number = input("Tell me a number: ") if number % 2 == 0: print number, "is even." elif number % 2 == 1: print number, "is odd." else: print number, "is very strange." Sample runs: Tell me a number: 3 3 is odd. Tell me a number: 2 2 is even. Tell me a number: 3.14159 3.14159 is very strange. average1.py count = 0 sum = 0.0 number = 1 # set to something that will not exit the while loop immediately. print "Enter 0 to exit the loop" while number != 0: number = input("Enter a number: ") if number != 0: count = count + 1 sum = sum + number print "The average was:", sum / count Sample runs: Enter 0 to exit the loop Enter a number: 3 Enter a number: 5 Enter a number: 0 The average was: 4.0 Enter 0 to exit the loop Enter a number: 1 Enter a number: 4 Enter a number: 3 Enter a number: 0 The average was: 2.66666666667 average2.py sum = 0.0 print "This program will take several numbers then average them" count = input("How many numbers would you like to average: ") current_count = 0 while current_count < count: current_count = current_count + 1 print "Number", current_count number = input("Enter a number: ") sum = sum + number print "The average was:", sum / count Sample runs: This program will take several numbers then average them How many numbers would you like to average: 2 Number 1 Enter a number: 3 Number 2 Enter a number: 5 The average was: 4.0 This program will take several numbers then average them How many numbers would you like to average: 3 Number 1 Enter a number: 1 Number 2 Enter a number: 4 Number 3 Enter a number: 3 The average was: 2.66666666667
1,408
Non-Programmer's Tutorial for Python 2.6/Debugging. What is debugging? By now if you have been messing around with the programs you have probably found that sometimes the program does something you didn't want it to do. This is fairly common. Debugging is the process of figuring out what the computer is doing and then getting it to do what you want it to do. This can be tricky. I once spent nearly a week tracking down and fixing a bug that was caused by someone putting an codice_1 where a codice_2 should have been. This chapter will be more abstract than previous chapters. What should the program do? The first thing to do (this sounds obvious) is to figure out what the program should be doing if it is running correctly. Come up with some test cases and see what happens. For example, let's say I have a program to compute the perimeter of a rectangle (the sum of the length of all the edges). I have the following test cases: I now run my program on all of the test cases and see if the program does what I expect it to do. If it doesn't then I need to find out what the computer is doing. More commonly some of the test cases will work and some will not. If that is the case you should try and figure out what the working ones have in common. For example here is the output for a perimeter program (you get to see the code in a minute): Height: 3 Width: 4 perimeter = 15 Height: 2 Width: 3 perimeter = 11 Height: 4 Width: 4 perimeter = 16 Height: 2 Width: 2 perimeter = 8 Height: 5 Width: 1 perimeter = 8 Notice that it didn't work for the first two inputs, it worked for the next two and it didn't work on the last one. Try and figure out what is in common with the working ones. Once you have some idea what the problem is finding the cause is easier. With your own programs you should try more test cases if you need them. What does the program do? The next thing to do is to look at the source code. One of the most important things to do while programming is reading source code. The primary way to do this is code walkthroughs. A code walkthrough starts at the first line, and works its way down until the program is done. codice_3 loops and codice_4 statements mean that some lines may never be run and some lines are run many times. At each line you figure out what Python has done. Lets start with the simple perimeter program. Don't type it in, you are going to read it, not run it. The source code is: height = input("Height: ") width = input("Width: ") print "perimeter =", width + height + width + width The next program we will do a code walkthrough for is a program that is supposed to print out 5 dots on the screen. However, this is what the program is outputting: And here is the program: number = 5 while number > 1: print ".", number = number - 1 print This program will be more complex to walkthrough since it now has indented portions (or control structures). Let us begin. How do I fix the program? You need to figure out what the program is doing. You need to figure out what the program should do. Figure out what the difference between the two is. Debugging is a skill that has to be practiced to be learned. If you can't figure it out after an hour, take a break, talk to someone about the problem or contemplate the lint in your navel. Come back in a while and you will probably have new ideas about the problem. Good luck.
882
Spanish/Haber. ../Verbs/ =Haber= "Haber" is an irregular verb that means "to have" in the sense of having done something, or "there is" or "there are". It is used mostly as an auxiliary verb to form the perfect compound tenses (has/had done, etc.) Indicative. ../Present/. (hecho is the :Past participle: of hacer, meaning "to make" or "to do". Here, it means "done".) ../Preterite/. Haber is used in the preterite exceedingly rarely. Mostly it is used as a literary tense. ../Future/ (Perfect). — "or" — Subjunctive. ../Imperfect Subjunctive/. — "or" —
186
Classical Nahuatl. Classical Nahuatl Wikibook. Welcome to the Classical Nahuatl Wikibook. Here you can learn the language that was spoken by the Aztecs in the valley of Mexico at the time of the Spanish Conquest and during the subsequent centuries, which has survived through a multitude of written sources written by Nahuas and Spaniards. "Nochi tlacameh huan cihuameh quipiah manoh cuali tlacaticeh, nochi zan ce totlatechpohuiltiliz huan titlatepanitalohqueh, yeca monequi cuali ma timohuicacah, ma timoicnelicah, ma timotlazohtlacah huan ma timotlepanitacah." Translation: All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood. (Article 1 of the Universal Declaration of Human Rights) Reference. __NOEDITSECTION__
245
Quantum Mechanics/Meaning of Quantum Wave Function. In the classical picture, we usually work with the position and momentum of a particle or particles. From these, we can generate all the physical information about the system. However, it is easy to see how such an approach will run into serious problems for quantum mechanics. If we consider, for the moment, the Uncertainty Principle to be our definition of Quantum Mechanics then, there is the position of a particle having no simple meaning, as there is an inherent uncertainty in it. Talking about a particular position "and" momentum is wrong, in quantum mechanics. To get round this problem, instead of having a particular value of position (or momentum) of a particle, we instead assign a probability to each point in space, of finding the particle there. We could similarly define the probability of it having a particular momentum but, while equally valid, that approach is not initially useful. Thus, in quantum mechanics, we have a wavefunction, which, as we will see, contains all the information about the system. In general, this wavefunction will be complex. This wavefunction's modulus squared is the probability distribution of the system. Position (or momentum for that matter) now, is not a variable. Rather, it is an operator. Before we see how it works, let us deviate a little, in order to understand operators better. Take a two state system for example. By two states, we mean that a particular property (say the color) can have only two values (say Red and Blue). Now, a wavefunction of the system will be a mixture of these states. Let us say R is the wavefunction when the particle is "definitely" Red, and B when it is definitely Blue. So, the general wavefunction, "W" of the system is a linear combination of the two. where formula_2 is the probability that the particle is Red. Since this is a two state system, formula_3. Be aware that, in general, formula_4 and formula_5 may be complex numbers, which is why we must use formula_2 rather than formula_7 in order to get a real probability. Now, the big news. The fundamental assumption of quantum mechanics is that any measurement will "send the system into one of that operator's eigenstates". Eigenstates are just the states of a system unchanged by an operator. In this example, when we measure the color of the system, we multiply it by a color operator, which turns a wavefunction into a color, Red or Blue. So, Quantum Mechanics says that if you make a measurement of the colour, you will never find the system to be a mixture of Red and Blue! It is only that you will sometimes find it Red, sometimes Blue, with the corresponding probabilities. If you were to measure some other property of the system, you might find it in a state which you could deduce had mixed color, but you wouldn't be able to observe this mixture. The uncertainty principle stems from this phenomenon. Measurement is nothing but acting the corresponding operator on our wavefunction. Remember, once we have acted an operator on our wavefunction, the system has already "collapsed" into one of its eigen-states (allowed states). Any subsequent measurements will yield the same result, because the system isn't anymore a mixture of all those eigen-states. To see the probability effect as stated above, you'll have to prepare the system from scratch. In other words, before making a measurement, prepare infinite mental copies of the system (an ensemble) and then perform the same measurement on each of them. Coming back to position; this is a special operator, in that its spectrum (the range of eigen-values) is continuous. Our example had a discrete (2 level) system. The details of working out stuff become more complicated for such an operator, but the basic premise remains exactly the same. What happens now? We know that Quantum Mechanics should reduce to Classical Mechanics at a large enough scale. For a single particle, this wavefunction is peaked around the "Classical Position" and the standard deviation is ~ h. So, on normal scales, we won't see this "fuzziness" of the particle. To see how a result matches with Classical Mechanics, we can use the concept of an "Expectation Value". An expectation value of an operator is just the average value of its eigenvalues, weighted with the corresponding probabilities. It can be shown that the expectation values of position and momentum are related like the classical position and momentum.
994
Non-Programmer's Tutorial for Python 2.6/Defining Functions. Creating Functions. To start off this chapter I am going to give you an example of what you could do but shouldn't (so don't type it in): a = 23 b = -23 if a < 0: a = -a if b < 0: b = -b #Or use the command: elif (if+else) if a == b: print "The absolute values of", a, "and", b, "are equal" else: print "The absolute values of", a, "and", b, "are different" with the output being: The absolute values of 23 and 23 are equal The program seems a little repetitive. Programmers hate to repeat things -- that's what computers are for, after all! (Note also that finding the absolute value changed the value of the variable, which is why it is printing out 23, and not -23 in the output.) Fortunately Python allows you to create functions to remove duplication. Here is the rewritten example: def absolute_value(n): if n < 0: n = -n return n a = 23 b = -23 if absolute_value(a) == absolute_value(b): print "The absolute values of", a, "and", b, "are equal" else: print "The absolute values of", a, "and", b, "are different" with the output being: The absolute values of 23 and -23 are equal The key feature of this program is the codice_1 statement. The codice_1 keyword (short for "define") starts a function definition. "codice_1" is followed by the name of the function "codice_4". Next, comes the single function parameter named, "codice_5". A parameter holds a value passed into the function from the program that "calls" the function. Parameters of a function in the codice_1 statement, must be enclosed within a parenthesis. The value that is passed to a function parameter is called an argument. So for now, a parameter and argument points to the same thing. The block of indented statements after the "codice_7" are then executed whenever the function is used. The statements within the function continue to be run until either the indented statements end, or a "codice_8" statement is encountered. The codice_8 statement returns a value back to the place where the function was called in the calling program. Notice how the values of codice_10 and codice_11 are not changed. Functions can be used to repeat tasks that don't return values. Here are some examples: def hello(): print "Hello" def area(w, h): return w * h def print_welcome(name): print "Welcome", name hello() hello() print_welcome("Fred") w = 4 h = 5 print "width =", w, "height =", h, "area =", area(w, h) with output being: Hello Hello Welcome Fred width = 4 height = 5 area = 20 That example shows some more stuff that you can do with functions. Notice that you can use one or more parameters, or none at all. Notice also that a function doesn't necessarily need to "return" a value, so a codice_8 statement is optional. Variables in functions. When eliminating repeated code, you often notice that variables are repeated in the code. In Python, these are dealt with in a special way. So far, all variables we have seen are global variables. Functions work with a special type of variables called local variables. These variables only exist within the function and only while the function is running. When a local variable has the same name as another variable (such as a global variable), the local variable hides the other. Sound confusing? Well, these next examples (which are a bit contrived) should help clear things up. a = 4 def print_func(): a = 17 print "in print_func a = ", a print_func() print "a = ", a,"which is global variable assigned prior to the function print_func" When run, we will receive an output of: in print_func a = 17 a = 4 which is global variable assigned prior to the function print_func Variable assignments inside a function do not override global variables, they exist only inside the function. Even though codice_10 was assigned a new value inside the function, this newly assigned value exists only within the codice_14 function. After the function finishes running and the value of an codice_10 variable is printed again, we see the value assigned to the global codice_10 variable being printed. Complex example. a_var = 10 b_var = 15 c_var = 25 def a_func(a_var): print ("in a_func a_var = ", a_var) b_var = 100 + a_var d_var = 2 * a_var print ("in a_func b_var = ", b_var) print ("in a_func d_var = ", d_var) print( "in a_func c_var = ", c_var) return b_var + 10 c_var = a_func(b_var) print ("a_var = ", a_var) print ("b_var = ", b_var) print ("c_var = ", c_var) print ("d_var = ", d_var) The output is: In this example the variables codice_17, codice_18, and codice_19 are all local variables when they are inside the function codice_20. After the statement codice_21 is run, they all cease to exist. The variable codice_17 is "automatically" a local variable since it is a parameter named by the function definition. The variables codice_18 and codice_19 are local variables since they appear on the left of an equals sign within the function in the statements: codice_25 and codice_26. Inside of the function codice_17 has no value assigned to it. When the function is called with codice_28, 15 is assigned to codice_17 since at that point in time codice_18 is 15, making the call to the function codice_31. This ends up setting the value of codice_17 to 15 when it is inside of codice_20 function. As you can see, once the function finishes running, the local variables codice_17 and codice_18 that had hidden the global variables of the same name are gone. Then the statement codice_36 prints the value codice_37 rather than the value codice_38 since the local variable that hid the global variable is gone. Another thing to notice is the codice_39 that happens at the end. This appears since the variable codice_19 no longer exists since codice_20 finished. All the local variables are deleted when the function exits. If you want to get something back from a function, then you will have to use codice_8 statement within the function. One last thing to notice is that the value of codice_43 remains unchanged inside codice_20 since it is not a parameter and it never appears on the left of an equals sign inside of the function codice_20. When a global variable is accessed inside a function, the function uses only value of the global variable but it cannot change the value assigned to the global variable outside the function. Functions allow local variables that exist only inside the function and can hide other variables that are outside the function. Examples. temperature2.py def print_options(): print "Options:" print " 'p' print options" print " 'c' convert from celsius" print " 'f' convert from fahrenheit" print " 'q' quit the program" def celsius_to_fahrenheit(c_temp): return 9.0 / 5.0 * c_temp + 32 def fahrenheit_to_celsius(f_temp): return (f_temp - 32.0) * 5.0 / 9.0 choice = "p" while choice != "q": if choice == "c": temp = input("Celsius temperature: ") print "Fahrenheit:", celsius_to_fahrenheit(temp) elif choice == "f": temp = input("Fahrenheit temperature: ") print "Celsius:", fahrenheit_to_celsius(temp) elif choice == "p": print_options() choice = raw_input("option: ") Sample Run: Options: 'p' print options 'c' convert from celsius 'f' convert from fahrenheit 'q' quit the program option: c Celsius temperature: 30 Fahrenheit: 86.0 option: f Fahrenheit temperature: 60 Celsius: 15.5555555556 option: q area2.py print def hello(): print 'Hello!' def area(width, height): return width * height def print_welcome(name): print 'Welcome,', name name = raw_input('Your Name: ') hello(), print_welcome(name) print print 'To find the area of a rectangle,' print 'enter the width and height below.' print w = input('Width: ') while w <= 0: print 'Must be a positive number' w = input('Width: ') h = input('Height: ') while h <= 0: print 'Must be a positive number' h = input('Height: ') print 'Width =', w, 'Height =', h, 'so Area =', area(w, h) Sample Run: Your Name: Josh Hello! Welcome, Josh To find the area of a rectangle, enter the width and height below. Width: -4 Must be a positive number Width: 4 Height: 3 Width = 4 Height = 3 so Area = 12 Exercises. Rewrite the area2.py program from the Examples above to have a separate function for the area of a square, the area of a rectangle, and the area of a circle (codice_46). This program should include a menu interface.
2,462
Non-Programmer's Tutorial for Python 2.6/Lists. Variables with more than one value. You have already seen ordinary variables that store a single value. However other variable types can hold more than one value. The simplest type is called a list. Here is an example of a list being used: which_one = input("What month (1-12)? ") months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] if 1 <= which_one <= 12: print "The month is", months[which_one - 1] and an output example: What month (1-12)? 3 The month is March In this example the codice_1 is a list. codice_1 is defined with the lines codice_3 and codice_4 (note that a codice_5 could also be used to split a long line, but that is not necessary in this case because Python is intelligent enough to recognize that everything within brackets belongs together). The codice_6 and codice_7 start and end the list with commas (codice_8) separating the list items. The list is used in codice_9. A list consists of items that are numbered starting at 0. In other words if you wanted January you would use codice_10. Give a list a number and it will return the value that is stored at that location. The statement codice_11 will only be true if codice_12 is between one and twelve inclusive (in other words it is what you would expect if you have seen that in algebra). Lists can be thought of as a series of boxes. Each box has a different value. For example, the boxes created by codice_13 would look like this: Each box is referenced by its number so the statement codice_14 would get codice_15, codice_16 would get codice_17 and so on up to codice_18 getting codice_19. More features of lists. The next example is just to show a lot of other stuff lists can do (for once I don't expect you to type it in, but you should probably play around with lists until you are comfortable with them.). Here goes: demolist = ["life", 42, "the universe", 6, "and", 9] print "demolist = ",demolist demolist.append("everything") print "after 'everything' was appended demolist is now:" print demolist print "len(demolist) =", len(demolist) print "demolist.index(42) =", demolist.index(42) print "demolist[1] =", demolist[1] c = 0 while c < len(demolist): print "demolist[", c, "] =", demolist[c] c = c + 1 del demolist[2] print "After 'the universe' was removed demolist is now:" print demolist if "life" in demolist: print "'life' was found in demolist" else: print "'life' was not found in demolist" if "amoeba" in demolist: print "'amoeba' was found in demolist" if "amoeba" not in demolist: print "'amoeba' was not found in demolist" demolist.sort() print "The sorted demolist is", demolist The output is: demolist = ['life', 42, 'the universe', 6, 'and', 9] after 'everything' was appended demolist is now: ['life', 42, 'the universe', 6, 'and', 9, 'everything'] len(demolist) = 7 demolist.index(42) = 1 demolist[1] = 42 demolist[ 0 ] = life demolist[ 1 ] = 42 demolist[ 2 ] = the universe demolist[ 3 ] = 6 demolist[ 4 ] = and demolist[ 5 ] = 9 demolist[ 6 ] = everything After 'the universe' was removed demolist is now: ['life', 42, 6, 'and', 9, 'everything'] 'life' was found in demolist 'amoeba' was not found in demolist The sorted demolist is [6, 9, 42, 'and', 'everything', 'life'] This example uses a whole bunch of new functions. Notice that you can just codice_20 a whole list. Next the codice_21 function is used to add a new item to the end of the list. codice_22 returns how many items are in a list. The valid indexes (as in numbers that can be used inside of the codice_23) of a list range from 0 to codice_24. The codice_25 function tells where the first location of an item is located in a list. Notice how codice_26 returns 1, and when codice_16 is run it returns 42. The line codice_28 is a just a reminder to the programmer (also called a "comment"). Python will ignore any lines that start with a codice_29. Next the lines: c = 0 while c < len(demolist): print 'demolist[', c, '] =', demolist[c] c = c + 1 create a variable codice_30, which starts at 0 and is incremented until it reaches the last index of the list. Meanwhile the codice_20 statement prints out each element of the list. The codice_32 command can be used to remove a given element in a list. The next few lines use the codice_33 operator to test if an element is in or is not in a list. The codice_34 function sorts the list. This is useful if you need a list in order from smallest number to largest or alphabetical. Note that this rearranges the list. In summary, for a list, the following operations occur: This next example uses these features in a more useful way: menu_item = 0 namelist = [] while menu_item != 9: print "--------------------" print "1. Print the list" print "2. Add a name to the list" print "3. Remove a name from the list" print "4. Change an item in the list" print "9. Quit" menu_item = input("Pick an item from the menu: ") if menu_item == 1: current = 0 if len(namelist) > 0: while current < len(namelist): print current, ".", namelist[current] current = current + 1 else: print "List is empty" elif menu_item == 2: name = raw_input("Type in a name to add: ") namelist.append(name) elif menu_item == 3: del_name = raw_input("What name would you like to remove: ") if del_name in namelist: # namelist.remove(del_name) would work just as fine item_number = namelist.index(del_name) del namelist[item_number] # The code above only removes the first occurrence of # the name. The code below from Gerald removes all. # while del_name in namelist: # item_number = namelist.index(del_name) # del namelist[item_number] else: print del_name, "was not found" elif menu_item == 4: old_name = raw_input("What name would you like to change: ") if old_name in namelist: item_number = namelist.index(old_name) new_name = raw_input("What is the new name: ") namelist[item_number] = new_name else: print old_name, "was not found" print "Goodbye" And here is part of the output: 1. Print the list 2. Add a name to the list 3. Remove a name from the list 4. Change an item in the list 9. Quit Pick an item from the menu: 2 Type in a name to add: Jack Pick an item from the menu: 2 Type in a name to add: Jill Pick an item from the menu: 1 0 . Jack 1 . Jill Pick an item from the menu: 3 What name would you like to remove: Jack Pick an item from the menu: 4 What name would you like to change: Jill What is the new name: Jill Peters Pick an item from the menu: 1 0 . Jill Peters Pick an item from the menu: 9 Goodbye That was a long program. Let's take a look at the source code. The line codice_35 makes the variable codice_36 a list with no items (or elements). The next important line is codice_37. This line starts a loop that allows the menu system for this program. The next few lines display a menu and decide which part of the program to run. The section current = 0 if len(namelist) > 0: while current < len(namelist): print current, ".", namelist[current] current = current + 1 else: print "List is empty" goes through the list and prints each name. codice_38 tells how many items are in the list. If codice_22 returns codice_40, then the list is empty. Then, a few lines later, the statement codice_41 appears. It uses the codice_21 function to add an item to the end of the list. Jump down another two lines, and notice this section of code: item_number = namelist.index(del_name) del namelist[item_number] Here the codice_25 function is used to find the index value that will be used later to remove the item. codice_44 is used to remove a element of the list. The next section old_name = raw_input("What name would you like to change: ") if old_name in namelist: item_number = namelist.index(old_name) new_name = raw_input("What is the new name: ") namelist[item_number] = new_name else: print old_name, "was not found" uses codice_25 to find the codice_46 and then puts codice_47 where the codice_48 was. Congratulations, with lists under your belt, you now know enough of the language that you could do any computations that a computer can do (this is technically known as Turing-Completeness). Of course, there are still many features that are used to make your life easier. Examples. test.py def get_questions(): # notice how the data is stored as a list of lists return "What color is the daytime sky on a clear day? ", "blue"], ["What is the answer to life, the universe and everything? ", "42"], ["What is a three letter word for mouse trap? ", "cat" def check_question(question_and_answer): # extract the question and the answer from the list question = question_and_answer[0] answer = question_and_answer[1] # give the question to the user given_answer = raw_input(question) # compare the user's answer to the testers answer if answer == given_answer: print "Correct" return True else: print "Incorrect, correct was:", answer return False def run_test(questions): if len(questions) == 0: print "No questions were given." # the return exits the function return index = 0 right = 0 while index < len(questions): # Check the question if check_question(questions[index]): right = right + 1 index = index + 1 # go to the next question else: index = index + 1 # notice the order of the computation, first multiply, then divide print "You got", right * 100 / len(questions),\ "% right out of", len(questions) run_test(get_questions()) The values codice_49 and codice_50 point to 1 and 0, respectively. They are often used in sanity checks, loop conditions etc. You will learn more about this a little bit later (chapter ../Boolean Expressions/). Sample Output: What color is the daytime sky on a clear day?green Incorrect, correct was: blue What is the answer to life, the universe and everything?42 Correct What is a three letter word for mouse trap?cat Correct You got 66 % right out of 3 Exercises. Expand the test.py program so it has a menu giving the option of taking the test, viewing the list of questions and answers, and an option to quit. Also, add a new question to ask, "What noise does a truly advanced machine make?" with the answer of "ping".
3,178
Non-Programmer's Tutorial for Python 2.6/For Loops. And here is the new typing exercise for this chapter: onetoten = range(1, 11) for count in onetoten: print count and the ever-present output: 1 2 3 4 5 6 7 8 9 10 The output looks awfully familiar but the program code looks different. The first line uses the codice_1 function. The codice_1 function uses two arguments like this codice_3. codice_4 is the first number that is produced. codice_5 is one larger than the last number. Note that this program could have been done in a shorter way: for count in range(1, 11): print count Here are some examples to show what happens with the codice_1 command: »> range(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9] »> range(-32, -20) [-32, -31, -30, -29, -28, -27, -26, -25, -24, -23, -22, -21] »> range(5,21) [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] »> range(5) [0, 1, 2, 3, 4] »> range(21, 5) The next line codice_7 uses the codice_8 control structure. A codice_8 control structure looks like codice_10. codice_11 is gone through starting with the first element of the list and going to the last. As codice_8 goes through each element in a list it puts each into codice_13. That allows codice_13 to be used in each successive time the codice_8 loop is run through. Here is another example (you don't have to type this) to demonstrate: demolist = ['life', 42, 'the universe', 6, 'and', 9, 'everything'] for item in demolist: print "The Current item is:", print item The output is: The Current item is: life The Current item is: 42 The Current item is: the universe The Current item is: 6 The Current item is: and The Current item is: 9 The Current item is: everything Notice how the codice_8 loop goes through and sets item to each element in the list. Notice how if you don't want codice_17 to go to the next line add a comma at the end of the statement (i.e. if you want to print something else on that line). So, what is codice_8 good for? The first use is to go through all the elements of a list and do something with each of them. Here's a quick way to add up all the elements: list = [2, 4, 6, 8] sum = 0 for num in list: sum = sum + num print "The sum is:", sum with the output simply being: The sum is: 20 Or you could write a program to find out if there are any duplicates in a list like this program does: list = [4, 5, 7, 8, 9, 1, 0, 7, 10] list.sort() prev = list[0] del list[0] for item in list: if prev == item: print "Duplicate of", prev, "found" prev = item and for good measure: Duplicate of 7 Found Okay, so how does it work? Here is a special debugging version to help you understand (you don't need to type this in): l = [4, 5, 7, 8, 9, 1, 0, 7, 10] print "l = [4, 5, 7, 8, 9, 1, 0, 7, 10]", "\t\tl:", l l.sort() print "l.sort()", "\t\tl:", l prev = l[0] print "prev = l[0]", "\t\tprev:", prev del l[0] print "del l[0]", "\t\tl:", l for item in l: if prev == item: print "Duplicate of", prev, "found" print "if prev == item:", "\tprev:", prev, "\titem:", item prev = item print "prev = item", "\t\tprev:", prev, "\titem:", item with the output being: l = [4, 5, 7, 8, 9, 1, 0, 7, 10] l: [4, 5, 7, 8, 9, 1, 0, 7, 10] l.sort() l: [0, 1, 4, 5, 7, 7, 8, 9, 10] prev = l[0] prev: 0 del l[0] l: [1, 4, 5, 7, 7, 8, 9, 10] if prev == item: prev: 0 item: 1 prev = item prev: 1 item: 1 if prev == item: prev: 1 item: 4 prev = item prev: 4 item: 4 if prev == item: prev: 4 item: 5 prev = item prev: 5 item: 5 if prev == item: prev: 5 item: 7 prev = item prev: 7 item: 7 Duplicate of 7 found if prev == item: prev: 7 item: 7 prev = item prev: 7 item: 7 if prev == item: prev: 7 item: 8 prev = item prev: 8 item: 8 if prev == item: prev: 8 item: 9 prev = item prev: 9 item: 9 if prev == item: prev: 9 item: 10 prev = item prev: 10 item: 10 The reason I put so many codice_17 statements in the code was so that you can see what is happening in each line. (By the way, if you can't figure out why a program is not working, try putting in lots of print statements so you can see what is happening.) First the program starts with a boring old list. Next the program sorts the list. This is so that any duplicates get put next to each other. The program then initializes a codice_20(ious) variable. Next the first element of the list is deleted so that the first item is not incorrectly thought to be a duplicate. Next a codice_8 loop is gone into. Each item of the list is checked to see if it is the same as the previous. If it is a duplicate was found. The value of codice_20 is then changed so that the next time the codice_8 loop is run through codice_20 is the previous item to the current. Sure enough, the 7 is found to be a duplicate. (Notice how codice_25 is used to print a tab.) The other way to use codice_8 loops is to do something a certain number of times. Here is some code to print out the first 9 numbers of the Fibonacci series: a = 1 b = 1 for c in range(1, 10): print a, n = a + b a = b b = n with the surprising output: 1 1 2 3 5 8 13 21 34 Everything that can be done with codice_8 loops can also be done with codice_28 loops but codice_8 loops give an easy way to go through all the elements in a list or to do something a certain number of times.
1,921
Non-Programmer's Tutorial for Python 2.6/Boolean Expressions. Here is a little example of boolean expressions (you don't have to type it in): a = 6 b = 7 c = 42 print 1, a == 6 print 2, a == 7 print 3, a == 6 and b == 7 print 4, a == 7 and b == 7 print 5, not a == 7 and b == 7 print 6, a == 7 or b == 7 print 7, a == 7 or b == 6 print 8, not (a == 7 and b == 6) print 9, not a == 7 and b == 6 With the output being: 1 True 2 False 3 True 4 False 5 True 6 True 7 False 8 True 9 False What is going on? The program consists of a bunch of funny looking codice_1 statements. Each codice_1 statement prints a number and an expression. The number is to help keep track of which statement I am dealing with. Notice how each expression ends up being either codice_3 or codice_4. In Python, false can also be written as 0 and true as 1. The lines: print 1, a == 6 print 2, a == 7 print out a codice_4 and a codice_3 respectively just as expected since the first is true and the second is false. The third print, codice_7, is a little different. The operator codice_8 means if both the statement before and the statement after are true then the whole expression is true otherwise the whole expression is false. The next line, codice_9, shows how if part of an codice_8 expression is false, the whole thing is false. The behavior of codice_8 can be summarized as follows: Notice that if the first expression is false Python does not check the second expression since it knows the whole expression is false. The next line, codice_12, uses the codice_13 operator. codice_13 just gives the opposite of the expression. (The expression could be rewritten as codice_15). Here is the table: The two following lines, codice_16 and codice_17, use the codice_18 operator. The codice_18 operator returns true if the first expression is true, or if the second expression is true or both are true. If neither are true it returns false. Here's the table: Notice that if the first expression is true Python doesn't check the second expression since it knows the whole expression is true. This works since codice_18 is true if at least one half of the expression is true. The first part is true so the second part could be either false or true, but the whole expression is still true. The next two lines, codice_21 and codice_22, show that parentheses can be used to group expressions and force one part to be evaluated first. Notice that the parentheses changed the expression from false to true. This occurred since the parentheses forced the codice_13 to apply to the whole expression instead of just the codice_24 portion. Here is an example of using a boolean expression: list = ["Life", "The Universe", "Everything", "Jack", "Jill", "Life", "Jill"] copy = list[:] copy.sort() prev = copy[0] del copy[0] count = 0 while count < len(copy) and copy[count] != prev: prev = copy[count] count = count + 1 if count < len(copy): print "First Match:", prev And here is the output: First Match: Jill This program works by continuing to check for match codice_25. When either codice_26 is greater than the last index of codice_27 or a match has been found the codice_8 is no longer true so the loop exits. The codice_29 simply checks to make sure that the codice_30 exited because a match was found. The other "trick" of codice_8 is used in this example. If you look at the table for codice_8 notice that the third entry is "false and won't check". If codice_33 (in other words codice_34 is false) then codice_35 is never looked at. This is because Python knows that if the first is false then they can't both be true. This is known as a short circuit and is useful if the second half of the codice_8 will cause an error if something is wrong. I used the first expression (codice_34) to check and see if codice_26 was a valid index for codice_27. (If you don't believe me remove the matches "Jill" and "Life", check that it still works and then reverse the order of codice_40 to codice_41.) Boolean expressions can be used when you need to check two or more different things at once. A note on Boolean Operators. A common mistake for people new to programming is a misunderstanding of the way that boolean operators works, which stems from the way the python interpreter reads these expressions. For example, after initially learning about "and " and "or" statements, one might assume that the expression codice_42 would check to see if the variable codice_43 was equivalent to one of the strings codice_44 or codice_45. This is not so. To see what I'm talking about, start an interactive session with the interpreter and enter the following expressions: »> 'a' == ('a' or 'b') »> 'b' == ('a' or 'b') »> 'a' == ('a' and 'b') »> 'b' == ('a' and 'b') And this will be the unintuitive result: »> 'a' == ('a' or 'b') True »> 'b' == ('a' or 'b') False »> 'a' == ('a' and 'b') False »> 'b' == ('a' and 'b') True At this point, the codice_8 and codice_18 operators seem to be broken. It doesn't make sense that, for the first two expressions, codice_44 is equivalent to codice_44 or codice_45 while codice_45 is not. Furthermore, it doesn't make any sense that 'b' is equivalent to codice_44 and codice_45. After examining what the interpreter does with boolean operators, these results do in fact exactly what you are asking of them, it's just not the same as what you think you are asking. When the Python interpreter looks at an codice_18 expression, it takes the first statement and checks to see if it is true. If the first statement is true, then Python returns that object's value without checking the second statement. This is because for an codice_18 expression, the whole thing is true if one of the values is true; the program does not need to bother with the second statement. On the other hand, if the first value is evaluated as false Python checks the second half and returns that value. That second half determines the truth value of the whole expression since the first half was false. This "laziness" on the part of the interpreter is called "short circuiting" and is a common way of evaluating boolean expressions in many programming languages. Similarly, for an codice_8 expression, Python uses a short circuit technique to speed truth value evaluation. If the first statement is false then the whole thing must be false, so it returns that value. Otherwise if the first value is true it checks the second and returns that value. One thing to note at this point is that the boolean expression returns a value indicating codice_4 or codice_3, but that Python considers a number of different things to have a truth value assigned to them. To check the truth value of any given object codice_43, you can use the function codice_60 to see its truth value. Below is a table with examples of the truth values of various objects: Now it is possible to understand the perplexing results we were getting when we tested those boolean expressions before. Let's take a look at what the interpreter "sees" as it goes through that code: First case: »> 'a' == ('a' or 'b') # Look at parentheses first, so evaluate expression "('a' or 'b')" # 'a' is a nonempty string, so the first value is True # Return that first value: 'a' »> 'a' == 'a' # the string 'a' is equivalent to the string 'a', so expression is True True Second case: »> 'b' == ('a' or 'b') # Look at parentheses first, so evaluate expression "('a' or 'b')" # 'a' is a nonempty string, so the first value is True # Return that first value: 'a' »> 'b' == 'a' # the string 'b' is not equivalent to the string 'a', so expression is False False Third case: »> 'a' == ('a' and 'b') # Look at parentheses first, so evaluate expression "('a' and 'b')" # 'a' is a nonempty string, so the first value is True, examine second value # 'b' is a nonempty string, so second value is True # Return that second value as result of whole expression: 'b' »> 'a' == 'b' # the string 'a' is not equivalent to the string 'b', so expression is False False Fourth case: »> 'b' == ('a' and 'b') # Look at parentheses first, so evaluate expression "('a' and 'b')" # 'a' is a nonempty string, so the first value is True, examine second value # 'b' is a nonempty string, so second value is True # Return that second value as result of whole expression: 'b' »> 'b' == 'b' # the string 'b' is equivalent to the string 'b', so expression is True True So Python was really doing its job when it gave those apparently bogus results. As mentioned previously, the important thing is to recognize what value your boolean expression will return when it is evaluated, because it isn't always obvious. Going back to those initial expressions, this is how you would write them out so they behaved in a way that you want: »> 'a' == 'a' or 'a' == 'b' True »> 'b' == 'a' or 'b' == 'b' True »> 'a' == 'a' and 'a' == 'b' False »> 'b' == 'a' and 'b' == 'b' False When these comparisons are evaluated they return truth values in terms of True or False, not strings, so we get the proper results. Examples. password1.py name = raw_input("What is your name? ") password = raw_input("What is the password? ") if name == "Josh" and password == "Friday": print "Welcome Josh" elif name == "Fred" and password == "Rock": print "Welcome Fred" else: print "I don't know you." Sample runs What is your name? Josh What is the password? Friday Welcome Josh What is your name? Bill What is the password? Money I don't know you. Exercises. Write a program that has a user guess your name, but they only get 3 chances to do so until the program quits.
2,759
Using Firefox. This book is designed to help you get the most out of your installation of . Don't have Firefox? You can download it from Mozilla's website. Note. While we, the maintainers of this book, strive to future-proof our texts, things can change, and in the software industry, change happens often and quickly before writers have a chance to catch up. For example, this book was written when Firefox was still on Windows XP, an operating system Firefox no longer supports (along with Vista and all operating systems haven't received Firefox updates since August 2018). If you're still on Windows XP or Vista, Mozilla recommends that you upgrade to Windows 7, 8, 10 or 11. Alternatively, you can switch to a Linux distribution. Edit: On January 14th, 2020, Microsoft Stopped Windows 7 Updates. On January 10th, 2023, Microsoft Stopped Windows 8.1 Updates. It Is HIGHLY Recommended To Upgrade To Windows 10 Or 11 Or Switch To A Linux Distro. This Will Let You Keep Getting Updates From Mozilla For Firefox.
276
German/Appendices/Names. Names. This is a list of common, modern German names. Please add to it. First Names. German names have undergone a drastic change in the last 60 years. Older, "typical" German names like Hans, Fritz, Heinrich, Karl or Wilhelm are now uncommon in contemporary Germany. Today many parents give their children names like (ten most popular names 2005): Typical for young people. older names: Girls' Names. young ones: older ones: Last Names. The 51. most popular last names in Germany:
141
Electronics/Thevenin/Norton Equivalents. Source Transformation. Any linear time invariant network of impedances can be reduced to one equivalent impedance. In particular, any network of sources and resistors can be reduced to one ideal source and one resistor, in either the Thevenin or Norton configurations. In this way, a complicated network attached to a load resistor can be reduced to a single voltage divider (Thevenin) or current divider (Norton). Thevenin and Norton equivalents allow a voltage source in series with a resistor to be replaced by a current source in parallel with that exact same resistor (or vice versa.) This is called a source transformation. The point to be noted is that the block that is replaced with such an equivalent should be linear and time invariant, i.e. a linear change in the electrical source in that block produces a linear change in the equivalent source, and the behavior can be replicated if the initial conditions are replicated. The above shown transformation figures are true only if the circuit contains at least one independent voltage or current source. If the circuit comprises only dependent sources then Thevenin (and also Norton) equivalent consists of RTh alone Thevenin Equivalents. The Thevenin equivalent circuit of a (two-terminal) network consists of a voltage source in series with a resistor. The Thevenin equivalent will have the same output voltage and current regardless of what is attached to the terminals. Techniques For Finding Thevenin Equivalents. The Thevenin voltage source value is equivalent to the open-circuit voltage. If the network has no dependent sources, the independent sources can be zeroed, and the Thevenin resistance is equal to the equivalent resistance of the network with zeroed sources. Then, find formula_2. If the network has only dependent sources, either attach a test voltage source to the terminal points and measure the current that passes from the positive terminal, or attach a test current source to the terminal points and measure the voltage difference across the terminals. In both cases you will have values for formula_2 and formula_4, allowing you to use the formula_1 relation to find the Thevenin resistance. Norton Equivalents. Norton equivalents can be found by performing a source transformation on the Thevenin equivalent. The Norton Equivalent of a Thevenin Equivalent consists of a current source, formula_6 in parallel with formula_7. Thevenin and Norton Equivalent. The steps for creating the Equivalent are: The Thevenin Equivalent is determined with formula_8 as the load as shown in Figure 1. The first step is to open circuit formula_8. Then the voltage v is calculated with formula_8 open circuited must be calculated. The voltage across formula_8 is formula_12 this is because no current flows in the circuit so the voltage across formula_8 must be formula_12 by KVL. Since this circuit does not contain any dependent sources, all that needs to be done is for all the Independent Voltage sources to be shorted and for all Independent Current Sources to be open circuited. This results in the circuit shown in Figure 2. Now the Thevenin Resistance is calculated looking into the two nodes. The Thevenin resistance is clearly formula_15. The Thevenin Equivalent is shown in Figure 3 and formula_7 and formula_17 have the values shown below. The Norton Equivalent is created by doing a source transformation using formula_20.(2) If formula_21 and formula_22 and formula_23 then As a final note if the voltage across formula_8 is calculate by Voltage Divider Rule using the Thevenin Equivalent circuit in Figure 3. If the value of formula_7 form equation 1 is substituted into equation 3. Now look at Figure 1 and calculate formula_30 by voltage divider rule it has the same value as equation 4. If the current through formula_8 is calculated in Figure 4 by current divider rule. Substituting equation 2 into 5. If equation 4 and Ohm's Law are used to get the voltage across formula_8 equation 3 is reached. Please note: The "||", a symbol that is used as an operator here, holds higher precedence than the "+" operator. As such, it is evaluated before a sum. See Norton's theorem and Thevenin's theorem for more examples.
997
Electronics/Phasors. Phasors. Phasors provide a simple means of analyzing linear circuits. At the heart of phasor analysis lies Euler's formula: A complex exponential can also be expressed as formula_3 is called a phasor. It contains information about the magnitude and phase of a sinusoidal signal, but not the frequency or time. This simplifies use in circuit analysis, since most of the time, all quantities in the circuit will have the same frequency. (For circuits with sources at different frequencies, the principle of superposition must be used.) A shorthand phasor notation is: formula_4 Note that this is simply a polar form, and can be converted to rectangular notation by (see figure one): and back again by (see figure two): Sinusoidal Signals. To begin, we must first understand what sinusoidal signals are. Sinusoidal signals can be represented as where A is the amplitude, formula_8 is the frequency in radians per second, and formula_9 is the phase angle in degrees(phase shift). We can return to the sinusoidal signal by taking the real part of Euler's formula: For the moment, consider single-frequency circuits. Every steady state current and voltage will have the same basic form: Example. We have three sinusoidal signals with the same frequency added together: In phasor notation, this is: We can combine these terms to get one phasor notation. This is done first by separating the real and imaginary components: The phasor notation can be written as: Back to the time domain, we get the answer:
372
Electronics/Impedance. Definition. Impedance, formula_1, is the quantity that relates voltage and current in the frequency domain. (The tilde indicates a phasor. An overscore or arrow may also be used.) In rectangular form, where "R" is the resistance and "X" is the reactance. Impedance is generally a function of frequency, i.e. NOTE: ω = 2 π f Reactance. Reactance (symbol formula_5) is the resistance to current flow of a circuit element that can store energy (i.e. a capacitor or an inductor), and is measured in ohms. The reactance of an inductor of inductance formula_6 (in Henries), through which an alternating current of angular frequency formula_7 flows is given by: The reactance of a capacitor of capacitance formula_9 (in Farads) is given similarly: The two formulae for inductive reactance and capacitive reactance create interesting counterpoints. Notice that for inductive reactance, as the frequency of the AC increases, so does the reactance. Hence, higher frequencies result in lower current. The opposite is true of capacitive reactance: The higher the frequency of AC, the less reactance a capacitor will present. Similarly, a more inductive inductor will present more reactance, while a capacitor with more capacitance will yield less reactance. Resistors. Resistors have zero reactance, since they do not store energy, so their impedance is simply Capacitors. Capacitors have zero resistance, but do have reactance. it is stored in the power of a circuit or it can be also stored in a motor running off a AC current. Their impedance is where "C" is the capacitance in farads. The reactance of one microfarad at 50 Hz is -3183 ohms, and at 60 Hz it is -2653 ohms. In much more basic terms storing energy would be equivalent to a battery the power source is active and stays in this manner without any loss of power, this is what is regarded as a means for reversing electricity in the process of keeping that current. Inductors. Like capacitors, inductors have zero resistance, but have reactance. Their impedance is where "L" is the inductance in henries. The reactance of one henry at 50 Hz is 314 ohms, and at 60 Hz it is 377 ohms. Circuit Analysis Using Impedance. Analysis in the frequency domain proceeds exactly like DC analysis, but all currents and voltages are now phasors (and so have an angle). Impedance is treated exactly like a resistance, but is also a phasor (has an imaginary component/angle depending on the representation.) Note that this analysis only applies to the steady state response of circuits. For circuits with transient characteristics, circuits must be analyzed in the Laplace domain, also known as s-domain analysis.
692
Non-Programmer's Tutorial for Python 2.6/Dictionaries. This chapter is about dictionaries. If you open a dictionary, you should notice every entry consists of two parts, a word and the word's definition. The word is the key to finding out what a word means, and what the word means is considered the value for that key. In Python, dictionaries have keys and values. Keys are used to find values. Here is an example of a dictionary in use: def print_menu(): print '1. Print Dictionary' print '2. Add definition' print '3. Remove word' print '4. Lookup word' print '5. Quit' print menu_choice = 0 print_menu() while menu_choice != 5: menu_choice = input("Type in a number (1-5): ") if menu_choice == 1: print "Definitions:" for x in words.keys(): print x, ": ", words[x] print elif menu_choice == 2: print "Add definition" name = raw_input("Word: ") means = raw_input("Definition: ") words[name] = means elif menu_choice == 3: print "Remove word" name = raw_input("Word: ") if name in words: del words[name] print name, " was removed." else: print name, " was not found." elif menu_choice == 4: print "Lookup Word" name = raw_input("Word: ") if name in words: print "The definition of ", name, " is: ", words[name] else: print "No definition for ", name, " was found." elif menu_choice != 5: print_menu() And here is my output: 1. Print Dictionary 2. Add definition 3. Remove word 4. Lookup word 5. Quit Type in a number (1-5): 2 Add definition Word: Python Definition: A snake, a programming language, and a British comedy. Type in a number (1-5): 2 Add definition Word: Dictionary Definition: A book where words are defined. Type in a number (1-5): 1 Definitions: Python: A snake, a programming language, and a British comedy. Dictionary: A book where words are defined. Type in a number (1-5): 4 Lookup Word Word: Python The definition of Python is: A snake, a programming language, and a British comedy. Type in a number (1-5): 3 Remove Word Word: Dictionary Dictionary was removed. Type in a number (1-5): 1 Definitions: Python: A snake, a programming language, and a British comedy. Type in a number (1-5): 5 This program is similar to the name list from the earlier chapter on lists (note that lists use indexes and dictionaries don't). Here's how the program works: for x in words.keys(): print x, ": ", words[x] if name in words: del words[name] if name in words: print "The definition of ", name, " is: ", words[name] A recap: Dictionaries have keys and values. Keys can be strings or numbers. Keys point to values. Values can be any type of variable (including lists or even dictionaries (those dictionaries or lists of course can contain dictionaries or lists themselves (scary right? :-) )). Here is an example of using a list in a dictionary: max_points = [25, 25, 50, 25, 100] assignments = ['hw ch 1', 'hw ch 2', 'quiz ', 'hw ch 3', 'test'] def print_menu(): print "1. Add student" print "2. Remove student" print "3. Print grades" print "4. Record grade" print "5. Print Menu" print "6. Exit" def print_all_grades(): print '\t', for i in range(len(assignments)): print assignments[i], '\t', print keys = students.keys() keys.sort() for x in keys: print x, '\t', grades = students[x] print_grades(grades) def print_grades(grades): for i in range(len(grades)): print grades[i], '\t', '\t', print print_menu() menu_choice = 0 while menu_choice != 6: print menu_choice = input("Menu Choice (1-6): ") if menu_choice == 1: name = raw_input("Student to add: ") students[name] = [0] * len(max_points) elif menu_choice == 2: name = raw_input("Student to remove: ") if name in students: del students[name] else: print "Student:", name, "not found" elif menu_choice == 3: print_all_grades() elif menu_choice == 4: print "Record Grade" name = raw_input("Student: ") if name in students: grades = students[name] print "Type in the number of the grade to record" print "Type a 0 (zero) to exit" for i in range(len(assignments)): print i + 1, assignments[i], '\t', print print_grades(grades) which = 1234 while which != -1: which = input("Change which Grade: ") which = which - 1 if 0 <= which < len(grades): grade = input("Grade: ") grades[which] = grade elif which != -1: print "Invalid Grade Number" else: print "Student not found" elif menu_choice != 6: print_menu() and here is a sample output: 1. Add student 2. Remove student 3. Print grades 4. Record grade 5. Print Menu 6. Exit Menu Choice (1-6): 3 hw ch 1 hw ch 2 quiz hw ch 3 test #Max 25 25 50 25 100 Menu Choice (1-6): 5 1. Add student 2. Remove student 3. Print grades 4. Record grade 5. Print Menu 6. Exit Menu Choice (1-6): 1 Student to add: Bill Menu Choice (1-6): 4 Record Grade Student: Bill Type in the number of the grade to record Type a 0 (zero) to exit 1 hw ch 1 2 hw ch 2 3 quiz 4 hw ch 3 5 test 0 0 0 0 0 Change which Grade: 1 Grade: 25 Change which Grade: 2 Grade: 24 Change which Grade: 3 Grade: 45 Change which Grade: 4 Grade: 23 Change which Grade: 5 Grade: 95 Change which Grade: 0 Menu Choice (1-6): 3 hw ch 1 hw ch 2 quiz hw ch 3 test #Max 25 25 50 25 100 Bill 25 24 45 23 95 Menu Choice (1-6): 6 Here's how the program works. Basically the variable codice_18 is a dictionary with the keys being the name of the students and the values being their grades. The first two lines just create two lists. The next line codice_19 creates a new dictionary with the key {codice_20} and the value is set to be codice_21, since thats what codice_22 was when the assignment is made (I use the key codice_20 since codice_24 is sorted ahead of any alphabetic characters). Next codice_1 is defined. Next the codice_26 function is defined in the lines: def print_all_grades(): print '\t', for i in range(len(assignments)): print assignments[i], '\t', print keys = students.keys() keys.sort() for x in keys: print x, '\t', grades = students[x] print_grades(grades) Notice how first the keys are gotten out of the codice_18 dictionary with the codice_28 function in the line codice_29. codice_28 is a list so all the functions for lists can be used on it. Next the keys are sorted in the line codice_31 since it is a list. codice_6 is used to go through all the keys. The grades are stored as a list inside the dictionary so the assignment codice_33 gives codice_34 the list that is stored at the key codice_9. The function codice_36 just prints a list and is defined a few lines later. The later lines of the program implement the various options of the menu. The line codice_37 adds a student to the key of their name. The notation codice_38 just creates a list of 0's that is the same length as the codice_22 list. The remove student entry just deletes a student similar to the telephone book example. The record grades choice is a little more complex. The grades are retrieved in the line codice_40 gets a reference to the grades of the student codice_11. A grade is then recorded in the line codice_42. You may notice that codice_34 is never put back into the students dictionary (as in no codice_44). The reason for the missing statement is that codice_34 is actually another name for codice_46 and so changing codice_34 changes codice_48. Dictionaries provide a easy way to link keys to values. This can be used to easily keep track of data that is attached to various keys.
2,360
Non-Programmer's Tutorial for Python 2.6/Using Modules. Here's this chapter's typing exercise (name it cal.py). codice_1 actually looks for a file named calendar.py and reads it in. If the file is named calendar.py and it sees an "import calendar" it tries to read in itself which works poorly at best.)): import calendar year = input("Type in the year number: ") calendar.prcal(year) And here is part of the output I got: Type in the year number: 2001 2001 January February March Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 1 2 3 4 1 2 3 4 8 9 10 11 12 13 14 5 6 7 8 9 10 11 5 6 7 8 9 10 11 15 16 17 18 19 20 21 12 13 14 15 16 17 18 12 13 14 15 16 17 18 22 23 24 25 26 27 28 19 20 21 22 23 24 25 19 20 21 22 23 24 25 29 30 31 26 27 28 26 27 28 29 30 31 (I skipped some of the output, but I think you get the idea.) So what does the program do? The first line codice_2 uses a new command codice_1. The command codice_1 loads a module (in this case the codice_5 module). To see the commands available in the standard modules either look in the library reference for python (if you downloaded it) or go to http://docs.python.org/library/. If you look at the documentation for the calendar module, it lists a function called codice_6 that prints a calendar for a year. The line codice_7 uses this function. In summary to use a module codice_1 it and then use codice_9 for functions in the module. Another way to write the program is: from calendar import prcal year = input("Type in the year number: ") prcal(year) This version imports a specific function from a module. Here is another program that uses the Python Library (name it something like clock.py) (press Ctrl and the 'c' key at the same time to terminate the program): from time import time, ctime prev_time = "" while True: the_time = ctime(time()) if prev_time != the_time: print "The time is:", ctime(time()) prev_time = the_time With some output being: The time is: Sun Aug 20 13:40:04 2000 The time is: Sun Aug 20 13:40:05 2000 The time is: Sun Aug 20 13:40:06 2000 The time is: Sun Aug 20 13:40:07 2000 Traceback (innermost last): File "clock.py", line 5, in ? the_time = ctime(time()) KeyboardInterrupt The output is infinite of course so I canceled it (or the output at least continues until Ctrl+C is pressed). The program just does a infinite loop (codice_10 is always true, so codice_11 goes forever) and each time checks to see if the time has changed and prints it if it has. Notice how multiple names after the import statement are used in the line codice_12. The Python Library contains many useful functions. These functions give your programs more abilities and many of them can simplify programming in Python. Exercises. Rewrite the High_low.py program from section Decisions to use a random integer between 0 and 99 instead of the hard-coded 78. Use the Python documentation to find an appropriate module and function to do this.
1,028
Non-Programmer's Tutorial for Python 2.6/More on Lists. We have already seen lists and how they can be used. Now that you have some more background I will go into more detail about lists. First we will look at more ways to get at the elements in a list and then we will talk about copying them. Here are some examples of using indexing to access a single element of a list: »> some_numbers = ['zero', 'one', 'two', 'three', 'four', 'five'] »> some_numbers[0] 'zero' »> some_numbers[4] 'four' »> some_numbers[5] 'five' All those examples should look familiar to you. If you want the first item in the list just look at index 0. The second item is index 1 and so on through the list. However what if you want the last item in the list? One way could be to use the codice_1 function like codice_2. This way works since the codice_1 function always returns the last index plus one. The second from the last would then be codice_4. There is an easier way to do this. In Python the last item is always index -1. The second to the last is index -2 and so on. Here are some more examples: »> some_numbers[len(some_numbers) - 1] 'five' »> some_numbers[len(some_numbers) - 2] 'four' »> some_numbers[-1] 'five' »> some_numbers[-2] 'four' »> some_numbers[-6] 'zero' Thus any item in the list can be indexed in two ways: from the front and from the back. Another useful way to get into parts of lists is using slicing. Here is another example to give you an idea what they can be used for: »> things = [0, 'Fred', 2, 'S.P.A.M.', 'Stocking', 42, "Jack", "Jill"] »> things[0] 0 »> things[7] 'Jill' »> things[0:8] [0, 'Fred', 2, 'S.P.A.M.', 'Stocking', 42, 'Jack', 'Jill'] »> things[2:4] [2, 'S.P.A.M.'] »> things[4:7] ['Stocking', 42, 'Jack'] »> things[1:5] ['Fred', 2, 'S.P.A.M.', 'Stocking'] Slicing is used to return part of a list. The slicing operator is in the form codice_5. Slicing cuts the list before the codice_6 and before the codice_7 and returns the parts inbetween. You can use both types of indexing: »> things[-4:-2] ['Stocking', 42] »> things[-4] 'Stocking' »> things[-4:6] ['Stocking', 42] Another trick with slicing is the unspecified index. If the first index is not specified the beginning of the list is assumed. If the last index is not specified the whole rest of the list is assumed. Here are some examples: »> things[:2] [0, 'Fred'] »> things[-2:] ['Jack', 'Jill'] »> things[:3] [0, 'Fred', 2] »> things[:-5] [0, 'Fred', 2] Here is a (HTML inspired) program example (copy and paste in the poem definition if you want): poem = ["<B>", "Jack", "and", "Jill", "</B>", "went", "up", "the", "hill", "to", "<B>", "fetch", "a", "pail", "of", "</B>", "water.", "Jack", "fell", "<B>", "down", "and", "broke", "</B>", "his", "crown", "and", "<B>", "Jill", "came", "</B>", "tumbling", "after"] def get_bolds(text): true = 1 false = 0 ## is_bold tells whether or not we are currently looking at ## a bold section of text. is_bold = false ## start_block is the index of the start of either an unbolded ## segment of text or a bolded segment. start_block = 0 for index in range(len(text)): ## Handle a starting of bold text if text[index] == "<B>": if is_bold: print "Error: Extra Bold" ## print "Not Bold:", text[start_block:index] is_bold = true start_block = index + 1 ## Handle end of bold text ## Remember that the last number in a slice is the index ## after the last index used. if text[index] == "</B>": if not is_bold: print "Error: Extra Close Bold" print "Bold [", start_block, ":", index, "]", text[start_block:index] is_bold = false start_block = index + 1 get_bolds(poem) with the output being: Bold [ 1 : 4 ] ['Jack', 'and', 'Jill'] Bold [ 11 : 15 ] ['fetch', 'a', 'pail', 'of'] Bold [ 20 : 23 ] ['down', 'and', 'broke'] Bold [ 28 : 30 ] ['Jill', 'came'] The codice_8 function takes in a list that is broken into words and tokens. The tokens that it looks for are codice_9 which starts the bold text and codice_10 which ends bold text. The function codice_8 goes through and searches for the start and end tokens. The next feature of lists is copying them. If you try something simple like: »> a = [1, 2, 3] »> b = a »> print b [1, 2, 3] »> b[1] = 10 »> print b [1, 10, 3] »> print a [1, 10, 3] This probably looks surprising since a modification to codice_12 resulted in codice_13 being changed as well. What happened is that the statement codice_14 makes codice_12 a "reference" to codice_13. This means that codice_12 can be thought of as another name for codice_13. Hence any modification to codice_12 changes codice_13 as well. However some assignments don't create two names for one list: »> a = [1, 2, 3] »> b = a * 2 »> print a [1, 2, 3] »> print b [1, 2, 3, 1, 2, 3] »> a[1] = 10 »> print a [1, 10, 3] »> print b [1, 2, 3, 1, 2, 3] In this case codice_12 is not a reference to codice_13 since the expression codice_23 creates a new list. Then the statement codice_24 gives codice_12 a reference to codice_23 rather than a reference to codice_13. All assignment operations create a reference. When you pass a list as an argument to a function you create a reference as well. Most of the time you don't have to worry about creating references rather than copies. However when you need to make modifications to one list without changing another name of the list you have to make sure that you have actually created a copy. There are several ways to make a copy of a list. The simplest that works most of the time is the slice operator since it always makes a new list even if it is a slice of a whole list: »> a = [1, 2, 3] »> b = a[:] »> b[1] = 10 »> print a [1, 2, 3] »> print b [1, 10, 3] Taking the slice codice_28 creates a new copy of the list. However it only copies the outer list. Any sublist inside is still a references to the sublist in the original list. Therefore, when the list contains lists, the inner lists have to be copied as well. You could do that manually but Python already contains a module to do it. You use the codice_29 function of the codice_30 module: »> import copy »> a = 1, 2, 3], [4, 5, 6 »> b = a[:] »> c = copy.deepcopy(a) »> b[0][1] = 10 »> c[1][1] = 12 »> print a 1, 10, 3], [4, 5, 6 »> print b 1, 10, 3], [4, 5, 6 »> print c 1, 2, 3], [4, 12, 6 First of all notice that codice_13 is a list of lists. Then notice that when codice_32 is run both codice_13 and codice_12 are changed, but codice_35 is not. This happens because the inner arrays are still references when the slice operator is used. However with codice_29 codice_35 was fully copied. So, should I worry about references every time I use a function or codice_38? The good news is that you only have to worry about references when using dictionaries and lists. Numbers and strings create references when assigned but every operation on numbers and strings that modifies them creates a new copy so you can never modify them unexpectedly. You do have to think about references when you are modifying a list or a dictionary. By now you are probably wondering why are references used at all? The basic reason is speed. It is much faster to make a reference to a thousand element list than to copy all the elements. The other reason is that it allows you to have a function to modify the inputted list or dictionary. Just remember about references if you ever have some weird problem with data being changed when it shouldn't be.
2,680
Non-Programmer's Tutorial for Python 2.6/Revenge of the Strings. And now presenting a cool trick that can be done with strings: def shout(string): for character in string: print "Gimme a " + character print "'" + character + "'" shout("Lose") def middle(string): print "The middle character is:", string[len(string) / 2] middle("abcdefg") middle("The Python Programming Language") middle("Atlanta") And the output is: Gimme a L 'L' Gimme a o 'o' Gimme a s 's' Gimme a e 'e' The middle character is: d The middle character is: r The middle character is: a What these programs demonstrate is that strings are similar to lists in several ways. The codice_1 function shows that codice_2 loops can be used with strings just as they can be used with lists. The codice_3 procedure shows that that strings can also use the codice_4 function and array indexes and slices. Most list features work on strings as well. The next feature demonstrates some string specific features: def to_upper(string): ## Converts a string to upper case upper_case = "" for character in string: if 'a' <= character <= 'z': location = ord(character) - ord('a') new_ascii = location + ord('A') character = chr(new_ascii) upper_case = upper_case + character return upper_case print to_upper("This is Text") with the output being: THIS IS TEXT This works because the computer represents the characters of a string as numbers from 0 to 255. Python has a function called codice_5 (short for ordinal) that returns a character as a number. There is also a corresponding function called codice_6 that converts a number into a character. With this in mind the program should start to be clear. The first detail is the line: codice_7 which checks to see if a letter is lower case. If it is then the next lines are used. First it is converted into a location so that a = 0, b = 1, c = 2 and so on with the line: codice_8. Next the new value is found with codice_9. This value is converted back to a character that is now upper case. Now for some interactive typing exercise: »> # Integer to String »> 2 2 »> repr(2) '2' »> -123 -123 »> repr(-123) '-123' »> `123` '123' »> # String to Integer »> "23" '23' »> int("23") 23 »> "23" * 2 '2323' »> int("23") * 2 46 »> # Float to String »> 1.23 1.23 »> repr(1.23) '1.23' »> # Float to Integer »> 1.23 1.23 »> int(1.23) 1 »> int(-1.23) -1 »> # String to Float »> float("1.23") 1.23 »> "1.23" '1.23' »> float("123") 123.0 »> `float("1.23")` '1.23' If you haven't guessed already the function codice_10 can convert a integer to a string and the function codice_11 can convert a string to an integer. The function codice_12 can convert a string to a float. The codice_10 function returns a printable representation of something. codice_14 converts almost everything into a string, too. Here are some examples of this: »> repr(1) '1' »> repr(234.14) '234.14' »> repr([4, 42, 10]) '[4, 42, 10]' »> `[4, 42, 10]` '[4, 42, 10]' The codice_11 function tries to convert a string (or a float) into a integer. There is also a similar function called codice_12 that will convert a integer or a string into a float. Another function that Python has is the codice_17 function. The codice_17 function takes a string and returns data of the type that python thinks it found. For example: »> v = eval('123') »> print v, type(v) 123 <type 'int'> »> v = eval('645.123') »> print v, type(v) 645.123 <type 'float'> »> v = eval('[1, 2, 3]') »> print v, type(v) [1, 2, 3] <type 'list'> If you use the codice_17 function you should check that it returns the type that you expect. One useful string function is the codice_20 method. Here's an example: »> "This is a bunch of words".split() ['This', 'is', 'a', 'bunch', 'of', 'words'] »> text = "First batch, second batch, third, fourth" »> text.split(",") ['First batch', ' second batch', ' third', ' fourth'] Notice how codice_20 converts a string into a list of strings. The string is split by whitespace by default or by the optional argument (in this case a comma). You can also add another argument that tells codice_20 how many times the separator will be used to split the text. For example: »> list = text.split(",") »> len(list) 4 »> list[-1] ' fourth' »> list = text.split(",", 2) »> len(list) 3 »> list[-1] ' third, fourth' Slicing strings (and lists). Strings can be cut into pieces — in the same way as it was shown for lists in the previous chapter — by using the "slicing" "operator" codice_23. The slicing operator works in the same way as before: text[first_index:last_index] (in very rare cases there can be another colon and a third argument, as in the example shown below). In order not to get confused by the index numbers, it is easiest to see them as "clipping places", possibilities to cut a string into parts. Here is an example, which shows the clipping places (in yellow) and their index numbers (red and blue) for a simple text string: Note that the red indexes are counted from the beginning of the string and the blue ones from the end of the string backwards. (Note that there is no blue -0, which could seem to be logical at the end of the string. Because codice_24, (-0 means "beginning of the string" as well.) Now we are ready to use the indexes for slicing operations: codice_25 gives us all of the codice_26 string between clipping places 1 and 4, "codice_27". If you omit one of the [first_index:last_index] arguments, you get the beginning or end of the string as default: codice_28 gives "codice_29". For both codice_30 and codice_31 we can use both the red and the blue numbering schema: codice_32 gives the same as codice_28, because the index -1 is at the same place as 5 in this case. If we do not use an argument containing a colon, the number is treated in a different way: codice_34 gives us one character following the second clipping point, "codice_35". The special slicing operation codice_36 means "from the beginning to the end" and produces a copy of the entire string (or list, as shown in the previous chapter). Last but not least, the slicing operation can have a second colon and a third argument, which is interpreted as the "step size": codice_37 is codice_26 from beginning to the end, with a step size of -1. -1 means "every character, but in the other direction". "codice_39" backwards is "codice_40" (test a step length of 2, if you have not got the point here). All these slicing operations work with lists as well. In that sense strings are just a special case of lists, where the list elements are single characters. Just remember the concept of "clipping places", and the indexes for slicing things will get a lot less confusing. Examples. def to_string(in_int): """Converts an integer to a string""" out_str = "" prefix = "" if in_int < 0: prefix = "-" in_int = -in_int while in_int / 10 != 0: out_str = chr(ord('0') + in_int % 10) + out_str in_int = in_int / 10 out_str = chr(ord('0') + in_int % 10) + out_str return prefix + out_str def to_int(in_str): """Converts a string to an integer""" out_num = 0 if in_str[0] == "-": multiplier = -1 in_str = in_str[1:] else: multiplier = 1 for x in range(0, len(in_str)): out_num = out_num * 10 + ord(in_str[x]) - ord('0') return out_num * multiplier print to_string(2) print to_string(23445) print to_string(-23445) print to_int("14234") print to_int("12345") print to_int("-3512") The output is: 2 23445 -23445 14234 12345 -3512
2,573
Non-Programmer's Tutorial for Python 2.6/File I/O. Here is a simple example of file I/O (input/output): out_file = open("test.txt", "w") out_file.write("This Text is going to out file\nLook at it and see!") out_file.close() in_file = open("test.txt", "r") text = in_file.read() in_file.close() print text The output and the contents of the file codice_1 are: This Text is going to out file Look at it and see! Notice that it wrote a file called codice_1 in the directory that you ran the program from. The codice_3 in the string tells Python to put a "n"ewline where it is. A overview of file I/O is: The first step is to get a file object. The way to do this is to use the codice_4 function. The format is codice_6 where codice_7 is the variable to put the file object, codice_8 is a string with the filename, and codice_9 is codice_10 to "r"ead a file or codice_11 to "w"rite a file (and a few others we will skip here). Next the file objects functions can be called. The two most common functions are codice_12 and codice_13. The codice_13 function adds a string to the end of the file. The codice_12 function reads the next thing in the file and returns it as a string. If no argument is given it will return the whole file (as done in the example). Now here is a new version of the phone numbers program that we made earlier: def print_numbers(numbers): print "Telephone Numbers:" for x in numbers.keys(): print "Name:", x, "\tNumber:", numbers[x] print def add_number(numbers, name, number): numbers[name] = number def lookup_number(numbers, name): if name in numbers: return "The number is " + numbers[name] else: return name + " was not found" def remove_number(numbers, name): if name in numbers: del numbers[name] else: print name," was not found" def load_numbers(numbers, filename): in_file = open(filename, "r") for in_line in in_file: in_line = in_line.rstrip('\n') #Eliminate end of line or enter name, number = in_line.split(",") numbers[name] = number in_file.close() def save_numbers(numbers, filename): out_file = open(filename, "w") for x in numbers.keys(): out_file.write(x + "," + numbers[x] + "\n") out_file.close() def print_menu(): print '1. Print Phone Numbers' print '2. Add a Phone Number' print '3. Remove a Phone Number' print '4. Lookup a Phone Number' print '5. Load numbers' print '6. Save numbers' print '7. Quit' print menu_choice = 0 print_menu() while True: menu_choice = input("Type in a number (1-7): ") if menu_choice == 1: print_numbers(phone_list) elif menu_choice == 2: print "Add Name and Number" name = raw_input("Name: ") phone = raw_input("Number: ") add_number(phone_list, name, phone) elif menu_choice == 3: print "Remove Name and Number" name = raw_input("Name: ") remove_number(phone_list, name) elif menu_choice == 4: print "Lookup Number" name = raw_input("Name: ") print lookup_number(phone_list, name) elif menu_choice == 5: filename = raw_input("Filename to load: ") load_numbers(phone_list, filename) elif menu_choice == 6: filename = raw_input("Filename to save: ") save_numbers(phone_list, filename) elif menu_choice == 7: break else: print_menu() print "Goodbye" Notice that it now includes saving and loading files. Here is some output of my running it twice: 1. Print Phone Numbers 2. Add a Phone Number 3. Remove a Phone Number 4. Lookup a Phone Number 5. Load numbers 6. Save numbers 7. Quit Type in a number (1-7): 2 Add Name and Number Name: Jill Number: 1234 Type in a number (1-7): 2 Add Name and Number Name: Fred Number: 4321 Type in a number (1-7): 1 Telephone Numbers: Name: Jill Number: 1234 Name: Fred Number: 4321 Type in a number (1-7): 6 Filename to save: numbers.txt Type in a number (1-7): 7 Goodbye 1. Print Phone Numbers 2. Add a Phone Number 3. Remove a Phone Number 4. Lookup a Phone Number 5. Load numbers 6. Save numbers 7. Quit Type in a number (1-7): 5 Filename to load: numbers.txt Type in a number (1-7): 1 Telephone Numbers: Name: Jill Number: 1234 Name: Fred Number: 4321 Type in a number (1-7): 7 Goodbye The new portions of this program are: def load_numbers(numbers, filename): in_file = open(filename, "r") while True: in_line = in_file.readline() if not in_line: break in_line = in_line[:-1] name, number = in_line.split(",") numbers[name] = number in_file.close() def save_numbers(numbers, filename): out_file = open(filename, "w") for x in numbers.keys(): out_file.write(x + "," + numbers[x] + "\n") out_file.close() First we will look at the save portion of the program. First it creates a file object with the command codice_16. Next it goes through and creates a line for each of the phone numbers with the command codice_17. This writes out a line that contains the name, a comma, the number and follows it by a newline. The loading portion is a little more complicated. It starts by getting a file object. Then it uses a codice_18 loop to keep looping until a codice_19 statement is encountered. Next it gets a line with the line codice_20. The codice_21 function will return a empty string when the end of the file is reached. The codice_22 statement checks for this and codice_19s out of the codice_24 loop when that happens. Of course if the codice_21 function did not return the newline at the end of the line there would be no way to tell if an empty string was an empty line or the end of the file so the newline is left in what codice_21 returns. Hence we have to get rid of the newline. The line codice_27 does this for us by dropping the last character. Next the line codice_28 splits the line at the comma into a name and a number. This is then added to the codice_29 dictionary. Exercises. Now modify the grades program from section ../Dictionaries/ so that it uses file I/O to keep a record of the students.
1,851
Non-Programmer's Tutorial for Python 2.6/Dealing with the imperfect. ...or how to handle errors. So you now have the perfect program, it runs flawlessly, except for one detail, it will crash on invalid user input. Have no fear, for Python has a special control structure for you. It's called codice_1 and it tries to do something. Here is an example of a program with a problem: print "Type Control C or -1 to exit" number = 1 while number != -1: number = int(raw_input("Enter a number: ")) print "You entered:", number Notice how when you enter codice_2 it outputs something like: Traceback (innermost last): File "try_less.py", line 4, in ? number = int(raw_input("Enter a number: "))</syntaxhighlight> ValueError: invalid literal for int(): @#& As you can see the codice_3 function is unhappy with the number codice_2 (as well it should be). The last line shows what the problem is; Python found a codice_5. How can our program deal with this? What we do is first: put the place where the errors occurs in a codice_1 block, and second: tell Python how we want codice_5s handled. The following program does this: print "Type Control C or -1 to exit" number = 1 while number != -1: try: number = int(raw_input("Enter a number: ")) print "You entered:", number except ValueError: print "That was not a number." Now when we run the new program and give it codice_2 it tells us "That was not a number." and continues with what it was doing before. When your program keeps having some error that you know how to handle, put code in a codice_1 block, and put the way to handle the error in the codice_10 block. Here is a more complex example of Error Handling. import math def main(): success = 0 while (success == 0): try: epact() success = 1 except ValueError: print "Error. Please enter an integer value." year = 0 except NameError: print "Error. Please enter an integer value." year = 0 except SyntaxError: print "Error. Please enter an integer value." year = 0 finally: print "Program Complete" def epact(): year = int(input("What year is it?\n")) C = year/100 epactval = (8 + (C/4) - C + ((8*C + 13)/25) + 11 * (year%19))%30 print "The Epact is: ",epactval main() The program above uses concepts from previous lessons as well as the current lesson. Let's look at the above program in sections. After we define the function called "main", we tell it that we want to "try" function named "epact". It does so "while" there is no "success". The interpreter then goes to the line codice_11. The interpreter takes the value entered by the user and stores it in the variable named "year". If the value entered is not an integer or a floating point number (which would be converted to an integer by the interpreter), an exception would be raised, and execution of the codice_1 block ends, just before codice_13 is assigned the value 1. Let's look at some possible exceptions. the program above does not have an codice_10 clause for every possible exception, as there are numerous types or exceptions. If the value entered for year is an alphabetical character, a codice_15 exception is raised. In the program above, this is caught by the codice_16 line, and the interpreter executes the print statement below the codice_16, then it sets the value of "year" to 0 as a precaution, clearing it of any non-numeric number. The interpreter then jumps back to the first line of the codice_18 loop, and the process restarts. The process above would be the same for the other exceptions we have. If an exception is raised, and there is an except clause for it in our program, the interpreter will jump to the statements under the appropriate except clause, and execute them. The codice_19 statement, is sometimes used in exception handling as well. Think of it as the trump card. Statements underneath the codice_19 clause will be executed regardless of if we raise and exception or not. The codice_19 statement will be executed after any codice_1 or codice_10 clauses prior to it. Below is a simpler example where we are not looped, and the codice_19 clause is executed regardless of exceptions. def main(): try: number = int(input("Please enter a number.\n")) half = number/2 print "Half of the number you entered is ",half except NameError: print "Error." except ValueError: print "Error." except SyntaxError: print "Error." finally: print "I am executing the finally clause." main() If we were to enter an alphabetic value for codice_25, the output would be as follows: Please enter a number. t Error. I am executing the finally clause. Exercises. Update at least the phone numbers program (in section ../File IO/) so it doesn't crash if a user doesn't enter any data at the menu.
1,292
Non-Programmer's Tutorial for Python 2.6/The End. For the moment I recommend looking at The Python 2 Tutorial by Guido van Rossum for more topics. If you have been following this tutorial, you should be able to understand a fair amount of it. If you want to get deeper into Python, Learn Python the Hard Way is a nice on-line textbook, although targeted at people with a more solid programming background. The Python Programming wikibook can be worth looking at, too. This tutorial is very much a work in progress. Thanks to everyone who has sent me emails about it. I enjoyed reading them, even when I have not always been the best replier. Happy programming, may it change your life and the world.
165
Civ/Sid Meier's Alpha Centauri/Secret Project Index. Ascent to Transcendence. Build this and win a Transcendence Victory. A no-brainer unless you have a faster way to win. Ascetic Virtues. Handy for everyone, of course, but Lal gets a real booster out of it, enabling him to get obscenely large bases well before Hab-Domes. For Morgan, it's a kicker too, all but eliminating his small base problem. The Spartans too, benefit greatly, as it enhances their existing police rating. Everybody else benefits, but not as much as these three. In Alien Crossfire, this plus a Brood Pit brings you to the magic +3 Police rating where police effect is doubled (unless your faction has an inherent police penalty). However, Brood Pits come fairly late at Centauri Genetics. Bulk Matter Transmitter. Despite its in-game description, the Bulk Matter Transmitter seems to increase every base's production by 50%. By the time you can build this, ecodamage will be a serious problem. An unexpected 50% jump in your production will cause rampant fungal pops and global warming. If you anticipate its effect, however, the boost in production can be very nice, though of course it comes very late in the game. Citizen's Defense Force. If Perimeter Defenses had an upkeep cost, this project would rank right up there with the others that provided free facilities, but since Perimeter Defense works are free (no maintenance cost), the value of this project is somewhat reduced. Still, it does save you time, especially if you have a large number of exposed bases, and so is fairly important, but non-critical, though you might expect a Momentum player to run for it as part of a denial strategy. Yang also doesn't need this because he already has its benefits, so for him it is useful mostly as a pre-build or for denial. Clinical Immortality. Talents = Drone control, and at this point in the game, you've probably got a sprawling empire and this is just the thing! It's certainly not crucial (not even for Zakharov by this stage), but very nice to have if you can free up a base for it. Cloning Vats. We can't think of a single reason not to build this project, except perhaps for the fact that it will make you the target of envy and, in all probability, attack...but hey, enjoy it while you got it! Cloudbase Academy. If you want to get and keep air superiority, "get this project"! If you plan to make use of satellites in your game, "get this project"! If someone else gets this project, "get that base"! If you can't do that, nuke it. It's that important. Note though, that if you get this project, people "will" gang up on you, and if they don't, you almost can't help but win. Not only do you get two extra points of movement for all your aircraft, but you get a morale boost, make it harder for people to use drop teams on you, and your satellites automatically have their maximum impact at all your bases. Simply too good to pass on. Cyborg Factory. In the Alien Crossfire world, Mind/Machine Interface is probably the most desired tech in the game. Not only does it give you choppers and thinkers, but it also gives you TWO secret projects! Awesome ones at that! Bio-enhancement centers are expensive from an upkeep standpoint, and they improve morale of ALL your units, making this project a must have, no matter who you are! Command Nexus. Another project that provides free facilities, this too, will be highly sought after by a number of players, regardless of style. Builders will likely spend long periods of time running Wealth, and the presence of this project will enable them to perfectly counter Wealth's singular negative. Also, Builders will want this project badly as part of a denial strategy against Momentum players, forcing the Momentum gang to take the time to build Command Centers if they want those morale upgrades. Momentum and Hybrid folk will also count this as a high priority, for obvious reasons. Their standing forces become 25% more lethal with its completion. More bang for your buck! Dream-Twister. Even if you have no intention of making use of Psi attackers, you need this project so that the Worm lovers don't come over and pay you an unwelcome visit. About the only time you don't need this one is if you have the Neural Amplifier, but even then, it might be good to pick it up for denial. Also, if you're into Navy at all, grab this one! Your Isles of the Deep, which are already awesome, will be all but unbeatable! Empath Guild. From a defensive perspective, the most important element of the game is to take what steps you can to ensure that your datalinks are not infiltrated, and as this project grants infiltration access to whomever completes it, it is easily one of the most despised projects in the game. I have seen coalitions formed solely on the basis of eliminating the player who builds this project, which speaks volumes about the scope of its power. Build it if at all possible, just to deny anyone else access to it, and, if it appears later that someone will take it from you, don't hesitate to burn the base to the ground to prevent it from falling into enemy hands! It really is that important! Human Genome Project. Another fantastic early game project! Talents are so vital to drone control, and this puts an extra talent at each base. If you favor Domai or Lal, with their fewer drones or higher number of talents, this project alone will enable you to forego the building of drone control facilities almost to the middle game, and if you're playing a drone-sensitive faction like Zak's researchers, the project will go a long way in undoing your chronic drone problems. Other factions will benefit greatly from it as well, though some may want it purely as part of a denial strategy (I'm specifically thinking Yang and Santiago here, who can easily control all their drones via police), still, no matter what the reasonings behind it, the fact is, this is a project that will be quite high on a number of people's lists! Hunter-Seeker Algorithm. Even in the Alien Crossfire world, where the power of this project has been weakened, it should still be considered critical to every player in the game. Even those factions who have probe-immunity will want it from a purely denial standpoint, making this one of the most sought after secret projects out there. Living Refinery. At this point in the game, support is usually only an issue if you're running Thought Control, and even then, with Clean Reactors it's not that big a deal. Nonetheless, clean reactors are expensive, and if you're running Social Engineering choices that lend you support anyway, this is a good way to be able to build large numbers of "non-clean" troops — which means that the ability slot formerly occupied by "clean" can be filled in with something else. For that reason alone it's quite handy, and if you're playing Miriam, mark it down as a must-have! Longevity Vaccine. The Clean Reactor tech also gives you a cash cow. If you have the Merchant Exchange someplace, toss this onto the pile as well, and you'll have a base that can single-handedly pay for the infrastructure at a lot of your bases. If not, it's fairly useful, but certainly not critical, though for Zak (when he's not running Market) the Drone control is nice. Manifold Harmonics. "Alien Crossfire only" This project makes fungus the best terrain in the game. Unfortunately, if you're like most players, you've just spent the entire game minimizing the amount of fungus in your empire. It's a good project, don't get me wrong, but unless you're playing one of the Native lovers, it's not a "great" project. Maritime Control Center. Comes a bit later in the early game, and is another project that provides free facilities. It's importance is directly tied to two things: What other factions are in the game (if the Pirates are playing, then you need this!), and how important a strong Naval presence is to your game. If Naval power is relatively unimportant to you, then skip this project, but note that whoever builds it will have ships with two (2) extra movement points, making Marine strikes of coastal bases that much harder to spot! Merchant Exchange. A good project, but not a great project. For certain factions, it can be a godsend (Yang, Deirdre, and Cha'Dawn especially) but for others, it's almost a waste of time until energy restrictions come off (Example: Morgan: Running wealth gives him +1 energy per square anyway, and with a maximum of 2r pre-restriction lifting, a good portion of the power of the ME will be lost in the early game). Combine that with the fact that its impact is limited to one base, and you have a project which is useful in the early game, extremely useful in the middle game, but non-critical at any point. Nano-Factory. Anybody who has a standing army of any size at all (and you'd better, by this point in the game) will want this project! Not only does it dramatically lower your upgrade costs, but it also (and more importantly) allows your forces to fully recover in the field in a single turn. You just can't get any better than that! Net-Hack Terminus. "Alien Crossfire only" Again, the probe bonus comes too late in the game to do you much good, as you would really have to try hard "not" to have elite Probe Teams, but if you missed the Hunter-Seeker Algorithm, this one's not bad to get. Network Backbone. For the money, it's not as good as it should be, because its value is too much tied to world size, which in turn, helps determine overall number of bases. Nonetheless, because it helps research, it should be fairly high on your list. Cyborgs don't need it, because they're already immune to the negatives of Cybernetic society, but it's still nice for the research kick. Neural Amplifier. Another project that comes later on in the early game, and one of the best defensive projects in the entire game. Essentially, this gives every unit you ever build the equivalent of "Trance" ability, and can be further enhanced by actually building "Trance" units. For Marketeers, this one is highly prized, and for players pursuing a heavy Native strategy, it's equally highly prized as part of a denial strategy. Non-native based Momentum players (and some Hybrids) will generally consider this project of only secondary importance and will seldom pursue it with much vigor. Pholus Mutagen. Unless you're one of the "Native" factions (and to a lesser extent, Morgan), this one's only marginally useful, though the ecology bonus will help you jack your mineral counts up slightly higher, but once you hit somewhere around 40, you really don't need that. Still, if you're playing Gaian, Cult, or Morgan, I'd put it fairly high on the list, and if you're playing against one of them, you'll want to pick it up just so they can't. Planetary Datalinks. Seldom even built in multiplayer games, unless it's a free-for-all with six players. Good one to deny the AI though. Planetary Energy Grid. "Alien Crossfire only" Even if you never plan to stockpile energy at any of your bases, the fact that it gives you a cash enhancing facility for free (no maintenance cost) at every base is an enormous boon. This project is everything that the Merchant Exchange is not, and is much more valuable because of it. Planetary Transit System. Even if you have no immediate plans to expand, this project is a must have from a denial standpoint! If you don't snag it, someone could quite easily "Borg" their way to dominance! Self-Aware Colony. The influx of cash you get when your maintenance costs are halved makes this project one of the fastest to pay for itself. If you're going for the economic win, this is crucial, and it's pretty important in general, because by this stage of the game, you've got a "lot" of maintenance every turn. A good investment, no matter how you slice it. Singularity Inductor. Comes too late in the game to really be useful. By this point, you've got more mineral production than you need anyway. This is an average project, at best, and too expensive for the relatively short lifespan it has. Space Elevator. If you're planning to make heavy use of Satellites to enhance your factors of production, or if you entered the space race late and want to play catch up, this project will be a huge boon! Otherwise, even as a denial project, its only average. Supercollider. If your middle game is not energy based, then it should be. Research and technology are so vital to the middle game, and a project like this — one that doubles lab outputs at a given base — how can you "not" start drooling over the prospect! No matter what your faction or pre-disposition, build it before someone else does! Telepathic Matrix. Most people stopped having drone problems a long time ago, and this project comes too late to really be of outstanding benefit for the money, but it "does" cut down on the need to micromanage your bases. The probe bonus is an utterly useless feature of this project, as by this point, your probes are elite anyway. They can't "get" any higher. Average at best, but handy if you're tired of micromanagement. Theory of Everything. Another lab-doubler, and every bit as important as the one that comes before it. Get it. You need it. Trust me. Universal Translator. Did somebody say free techs?! If you don't go for this one, you erode your tech position, allowing others to catch up, and if you're behind in tech, and happen to get to Homo-Superior first (thanks to your path up the tech-tree), this may be just the thing that enables you to catch up! Virtual World. Any project that gives you a free facility which would normally require an upkeep cost if you had to actually build the facility it gives is automatically an important project, and even if drone control is not high on your list of concerns, building network nodes probably is, so why not have those net nodes serve two purposes, rather than just one? All in all, this is one of the most powerful early game projects around, both in terms of money saved by not having to build infrastructure, and in terms of control all the way through to the mid-game. Even more important to Zakharov to control his drones and he already has the nodes, for free. Voice of Planet. Building this allows you to build the Ascent of Transcendence, although it may sometimes be best to wait for somebody else to build the Voice. Alien lifeforms you breed also get a +1 lifecycle bonus. If you must build the Voice yourself, start building it in your second-most productive base, then a few turns later in the most productive base, making sure it will finish in the former base first. Then when the Voice is built, switch your best base to building the Ascent! This must also be built before you can build Temple of Planet facilities, but this is nearly inconsequential because the construction of the Voice of Planet marks the beginning of the end — if that hadn't begun already. Weather Paradigm. This project will help you enormously no matter what faction you play! The ability to begin construction of Condensers and Boreholes inside the first hundred turns of play is...simply too huge to pass on! No matter what your style or faction of choice, this project should be very high on your list, and in MP games, whoever gets it will be far ahead of every other player in that game from the moment resource restrictions begin to come off. Xenoempathy Dome. Anyone who plans on pursuing a "Native" strategy, or anyone who is completely hemmed in by fungus in the early game really, "really", really needs this project. Otherwise, skip it for something more essential. Another unstated effect of this project is that units in fungus can fully heal. "Some of this information was originally written by Velociryx in his SMAC FAQ. Used with permission."
3,866
General Mechanics/Statics. If a rigid body is initially at rest, it will remain at rest if and only if the sum of all the forces and the sum of all the torques acting on the body are zero. As an example, a mass balance with arms of differing length is shown in figure above. The balance beam is subject to three forces pointing upward or downward, the tension "T" in the string from which the beam is suspended and the weights "M"1g and "M"2g exerted on the beam by the two suspended masses. The parameter "g" is the local gravitational field and the balance beam itself is assumed to have negligible mass. Taking upward as positive, the force condition for static equilibrium is Defining a counterclockwise torque to be positive, the torque balance computed about the pivot point in figure 10.7 is where "d"1 and "d"2 are the lengths of the beam arms. The first of the above equations shows that the tension in the string must be while the second shows that Thus, the tension in the string is just equal to the weight of the masses attached to the balance beam, while the ratio of the two masses equals the inverse ratio of the associated beam arm lengths.
289
Civ/Sid Meier's Alpha Centauri/Tech Tree. Industrial Automation. Easily one of the two or three most important technologies in the game. This technology allows you to build the Supply Crawler, a staple of virtually all advanced strategies, and additionally allows Wealth, which may be desirable, and the construction of Hab Complexes, which you'll need for bigger bases, and the Planetary Transit System, which is useful if you can spare the time and resources to grab it. On top of all that, you get more commerce. Getting this tech before anybody else does can easily swing the game in your favor even if you are otherwise behind in every other respect — but you must take full advantage of it. Transcendent Thought. Transcendent Thought serves the same function as the 'Future Technology' techs in the Civilization series: Bonus Points at the end of the game for each 'level' of Transcendent Thought researched.
212
General Mechanics/Forced Oscillator. If we wiggle the left end of the spring in the above diagram by amount "d"="d"0sin ω"Ft", rather than rigidly fixing it, we have a forced harmonic oscillator. The constant "d"0 is the amplitude of the imposed wiggling motion. The forcing frequency ω"F" is not necessarily equal to the natural or resonant frequency of the mass-spring system. Very different behavior occurs depending on whether it is less than, equal to, or greater than ω. Given the above wiggling, the force of the spring on the mass becomes since the length of the spring is the difference between the positions of the left and right ends. Proceeding as for the unforced mass-spring system, we arrive at the differential equation The solution to this equation turns out to be the sum of a forced part in which "x"∝ sin ω"Ft", and a free part which is the same as the solution to the unforced equation. We are primarily interested in the forced part of the solution, so let us set "x"="d"0sin ω"Ft"and substitute this into the equation of motion, giving: The sine factor cancels leaving us with an algebraic equation for , the amplitude of the oscillatory motion of the mass. Solving for the ratio of the oscillation amplitude of the mass to the amplitude of the wiggling motion, we find where we have recognized that "k"/"M"=ω2, the square of the frequency of the "free" oscillation. Notice that if ω"F"<ω, then the motion of the mass is in phase with the wiggling motion and the amplitude of the mass oscillation is greater than the amplitude of the wiggling. As the forcing frequency approaches the natural frequency of the oscillator, the response of the mass grows in amplitude. When the forcing is at the resonant frequency, the response is technically infinite, though practical limits on the amplitude of the oscillation will intervene in this case -- for instance, the spring cannot stretch or shrink an infinite amount. In many cases friction will act to limit the response of the mass to forcing near the resonant frequency. When the forcing frequency is greater than the natural frequency, the mass actually moves in the opposite direction of the wiggling motion -- i. e., the response is out of phase with the forcing. The amplitude of the response decreases as the forcing frequency increases above the resonant frequency. Forced and free harmonic oscillators form an important part of many physical systems. For instance, any elastic material body such as a bridge or an airplane wing has harmonic oscillatory modes. A common engineering problem is to ensure that such modes are damped by friction or some other physical mechanism when there is a possibility of excitation of these modes by naturally occurring processes. A number of disasters can be traced to a failure to properly account for oscillatory forcing in engineered structures.
660
German/Level I/Freizeit/Problems. Sports and Activities. Name all of the sports in German included in the lesson that are not the same as in English. Section Answers» Spielen, Machen, and Other Verbs. Translate these phrases and sentences from German into English. Section Answers» Other Verbs and Their Conjugations. Provide all of the possible pronoun subjects for the verb given. For example, if the verb is "sind", the answers are wir, sie (pl) and Sie. Note: This assignment works well as a quiz. Example: 1. sehen The possible pronoun subjects for sehen are: wir, sie and Sie 1. sehen 16. hat 2. arbeitet 17. heißen 3. heißt 18. lesen 4. schwimmst 19. seht 5. machen 20. spielst 6. ist 21. mache 7. haben 22. sieht 8. schreibt 23. schreiben 9. spiele 24. hast 10. liest 25. seid 11. arbeitest 26. lest 12. schaut 27. arbeiten 13. bin 28. heiße 14. schwimmen 29. macht 15. schaust 30. schwimme Section Answers» Two More Verb Forms. Translate the following sentences into German. Extra Credit: Remember "Wie geht's?" from last lesson? It's really a contraction of "Wie geht es?". Since this means "How's it going?", write out the conjugations of the regular (Best Ten Ten) verb for "to go". Section Answers» Expressing likes and dislikes. Fill in the blanks in these conversations. A. Was ________ ___ gern? B. ____ spiele gern _________, aber ihr _______ nicht Football. Was spielt ____? A. Wir ________ gern Volleyball ____ Fußball. Sie ________ Football. B. Gut! Tschüß! A. ____ später! A. Ich ______ Markus. ____ ______ ihr? B. ____ heiße Thomas, ____ er ______ Hans. A. ____ spielt ____ gern? C. Wir ________ Tennis _____, aber Fußball lieber. Aber am _________ spielen ____ Football. A. _______ ihr Kegeln? B. _____. Wir ________ nicht Kegeln. Section Answers» Numbers. Write in words (and say out loud) these numbers. 1) 30 2) 42 3) 9 4) 87 5) 1 6) 13 7) 20 8) 16 9) 5 10) 51 11) 4 12) 67 13) 17 14) 49 15) 70 16) 163 17) 812 18) 348 19) 975 20) 704 21) 580 22) 601 23) 596 24) 423 25) 259 26) 831 27) 647 28) 903 29) 251 30) 475 Section Answers» Time. Exact form. Write how you would say the following numerical times in German. Fill in the blanks in this short conversation: A. Wie _____ ____ es? B. ___ ____ Fünfzehn ____ sechsunddreißig. Section Answers» Before/After the Hour. Write how you would say these times using before/after the hour. Section Answers» Saying When You Do Something. Fill in the blanks in this conversation. A. ________ ___ Baseball? B. Ja, ____ spiele _________. A. _____ ________ du _________? B. ___ Achtzehn ____ ________. (18:30) A. Prima! ____ spiele _____ Baseball ___ halb _______. (6:30) B. ____ dann! A. Tschau! Section Answers» Other Time. Times of Day. Write the German translations for these English phrases. Section Answers» Days and Months. Write the German translations for the following English words/phrases. 1) Tuesday 2) in March 3) Sunday afternoon 4) on Thursday 5) February 6) Friday night 7) Wednesday 8) in December 9) Wednesday morning 10) on Saturday 11) October 12) Tuesday evening 13) Friday 14) in August 15) Saturday afternoon 16) on Monday 17) June 18) Thursday morning 19) Sunday 20) in January 21) Saturday night 22) on Wednesday 23) July 24) Sunday morning 25) Thursday 26) in November 27) Monday evening 28) on Friday 29) May 30) Thursday afternoon Section Answers» Dates. Write out how you would say these dates in German. Section Answers» Birthdays. Fill in the blanks in these conversations. A. ______ Tag, Frau Schneider. B. Hallo, Lisa. A. Wann _______ Sie ___________? B. ___ einundzwanzigsten Februar. ____ wann _____ du ___________? A. Ich _____ ___ achten Juli ___________. A. ____ habe ___ vierzehnten Mai ___________. _____ _____ ihr _________? B. Ich _____ _____ im ____ ___________! Ich _____ ___ dritten ____ ___________. C. Und ____ habe ___ siebenundzwanzigsten September ___________. A. ______ Morgen. Wie _______? B. Sehr ____. Heute _____ ich ___________! A. ______ _____ zum ___________! Section Answers» Seasons. Name the season the following dates are in. Example. Der zwölfte Dezember ist im Herbst. Section Answers» Periods of Time. Translate the following phrases and sentences into English. Section Answers» How often? A Number of Times. Match the following English phrases with their German translations below. English Phrases: German Phrases: a. zweimal in der Nacht b. zwölfmal am Tag c. viermal am Morgen d. fünfmal im Nacht e. einmal am Wochenende f. zweimal im Monat g. einmal im Tag h. fünfmal in der Nacht i. dreimal am Wochenende j. einmal am Tag k. einmal im Jahr l. zweimal im Monat m. sechsmal in der Woche n. fünfmal im Tag o. fünfundvierzigmal im Jahr p. zweimal am Morgen q. viermal im Monat r. einmal in der Woche s. zweimal am Monat t. fünfmal am Tag Section Answers» Often Adverbs. Translate the following sentences into German. Section Answers» Time-Related Words. Translate these phrases into German and complete the sentences to say when you have (free) time. Use standard time-telling on the odds and before/after times on the evens, when applicable. Example. Time, Only on Monday and Wednesday from 1 p.m. to 5 p.m. Answer: "Ich habe nur am Montag und M"i"ttwoch von Dreizehn Uhr bis Siebzehn Uhr Zeit." Section Answers» Freizeit/Problems
2,018
Electrodynamics/Lorentz Transformation. Fields and Forces. The forces caused by electric and magnetic fields are mostly what we can actually measure in electromagnetism. These vector quantities are related to the scalar and vector potentials as follows: The E is the electric field vector, and the B is the magnetic field vector. Because of these equations, electric fields are frequently called "E Fields", and magnetic fields are frequently called "B Fields". This book may use either of these notations. Lorentz Equation. By comparison of these equations with the general expression for force in gauge theory, we find that the electromagnetic force on a particle with charge "q" is where v is the velocity of the particle. For historical reasons this is called the "Lorentz" force. Relativity. Relativity is, in brief, the study of reference frames. A reference frame is a fixed coordinate system against which local measurements are taken. Consider the common example of two observers: Observer A is located on a moving train, and Observer B is standing in a field watching the train. Here is what the two observers see: Both observers are essentially the origin of their own coordinate system. Clearly, the two coordinate systems can be related together through some sort of transformation, that is that things that Observer A can see can be translated into coordinates according to Observer B, and vice-versa. In linear algebra, a coordinate system has a "basis", a small set of unit vectors that can be used to describe all the points in that system. If we can relate the basis vectors of Observer A and Observer B, then we can relate any point in either system to the other system. Because basis vectors are vectors (rank-1 tensors), the transformations between them are typically matrices (rank-2 tensors). Special Relativity is based on the idea that the laws of physics are the same in all inertial reference frames, and that the speed of light, "c", is a constant regardless of the frame. An equation is said to be "Invariant under Lorentze Transformation" if it satisfies these requirements when a lorentz transformation is applied to it. We will see that the requirement of lorentz invariance is an important one in electrodynamics. Another subject, General Relativity, expands the mathematical ideas of relativity to non-inertial frames. We will not consider general relativity topics in this book. Lorentz Transformations. It is tempting, but naive, for us to consider only 3 basis vectors. These vectors, the spacial vectors, can be called without any lack of generality "X", "Y", and "Z". However, one of the important results from Einsteins work on relativity is that time is also dependent on the reference frame, and that therefore we need to consider all points in both space (X, Y, and Z vectors) but also in time (a T vector). All our vectors then have a length of 4, and our transformation matrices must be 4×4 matrices. A 4×4 transformation matrix that uses three spatial coordinates and 1 time coordinate is known as a lorentz transformation matrix, or simply a "lorentz transformation". If we have two coordinate systems, (X, Y, Z, T), and (X', Y', Z', T') and they are non-inertial systems, we can relate the two systems using the L transformation functions: Now, if each element X', Y', Z', and T' are linearly related to X, Y, Z, and T, we can convert L into a matrix: As we can see from this equation, if we are going to apply a Lorentz transformation to a coordinate system, the coordinates must be specified in vectors of length 4. We will call all vectors with a length of 4 a "four vector". We will discuss four vectors in a later chapter. Inertial vs. Non-Inertial Frames. An inertial frame is a frame with no net acceleration. Consider the case above with the two observers, Observer A, and Observer B. Observer A is on a train, and Observer B is looking at the train from a distance. If the train is moving at a constant speed and in a straight line, then the two frames are inertial. However, if the train is accelerating or decelerating, or if the train is not moving in a straight line, then the two frames are non-inertial. The study of inertial frames is a field known as Special Relativity. The study of non-inertial frames is known as General Relativity. In this book, we will consider special relativity only. Ohm's Law. The continuum form of Ohm's Law is only valid in the reference frame of the conducting material. If the material is moving at velocity v relative to a magnetic field B, a term must be added as follows: The analogy to the Lorentz force is obvious, and in fact Ohm's law can be derived from the Lorentz force and the assumption that there is a drag on the charge carriers proportional to their velocity.
1,123
Civ/Sid Meier's Alpha Centauri/Facility Index. The cost of each facility is given in "rows". The number of minerals for a human player with 0 industry is 10, so an Aquafarm, with its 8-row cost, is usually 80 minerals. Aerospace Complex. Adds +2 morale to air units built at this base, increases base air defense by 100%, allows base to construct and receive the full benefits of satellites. Aquafarm. The Aquafarm increases the nutrient output of every kelp farm at that base by one. This facility is most useful when a tightly packed sea-base spacing is used, and if you really need to maximize production from worked tiles it can help keep a small base eating well, even when mostly specialists. The main negatives are that despite coming early in the tech tree, you won't be able to reap the benefits until after Gene Splicing lifts the nutrient restrictions, and the large mineral cost, combined with a per-turn upkeep, mean that this facility may be a waste of precious minerals to build, and even more precious cash to maintain until at least after Tree Farms — by which point you probably will not be short of nutrients anyway. The case for building them in sea bases is even worse, as sea bases normally are so rich in nutrients, that any more is purely a waste. Having said that, if building an Aquafarm allows you to increase the base size, then it may pay for itself in the long term, although if it allows one specialist (producing +2 of something) it will require 160 turns to cover its costs, or with 2 extra specialists 53 turns. If the Aquafarm allow you to use two extra second-tier specialists (that is, if you are working four tiles with kelp), the construction costs can be regained in only 18-25 turns, and then anything after that is profit. This is bad practice in terms of turn advantage, though; sea bases are notoriously short of minerals, and an 8-row facility is going to block up your build queues for a few years. A single trawler on a kelp tile will offer just about the same benefits, for half the mineral cost and no upkeep. Bioenhancement Center. Adds +2 morale to conventional units and +1 lifecycle to psi units. Biology Lab. +1 Lifecycle for Native Life, +2 Labs/turn There's only one reason to build a Biology Lab, and that is for the +1 Lifecycle Native Life gets when built here. Without a decent level of Lifecycle, your worms and locusts will just get mashed. If you are planning on pursuing an all-worm strategy, these facilities are your Command Centers. The comments about Command Centers apply equally here, but more so, as Morale/Lifecycle is much more important in psy-combat. The +2 Labs per turn is insignificant unless you're planning on building them everywhere, but I don't recommend the investment in these for the purpose of boosting your research. Paying 1 ec/turn for 2 Labs/Turn may sound like a good deal, but with your six rows of minerals (worth about 120 ec) you could have built two crawlers, which I guarantee will be able to crawl you more energy than the +1 you gain from just the Biolab (which will make a profit in the 123rd turn after its built) Brood Pit. The base gets a +1 lifecycle bonus for aliens and decrease cost of breeding aliens by -25%. Negative lifecycle effects are canceled inside this base. Also the base gets +2 police rating. Centauri Preserve. Decreases Eco damage and adds +1 lifecycle bonus. Children's Creche. This facility provides +2 Growth and +1 Efficiency. Any units defending the base ignore negative Morale penalties and take +1 Morale instead. Units that already have +1 Morale or better do not benefit. Everyone knows the importance of looking after the children. For a mere 50 minerals (Roughly = 100 ec) plus 1 ec/turn (Which the +1 Effic often gives back to you from reduced inefficiency losses) you have given yourself (with most factions) the ability to pop-boom. Even without the other bonuses, the +2 Growth is easily worth twice the current cost of the facility. Say, for example, that we build the Creche in one of our little size 4-5 bases in turn 30, expecting to end the game around turn 130 (conservative estimates indeed) so we have to pay the equivelent of 200ec all together over those 100 turns, which is about 2 ec/turn. Here comes the good news. Even without pop-booming, the extra +2 Growth will (assuming there's always enough food) make the base grow so much faster, that often in the long run the extra income from a getting a larger base x turns earlier than otherwise more than pays for the production and maintainance with the profit gained over a base growing without a Creche. Assume the Creche makes the base grow to each size 1 turn faster. Assume also that each extra poppoint is worth a 2-2-2 tile (nothing special) which has an estimated ec-value of 6. Now with a 50/50 Labs/Economy split, that's 3 extra ecs each time the base grows one turn earlier (ignoring the other benefits). So, the first growth comes 1 turn earlier, the second comes 2 turns earlier... till the tenth comes 10 turns earlier. That's a total of (1+2+3+4+5+6+7+8+9+10) x 3 = 165 extra ecs gained in the growth of the base compared to one without a creche. Ok, then we have to pay for the creche, and that costs an estimated 200ecs over our 100 turns or so, so we only make a loss of 35 ecs. However... what if the base grows more than only one turn faster? Depending on the base set-up, its possible to rake huge profits here by growing 2 turns faster each time (130 ec/base = 1.3 per turn) or 3 turns faster to the next size (295 ec/base = 2.95 ec/turn) And that's without figuring in the other advantages of more population, namely council votes and score. Not to mention how much you can gain by going from size 5 to size 14 in only 9-10 turns, in which case you are Popbooming, and the maths becomes irrelevant. If you're going to pop-boom, time your construction so that all your bases are finishing the Creches about the same time, then flick over to Democratic/Planned and enjoy the glory of +6 Growth. Command Center. This facility provides +2 Morale to land units produced. Land units end their turn here are automatically restored to full strength the next turn. For a small cost you can make your units 25% better in combat. You can see how that might be useful in a prolonged war. There's a big "but..." implied here though, and that is whether or not the time and minerals needed to build Command Centers in every base are well spent. Consider you intend to start an early war using Laser or Impact Rovers. The aim of an early war is to rush a nearby opponent before he or she can get their defenses ready. If you delay your war long enough to build Command Centers (say 4 turns in a size 3 base with Recycling Tanks working 3 forest tiles) your intended target has time to prepare. There's nothing more embarrassing than a failed rover rush. So, what else could you do with 4 rows of minerals instead of building a Command Center? You could build four 1-1-1 infantry units or two 1-1-2 rover units to upgrade into real attack troops. In this case, you'd better be playing a high-support faction. For a high-cash faction, it's much better to have smaller numbers of better troops. Don't automatically build the Command Centers before building the troops. If you're planning on attacking Morgan or Zakharov, it's usually unnecessary to pump up your Morale. It's far better to attack these Builders early before they can get ahead in tech, and your 4-1-2 rovers find themselves attacking 1-3-1 ECM units behind Perimeter Defenses. If you want to take on Cha'Dawn or Deirdre, then that extra Morale may just save you while you fight the inevitable Mind Worms. The catch: Command Centers will cost you 1 energy per turn each. If you're playing as Yang, with his -2 Economy, then this may be a bridge too far. Of course, Yang can run Wealth to counter his -1 energy per base, but this is not an option because it reverses the effect of the Command Centers. You gain 1 Energy, pay it to the Command Center, which gives you +2 Morale, which in turn is taken away by the Wealth. Sure, you get +1 Industry, but that will save 4 minerals from the cost of your rather expensive and pretty useless Command Centers. But, and here's the rub, against the AI you can be pretty sure of snagging The Command Nexus, and getting one free in every base. Of course, this is only a good deal if you have 5 or more bases. [1] The upkeep of your Command Centers starts at 1 and increases according to the best Reactor strength you have. For example, upon discovery of Fusion Power, Command Centers will cost 2 energy per turn to maintain. Covert Ops Center. Probe Teams get 2 morale upgrades and gets a +2 probe rating. Energy Bank. The Energy Bank adds +50% Economy at the base. As long as you're making good money anyway, it can't hurt to make a bit more. Energy Banks are always worth having, especially if you can get one in every base for free with The Planetary Energy Grid ("Alien Crossfire only"). However, there are two questions to ask yourself before building an Energy Bank: "Will it give me a profit?" and "What else could I be building?" Firstly the profit question. An Energy Bank gives you +50% Economy, at a cost of 1ec/turn. So if you're producing 2 Economy (not total energy, just Economy) at that base, you will gain 1 energy/turn at a cost of 1 energy/turn — not such a great deal. With 4 Economy at that base you gain 2 energy/turn which means it will only take 160 turns to cover the value of the minerals involved in building the Energy Bank. Of course, the base will grow, and the returns will improve over time, so the sooner you build one, the quicker you'll make the money back. Energy Banks are like a stock exchange: you put some cash in now, and hope the company goes up, and stays up long enough for you to profit from it. So, as with all facilities that improve the base's mineral or Economy production, the sooner you build an Energy Bank, the more you will gain from it. However, building too many facilities early on is going to kill your horizontal growth in favor of vertical growth. Which is better, 5 bases with Energy Banks now, or 15 bases with Energy Banks later? Instead of increasing the Economy of your bases by 50%, why not increase the number of your bases by 50%? What else could we have built in the same time with those 8 rows? A Colony Pod, 2 Formers to develop the new base, and a 1-1(t)-1 unit to protect it? Recycling Tanks and a Crawler? Two Colony Pods and 1-1(t)-1 units to protect them? If every base did that instead of building an Energy Bank, you'd increase the number of bases by 200%. So, we must decide between building early to get more cash for rush buying to speed a later but faster expansion, or building later, to expand faster in the first instance, but to get less efficient use from our Energy Banks. There really are a lot of factors to consider here, such as which faction, Social Engineering settings and map you are using, but with the exception of Morgan, it may be wiser to use those 8 rows in the early game to get more stuff on the map instead of more credits in your pockets. Morgan on the other hand has poor Support and high energy in the base square (easily gets 8+) so he can build Energy Banks as soon as he is running Free Market/Wealth and really rake in the cash. Morgan can easily get 16 energy at a size 3 base, which with the default 50/50 Economy/Labs split allows an Energy Bank to make a net profit of 3 energy/turn – only 53 turns at that rate to earn the value of the Bank back, and most probably less, and help to fuel a rush-buying frenzy that only Morgan can get away with. Flechette Defense System. There is a 50% chance that a normal missile will be shot down if it comes near the base. It also can shoot down more powerful missiles like Planetbusters 50% of the time. The more you have, the more chance you have. (50% to shoot down, if he lives, another 50% to be shot down by the second) Fusion Lab. Labs and Economy is increased by 50% Genejack Factory. You gain an extra 50% minerals at this base, but you get 1 more drone at the base and you’re more vulnerable to mind control. Geosynchronous Survey Pod. Sight Radius of the base is now 3. They also count as sensory array so you get +25% defense. They can be destroyed by Orbital Defense Pods and Probe Teams. Hab Complex. The Hab Complex increases the population limit of the base by seven. What is there to say? Every base needs one to grow above size 7 except those of Lal (size 9) and Morgan (size 4). If you're at all interested in vertical growth, then you'll have to build some eventually. Having said that, Jamski has won a game on Transcend using the Gaians without building any, and won Diplomatic Victory in 2180. Lots of smaller bases with crawlers and specialists can perform very well in the early and middle game, and aggressive play in this period can ensure that your "swarm techniques" end up saving you the trouble of building the 8 rows and paying the 2 energy/turn needed for the Hab Complex. The most important consideration when building Hab Complexes is timing. You don't want one sitting around in a size 5 base for turns and turns costing you money for no reason. In an ideal world you'd look to see how many turns until you grow to size 8, and time the Hab Complex to be either finished then, or at least in a position for you to rush it then. Also, it's hardly worth the cost for bases that will only grow to size 8 and then stop. If you're really packing them close together and concentrating on boreholes and mines, this happens pretty often. You'll be paying 2 energy/turn for an extra worker, who as number 8 will be born a Drone, even on Citizen level. Consider it, and don't stick them everywhere, even in size 4 bases that were not growing because "I might get enough satellites up there eventually". Habitation Dome. Allows your base to grow beyond 14. Note: You need Hab Complex first. Headquarters. This facility can be moved, you can only have 1. You get +1 energy at the base and you have ZERO inefficiency. And enemy Probe Teams cannot try to Mind Control. Hologram Theatre. A Hologram Theatre adds +50% to Psych, and quells 2 Drones. If you didn't get the Virtual World, you're going to need deep pockets here. Unless you're playing on one of the easier levels, you will need to suppress your Drones somehow. You may think the Virtual World is expensive for a Secret Project you can build very early, but those 300 Minerals = only 5 Hologram Theatres, and you don't have to pay the upkeep (although you wil have to build some Network Nodes, which you were planning on doing anyway, right? Hologram Theatres are expensive, and before you blindly build them, its always worth considering if there's another way of dealing with your Drones. First alternative are Recreation Commons – they cost less to build, they only cost 1 energy/turn but they don't give extra Psych. Second alternative is to use more Police, either more units, or a different Social Engineering setting. Third alternative is to increase Psych spending on the Social Engineering screen, and the fourth easy option for those early game Drones is to use specialists. There's a fifth option, which is to play as Lal and pinch the Human Genome Project, in which case Drones will be a non-issue even on Transcend level. In this case Hologram Theatres are a waste of time and money. In most situations you might be better advised to crawl 2 extra nutrients and make someone a doctor than to spend 6 rows of minerals up front (roughly = 120 ec) and then another 3 energy/turn. There's only a short window in which Holo Theaters are worth it, but when Tree Farms (also +50% Psych) and Research Hospitals (+25% Psych and -1 Drone) come along then I'd build them instead. You'll end up having to shove some energy into Psych at some point in most games anyway, there's no need to be ashamed of it. Anyway this is about facilities, not Drone control, and of all the facilities in this category, Hologram Theatres are the worst value. They do a good job, but not at those prices, and not in my early game build queues. There's plenty of reasons to get them free with the Virtual World, though. Hybrid Forest. You get +1 Energy and Nutrient from forests. You get an extra 50% psych and economy. It removes eco damage from terraforming 100% (You need Tree Farm first before you can build this). A must have since, you can get 3/2/2 resources from forests! Nanohospital. Psych goes up 25%, labs go up 50% and the amount of drones goes down by 1. Helps prevent population loss by disease or genetic warfare. Nanoreplicator. Mineral output goes up by 50%. Naval Yard. This facility provides +2 Morale to naval units produced. Naval units that end their turn here are automatically restored to full strength the next turn. Ouch. Big ouch. I'm not convinced of the economics of Command Centers, unless you can get them free with the Command Nexus, and Naval Yards not only have a more limited application (Everyone except the Pirates will build many less naval units than land and air units) but they also require twice the upkeep costs. Unless you get The Maritime Control Center and get them for free, or you feel you really must take on the Pirates before Doctrine: Airpower, you are simply foolish to build these. Actually, if you want to make a big enough navy to take on the Pirates at surface level, you're pretty foolish too. They get these Naval Yards for free, and can capture the ships you so expensively trained up. If the Pirates are not in the game, then who exactly did you want to use all these +2 Morale foils and cruisers against anyway? By the time there's enough sea bases in the game that its worth training your navy to attack them, its also late enough that you have noodles and choppers, which do a much better job. Use those 8 rows to build a couple of Foil Probes if you really have to muck about in the water, and then spend the cash you saved on causing a few problems for some other fool. Nessus Mining Station. At EVERY base, you get an extra +1 mineral, but in bases where you do not have an Aerospace Complex, the effects are halved. You need Aerospace Complex to build these. You can place more than 1 Nessus Mining Station. Network Node. They're not cheap, and despite what the Datalinks say, they cost 1 energy/turn, not zero, which is a shame. If you play as the University, you get one in every base for free. They are also the prequisite for some of the later and greater tech boosting facilities, and they link up with two different Secret Projects (The Virtual World and The Network Backbone) to become even more useful. If you're playing as the University you can skip this, but the other factions are almost forced to build them in order to try and match the Uni's tech speed. They get a basic +2 Research on the Social Engineering table, making their tech costs 20% lower, and the free Nodes make them reach that lower target 50% quicker. They get you coming and going, so the other factions are obliged to try to do something about it. Like their sister facility, the Energy Bank, they need to be built at the right moment. They'll cost you 1 energy/turn so unless they'll give you at least 2 extra labs/turn you're not making a profit. That means bases that are producing a basic 4 labs/turn or more will start to feel the benefit, or even at 2 labs/turn its worth considering for factions with low Efficiency ratings if they have lots of cash, but slow tech. Build your Nodes too early, and you are throwing away expansion for little or no return. Build them too late, and someone else will out-tech you. Either build them in core bases just after getting Industrial Automation and getting the basic Crawler infrastructure out and building whatever early game Secret Projects you might want, or to try and get them built quickly before Industrial Automation so they don't stop you from filling your build queues with crawlers. Network Nodes have some other nice effects. They prevent the bad random event from happening when you lose all accumulated labs, and instead give you a chance of getting the random event where "A Network Node reports a technological breakthrough" and you get the tech currently being researched. They also allow you to 'cash in' alien artifacts for an extra tech. Orbital Defense Pod. 50% of all missiles will get destroyed if they try to attack ANY base. To stop a Planet Buster, an Orbital Defense must be sacrificed. Orbital Power Transmitter. At EVERY base, you get an extra +1 energy, but the effects are halved in bases where you do not have an Aerospace Complex. You need an Aerospace Complex to build these. You can place more than 1 Orbital Power Transmitter. A Sky Hydroponics Lab will probably be more useful. Paradise Garden. Two extra talents at the base. Perimeter Defense. The Hive get free Perimeter Defenses, which is a strong argument for playing them. In the early game they have immense value. Before Synthetic Fossil Fuels, the common early wars will be Impact (4) weapons against Synthmetal Armor (2) or Plasma (3) armour. Plasma armour behind a Perimeter Defense is not going to be pushed out by Impact Rovers so easily. In fact, with just the first Impact Rover destroyed attacking your Perimeters, the minerals/ecs lost by your opponent are already nearly equal to what the Perimeter cost you, not to mention the fact that you just saved your base. This tends to dissuade human opponents from even attacking. You're threatening them with losing before they even attack you. Of course its not that simple, because the threat of one Impact Rover probably will cause the defender to build more than just one Perimeter Defense, since if the attacker sees one base is protected and another is not, which is he likely to go for? And if you have to build 5 or 6 Perimeters to scare off a couple of rovers, the attacker has won a material victory. He's made you spend 250-300 minerals and the build queues of half a dozen bases for his cost of 50-60 minerals and two build queues. So turn this on its head, and you have another use for Perimeter Defenses – making your opponents build them. The game is so balanced that the attacker will almost always have the advantage without Perimeters, and the defender the advantage with Perimeters. If you have the minerals to spare, The Citizens' Defense Force is one of the more expensive Secret Projects. Most "put a facility in every base" SPs cost the same as (5 x facility), but the CDF at 350 minerals costs (7 x facility) It does have the advantage of putting a free Perimeter Defense in every base though, helping when expanding ino dangerous areas and may save you cash compared to the usual cat & mouse game between the attacker and the defender. Compared to the other SPs up for grabs at this level. I'd rather take the Empath Guild, PTS or Virtual World though. Generally, Perimeter Defenses are nice things to have. They're cheap, cost no upkeep and can save your bases. The one warning I would give is that they should only be built in the bases that will need them, as they do still take up the 5 rows that could otherwise be used to build facilities or units that will then return nutrients, population, energy and minerals back to you and make you more powerful in the long run. Remember, the sooner you build these facilites and units, the better, while a Perimeter Defense is just as good if it was built the turn before the attack or 100 turns before. Pressure Dome. Counts as a recycling tank. Prevents base from submerging when the terrain changes. (Base will turn into a naval base.) Psi Gate. Allows one unit to teleport to -or- from another base with a psi gate per turn. Punishment Sphere. Quells all drones at this base with the penalty of -50% labs and no talents. Might be useful in a recently conquered base, if you manage to rush it before the drones start rioting. Quantum Converter. Adds +50% minerals production at this base. Cumulative with similar facilities. Quantum Lab. Adds +50% labs and energy production at this base. Cumulative with similar facilities. Recreation Commons. Quells 2 Drones. Unless you're playing on one of the "baby" levels, or you are using at least +2 Police per base, you're going to have to find some way of dealing with Drones in the early game. Of all the facilities available, Recreation Commons give the best cost:effect ratio, and are available with one simple starting-level technology, Social Psych. A 1-1-1(police) unit is actually a lot quicker/cheaper to build, and with decent Support on the SE table won't cost you anything in upkeep, but not everyone has the ability to use Police. Now let's look at the numbers. Recreation Commons are actually one of the biggest production-boosting facilities. They enable 2 more tiles to be worked or two more useful (i.e. non-Doctor) specialists to be made in the base. Before restriction lifting that's a possible extra 4-4-4 against the initial cost of 40 minerals ( = 80 ec ) + 1ec/turn. Assuming maximum energy and mineral production from the two workers (and the food is a bonus) then it will take only 7 turns before the facility is making a mineral/energy profit for you. And a big one too, with a possible converted ec value of 11 ec/turn – all before restriction lifting. After lifting you can double that value. Very few facilities offer such huge gains from such moderate outlays. All factions benefit from the use of Rec Commons. Police-based Drone quelling is limited in the numbers it will subdue, and Psych spending cuts into your Econ and Labs at 4 times the cost of a Rec Commons (although other facilities will make Psych spending more efficient in the long run) The trick, as always, is in the timing. Ideally a base should build the Rec Commons exactly one turn before it will grow to a size where Drones would riot, or exactly one turn before building a new base that will push you over another Bureaucracy Limit and give you a B-Drone in that base. Always try and stop Drone Riots before they happen. Losing a whole turn of production is no way to win a game, especially against human opponents. There's ALWAYS time to check your bases before pressing "End Turn". Recycling Tanks. The Recycling Tanks provides +1 nutrient, mineral, and energy per turn in the base square of the base it is built. The Pressure Dome can serve the same function as a Recycling Tanks but also protects the base in case it gets submerged in the sea...but it costs twice as much to build. Sea bases are automatically equipped with a Pressure Dome (so Svensgaard will rarely have to worry about Recycling Tanks). The Tanks seem modest at first glance, but they are essential facilities; every base should have one as soon as it can get it. Some consider the Tanks so essential that they will rush-build it the very turn a base is built if they can, even if the base is undefended. It pays for its mineral cost in 40 turns, assuming no Industry bonuses or penalties, while providing free nutrients and minerals all the while, and everything after those 40 turns is profit. The extra resources can also be multiplied by facilities, so the small amount the Tanks contributes each turn will still be significant later in the game. Imagine we have a size 1 base on land which is producing a total of 4-4-4. Adding a Recycling Tank to the base is a 25% increase for all the base's production and income. Not bad, for a facility that's so cheap, and requires no upkeep. Look at it another way — your first 4 bases with Recycling Tanks will be as productive as 5 bases without Recycling Tanks. Of course, you don't want to tie up your build queues early in the game with expensive facilities when you should be scouting, Mind Worm hunting, Colony Pod rushing and former flooding. Therefore, the best way to build Recycling Tanks is probably to rush them using the free minerals1 on the very turn you found a new base. The cost is somewhere around (40-10) = 30 minerals, assuming the base can produce 4 minerals per turn, so that's only 26 minerals that you need to buy, which will cost about 52 energy to rush with normal Industry. The Recycling Tanks will only take 15 turns to pay off the rough equivalent of that cost, while increasing the growth, research rate, and speed of production immediately. More growth and more production mean the next base will be planted perhaps a turn sooner. That adds up in the long term to big savings and more turn advantage, and after only 15 or so turns, you're making pure tax-free profit from your rush building. A nice side effect of Recycling Tanks is that a size 3 base with Recycling Tanks can work 3 forest tiles for 6 nutrients, ensuring no waste. Before restriction lifting, this is one of the more efficient base builds, especially if you can manage 3 forests on a river. Without the Tanks, the base would have to use a farm or crawl one nutrient, costing you either a mineral or an energy credit, or an extra turn for the next citizen and wasted nutrient production. [1] Won't work so well with Democratic; otherwise, the ten free minerals are pretty nice. Research Hospital. Adds +50% Labs, +25% Psych, quells 1 Drone. This facility is always a problem. It comes with Gene Splicing and heralds the end or the true "Early Game" with the lifting of the restriction on nutrient production. Those size 3-4 bases start growing a bit, you have a decent infrastructure and now you're faced with the choices offered by the first of the "second tier" facilities1. Here is the moment when you really have to decide what direction you want to build in. Do you want to go upwards, or outwards? If you want to go outwards, then leave the Research Hospitals for now, apart from those bases you may have identified as science bases. Crawling farms/condensors now that the restrictions are lifted can really give you the nutrients needed for a very rapid expansion horizontally. Research Hospitals are expensive to build and maintain, and you want to preserve outward momentum at this point, not shut up shop and enter "turtle mode" The 12 rows of minerals needed means you can't simply rush one at every base and then continue expanding, as you can with Nodes and Energy Banks. You'll have to sit and build for 4-5 turns even with a great cash supply. If you want to build vertically though, this is generally a good time to take your foot off the "colony pod/former/scout patrol" pedal and start to really develop your bases. This bears repeating: They're not cheap. And they keep costing you 3 ec/turn too, so don't build them unless you can afford them. They do boost production in 3 different ways though, so in a large enough base (never build in a small base) they more than pay for themselves. Firstly the +50% Labs. Let's assume a nice size 4 base with the basic facilities already in place, with 2 energy from each population, and say 4 from the base (a moderate estimate) for 12 base energy. Then let's take again the default 50/50 Econ/Labs distribution. In this case, the Research Hospital is going to give you 3 Labs/turn at a cost of 3 ec/turn. No loss, no gain either. However, when that size 4 base grows to size 5, let's imagine that it develops another Drone, which is then quelled by the Research Hospital. We now have to include the added productivity of an extra worker (let's put him on a forest for 1-2-2) which (ignoring the nutrients) is worth 6 ec/turn. This defrays the upkeep cost of the Hospital, returns 3 ec/turn to our pockets, and gives us an extra 0.5 Labs/turn (a whole +1 Labs/turn, with the Node that the base should already have) As the base grows past size 5, you may have to spend on Psych to keep them happy in there, so the 3rd bonus comes into play, of +25% Psych. So, the timing of Research Hospitals is pretty simple. You should aim to have them built the turn before reaching size 5 if running an FM using faction, and any time between sizes 5 and 7 if using Police under Planned or Green and planning on "turtling" for a bit, or if you are planning on spreading like xenofungus before simply crushing everyone, its best not to build them at all. Do one thing, and do it well, its better than messing them both up. One final thing to note – A Research Hospital stops outbreaks of Prometheus Viruses and Planet Blight at that base. [1]Assuming a normal tech progression to Industrial Automation, then restriction lifting, then Doctrine: Air Power Robotic Assembly Plant. Adds +50% minerals production at this base. Cumulative with similar facilities. Skunkworks. Building prototype units at this base does not cost extra minerals. It may be useful to build a Skunkworks in a base with a morale-boosting facility, if you can afford to set aside a major base for building prototypes, instead of building secret projects. Sky Hydroponics Lab. Adds +1 nutrients to every base. Bonus halved for bases without Aerospace Complexes and cannot exceed the size of the base. Can be built any number of times. Stockpile Energy. Converts minerals to energy at a rate of 2 minerals for each point of energy Subsea Trunkline. Increases minerals by 1 on every square (in the sea). Subspace Generator. Only aliens can build these. If you build 6 generators each in a base with a population of 10 or more, you win the game. Tachyon Field. Like perimeter defense, but more powerful & higher maintenance cost. Thermocline Transducer. +1 Energy from Tidal Harnesses First thing to note is that before you lift the restriction on Energy Production, this is completly useless to you. Don't build it. Don't even think about the idea of building one. You can't get more than 2 energy per tile1 until Environmental Economics even if you are Morgan running FM and Wealth with the Merchant Exchange. After Environmental Economics, however, a facility that gives +1 energy per square with no upkeep costs sounds too good to be true. It's not. Rush one in any base that is working 2 or more Tidal Harnesses. It will take a while till you are actually in profit from it, but it can also be used as a way to convert minerals to energy cheaply if you let it build naturally. If you are working 5 tiles with Tidal Harnesses, it will only take 32 turns until the mineral cost of the facility is returned to you as energy to do with as you wish. (Much less time if you have decent Industry and didn't pay so much in the first place) Any base that is sea energy based would be stupid not to build one of these. Coastal bases with only 1-3 Tidal Harnesses would probably not always recover the cost of building the facility between the lifting of restrictions and the end of the game. Better to build those Treefarms, I'd say. Tree Farm. Adds +50% Economy, +50% Psych, +1 Nutrient in Forest tiles. Coming two techs after Gene Splicing and the Research Hospital comes the Tree Farm, and the lifting of the energy restrictions. Just one tech before, your mineral restriction was removed, and all your 2-mineral crawlers moved off the forests and onto the mine/road/rocky tiles you cunningly had just prepared with this tech in mind, and doubled their production to 4 mins/turn. As a result you suddenly hear*pop* and you know its time to start with the Tree Farms. For my mind, this marks the end of the true "Early Game" and the beginning of the "Mid Game", where all tiles can now be used to their full effects, and all terraforming enhancements are possible except magtubes and soil enrichment. Ok, first of all the main reason to build these facilities is not for the extra Econ or Psych. What we are after is the extra nutrient from our forests, (they should be everywhere by now) which will give us the +2 nuts/turn we need for a popboom. If we're playing a faction that needs a Golden Age to popboom, then view the +50% Psych as the game telling you to get into the SE screen and push that central slider to the right. Like Research Hospitals, they boost income by 50%, in this case for Psych and Econ, the other two of the three energy categories, and in the same way they cover their own costs, as long as the base is producing a base 12 energy after ineffieciency, with anything else being profit. Tree Farms, however, are the one facility where I'm inclined to ignore the maths. The extra nutrients translate into extra growth, which is always good – see my comments on Children's Creches. If you want to count every last ec though, then I'd say that the only bases that are really too small to build a Tree Farm are any bases under size 4 which are not directly working either at least 2 forested rivers, or at least two forests under FM. The "hidden" effects of Tree Farms are also worth considering. Each Tree Farm built increases the number of "clean minerals" for all your bases by one, as long as it was built after the first fungal *pop* and also reduces the Ecodamage at that base caused by terraforming within the base radius. There's only two instances where I would consider not building Tree Farms as soon as they became available. Either if I was still pumping units for an expansion or a war, or if I was running towards a future "All Specialists" strategy, which was using only advanced terraforming instead of any forests. "Some of this content was originally written by Jamski on Apolyton and has been modified from its original version, which can be found here. Used with permission."
9,515
Electronics/Voltage, Current, and Power. =Voltage, Current, and Power= Basic Understanding. Experiments show us that electric point charges attract or repel as calculated by Coulomb's law. Integrating (summing) over a distribution of points charges as they are assembled into a specific system configuration allows us to determine a scalar value defined as the electrical potential or electric field of a specific point. This mathematical definition is very useful in electronics circuit theory. Voltage Current Power Law of Charges Inductance Capacitance Resistance Electric Field. A charged particle such as a proton or electron may "feel" an electrical force on it in a certain environment. This force is typically due to the presence of other charges nearby. The force will have a direction and magnitude, and can be represented by a vector. (A vector is simply a quantity that represents the direction and magnitude of something.) The magnitude of the force depends on the charge of the particle, the charge on the particles around it, and how close or far away they are: Highly charged particles close to each other exert heavy forces on each other; if the charges are less, or they are farther apart, the force is less. The direction of the force depends on the location of the surrounding charges. In describing the electrical environment at that location , it is said there is an electric field at that location. The electric field is defined as the force that a single unit of charge would feel at that location. In some systems of measurement, the unit of charge is the charge of a single proton; in others it is the coulomb. A coulomb is the charge of 6.24×1018 protons The relationship between force and electric field for a single charged particle is given by the following equation: The bold letters indicate vector quantities. This means that a charge q, in an electric field E, having a certain direction and a magnitude E, would have a force F on it, in the same direction and with a magnitude F. Considering only the magnitudes, the following would result from the definition. E = F/q these are all magnitudes or numerical quantities The net electric field E, at a location is due to the presence of all other charges nearby, similar to the net electric force F, if there was a charge q at that location. The contribution of one of these other charges to the total (or net) electric field is a vector E contribution, which for a point charge can be derived from Coulomb's Law. Distributions of charge density in various shapes may also yield vector E contributions to the total electric field, to be added in as vector quantities. Practically speaking, most electricians, electrical engineers, and other electrical circuit builders and hobbyists seldom do these sorts of electric field calculations. Electric field calculations of this sort are more of a theoretical physics or special applications problem, so these calculations are omitted here in favor of more applicable material. See Electric Field for such information on electric field formulas. There is an electrical force on a charge only if there is a charge subject to the force at a location in an electric field. However, even if there is no such charge subject to the force, there could still be an electric field at a point. This means that an electric field is a property of a location or point in space and its electrical environment, which would determine what a charge q would "feel" if it were there. Energy. Now, a micro-physics review: Work is causing displacement (or movement) of an object or matter against a force. Energy is the ability to perform work like this. Energy can be kinetic energy or potential energy. Kinetic energy is the energy a mass has because it is moving. Potential energy in an object, in matter, in a charge or other situation has the ability to perform work or to be converted into kinetic energy or a different kind of potential energy. A reason why a particle or a charge may have potential energy could be because it is located at a point in a force field, such as a gravitational field, electric field, or magnetic field. In the presence of such a field, gravity or electric or magnetic forces could cause the particle or charge to move faster or move against resistive forces, representing a conversion of potential energy to kinetic energy or work. The amount of potential energy it has would depend on its location. Moving from one location to another could cause a change in its potential energy. <br>For example, an object near the surface of the earth placed high would have a certain amount of gravitational potential energy based on its mass, location (height or altitude) in and strength of the Earth's gravitational field. If the object were to drop from this location (height) to a new lower location, at least some of its gravitational potential energy would be converted to kinetic energy, resulting in the object moving down. The difference in gravitational potential energy could be calculated from one location to another, but determining the absolute potential energy of the object is arbitrary, so ground level is chosen arbitrarily as the height where its gravitational potential energy equals zero. The potential energy at all other heights is determined from the mass of the object, location relative to the ground level, and strength of the gravitational field. All energy values are numerical or scalar quantities, not vectors. Electric Potential Energy. Somewhat similarly, a charged particle at a certain point or location in an electrical environment (i. e. an electric field) would have a certain amount of electric potential energy based on its charge, location, and the electric field there, which could be based on quantity and locations of all other charges nearby. If the charge were to move from this location to a new location or point, it could cause a change in its electric potential energy. This difference in electric potential energy in the charge particle would be proportional to its charge and it could be an increase or a decrease. From measurements and calculations, one may be able to determine this difference in electric potential energy, but coming up with an absolute figure for its potential is difficult and typically not necessary. Therefore, in a manner somewhat similar to gravitational potential energy, an arbitrary location or point nearby, often somewhere in the electric circuit in question, is chosen to be the point where the electric potential energy would be zero, if the charge were there. Often the wiring, circuit, or appliance will be connected to the ground, so this ground point is often chosen to be the zero point. The electric potential energy at all other points is determined relative to the ground level. The SI unit of electric potential energy is the joule. Electric Potential. Because the electric potential energy of a charged particle (or object) is proportional to its charge and otherwise simply dependent on its location (point where it's at), a useful value to use is electric potential. Electric potential (symbolized by "V") at a point is defined as the electric potential energy (PE) per unit positive charge ("q") that a charge would have at that given point (location). At a point "a", the electric potential at "a" is given by: "V"a = (PE of charge at "a")/"q" Somewhat analogously to an electric field, electrical potential is a property of a location and the electrical conditions there, whether or not there is a charge present there subject to these conditions. On the other hand, electric potential energy is more analogous to electric force in that for it to be present, there should be a subject charged particle or object which has that energy. Electric potential is often simply called potential by physicists. Because the SI unit of electric potential energy is the joule and because the SI unit of charge is the coulomb, the SI unit for electric potential, the volt (symbolized by V), is defined as a joule per coulomb (J/C). Because electric potential energy is based on an arbitrary point where its value is set at as zero, the value of electric potential at a given point is also based on this same arbitrary zero point (reference point where the potential is set at zero). The potential at a given point "a" is then the difference between potentials from point "a" to the zero point, often called a ground node (or just ground). Calculations of electric potential energy or electric potential based on Coulomb's Law are sometimes theoretically possible, such as might be for electric field calculations, but again these are of mostly theoretical interest and not often done in practical applications. Therefore, such calculations are also omitted here in favour of more applicable material. Often it is of interest to compare the potentials at two different points, which we may call point "a" and point "b". Then the electric potential difference between points "a" and "b" ("Vab") would be defined as the electric potential at "b" minus the electric potential at "a". "Vab" = "Vb" - "Va" The unit for electric potential difference is the volt, the same as for electric potential. Electric potential difference is often simply called potential difference by physicists. Under direct current (DC) conditions and at any one instant in time under alternating current (AC), potential and potential difference are numerical or scalar quantities, not vectors, and they can have positive or negative values. Voltage. Voltage is electric potential expressed in volts. Similarly, potential difference expressed in volts is often called voltage difference or often referred to as voltage across two points or across an electrical component. The terms electric potential, potential, and potential difference are terms more often used by physicists. Since these quantities are almost always expressed in volts (or some related unit such as millivolts), engineers, electricians, hobbyists, and common people usually use the term voltage instead of potential. Furthermore, in practical applications, electrical force, electric field, and electrical potential energy of charged particles are not discussed nearly as often as voltage, power, and energy in a macroscopic sense. Additional note: The following explains why voltage is "analogous" to the pressure of a fluid in a pipe (although, of course, it is only an analogy, not exactly the same thing), and it also explains the strange-sounding "dimensions" of voltage. Consider the potential energy of compressed air being pumped into a tank. The energy increases with each new increment of air. Pressure is that energy divided by the volume, which we can understand intuitively. Now consider the energy of electric charge (measured in coulombs) being forced into a capacitor. Voltage is that energy per charge, so voltage is analogous to a pressure-like sort of forcefulness. Also, dimensional analysis tells us that voltage ("energy per charge") is charge per distance, the distance being between the plates of the capacitor. (More discussion is on page 16 of "Industrial Electronics," by D. J. Shanefield, Noyes Publications, Boston, 2001.) Frequency. When an electric circuit is operating in Direct Current (DC) mode, all voltages and voltage differences in the circuit are typically constant (do not vary) with time. When a circuit is operating under Alternating Current (AC) conditions, the voltages in the circuit vary periodically with time; the voltages are a sinusoidal function of time, such as V(t) = a sin (b t) with constant a and b, or some similar function. The number of times the period repeats (or "cycles") per unit time is called the frequency of V(t). Under DC conditions or at any one instant in time under AC, potential (or voltage) and potential difference (or voltage difference) are numerical or scalar quantities, not vectors, and they can have positive or negative values. However, in AC mode, the overall function of voltage with time V(t), can be expressed as a complex number or a phasor for a given frequency. The frequency can be expressed in cycles per second or simply sec-1, which is called Hertz (Hz) in SI units. Typical commercial electric power provided in the United States is AC at a frequency of 60 Hz (50 Hz for India). Ground. Ground is shown on electronics diagrams, but it isn't really a component. It is simply the node which has been assigned a voltage of zero. It is represented by one of the symbols below. Technically, "any" single node can be assigned as ground, and other voltages are measured relative to it. However, the convention is to only assign it in one of two ways, related to the type of power supply. In a single supply situation, such as a circuit powered by a single battery, the ground point is usually defined as the more negative of the power source's terminals. This makes all voltages in the circuit positive with respect to ground (usually), and is a common convention. For a split-supply device, such as a circuit driven by a center-tapped transformer, usually the center voltage is defined as ground, and there are equal and roughly symmetrical positive and negative voltages in the circuit. The earth ground symbol and signal ground symbol are often interchanged without regard to their original meanings. As far as signal-level electronics (and this book) is concerned, ground almost always means a signal ground or floating ground, not connected to the earth itself. Current. "Electric current", often called just current, is the movement of charge in a conductor (such as a wire) or into, out of, or through an electrical component. Current is quantified as a rate of positive charge movement past a certain point or through a cross-sectional area. Simply put, current is quantified as positive charge per unit time. However, since current is a vector quantity, the direction in which the current flows is still important. Current flow in a given direction can be positive or negative; the negative sign means that positive charges move opposite of the given direction. The quantity of current at a certain point is typically symbolized by a capital or small letter I with a designation which direction the current I is moving. The SI unit of current is the ampere (A), one of the fundamental units of physics. See ampere for the definition of ampere. Sometimes, ampere is informally abbreviated to amp. The definition of a coulomb (C), the SI unit of charge, is based on an ampere. A coulomb is the amount of positive charge passing a point when a constant one ampere current flows by the point for one second. The second is the SI unit of time. In other words, a coulomb equals an ampere-second (A·s). An ampere is a coulomb per second (C/s). Conventional Current. Typically, current is in a metal and constitutes movement of electrons which have negative charge; however, people initially thought that current had a positive charge. The result is that even though current is the flow of negative electrons and flows from the negative to the positive terminal of a battery, when people do circuit analysis they pretend that current is a flow of positive particles and flows from the positive to the negative terminal of a battery (or other power source). Actually, it is more complicated than this, since current can be made up of electrons, holes, ions, protons, or any charged particle. Since the actual charge carriers are usually ignored when analyzing a circuit, current is simplified and thought of as flowing from positive to negative, and is known as conventional current. Analogy to pebble tossing: I have pebbles and I am throwing them into a basket. In doing this the basket gains pebbles and I lose pebbles. So there is a negative current of pebbles to the basket because it is gaining pebbles, and there is a positive current of pebbles to me because I am losing pebbles. In pebble tossing the currents have equal strength but in opposite directions. Current "I" is represented in amperes (A) and equals "x" number of "y" Power. Power is energy per unit of time. The SI unit for power is the watt (W) which equals a joule per second (J/s), with joule being the SI unit for energy and second being the SI unit for time. When somebody plugs an appliance into a receptacle to use electricity to make that appliance function, that person provides electrical energy for the appliance. The appliance usually functions by turning that electrical energy into heat, light, or work — or perhaps converts it into electrical energy again in a different form. If this situation is ongoing, it is said that the receptacle or electric power company delivers power to the appliance. The current from the receptacle going in and out of the appliance effectively carries the power and the appliance absorbs the power. Multiplying a unit of power by a unit of time would result in a unit that represents a quantity of energy. Therefore, multiplying a kilowatt by an hour gives a kilowatt-hour (kW·h), a unit often used by electrical power companies to represent an amount of electrical energy generated or provided to consumers. Oddly, in marketing and retail packaging, portable batteries are often rated in "mAh", which are normally units of power, but do "not" identify how much power the battery can supply. Rather, the mAh rating is always at the implied voltage defined by the battery's chemistry. For example, a common, premium quality 18650 Li-ion battery would be advertised/rated 3400 mAh, at most. Even though "3400 mAh" is in power units, Li-ion chemistry battery voltage is typically around 3.7 volts, and this "does" identify the battery as one that should be able to store about 3400 mAh x 3.7 volts = 12.6 mWh (milliwatt hours) of "energy" per charge.) Also oddly, in marketing and retail packaging, a larger (e.g. vehicle) battery is often advertised based on the "Amps" or "Cold Cranking Amps" (CCA) the battery can provide to indicate the maximum power it can deliver. Although Amps are not power units, these ratings do represent the amount of power that can be output. For direct current (DC), power "P" can be calculated by multiplying the voltage and current, when they are known. "P" = "V" "I" Note that energy/charge is multiplied by charge/time to give energy/time. At any one point in time t in alternating current (AC) circuitry, power P(t) equals voltage V(t) times current I(t). P(t) = V(t) I(t) at any one time t Calculations of AC power averaged over time will be discussed under AC power. Circuit. An electronic circuit is a system in which conventional current flows from the positive terminal of a source, through a load, to the negative terminal of the source. But the current will only flow when there is a closed path from the positive to negative terminal. If there is a discontinuity or an open circuit in its path, the current will not flow and hence the circuit will be non functional. The current does not flow since the open circuit acts like an infinite resistance. Short Circuit. A short circuit is another name for a node, although it usually means an unintentional node. Has current through it but no voltage across it. Open Circuit. Has potential across it but no current through it. Properties of wires. Theoretical circuit connection (wire) has no resistance or inductance. Real wires always have voltage over them if there is current flowing through them (resistance). On high frequencies there are measurable voltage potentials over wire links if there is flowing alternating current through wires (inductance like in inductors).
4,349
The Voynich Manuscript/F1r. Transcription, comments, theories, links to do with VMs page f1r to be added here... :-) Description:. This page contains four paragraphs (with 4.6, 2.4, 9.5, 5.5 lines, respectively), each followed by a short right-justified "title". " Paragraphs 2 and 3 begin with big "weirdo" doodles, very unlike normal Voynichese letters. The first (EVA &252) looks like a capital K lying on it side, with the vertical bar at the bottom; it could be said to resemble a bird with its wings outspread. The second (EVA &253) looks similar to the first, with an extra squiggly line rising from between the two "horns". The two symbols are drawn or painted with flaring strokes ending in swallowtail serifs. A 1-inch band along the right margin is heavily stained. There seem to be two or three columns of letters ("key like sequences" in that band, which are barely visible in the reproductions There is a faint unreadable text at the top of the page, apparently in cursive handwriting. Comments:. This page starts both Quire 1 and the whole manuscript. Many of the VMs' mysterious features - such as right-justified "titles", mysterious marginalia, deliberate (yet curious) page-structure, rare one-off characters, etc - are to be found here. The page layout suggests four quotes with attributions, or signed endorsements, or perhaps descriptive summaries of sections that follow. The faint scribbling at the top is the signature of Jacobus de Tepenecz, as asserted in many references. Jim Reeds writes [15 Jul 94]: "The erased key on f1r is discussed by Brumbaugh. It seems to have 3 vertical columns of letters. The leftmost is the ordinary alphabet, lower case italic hand, a through z. I could not check for the presence of every letter (I'm not sure about j, for instance) but a, b, c, ... o, p, q, r, s, ... y, z are pretty clear. Next to those are very spotty frags of Voynich letters. I could make out <8> next to a, <R> next to c, <6> next to y, and one of the gallows letters somewhere near the q, r, s range. [...] The 3d column seems to be 1 off from the first: italic miniscules, r next to s, and so on. More is visible in UV shots than Petersen shows." Brumbaugh reportedly claims that there was a date in the upper right corner of f1r before it was obliterated by the application of chemicals (intended to reveal faded writing). D'Imperio says that the "weirdo" characters EVA &252/&253 are in bright red ink; confirmed by Glen Claston [20 Feb 1998] and Jim Reeds [03 Mar 1998]. Rene [28 Jul 1997] found a medieval astrological diagram [1], in Greek, where EVA &252 is used as a symbol for Aries, which is "kruos" or "kryos" in Greek. Stolfi suggested [07 Aug 1998] that the symbols may be abbreviations for "Koenig" and "KoenigiN" --- i.e. "K" and "K"-with-squiggle. "(How desperate can you get?)" References:. [1] Codex Taurinensis C VII 15 (author anonymous, no date available). http://www.ficom.net/members/ditch/secret.htm [2] John Grove http://members.tripod.com/~VoynichMs/Prefix.htm Images:. From [Beinecke Rare Book and Manuscript Library]: [4x JPG] [8x JPG] [Full-Size SID]
971
The Voynich Manuscript/F12v. "[Nick Pelling]" Even though this page is missing, we can still see the "bleed-across" from its paint on page f13r. It also seems highly likely that f12 was cut out after the folios were numbered: I think it's reasonably safe to conclude that this page was cut out by a later owner. Perhaps by examining the technology used to perform the cut, we may be able to get an idea of who cut it out! However, whether this is the page (from North Wales) described by Paul Floyd in 2003 is another question entirely...
144
The Voynich Manuscript/F1v. Transcription, comments, theories, links to do with VMs page f1v to be added here... Description:. One plant centered on page. Two paragraphs (with 3.8 and 5.8 lines), just below mid-page, left- and right-justified, interrupted by the plant's main stem. Comments:. Part of this drawing (root and leaves only) is repeated on Pharma page f102r1[3,2]. The plant looks basically normal, except for the very peculiar root. Petersen identifies the plant as "Solanum Solatrium, Belladonna" specifically the "flower". He says: "see L.Fuchs p.398". There is no "Solanum solatrium"; rather, "solatrium" is an ancient (Dioscoridean) name for some or all of these species: Atropa Belladona (deadly nightshade) http://www.mobot.org/MOBOT/research/library/kohler/1763_010.jpg http://130.60.70.1/GIFTDB/pict_02.htm Hyoscyamus niger (henbane) http://www.mobot.org/MOBOT/research/library/kohler/1763_011.jpg http://www.runeberg.org/nordflor/110.html Solanum nigrum (black nightshade) http://axp.ipm.ucdavis.edu/PMG/WEEDS/black_nightshade.html Solanum dulcamara (bittersweet) http://cal.vet.upenn.edu/poison/ppstsleurop.htm http://www.runeberg.org/nordflor/109.html and perhaps other somewhat less likely species such as Withania somnifera and Physalis alkekengi. The leaves of f1v seem most compatible those of Atropa belladonna (shape) and Hyoscyamus niger (attachment to stem), and the "flower" at the top of f1v does resemble the sheathed, shiny black fruits of these two species. However, A.beladonna's root has been described as a roundish rhizome with a long (up to 1m) tapering root, which does not seem to match the highly distinctive "pancake with claws" of f1v. I have found no image or description of the other plants' roots. A very similar root, with quite different leaves, can be seen on another Italian herbal: University of Vermont Library MS 2, fol. 39 (ca. 1500) http://www.library.ucla.edu/libraries/biomed/his/immi/vm9437.htm The medieval text calls that plant "Gran[i]a maggiore". The modern commentary tentatively identifies it with Ecballium elaterium (Squirting Cucumber) http://www.csdl.tamu.edu/FLORA/mi10/mi10043.jpg However the leaves do not match, and the flower barely so. I have found no image or description of E.elaterium's roots. All four plants are poisonous in varying degrees. The active principles can be absorbed by smoking or through the skin as well as by ingestion. They were used as potent psychoactive drugs, causing paralysis of involuntary muscles, dizziness, sleep, hallucinations, violent behavior, etc., and have been often associated with witchcraft.
874
General Mechanics/Coupled Oscillators. We often encounter systems which contain multiple harmonic oscillators, such as this: two identical masses, "m", the first attached to a wall by a spring with constant "k", and the second attached to the first by another, identical spring. If the springs weren't linked they'd both vibrate at the same frequency, ω=√("k"/"m"). Linking the springs changes this. To find out how the linked system behaves, we will start with the Lagrangian, using the displacements of the masses, "x"1 and "x"2, as our coordinates. A moment's inspection of the system shows so, using ω²="k"/"m", The equations of motion immediately follow. To solve these equations we try a solution in trig functions Substituting this into (1) gives We would get the same equations from any trig function solution of the same frequency. Gathering the coefficients of "A"1 and "A"2 together lets rewrite the last equation as We can only solve this equation if the determinant of the matrix is zero. The solutions are so the combined system has two natural frequencies, one lower and one higher than the natural frequency of the individual springs. This is typical. We can also calculate the ratio of "A"1 and "A"2 from (2). Dividing by "A"2 gives This behaviour is typical when pairs of harmonic oscillators are coupled. The same approach can also be used for systems with more than two particles.
355
Internet Technologies/IRC. Internet Relay Chat, commonly abbreviated IRC, is a chat protocol, a way how to enable several people to talk to each other by entering text messages, each participant seeing everything that the other participants write, as if they were in a telephone conference. Technology of IRC. Formally, IRC is a real-time text-based multi-user communication protocol specification and implementation, which relays messages between users on the network. According to Efnet.org, IRC was born sometime in 1988. According to IRChelp.org, the official specification for IRC was written in 1993 in the RFC format. The specification "RFC 1459: Internet Relay Chat Protocol" is a really excellent source for both an introduction to and detailed information about the IRC protocol. Today IRC has a very wide range of users and anyone can find a place to participate in chat. IRC's largest unit of architecture is the IRC network. There are perhaps hundreds of IRC networks in the world each one running parallel and disjoint from the others. A client logged into one network can communicate only with other clients on the same network, not with clients on other networks. Each network is composed of one or more IRC servers. An IRC client is a program that connects to a given IRC server in order to have the server relay communications to and from other clients on the same network but not necessarily the same server. Messages on IRC are sent as blocks. That is, other IRC clients will not see one typing and editing as one does so. One creates a message block (often just a sentence) and transmits that block all at once, which is received by the server and based on the addressing, delivers it to the appropriate client or relays it to other servers so that it may be delivered or relayed again, et cetera. Once connected to a server, addressing of other clients is achieved through IRC nicknames. A nickname is simply a unique string of ASCII characters identifying a particular client. Although implementations vary, restrictions on nicknames usually dictate that they be composed only of characters a-z, A-Z, 0-9, underscore, and dash. Another form of addressing on IRC, and arguably one of its defining features, is the IRC channel. IRC channels are often compared to CB Radio (Citizen's Band Radio) channels. While with CB one is said to be "listening" to a channel, in IRC one's client is said to be "joined" to the channel. Any communication sent to that channel is then "heard" or seen by the client. On the other hand, other clients on the same network or even on the same server, but not on the same channel will not see any messages sent to that channel. While IRC is by definition not a P2P protocol, IRC does have some extensions that support text and file transmission directly from client to client without any relay at all. These extensions are known as DCC (Direct Client Connect) and CTCP (Client To Client Protocol). For CTCP, clients like mIRC implement commands such as "ctcp nickname version" or "ctcp nickname ping" to get some interesting infos about other users. Using Internet Relay Chat. To use Internet Relay Chat, you need to do the following: Registering your nickname. Some IRC networks offer to register your nickname through a service bot. This provides sometimes access to channels that are blocked to unregistered users and in most cases reserves your nickname so no one else can use it (it will at least mark you as the logged in user and anyone else who uses it as not logged in). The service bots providing this is mostly named "NickServ", sometimes also "AuthServ" or on a big network just "Q". When you found out which one of those bots exists, you can gather more information by typing: This should get you detailed instructions on how to use the service. Example HowTo for a network. The process is fairly simple, once you have chosen a nickname you would like to register (assuming it's not owned by anyone else) and chosen a password, follow these steps: For example: For example: You should now be "logged in" under your nick. If you disconnect from the server, to relogin under your nick you will need to message the nickserv with your password: For example: Once doing so, it should reply back saying you successfully logged in. Private conversations and chats. By default, the conversations using IRC are public, visible to all users in the channel. To have a private conversation with a user in the channel, type "/query nickname". To have a private chat, join an non-existent channel, and then allow joining only by invitation using the command "/mode +i". Chunked into steps: IRC clients. To use IRC, you'll need an IRC client--a program that lets you connect to an IRC server, and enter an IRC channel. There is a variety of IRC clients: IRC commands. What follows is an overview of some of the basic commands of the IRC protocol. All the commands are already prefixed with a slash "/", as in most clients this will indicate that an IRC command follows that shall be executed. With some IRC clients including ChatZilla and Pidgin, you do not need to know these commands: you tell the client what you want to do using the graphical user interface and the client sends the necessary commands for you. Basic commands. Some basic commands for IRC are listed in the following section. Please note that not all of them are available in all clients, as some of them are client-sided inventions to make your life easier and not part of the IRC protocol itself. Privileged User Commands. Commands for half-operators, channel operators, channel owners, and admins:
1,314
Geometry/Inductive and Deductive Reasoning. There are two approaches to furthering knowledge: reasoning from known ideas and synthesizing observations. In inductive reasoning you observe the world, and attempt to explain based on your observations. You start with no prior assumptions. Deductive reasoning consists of logical assertions from known facts. Basic Terms. Before one can start to understand logic, and thereby begin to prove geometric theorems, one must first know a few vocabulary words and symbols. Conditional: a conditional is something which states that one statement implies another. A conditional contains two parts: the condition and the conclusion, where the former implies the latter. A conditional is always in the form "If "statement 1", then "statement 2"." In most mathematical notation, a conditional is often written in the form "p" ⇒ "q", which is read as "If "p", then "q"" where "p" and "q" are statements. Converse: the converse of a logical statement is when the conclusion becomes the condition and vice versa; i.e., "p" ⇒ "q" becomes "q" ⇒ "p". For example, the converse of the statement "If someone is a woman, then they are a human" would be "If someone is a human, then they are a woman." The converse of a conditional does not necessarily have the same truth value as the original, though it sometimes does, as will become apparent later. AND: And is a logical operator which is true only when both statements are true. For example, the statement "Diamond is the hardest substance known to man AND a diamond is a metal" is false. While the former statement is true, the latter is not. However, the statement "Diamond is the hardest substance known to man AND diamonds are made of carbon" would be true, because both parts are true. OR: If two statements are joined together by "or," then the truth of the "or" statement is dependent upon whether one or both of the statements from which it is composed is true. For example, the statement "Tuesday is the day after Monday OR Thursday is the day after Saturday" would have a truth value of "true," because even though the latter statement is false, the former is true. NOT: If a statement is preceded by "NOT," then it is evaluating the opposite truth value of that statement. The symbol for "NOT" is For example, if the statement "p" is "Elvis is dead," then ¬p would be "Elvis is not dead." The concept of "NOT" can cause some confusion when it relates to statements which contain the word "all." For example, if "r" is "¬". "All men have hair," then "¬r" would be "All men do not have hair" or "No men have hair." Do not confuse this with "Not all men have hair" or "Some men have hair." The "NOT" should apply to the verb in the statement: in this case, "have." "¬p" can also be written as NOT "p" or "~p". NOT "p" may also be referred to as the "negation of "p"." Inverse: The inverse of a conditional says that the negation of the condition implies the negation of the conclusion. For example, the inverse of "p" ⇒ "q" is "¬p" ⇒ "¬q". Like a converse, an inverse does not necessarily have the same truth value as the original conditional. Biconditional: A biconditional is conditional where the condition and the conclusion imply one another. A biconditional starts with the words "if and only if." For example, "If and only if "p", then "q"" means both that "p" implies "q" and that "q" implies "p". Premise: A premise is a statement whose truth value is known initially. For example, if one were to say "If today is Thursday, then the cafeteria will serve burritos," and one knew that what day it was, then the premise would be "Today is Thursday" or "Today is not Thursday." ⇒: The symbol which denotes a conditional. "p" ⇒ "q" is read as "if "p", then "q"." Iff: Iff is a shortened form of "if and only if." It is read as "if and only if." ⇔: The symbol which denotes a biconditonal. "p" ⇔ "q" is read as "If and only if "p", then "q"." ∴: The symbol for "therefore." "p" ∴ "q" means that one knows that "p" is true ("p" is true is the premise), and has logically concluded that "q" must also be true. ∧: The symbol for "and." ∨: The symbol for "or." Deductive Reasoning. There are a few forms of deductive logic. One of the most common deductive logical arguments is modus ponens, which states that: An example of modus ponens: Another form of deductive logic is modus tollens, which states the following. Modus tollens is just as valid a form of logic as modus ponens. The following is an example which uses modus tollens. Another form of deductive logic is known as the If-Then Transitive Property. Simply put, it means that there can be chains of logic where one thing implies another thing. The If-Then Transitive Property states: For example, consider the following chain of if-then statements. Inductive Reasoning. Inductive reasoning is a logical argument which does not definitely prove a statement, but rather assumes it. Inductive reasoning is used often in life. Polling is an example of the use of inductive reasoning. If one were to poll one thousand people, and 300 of those people selected choice A, then one would infer that 30% of any population might also select choice A. This would be using inductive logic, because it does not definitively prove that 30% of any population would select choice A. Because of this factor of uncertainty, inductive reasoning should be avoided when possible when attempting to prove geometric properties. Truth Tables. Truth tables are a way that one can display all the possibilities that a logical system may have when given certain premises. The following is a truth table with two premises ("p" and "q"), which shows the truth value of some basic logical statements. "(NOTE: T = true; F = false)"
1,479
Geometry/Proof. Introduction. Unlike science which has theories, mathematics has a definite notion of proof. Mathematics applies deductive reasoning to create a series of logical statements which show that one thing implies another. Consider a triangle, which we define as a shape with three vertices joined by three lines. We know that we can arbitrarily pick some point on a page, and make that into a vertex. We repeat that process and pick a second point. Using a ruler, we can connect these two points. We now make a third point, not on the line through the first two points, and using the ruler connect it to each of the other points. We have constructed a triangle. In mathematics we formalize this process into axioms, and carefully lay out the sequence of statements to show what follows. All definitions are clearly defined. In modern mathematics, we are always working within some system where various axioms hold. Two-Column Proof. The most common form of explicit proof in high school geometry is a two column proof consists of five parts: the given, the proposition, the statement column, the reason column, and the diagram (if one is given). Example of a Two-Column Proof. Now, suppose a problem tells you to solve formula_1 for formula_2, showing all steps made to get to the answer. A proof shows how this is done: Given: formula_1 Prove: x = 1 We use "Given" as the first reason, because it is "given" to us in the problem. Written Proof. Written proofs (also known as informal proofs, paragraph proofs, or 'plans for proof') are written in paragraph form. Other than this formatting difference, they are similar to two-column proofs. Sometimes it is helpful to start with a written proof, before formalizing the proof in two-column form. If you're having trouble putting your proof into two column form, try "talking it out" in a written proof first. Example of a Written Proof. We are given that x + 1 = 2, so if we subtract one from each side of the equation (x + 1 - 1 = 2 - 1), then we can see that x = 1 by the definition of subtraction. Flowchart Proof. A flowchart proof or more simply a flow proof is a graphical representation of a two-column proof. Each set of statement and reasons are recorded in a box and then arrows are drawn from one step to another. This method shows how different ideas come together to formulate the proof.
575
Beginning Mathematics/Introduction to Abstraction. Mathematics takes concrete things, and turns them into abstractions which help to generalize ideas. Take a simple example with numbers. Is quantity the property of a thing? We can have two cars or two shoes, but there are still two. We can also have one car or two cars, but we are still talking about a "car". Think about it for a minute. Can you define the idea of number? There is no tangible thing as one. There is "one dollar", but there is not a one. There is a symbol for one, but again no tangible "one". If you attempted to define numbers you probably came up with definitions that just start out listing 1,2,3,etc. or you can also look and see that one plus one is two. There is something inherent in this property. This seemingly imperceptible condition of abstraction is the defining quality of mathematics. In geometry we consider enclosed shapes with three sides on them, and call them triangles. You may see a triangle, but you will never see the tangible idea of triangle. You merely see a representation of it. Yet, you can discover such facts like a rectangle can be divided into two triangles. This is true regardless of the rectangle you choose, and you can reason this without actually seeing every rectangle, which would be impossible. Mathematics is able to generalize various things into abstract ideas, upon which generalized statements can be made for classes of objects without considering each one individually. Triangles have certain properties. Two of anything has certain properties. These are all related in the abstract. In understanding abstractions, mathematics begins to classify ways in which abstract objects are alike, and ways they are different. Some things are numbers, and others are shapes. Mathematics deals with this problem by defining different types of equivalences. For any two things it covers, an equivalence class says they are either the same or different in a certain way. In ordinary arithmetic this might be expressed by something like formula_1 which says that under the equal equivalence class 3+3 is the same as 6.
470
Puzzles/Action sequences/Three Bottles/Solution. Puzzles | Action sequences | Three Bottles | Solution
28
The Voynich Manuscript/Jargon. "Your friendly online dictionary for impenetrable Voynich terminology!" Basic Voynich Jargon. Dain = Colloquial Scots, particularly North East Scotland meaning "doing". A typical example may be "Fit i Ye Dain?'" = "What are you Doing?" Can also be "Dein" dain/daiin/daiiin = a weird-looking "word" that recurs throughout the VMS, often in groups (like dain daiin), which has led to numerous bizarre theories. EVA = a particular stroke-based transcription format for the VMS, designed to be both linguistically readable and post-processible into whatever glyph format you like. For more on this (and to download the EVA Hand 1 font), go to: http://www.voynich.nu/extra/eva.html Folio = a pair of pages with a number (the foliation) on the front (typically in the top right). The front page of the pair is denoted "-r" (for recto), and the back (reverse) page of the pair is denoted "-v" (for verso). So, f80r means folio #80, front page. Gallows / Gallows Characters = the tall squiggly characters seen freqently in the VMS. Less common are Long gallows or Split gallows, which are gallows characters which (typically) have the two 'legs' of the gallows separated and some other text placed beneath. Interlinear = a merged set of transcriptions of the VMS, where various authors' transcriptions of the same line of VMS text are interleaved (ie, placed one after the other). You can download the latest ("version 1.6e6") Landini/Reeds/Takahashi/etc interlinear file from http://www.dcc.unicamp.br/~stolfi/voynich/98-12-28-interln16e6/ Nymph = one of the small naked women adorning the pages of the balneological and astrological sections. Picnic Table = an inverted V shape with a flat line across the top (not a gallows character). In EVA this is character <x>. Quire = a set of bifolios folded around a central "gutter" into a small chapter-like entity: typically 16 pages long. If numbered (as they are in the VMS, usually on the bottom right of the back of each quire), the numbering is referred to as its quiration. Voynich Section Jargon. Herbal pages = pages with a single type of plant on Pharma pages = pages with multiple plants and apothecary jars (maiolica) Astrological pages = the circular volvelles with nymphs (f70v2..f73v) Astronomical pages = the other circular diagrams (f67r1..f70r2, etc) 9-rosette page = the foldout map page Recipe / Ephemeris pages = the starred paragraphs at the back of the VMS Balneological pages = nymphs, baths, plumbing (f75r...f84v) Key-like sequences = pages with 1+ sets of single glyphs in a row/column/circle Front page = f1r Magic circle page = f57v Fertilisation / Seed page = f86v The michiton oladabas page = the last page, named after one particularly influential reading of its non-Voynichese letters. Linguistics/Statistics Voynich Jargon. Core-mantle-crust theory = three separate categories to group letters into: part of a VMS grammar proposed by Jorge Stolfi, explained in depth at http://www.dcc.unicamp.br/~stolfi/voynich/00-06-07-word-grammar/ Entropy = an overall measure of how unpredictable a sequence of numbers is. However, if you change how you predict what the next number is (ie, change the context or model), and you'll get a different entropy value. If you change how you transcribe the text, you'll get a different entropy value too. Glyph = a single connected entity on a page. But is the ligatured "4o" you often see one glyph or two? Opinions differ... Grammar = how text 'works'. For the VMS, written in a language and alphabet we (apparently) don't know, working this out has proven hard. A good summary is here: http://www.voynich.nu/a_para.html (The) Kober/Ventris Approach = the way that Linear B was famously decoded by Michael Ventris, who built his ideas around the patterns noticed by Alice Kober (typically a common triplet at the start of some groups of five symbols, which she suspected formed some kind of root). If the VMS is actually a language, then Kober/Ventris would be relevant, as they decoded Linear B without the help of bilingual texts (like the Rosetta stone, etc). For more info, go to http://www.bib-arch.org/bswb_AO/bswbao0601review.html Stroke = a single pen-stroke within a glyph. Transcription = how you choose to convert a text into (ASCII) characters. There are two major types - stroke-based (such as EVA) and glyph-based (pretty much every other one). As opinions differ about what is and isn't a glyph, EVA was introduced so that a single transcription could be post-processed to fit your glyph model. Cryptography / Shorthand Voynich Jargon. Cipherbet = a contraction of "cipher alphabet" coined by Nick Pelling. Admittedly a horrible word, but if you take a cryptographic view of the VMS, you'll probably end up using this (perhaps unwillingly). Cleartext = the original text before encoding. Same as plaintext. Ciphertext = plaintext that has been enciphered/encoded (perhaps encoded text should be called Codetext, but that seems somehow ugly and unusable, I don't know why). Code / Cipher = a system to fiddle around with text. Technically, codes replace words with a number reference (a code index) and ciphers replace letters with other letters: though nomenclature (whereby particular key words were replaced by special symbols) forms a kind of bridge between the two types of systems. Cryptanalysis = the art/science of breaking codes/ciphers. Cryptography = the art/science of making codes/ciphers. Cryptology = the overall science of code-making and code-breaking Monoalphabetic = a cipher system that only ever has a single (output) replacement character for a single (input) plaintext character. It's long been agreed that, if the VMs is encoded, it's using a system that's more complex than just a monoalphabetic cipher. cf polyalphabetic. Notarikon = a system of Qabbalistic word manipulation whereby phrases are transformed into their acronyms (and words expanded back into phrases as if they were acronyms), typically to reveal deeper truths in the Torah. Often described as a kind of possible shorthand / code mechanism, but rarely actually used. Pair cipher = a cipher which replaces one or more plaintext letters with a pair (or group) of letters from the cipherbet. AKA a verbose cipher. Plaintext = raw text that hasn't been fiddled around with at all. Polyalphabetic = a cipher system that has multiple monoalphabetic (qv) ciphers, which it selects between according to context. A "straight polyalpha" will change context every letter, and loop around after (say) every 26 letters: when breaking polyalphas, you often try to discern this "heartbeat". Unless the text has an internal "rhythm" that matches the internal rhythm of the context change, this typically has the effect of emitting all letters at roughly the same rate - which we don't observe in the VMS. So, if it isn't a monoalpha, & it isn't a straight polyalpha... what is it? Steganography = a system to hide text in plain sight. Rather than relying on mathematics, this relies on psychology and misdirection to distract the eye from seeing the text. Hiding text in JPEGs or WAVs is the modern form of steganography (various intelligence agencies claimed that Al-Qaeda was doing this, but AFAIK have failed to find even one) - but people have taken delight in hiding secret messages in pictures since time immemorial. Stenography = a modern name for shorthand. Often confused with steganography (qv), even by people who should know better. :-) Tachygraphy = a shorthand system based around writing a limited number of symbols at speed, typically by using a specially designed "single-stroke" alphabet to take notes onto a wax tablet with a stylus. Verbose cipher = a cipher which replaces one or more plaintext letters with a pair (or group) of letters from the cipherbet: such systems date back to at least 1440. AKA pair cipher. Miscellaneous Voynich Jargon. Albarelli = maiolica containers (like small barrels) for potions and lotions. These are relevant to the "barrels" with nymphs in (which Edith Sherwood talks about) in the low-numbered astrological volvelle pages, as these could well be albarelli: the complexity of the glazing designs grew steadily throughout the 15th Century, so moved from austere Islamic geometric shapes (circa 1440-1450) through to complex historical scenes (circa 1510). Similarly, the number of colours that could be employed sensibly increased over the same period - these would date the VMS' albarelli to (say) 1460-1470 (few colours, geometric designs). Antidotary = manuscript or book from the 15th/16th Century describing recipes, mixtures, plants, jars, etc. Apothecary = medieval / early modern pharmacist or chemist. The "apothecary oncia" symbol (a 'cursive z' with a bar above it), denoting an ounce or fluid ounce, was a frequent feature of early modern recipes, and is often transcribed as "3". This means a frequent pattern there is "3 iii" (which means "oncia tria", 3 ounces) - so some suspect that the VMS' "dain/daiin/daiiin" could be a steganographic version of "3 i / 3 ii / 3 iii". However, YMMV. :-) Balneological = a hand-rolled fancy Cuban-cigar way of saying "to do with [medicinal] baths and spas". Circinus = medieval device used to draw circles. CopyFlo = a kind of monochrome photocopy printout from microfilm produced by the Beinecke Library which you can buy. It's very nice to own one, but it's just a shame that it's not somewhat better quality. Foldout = a page larger than the size of most VMS pages that you can "fold out" to see in full. Examples: the famous "9-rosette" map page, the pharma pages, the astronomical pages. FSG = First Study Group, a early (and significant) group of cryptographers and historians who tried to crack the VMS, 1944-1946. Similarly, there was an SSG in the 1960s. There's a good page listing numerous people involved with the VMS over the years here --> http://www.voynich.nu/solvers.html Grove Numbers = a way of numbering the nymphs/stars/labels on the circular astrological diagrams: for a particular ring, count clockwise from 9 o'clock (normally the leftmost nymph) up from #1. There are three (partial) justifications for this: (1) this is the location of the ascendant (the horizon) in a circular astrological natal chart; (2) this is roughly where you find stylised markers (probably indicating "start-of-line") in the circular rings of text; (3) if you count from the inside ring first, the nymph associated with the 7th degree of Leo is wearing a crown - the star associated with Leo 7 is Regulus, "the little king". If you're interested, you might like to look at Astromagia. However, YMMV... :-o Maiolica = 15th/16th century tin-glazed earthenware, AKA lustreware. (Note that Victorian tin-glazed earthenware is called "Majolica", i.e. with a "j"). Maiolica was originally shipped across to Italy from Spain via Majorca (hence the name, somewhat misleadingly), but the technique for making it was copied in Northern Italy, which became the leading centre for their manufacture (circa 1450). http://www.chass.utoronto.ca/~kovacevi/homepage.htm Mirror of Princes = a type of medieval document which purported to advise princes on how to tackle numerous different aspects of stately life. Filarete's utopian "Treatise on Architecture" falls into this category, as does Machiavelli's (in)famous "Il Principe". However, Alberti also wrote a satire ("Momo e Il Principe Italiano", which is online at http://www.intratext.com/X/ITA0734.HTM ) taking the mickey out of these "Mirrors" (which tended to take themselves rather too seriously), & their intention (to influence those in power) seems rarely to have succeeded. Oh well. :-/ Murano = the centre of the Italian glass-making and mirror-making trade, which was tightly controlled by Venice. A few of the containers in the VMS pharma section have decoration similar to glass from Murano circa 1450-1500. Nocturnelle = a hand-held circular early modern instrument similar to a volvelle, but instead used for calculating the time at night from the position of the stars. AKA moon-dial, or even phebilabe or phebelabium (following David A. King). Rotoscope / Rotograph = a kind of projective photograph system used in the early 20th Century, whereby images (rotographs) were projected onto the plane of a screen inside a mechanism (a rotoscope), which could then be examined closely or traced from. The British Library was given a set of VMS rotographs in 1931. Volvelle = a hand-held medieval astrological instrument made from concentric circular dials, & used to calculate planetary positions... Wiki / WikiWiki = a generic name for a web-page which anyone can edit quickly without having to learn HTML. Try it yourself! :-) WMV = Wilfrid Michael Voynich, who bought the VMS in Italy in 1912. His original (Polish) name was "Michal Wojnicz", and his clandestine spy-name (don't ask) was "Wilfryd" - when he moved to the West, he westernised his name to be a mixture of the two, spelt more phonetically. Wolkenband = a chain of clouds, often used as a squiggly decorative feature in 15th Century Italian MS, to be seen on VMS page f68v3 (first brought up by Erla Rosakiewicz in 1945 - see http://www.ehabitat.demon.co.uk/vms/letter-050.html ) and indeed throughout the VMS' balneological section. YMMV = Your Mileage May Vary, ie "interpret the preceding statement(s) how you will"
3,817
GTK+ By Example. This book aims to be an accessible introduction into creating applications with GTK+ widget toolkit. We introduce widgets and give examples on how to use them. Why a Wikibook on GTK+? A wikibook is an undertaking similar to an open-source software project: A contributor creates content for the project to help others, for personal enrichment, or to accomplish something for the contributor's own work (e.g., lecture preparation). An open book, just like an open program, requires time to complete, but it can benefit greatly from even modest contributions from readers. For example you can fix "bugs" in the text (where the bug might be typographic, expository, technical, aesthetic or otherwise) in order to make a better book. If you find an opportunity to fix a bug, simply click on "edit", make your changes, and click on save. Other contributors may review your changes to be sure they are appropriate for the book. If you are unsure, you can visit the discussion page and ask there. Use common sense. If you would like to make bigger contributions, you can take a look at the sections or chapters that are too short or otherwise need more work and start writing! Be sure to skim the rest of the book first in order to avoid duplication of content. Additionally, you should read the Guidelines for Contributors page for consistency tips and advice. Note that you don't need to contribute everything at once. You can mark sections as "TODO," with a description of what remains to be done, and perhaps someone else will finish those parts for you. Once all TODO items are finished, we'll have reached our First Edition! Examples in this book should be written in C as that is the language GTK+ is written in most. Additionally, implementations of the algorithms as an appendix are welcome. Contributors. __NOEDITSECTION__
412
The Voynich Manuscript/F49v. This folio has the numbers 1-5 corresponding to alphabet characters along the left side. If these are indeed values for the characters, it would explain why numbers have not been found with any certainty. These values have been applied to words in the Astronomical Section in an attempt to find dates. This has met with some success, although the results are not accepted by many.
94
The Voynich Manuscript/F67v1. The central figure may be Tycho Brahe, although this identification places the manuscript at a later date than many researchers are comfortable with. Under that theory, the prominent stars to the lower left appears to be Casseopeia, and Tycho's Star, the supernova of 1572, is the outer of the two stars in the 8:30 position. The single star to the lower right is Algol.
108
The Voynich Manuscript/F67v2. One idea concerning the collections of faces in the corners is they may represent planetary conjunctions. Astronomical research has revealed that such configurations do indeed occur. While providing specific dates, they do not help date the manuscript, as they occurred in both the 15th and 16th Centuries. An interpretation of the folio is that the conjunctions were observed from the central point while the Sun or Moon was setting (or rising) over the trees. Here are some of the alignment dates: NW Mercury, Venus, Jupiter (Virgo) 29 August 1554 NE Mercury, Venus, Mars, Saturn (Taurus/Aries) 17 April 1588 SE Mercury, Venus, Mars, Jupiter (Leo/Cancer) 10 July 1577 SW ? Red Ink. Jorge Stolfi discusses the red ink on this page at http://www.dcc.unicamp.br/~stolfi/voynich/99-12-15-f67-reds/ . I have a couple of comments on this document. First he mentions "The shadow is painted red in seven of the moons, and light yellow in the other five." Looking at the more recently available SIDs provided by the Beinecke (2004) I'm of the opinion that this yellow is a thinner "wash" of the same color used in the non-red text. In fact it is difficult to distinguish the color from some of the fainter letters. As far as the red ink goes, my non-expert opinion based on the high quality scans now available are that they are all the same ink painted at the same time. However, I'm not so sure that the red ink was necessarily applied at the same time as the rest of the text. Firstly there has been some discussion about the sloppiness of some of the painting. In the "moons" on this page neither the red nor the "yellow" fillins are very neat. In the case of the lighter color overpainting I believe that the overpainting was applied after the outline had dried. This theory is based on the appearance of where the overpainting overlaps the outline and produces and "additive" darkening effect. However this could be no more than minutes after the outline was drawn so perhaps doesn't say much. I considered the possibility that the red text was an overpainting of earlier brown "original" text. I can't find much evidence for this theory though: Another random note: What thought has been given to the pattern in the outer band? At first glance it seems to be decorative, but it is fairly complex and not entirely repetitive. It should be noted that this band seems to have the same "yellow" wash in a couple of places as the lighter overpainted moons. This color also appears in the center figure. 18:39, 12 Jul 2004 (UTC)
689
Guide to Social Activity/Appearance. "The factual accuracy of this module is ." First, the bad news. There is nothing you can do that will make you attractive to every woman you meet. Every woman has her own unique preferences, turn-ons, and turn-offs. Even if you happened to be Mel Gibson, there are women who would look at you and think, "Eh, nothing special," or women for whom Mel Gibson reminds them of some person they intensely dislike (Mel Gibson, perhaps). You just can't please everybody. However, you need not appeal to a woman in terms of looks to make her go out with you. Of course, she needs to admire you, to feel good and comfortable because of you. So the whole area of looks is just to prevent some thoughts like "my, that's a dirty/boring/careless guy/gal" to pop up in her mind the moment she sees you first. Clothing. Basic elements of style: Fit: Obviously, the piece of clothing in question needs to fit, preferably loosely. If you feel like flaunting your muscles (if you HAVE muscles), then go ahead and wear something a little tighter. Comfort: Except in extreme situations (i.e. formal dinners and the like), make sure your clothing feels comfortable on you. If not, you'll wriggle around, and this will make you look odd. Colour: The ideal colour of your clothes depends on you. Dark, muted tones convey an air of professionalism, whereas light, bright tones convey an air of lightheartedness. Play to your strengths. Fabric: This ties back into comfort. If the basic material the clothing is made out of is itchy and uncomfortable, it won't play well with the ladies. Obviously, find what you feel most comfortable in. Appropriateness: Wearing an inappropriate outfit can effectively sink you. What is deemed "appropriate" is determined by the situation: obviously, black-tie galas and other upscale events call for a much more strict standard of dress than, say, a club. Practicality: When buying an outfit, think: "How will I use it"? If it's fairly expensive, and you're rarely going to use it, then it may not be a good idea to buy it. Value: Go with what works on your budget. If you attempt to woo the ladies by looking like a millionaire when you are not one, it will lead to disappointment. Mixing and matching: This is very important. If two items of your wardrobe clash, this can sink you. Think of your wardrobe like an orchestra. No matter how good one instrument is, if another doesn't produce a pleasant sound, that's all people will notice. White, black, and grey are the universal matching colours: nearly every other colour will go with at least one of them. Accessories: Accessories come in two categories, the utile and the stylish. Utile accessories: These are the accessories you actually USE. Take your belt for example. It's holding up your trousers. You're using it. A watch is another example. You can use it to tell time. Stylish accessories: You don't actually use these, they're just there to make something look good (like a "grill"). Your body. If you ask a woman what she wants in a man or woman, considering the looks, they will often prefer men or women without fat, a little bit of muscle up to bodybuilder-like figures. However, reality shows the opposite, and it's more important how you make her feel. If she feels turned on by big muscles, that's okay. If you can make her comfortable and (only then) turn her on via what you say, it's even more powerful! Exercising is a good way to go, though. Exercise. The sacks of meat charged with moving our brains from place to place are wonderful devices, but they weren't designed for the sedentary lives and atrocious diets so many of us inflict upon them. They are meant to be used and used vigorously. Exercise is absolutely critical to the human body. There are a dozen reasons, and making yourself gorgeous for women of the female persuasion is just one of them. You want to be able to accomplish the daily tasks of life without getting winded. You want to be able to run and play with your kids. You want to be able to defend yourself in a fight. Just choose a reason that motivates you and compels you to do put in the effort, so your body can live up to its potential. There is no shortage of exercises to choose from. Running, jogging, cycling, weight lifting, swimming, basketball, racquetball, tennis, gymnastics, badminton, and football (European or American) are all popular. But if you prefer some niche sport like fencing, go for it. The important thing is to tailor your workout to fit your own personality and lifestyle. Is it convenient to bicycle to and from work? Do it. Do you enjoy team sports? Do it. Do you like the idea of upgrading your muscles? Do it. Many people go the weight lifting route, but don't forget to add aerobic exercise into the mix. The usual advice is three to four times per week, for at least twenty minutes per session. If you are in a very unhealthy condition (like you have difficulties to move thereof...) you need to begin slowly, assisted by some diet, because the primary goal will be weight loss, and to exercise properly you need less weight. Running is best for fat-reducing, you can run as slow as you want (well it should be more strainful than simply walking) for as long as you can. 15 minutes is ok for beginners, even with casual breaks. After two or three months you will feel your heart has become a lot stronger, and you can do a lot longer. You need more than half an hour to begin burning fat efficiently. One hour seems to be a good time span, that is not too stressful for the rest of your body (after some practice though). Don't be fooled by sports that don't really give you much exercise. For example, cricket. It's a sport with a long and storied history, but try watching a game. How many of the players are actually moving at any given time? The game is characterized by the occasional frantic burst of activity, and a whole lot of standing around. This pattern of exercise is more likely to result in injuries than in firm, woman-attracting abs. It's great to enjoy cricket, but be sure to give your body other forms of exercise. The overall health that results will make you a better player and reduce your likelihood of injury. Diet is a tricky subject. We all have different dietary needs, we all have different food preferences, and some lifestyles aren't conducive to getting proper nutrition. Lifestyle changes aren't easy, but they're worth doing. Put down the twinkies and acquaint yourself with the produce department of your local supermarket. Most of us could benefit from cutting back on fat, cutting our overall calorie intake, and eating a much wider variety of healthy foods. Avoid fad diets, diets that focus on a single miracle food (the infamous grapefruit diet, for example), and starvation diets. The best diet isn't necessarily the one that drops pounds fastest, but one which involves permanent lifestyle changes that keep unwanted pounds from coming back. The news are always full of studies where eating such-and-such vegetable or fruit prevents cancer/heart disease/arthritis/etc/etc /etc.. A sum-up of all these studies is "Food is medicine, and medicine is food." This is the case when you are careful to eat lots of raw vegetables, fruits, and grains, while eating dairy and meat much less often. Eating veggies raw is to be preferred to eating them cooked, because the heat breaks up the vitamins and minerals. Think of fruit as nature's dessert. Eating healthy foods will do you much more good if you stop eating the unhealthy foods too. The key to this is to avoid the pre-processed foods like the plague, and eat things in as natural a state as possible. High fructose corn syrup in particular kills your bodies ability to determine that you are full, which leads to overeating. (do a Google search on "high fructose corn syrup, health" to find out more.) It is amazing how many foods it is found in now. Healthy eating affects your looks - the gloss of your hair, the clearness of your skin.. It also affects body odor, your energy level, and your outlook on life. You will know that you're eating healthy if you find yourself feeling fewer and fewer cravings for sweets and meats. Changing your diet. When you go to the grocery store, choose a new vegetable to try, and get only one. When you get home, wash it in water to get the pesticides off of it, cut a small piece, and eat it raw to see what it tastes like and decide whether you like it. If you like it raw, then that's definitely how you should eat it. If you don't like it raw, then try cooking it for just a few minutes, and then try it again. (It is better to undercook than overcook vegetables.) If you don't like that vegetable at all, then don't try eating it again until 6 months later, when you've gotten more used to your more natural diet and your perception of vegetables and their flavors have changed. Think of it as a scientific experiment, and work your way through all the vegetables this way so that you can find you didn't know you liked. Try out fruits in a similar fashion, but omitting the cooking step. Fruits are especially good for satisfying hunger quickly, and a piece of fruit can go a long way. If you hate breakfast cereals with flakes, go for granola cereal. Test out brands until you find one you like, as not all granolas are created equal. Whenever possible, eat carbohydrates based on whole grain, wheat, wheat flour, and the like. Avoid "enriched" if possible. Hair and Facial Hair. Hair should be clean and well-groomed. Frequent use of shampoo and conditioner is advised, and the longer your hair is the more important it becomes. Regular trims keep your hair low Oh, one more thing: Comb-overs. Don't do it. Just don't. It is becoming commonplace for balding men now to simply shave off all of their hair, which many consider to be a better alternative. Facial hair is a difficult and controversial area. Some women love it, some women absolutely hate it. For widespread appeal, I would suggest doing away with the beard and sideburns altogether. But if you like how you look with a beard or goatee, go for it, and keep it neatly trimmed at whatever length you enjoy. When you are happy with the way you look, it shows in the way you conduct yourself, and the confidence you display is often very attractive to women. Body Language. Stand up straight. This says you are alert and on top of things. It also shows your body to the best advantage. Same goes for sitting up straight. What to do with your hands -- Use your hands to help convey your meaning when you speak and tell stories. While listening, you can keep them in your pockets, or on your lap (if sitting down). Having your arms folded across your chest during a conversation conveys an impression that you are resistant or closing your mind against whatever is being said; it is like a barrier between you and other people. Avoid this stance when in any kind of argument with a girl. Having one arm folded across your chest with the other arm resting over it and that hand up touching your face conveys the impression that you are listening carefully. If you are at a table, you can also send the same signal by leaning forward slightly, with your elbows on the table, with your head leaning on your hands. If you sit on a couch next to a girl you don't know, resting your arm on the back of the couch (assuming the back is low enough to do so comfortably) yet without touching her back may be interpretted by some girls as expressing mild interest. More interest may be conveyed, if your other arm is not similarly draped over the back of the couch and there is another girl sitting on that side. If you are sitting down with an empty spot next to you and a girl walks into the room who you find attractive, you can subtly signal to her to come over and sit down by you by catching her eye and smiling. This will fulfill a girl's psychological need to feel wanted, and it will draw them to you like a moth to a flame. Even if they don't come over and sit down next to you immediately, they will eventually (unless they have a boyfriend and he is present). Be Yourself! The most important thing is to be happy with and confident in your body. If you don't feel confident in the appearance you present to women, this lack of confidence will speak louder than expensive clothes or a new haircut ever could. So if some piece of advice feels totally wrong, jettison it. If some outfit makes you feel like an idiot, wear something else. Attitude is everything.
2,991
Introduction to Philosophy/Existentialism. < Introduction to Philosophy <-- I have not the time now but I recommend adding Nietzsche's "proto"-existential viewpoint which was neither one of "nausea" or "apathy" --> <-- Indeed, he even says that many people are not existential and are mere skeletons who have shrouded themselves with the beliefs of others. --> "Have you ever felt that "hell is other people"?" Do you think you are "condemned to be free" because you make your own choices in life, and are not dependent on external morality? If so, you may be an "existentialist". One existentialist thought is "Nothing is true, everything is permitted". Fyodor Dostoevsky expressed this through Ivan, a character in his book "The Brothers Karamazov" ("Братья Карамазовы"). Ivan later shed his existentialism for faith in God (misquoted by Sartre in "Existentialism is a Humanism"). One existentialist feeling is nausea, another is apathy. Both feelings are in response to not actually being able to change the world. Kierkegaard. The "first" existentialist (or at least the first to bear this title of "existentialist") was Søren Aabye Kierkegaard, a Danish philosopher. He talked about three stages in our lives: These three stages were commonly associated with the "feelings" that accompanied them. The aesthetic stage, embodied by young people who recklessly pursue youth's pleasures or by students of science or another devotion which requires great discipline in which to achieve success, is characteristically associated with the feeling of "despair" including the aforementioned "nausea". This is brought on by the realization that no matter how long one parties and drinks and cavorts, or in the second case, no matter how many books are studied and lectures attended, the secrets to life and a happy existence are simply not to be found in this fashion. This leads to a despair darker than night, a wanting to make something of oneself, to be remembered or to be depended upon. This sense of duty brings on the second stage of existential appropriation, the religious stage. Though termed the "religious stage", this stage is embodied by a clear desire to do a duty to something bigger than oneself. The activities that result in this stage are usually ones of great responsibility, sometimes with others depending upon the individual. Examples of such activities include marriage, volunteering in a military organization, or becoming religiously devout or joining the monastic order. During this religious stage, feelings of guilt are eventually encountered because no matter how devout, responsible, or courageous people can be, certain things occur that are out of their control and they inevitably fail themselves in some way by not being able to uphold their responsibility or oath. For example, an individual could be the best soldier he can be, but alas, his comrade is felled by a bullet that he could not stop, and is thus guilt stricken. Finally the individual undergoes a schism in which a discovery is made that one can really only be true to oneself, and that from this idiom stems the powerful realization of free will and the terrible responsibility that comes with it. This final stage of realization is known as the existential or enlightened stage. In this stage an individual is aware that his or her "reason for being" is solely decided by his or her own decisions, and nothing else. This enlightenment is the mantle of true freedom, even onto the decision of suicide! Paris - Sartre. Then in Paris, after the Second World War, many literary and philosophical ideas changed. Albert Camus wrote The Outsider, The Fall and The Plague. Jean-Paul Sartre, who had studied under Martin Heidegger, started a magazine called "Les Temps Modernes" with Maurice Merleau-Ponty. Sartre's main philosophical book is "Being and Nothingness" ("L'Être et le Néant"), while "Existentialism is a Humanism" ("L'existentialisme est un humanisme") is a concise and less technical work suitable for the beginner. He also wrote plays, such as "No Exit" ("Huis Clos"), and novels, such as "Nausea" ("La nausée") and "The Roads to Freedom" ("Les chemins de la liberté") trilogy. When discussing Sartre in the line of existentialists it may be useful to note that he was by far the most political of the lot. Sartre became a Marxist and in some sense lost some respectability among many existentialists — because he had begun to rely on an external set of values rather than an "authentic" set of choices.
1,104
Guide to Social Activity/Body Language. Interpersonal Body Language. Women on average are better at body language than men; it could even be said to be an innate knowledge. Thus, understanding body language is of great importance if you want to approach attractive women. It's up to men to decipher the implied meanings of their actions, but sadly, most men are generally lacking in this area. The consequence would be this: a man feeling that everything is going perfectly -- until the woman suddenly leaves him. When you meet a woman who interests you, one of the first things you should do is to observe the way she carries herself; the way she moves, stands, makes conversation with others, dilated pupils, shiny eyes, so on and so forth. Your own body language. List of things to consider: If you stay in one place, then you can let the other person or persons find a comfortable distance from you. Continue to stay in one place while talking with the other person. If leaving the person, leave discretely, before the other person becomes completely disinterested with you. Good posture potentially improves your confidence and the impression you make. Sit and stand straight, keep your shoulders back and your chest up. If you avoid reacting to your own humorous remarks, the other persons might react more. "Do not change the angle of your body." That is, if the other person approached you first, and your body does not face the body of the other person, then do not reorient yourself. If you must reorient yourself, leave and return. It is best to show other persons that you are stable and consistent. Body language of other person. The meaning of some of the body language in this list has not yet been documented here. In a social setting, try comparing the other person's body language with a third person with its interactions with you. The "personal space" test consists of moving a little bit closer to another person at a social setting so that you are standing close and reducing the size of the space around another person. A person less interested in you will attempt to move away. People instinctively raise their eyebrows when they meet interesting people. Use this to attempt to measure the interest that other people have with you. Interested or excited people will also have shiny eyes. The eyes have a tiny gland on the bottom of the eyelid secreting liquids such as tears and lubrication. When a person is interested or excited, the glands tend to secrete liquid thus giving the eyes the shiny appearance. Maintaining eye contact shows a person's confidence level. Closed versus Open. Some persons form a barrier: arms crossed, legs crossed, or holding an object in front of themselves. Their body is closed. It is better to seek persons who have arms apart, legs uncrossed, and are facing in your direction; their body is open. As an exception, if two persons like themselves well, then they might close their bodies while standing or sitting opposite each other. These persons are acting open; their bodies are only closed because they are closed to themselves. Leaning Forward versus Away. When sitting at a table, persons can either lean forward or away. If you lean forward, then you are more visible to other persons at the table; it is easier to converse with other persons who lean forward. When comfort and trust have not yet been secured, leaning forward can be taken subconsciously as a sign of hostility. This can be used to subconsciously manipulate or train the other person's actions to your liking. In contrast, leaning backward, away from the table, is a sign of disinterest. However, a person that leans backward but has their body open might simply be relaxing. Try using some jokes or humor to gain the interest of this person so that they begin leaning forward. Therefore, if you want to invite someone home, or plan another social meeting with them, suggest making the invitation when the other person or persons are leaning forward with open bodies. Invite the person to meet with you for coffee or some other beverage, or tell them to write their telephone number, even if they must write it with your pen on your arm. Rapport. Rapport is the technique of mimicking the body language of the other person. If your body language mirrors the body language of other persons in the conversation, then you are implementing rapport. For example: Other persons sometimes check if you mirror their body language, and have more interest in persons with rapport. For the converse, you can check if the other person mirrors you. Definitions. Binocular Disparity The difference between the two retinal images of an object. Because the right and the left eye are at slightly different positions from each other, they have to turn inwards in order to keep focus on an object as it approaches closer. The closer the object the more the eyes turn inwards. A listener can tell how alert the other person is by the angle or the eyes turning inwards. Binocular Disparity is what allows us to have three dimensional vision. While talking to a person, subconsciously one can tell if the other person is paying attention. The more a listener focuses their vision on the speaker, the more the eyes turn inwards. A listener whose eyes are both turned straight forward reveals that he's not paying attention. Even though there is eye contact, the eyes should be turned in slightly in order to focus on the speaker. Binocular Disparity can be used to subconsciously communicate relaxation or aggression. By focusing the eyes on a dot on the other person's face, one is perceived to be alert. Maintaining focus on the dot for longer time would make the person appear as aggressive or even angry such as zeroing in on a target. On the contrary, looking at the whole face of the other person, and unfocusing the eyes, makes one come across as relaxed and friendly or even easy going. Unfocusing the eyes can be used as an aid in argument resolution. The decreased angle of the eyes turning inward makes one look as having relaxed. As a result, the other person sees a relaxed look of the eyes and tends to relax himself. See Also: Pupil Dilation, Shining Eyes Cut Off / Facing Away A form of gaze avoidance or intrusion avoidance in which the head or the whole body is turned fully away to one side. A sudden cut-off gesture in conversation may indicate uncertainty or disagreement with a speaker's remarks. Sustained cut-off may reveal shyness or disliking. A cut off is a form of angular distance. People also turn away as a form of being considerate and giving the other person space in a setting where moving away physically is impractical. During an intermission, the candidates in a debate would respectfully turn away, so as to give each other room to breathe. In salesmanship, looking suddenly up and to the side is a signal of the prospects skepticism. The sales agent themselves could turn their head or the whole body to the side to make their presence less pushy to the prospect. While walking away discourages prospects because of the retreating nature, the cut off can be used as a substitute for angular distance. Facing away is a reaction to spatial invasion either one's own of the other persons. After the host and the various guests embrace, they back off and one or both always look away as an equilibrium-maintaining technique to re-establish a proper level of proximity. Males and people of greater physical size turn their heads away to the side more than do females and people of smaller stature who in turn find it more comfortable and easier to create distance by walking. Both gaze aversion and torso rotation increase dramatically in conditions of crowding. Dancing as a Seduction Tool Dancing is one of those things that can either greatly enhance or totally destroy your chances to score depend on how good you are at it. Many guys would actually be better off just standing around trying to look cool, if the alternative is dancing badly. Women treat dancing as a form of "safe sex" (a fun, sensual activity without any of the risks or downsides of actual sex), and a guy's ability to close-contact dance with women is often viewed by them as an indicator of sexual ability. There's a certain breed of guy called "the dance partner". This guy likes to hang out all night in clubs, dance for hour after hour with many women, and go home with none of them. He might either be gay, or simply have no idea on how to translate the dancing into sex. Or simply like dancing. A famous receiver for the Oakland Raiders named Fred Biletnikoff used to say that "if you can put your hands on a pass, you should be able to catch it. If you have a woman in your arms, you should be able to get her into your bed. Dancing is an excellent way to get her into your arms. If she is with a group of girls, ask everyone at the table to dance one by one and work over to the one you want. If they are sitting there drinking and talking, watching the dance floor and keeping time to the music, they are ready to dance. Go ask, if they say no, laugh and have your comeback line ready. I have had girls that said no come back to me and want to know why I didn't ask them again. Usually those are the one's that go home with you too. I would say that 9 1/2 out of ten girls I ask to dance, go out on the floor with me. Energize them, then let things flow. Firm but gentle works most of the time." Ears, Right Ear vs. Left Ear If you're stuck chatting up a "mumbler" (someone who will mumble their words instead of speaking clearly) at a cocktail party, lean in with your right ear. It's better than your left at following the rapid rhythms of speech, according to researchers at the UCLA David Geffen School of Medicine. If, on the other hand, you're trying to identify a song playing softly in the elevator, turn your left ear toward the sound. The left ear is better at picking up music tones. Eyebrow Raise The tendency for people to raise their eyebrows as one approaches them face-to-face is usually indicative of esteem. If you walk down the street and encounter someone you don't know then the chances are that neither of you will raise your eyebrows. If you recognize each other, however, even if you do not greet each another, then eyebrows will likely raise and lower. Of particular interest here in a business-place context is that if one person is not rated highly by the other person then that person will not raise their eyebrows, even though they acknowledge the presence of the first person. While meeting a person, briefly raise and lower the eyebrows to communicate greetings as the person enters your scope of vision. When accompanied by a slight backwards head tilt, the greeting gesture can be made to come across as very sincere and genuine. Both the zygomatic smile and the eyebrow movement are very popular body language tools used by sales people and politicians. Hugging (Rocking) Primate holding in the arms, a natural mothering response, is met with clinging, an infantile sign of needing to be mothered. Thus, embracing is the evolutionary correct way to say "I love you," and the proper primate way to say "I need you" as well. As humans embrace, a gentle rocking motion from side to side occurs. Swaying, a positive sign, stimulates pleasure centers linked to the inner ear's vestibular sense. Not only do we rock babies, but also the adults we love. Kinesics The importance of body language is recognized worldwide - there will not be a training for sales people and management in which the study of body language is absent, for instance. In 1970 Julius Fast wrote his famous book ""Body Language"." In it he writes about the study of the language of the body and called it: kinesica. More recent developed theories on human functioning have given life to Neuro Linguistic Programming. NLP uses body language as its main source of information to tell more about the way we operate as people, by ourselves or when we are together. For instance, we adjust our body position all the time to our environment when we are in company or in a public place. It has been researched that we have a higher success rate of getting our message across to another when we take on a similar position as him/her. Unconsciously we copy the others movements like crossing and uncrossing legs, turning our bodies this way or that. In NLP this process is called mirroring and could also be referred to as building rapport. Love Signals A great deal of our nonverbal communication bespeaks sexuality. Despite speech, courtship is best transacted in an unspoken medium through, e.g., lip-pouts, head-tilts, and shoulder-shrugs. Verbally saying "I love you" before showing love nonverbally in gesture, posture, and deed is apt to scare a partner away. The lesson here? Don't tell a girl "I love you" too soon. Instead use body language gestures and nonverbal communication to show your feelings of interests. If you tell her your feelings, but you're too nervous and your body language in not in tune, she might perceive your verbal speech as insincere. First try to use non verbal signals. See also Rapport and Mirroring. Masculinity "Keep shoulders broad but posture not *too* straight; keep eye contact; look other men in the eye and don't do the "down & away"; don't cover face unless you are acting mischievous; slow movements; deep tonality; move from either the hips or the shoulders (generally); broad arm movements; move with a sense that you occupy a great deal of space -- that you have a large domain or territory; make your eyes expressive of emotion and not of excitement; learn to really dance (waltz, salsa, samba, flamenco, etc.) and this'll become second nature." alt.seduction.fast Right Brain vs. Left Brain This theory of the structure and functions of the mind suggests that the two different sides of the brain control two different "modes" of thinking. Experimentation has shown that the two different sides, or hemispheres, of the brain are responsible for different manners of thinking. The following table illustrates the differences between left-brain and right-brain thinking: Left Brain: Logical Sequential Rational Analytical Objective Looks at parts Right Brain: Random Intuitive Holistic Synthesizing Subjective Looks at wholes Some individuals have a distinct preference for one of these styles of thinking. Some, are more whole-brained and equally adept at both modes. In general, academia tend to favor left-brain modes of thinking, while downplaying the right-brain ones. Left-brain scholastic subjects focus on logical thinking, analysis, and accuracy. Right-brained subjects, on the other hand, focus on aesthetics, feeling, and creativity. Pacing and Leading Pacing and leading is one of the keys to influencing people. It refers to meeting them at their map of the world (pacing) and then taking them where you want them to go (leading.) Rapport is a basic, behavioural signal that you have met someone at their map of the world. The simplest, most effective test for rapport is "if you lead, they follow." 2) Choose a safe situation to practise mirroring an element of someone else's behaviour. When you have mirrored them for a while, and think you are in rapport with the person, scratch your nose. If they lift their hand to their face within the next minute or so, congratulate yourself: you have led their behaviour! Skilled communicators have a wide range of behaviours they can mirror to build rapport. You can find a way to mirror virtually anything you can observe. 3) Increase the range of behaviours that you can mirror, and introduce deliberate rapport-building into situations where it will benefit you and others (nb. Use your common sense and choose low-risk situations to practice in.) Note: It is possible to get rapport without pacing by being outrageous and/or dynamic in a way that drawn in the audience and catches their attention. See Also: Mirroring, Rapport Pupil Dilation The dilation of the pupils is an increase in the diameter of the pupils as they get bigger to take in more light as it gets darker. Dilating pupils is also indicative of interest. One can subconsciously tell if the other person is eager to see them by the size of the pupils in the other persons eyes. When the pupils are large in normal lighting conditions, the persons eagerness and alert perception is noticed. A person with fake interest would be smiling and showing positive gestures, but their pupils would remain small, thus giving the person away. Pupil Dilation combined with Shining Eyes and Binocular Disparity could be used in communicating enthusiasm and warmth towards the subject. Push Pull Technique In the song Yellow by Coldplay, Chris Martin demonstrates using body language a Push Pull example. "Because I love you so". Stops, looks back, turns around, gives you a chance to leave, gives you space. Then when he sees that you really do want him, you would wait for him and you in the camera are there slowing down to stay with him. The camera was moving gradually along the beach and he was walking forward along the beach. Both he and the camera were together, that is how we could see him, and now that he slows down, we see that we are slowing down for him. But he doesn't make us, the audience wait, he is the one who comes back. The camera is staying there, looking at him and he comes back, tight after he looks around first: Push, Pull. Make your move, then if the girl's not going for it by saying yes right away, just give some space. If she waits for you to come back; she's yours. Reconnaissance Upon re-entering our home (after several hours of absence), we feel a peculiar need to wander about the space to "check" for intruders. In mammals, this behavior is known as reconnaissance: ". . . in which the animal moves round its range in a fully alerted manner so that all its sense organs are used as much as possible, resulting in maximal exposure to stimuli from the environment. It thus 'refreshes its memory' and keeps a check on everything in its area. This is a regular activity in an already familiar environment, which does not require the stimulus of a strange object. Shining Eyes The eyes have a tiny gland on the bottom of the eyelid secreting liquids such as tears for use as lubrication. When a person is interested or excited, the glands tend to secrete liquid thus giving the eyes a shiny appearance. During courtship, shining eyes are used extensively to indicate a sign or attraction in the other person. When describing a guy, the girl might say "there was something in his eyes." "The lover's eyes" is another term used to mark their characteristic appearance. In practice, it is very hard to have shining eyes without having genuine intentions, therefore there is the belief that people can tell one another's motives subconsciously through face to face interaction. Shining Eyes combined with Pupil Dilation and Binocular Disparity subconsciously communicate enthusiasm and warmth towards the subject. Symmetry The body plans of most animals, including humans, exhibit mirror symmetry, also called bilateral symmetry. They are symmetric about a plane running from head to tail (or toe). Bilateral symmetry is so prevalent in the animal kingdom that many scientists think that it can't be a coincidence. After all, there are infinitely more ways to construct an asymmetrical body than a symmetrical one. And yet, fossilized evidence shows that bilateral symmetry had already taken hold in animals as early as 500 million years ago. Therefore, bilateral symmetry must have evolved for a reason, the thinking goes. And over the years, scientists have come up with a number of hypotheses about what that reason might be. According to one, a body that is bilaterally symmetrical is easier for the brain to recognize while in different orientations and positions, thus making visual perception easier. Another popular hypothesis is that symmetry evolved to help with mate selection. Experiments with birds and insects revealed that females prefer to mate with males possessing the most symmetrical sexual ornaments. Peahens, for example, prefer peacocks with more extravagant and symmetrical tails, and female barn swallows prefer males with long, symmetrical tail feathers. Human experiments also show similar patterns. Experiments have found that women are more attracted to men who have features that are more symmetrical than other men. One study even found that women have more orgasms during sex with men who were more symmetrical, regardless of their level of romantic attachment or the guys' sexual experience. The connection between body symmetry and mate selection began to make sense when researchers started finding correlations between symmetry and health. One study found that men with asymmetric faces tend to suffer more from depression, anxiety, headaches and even stomach problems. Women with facial asymmetry are less healthy and more prone to emotional instability and depression. Another study found that the more asymmetric a person's body was, the more likely they were to show signs of aggression when provoked. Symmetry is also prevalent in the physical sciences and is woven into the very laws that govern our universe. Tapping Tapping is a defensive gesture or a warning sign for a person not to come any closer. It doesn't necessarily mean that one wants the other person to leave, unless the tapping becomes very loud and even audible from a distance, which is then the area from which the person doing the tapping wants the people around them to clear. It is not an aggressive signal, but that of mainly wanting to hold things off, not come any close, keep things the way they are. The auditory effect of the tapping also has the verbal effect of not wanting to be disturber with conversation. The sound itself is meant to block of other sound as another person might try to speak and has a psychological effect of distracting the brains auditory cortex. It's like turning on the radio to distract oneself from noisy neighbors arguing across the hall, or pretending to be listening to a walkman when someone is trying to start a conversation. Tapping in a physical sense also serves to designate one's territory. In a classroom setting or an office environment, one might tap their pencil against the side of the table meaning that he/she's busy so that nobody sits next to them in order to maintain the concentration. Tense Eyes The eyes themselves don't tense as much as the eye lids around them and in tense situation, more particularly the lower eye lids. The eye lids close in around the eyes limiting their vision and in effect having an expression of zeroing in or targeting someone. When the eye lids are smaller it's hard to see the surrounding area, so the person has one location in their scope of vision in mind. It is the opposite of open body language and a sign of closed body language. In open body language a person is friendly willing and receptive. When the eyes are smaller, they are showing that they are not receptive. They are focused on one particular area of importance usually because it is perceived as a threat or a source of trouble. The eyes can also be tense sometimes when a person is concentrating on a task, such as reading an important document, or working on an assignment, however, when dealing with personal interaction, tense eyes are very specifically associated with unfriendliness or hostility. Tensing of the eyelids could also help one so see better as the tension helps in the shaping of the eyes to focus. When a person is working on a task and not involved in a social setting, tense eyes would indeed be a method for the person to focus better. In a social setting people have adapted to use tense eyes as a means of communicating suspicion or wariness, particularly of an intellectual basis as opposed to emotional or personal. A tense or unfriendly expression in the eyes is a sign that the person is disliking something that is something analytical or of technical nature. For instance when one's wife has tense eyes it could mean that she doesn't trust her husband in something like doing the bills or renovating the house. It doesn't mean that she's suspecting him of having an affair or believes he's forming an emotional attachment with another woman. The eyes mainly reveal thought processes and not matters of the hearth, unless a person evaluates their personal relationships on an analytical level, which is rarely so. Tense Mouth Tense mouth is indicative of hostility or disagreement. It is closely related to the usage of the lower teeth which are associated with unfriendliness. It is an attempt to hide or not show off the lower teeth or make an offensive gesture with the mouth while in conversation with someone not particularly liked. A tense mouth is visible through flattening and thinning of the lips. As opposed to full lips, the person is subconsciously tensing their lips in effect making them seem smaller and less visible. The lips are a very friendly and encouraging part of the face. When a person doesn't like someone, they inevitably find it hard to show their lips as a way of saying that they are not happy and they are not inviting. At the same time the person is trying not to show off their lower teeth too much, although this might happen, as this could be a very offensive and at times inappropriate display of facial expression. The opposite of a tense mouth would be the lower lip protrusion, plumping lips (as in flirting), showing upper teeth and in effect smiling. Through Look Psychological technique to get oneself unattached to a particular person by not avoiding them in the field of vision, and at the same time to slowing down to make eye contact, so as to be uninfluenced. Used very often by public speakers. Public speakers are trained to make eye contact, to scan the room and at the same time not fixate on any one particular person or area. The purpose is to give everyone recognition and a chance to speak up, if a member of the audience has a question, but not to be otherwise distracted by any one particular person or object. Touch (First Touch) The first touch—a milestone in courtship—is likely to seem casual, unpremeditated, and "accidental" rather than serious. An eager hand reaches out to a neutral body part (a forearm or shoulder, e.g.) which reacts by accepting the contact or by pulling away. Sensitive pads of our fingertips used as tactile antennae gauge the slightest startle, tenseness, or hesitation of response. Negative replies include angling away, leaning away, and no reaction. Positive responses include Thus, partners learn a great deal from the first manual contact, which deftly probes beneath spoken words to feelings. Touching another's body captures full attention, and is the evolutionary true test of where a partner stands. Touching Research shows: "Wives under stress are soothed by husbands' touch." Casual touching is one of the most powerful attraction triggers. The soothing effect of the touch could be seen in MRI scans of areas deep in the brain that are involved in registering emotional and physical alarm. The 'touch' most commonly referred to is hand holding. There are other important reasons for holding her hand, but as this research confirms, it has an INSTANT soothing affect. It is believed that casual touching, and hand holding in particular has a massive effect on success in long term relationships. Researcher notes that this effect is many times more powerful with married couples, but even a complete stranger STILL had an effect on the woman's brain. It is possible for a total stranger, can trigger a soothing effect on any woman, DEEP in her subconscious mind, simply through the use of a simple touch. Verbal Plumage - The lip sinking that is attractive in men and unattractive in women Verbal Plumage is quite simply using exaggerated facial expressions and lips and mouth movement to talk with the face. We all move our lips and faces when we talk to deliver the sound. Verbal plumage is just that same facial behaviors to a greater volume especially when saying pleasant, soft or deep sounds. What ever kind of movement you make with your mouth and lips when you say words like "you", "on", "feel", "between", "inside", "deep", "always", "forever", "no other" etc. Girls like those words. They are just words to us guys, but to them they have special significance when we say it. The word "special" is another word. When you say those words exaggerate the lip movement part of the word as if it has special significance for you too. Girls love that. They feel special when they hear those words, and you adding verbal plumage to it makes the word that much more profound as if you really mean it. Verbal plumage doesn't have to be any particular words. Verbal plumage on its own is simply talking with the face by definition. To use it in the context of seduction would be to increase verbal plumage at particular words and phrases that have deep meaning and feeling attached to them. Imagine you are talking to a deaf persona and you are trying to make your self understood. Imagine the extra kind of lip sinking you would do to express yourself. Do just that, but only do it with the right words when you are saying words that are pleasant to girls when they hear them. Here are some more words that girls like when you say them: intention true reality no choice I want appreciation sincere trust come on yes In comparison, words like: call, go out, maybe, I don't know, no, number, meet etc. Girls don't like those words. They hear them all the time when guys try to hit on them and get their digits. Say less of those words, and when you do use them you are a ventriloquist at the time. Girls are already very expressive and feeling when they talk. It's not attractive in a woman to use verbal plumage because that makes her even more touchy feely clingy when she talks. But in a guy, it makes him come by as caring and in touch with his feelings when talking to women. Voice Training Right before you call stand up and hum a little bit at a moderate to deep tone -- it'll improve the sound of your voice over the phone Zygomatic Smile A very "pleasant" smile, and one of the most sincere types of smiles which is very hard to produce on demand, is the zygomatic smile. A zygomatic smile is the real item, a genuine heartfelt smile that involves upturned corners of the mouth, wrinkling at the eyes, or crow's feet, and utilizes very many more facial muscles than we can easily control voluntarily. It is therefore virtually impossible to fake the zygomatic smile, and most of us, while not necessarily knowing it, can distinguish it from a "phony" smile.
7,000
Introduction to Philosophy/Utilitarianism. Utilitarian theories of ethics judge an action by its consequences; an action is right, or duty, if it brings about the best balance of intrinsic good over intrinsic bad. Thus, utilitarians place an emphasis on the consequences of our actions or policies. Jeremy Bentham formulates this in his famous "Principle of Utility." Utilitarianism is a well-known example of a branch of ethics known as consequentialism, which states that actions are morally judged by the impartially reckoned value of the consequences. That which is good or bad differs between different types of utilitarianism, hedonistic utilitarianism and preference-respecting utilitarianism being the most noteworthy. History of utilitarianism. Utilitarianism was founded by Jeremy Bentham and further developed by his disciple, John Stuart Mill. Bentham was most interested in the ramifications that a utilitarian ethics would have for the law, and he developed a precise system for correlating a crime's detrimental effect on utility to the severity of its punishment. Mill explored utilitarianism from a more broadly philosophical perspective, and defended it from the critiques of opposing ethicists. Mill did this by taking Bentham's dictum that what was important was the precise amount of happiness and adding a factor of quality, where quality is determined by "competent judges" who are capable of fully enjoying the given pleasure. More than this, however, Mill suggested that some happiness was of such a high quality that any amount of it would be preferable to any amount of a happiness which was of a lesser quality. This thesis is controversial, partially because it is patronizing, but primarily because Mill's reasoning behind introducing it -- that there are some happinesses which are of such a high quality that a well informed and independent jury would always choose some of that happiness over any amount of another -- is far from rigorous and might simply not be the case. Another 19th Century Philosopher, Henry Sidgwick, re-interpreted utilitarianism along lines which are more commonly used today. He found that the classification of utility as happiness was clumsy and so began to talk about utility as a measure of desire and satisfaction. Thus, something would be good on utilitarian grounds if it satisfied the desires of many people, and bad if it did not, or if it went against their desires. Two branches of utilitarianism that are still recognized today eventually developed: Act utilitarianism, or AU, states that if an agent is faced with a moral decision, it is morally obligatory to make the choice that brings the highest total pleasure to everyone affected. Rule utilitarianism, or RU, states that it is morally obligatory for everyone to act in accordance with the set of moral rules such that if everyone acts in accordance with this set of rules, more pleasure is produced than if everyone acts in accordance with any other set of moral rules. Utilitarianism today. Peter Singer is a contemporary philosopher whose basic approach to ethics is utilitarian. Criticism. Professor James Rachels critiqued the philosophy of utilitarianism, mainly by attacking the following points: The first flaw that Rachels identified with Utilitarianism was making happiness the goal that we seek out in our endeavors. While this may be attractive in principle, Rachels claims that it is very flawed in practice. An example proving this is if a friend bad-mouths somebody behind their back, Utilitarianism will claim that it is a moral action, because the person is not aware; Ergo, it did not cause them any harm. Rachels suggests that one should not seek out friends in order to make him or herself happy. Instead, happiness should be a response to what one has achieved or obtained. Another point that Rachels makes is regarding the dogma of only considering the consequence of an action important, rather than the action itself. For example, if a police officer is accused of abusing somebody based on their race, clearly the best solution according to utilitarianism would be to find the officer guilty, and punish them severely, as this will cause the greatest number of people to achieve happiness. Rachels would refute this by saying that this is not moral, since although more people are happy, one person was ruined without receiving fair representation. Rachels would claim that they should receive a just trial, and be prosecuted according to the law. Another example is if there is a person who has hidden cameras in the washroom, utilitarianism would claim that this is morally right, due to the fact that he didn't cause anybody unhappiness, and increased the happiness of himself. Rachels would deny this, and claim that his actions were immoral. Rachels also attacks the Utilitarianist argument that everybody is equal, and your own happiness is no more important than anybody else's. He claims that this is completely impractical, as one can usually increase the happiness of somebody else whenever they buy something. For example, if one has $20 that they can either spend on new shoes, or they can donate it to help the poor, obviously donating it will help more people, but is it reasonable to sacrifice the happiness of yourself and your loved ones in order to help complete strangers? Rachels would claim that it is not. Other often cited criticisms of utilitarianism are that the philosophy doesn't take into account a person's intention. Did a person that took an action intending to maximize happiness do something immoral if the action ends up decreasing happiness? If four people need an organ transplant to live, would it be a moral act to kill one person against his will and transplant his organs into those people so that they will live? If Utilitarianism states that any action that maximizes happiness is good, then killing one person against his will in order to save others would be a moral act.
1,275
Introduction to Philosophy/Philosophy of Mind. The philosophy of mind is about the form and content of our thoughts, and how and why we come to think them. Understanding the philosophy of mind gives us some fairly universally applicable rules to understand ourselves, other people, animals and even computers. Philosophy of mind covers similar domains to psychology, , , , , , , epistemology, , , , , and , and helps us look at these disciplines within a specifically philosophical context. There is now growing evidence of a . You can either look at things in a hermetic (closed) or empirical (open) way. Philosophy of mind is closely connected to cognitive psychology. It is connected also to neuroscience, which is still attempting to sort out (once and for all) whether our minds and our brains are separate. Questions one may ask are: 'What is the difference between reality and illusion?', 'How is the mind related to the body, or to physical things in general?', 'How do I know that other minds exist?' In studying these questions one might start with Descartes' Meditations, then go on to study George Berkeley, Edmund Husserl and Gilbert Ryle, to mention just one or two. Further questions include: 'What, if anything, is the "subconscious"?' If this cannot be put on a sound footing, how do we talk about 'self deception'? 'What, if anything, is "mental illness"?' Another area of philosophy of mind that grew during the second half of the 20th Century is artificial intelligence. The Turing test challenges us to say whether we are talking to a human being or to a computer. People have been developing computers to the point where these tools could be said to have minds. Perhaps they will think autonomously. Philosophy of mind can be expressed as 'thoughts about thoughts'. Reading List. Wikibook on Consciousness Studies : pursues the problem of mind from Aristotle to fMRI. Descartes, R. "Meditations on First Philosophy" Kim, Jaegwon. "Philosophy of Mind" Westview, 2006. Ryle, G. "The Concept of Mind" 1949 Turing, A. 'Computing Machinery and Intelligence' "Mind" 1950, pp. 433-460 Searle, J. "The Rediscovery of the Mind" 1992 Sternberg, E. "Are You a Machine?" 2007 also see Thinking And Moral Problems [] Further Inquiries into Philosophy of Mind involve questions of whether specific thoughts or activities of the mind such as perception of color or feeling pain can be identified, in a strict sense, with the physical brain event which corresponds to such mental activities, or whether there is a distinction between the two. See Saul Kripke's "Naming and Necessity".
661
Civ/Sid Meier's Alpha Centauri/Diplomacy. Negotiating with factions. Negotiation with other factions is allowed once you have their commlink frequency, which means you must encounter them physically on the map (you units need to be in adjected squares), receive it from a faction you already have contact with, discover it in a Unity pod, or receive it through the Empath Guild Secret Project. Negotiating with other factions is very important, as it allows you to exchange technologies, maps and commlink frequencies, enter into formal treaties and pacts, declare war on one another, and synchronise your attacks on a third faction. Formal Relationships. Your relationship with other factions consists of one formal value and an informal one. Your formal status with other factions is one of the following: Vendetta, Truce, Treaty and Pact. Additionally, you may have an "informal truce" with another faction. "Vendetta" is rather self-explanatory: this faction leader has made a promise to destroy your faction, or at least bust it up pretty good. Unless you are the aggressor, of course. "Truce" (or "Blood Truce") means that your two factions have agreed not to attack each other, at least for the time being. "Treaty" ("Treaty of Friendship") is just that, a treaty which represents your two factions' friendship. More importantly, a Treaty means the citizens and organizations of two faction will now trade with each other, meaning you get extra energy credits, straight into the state coffers. The final kind of formal relationship is the Pact ("Pact of Brotherhood"). This means your two factions are committed to helping each other out, which has several manifestations. First, commerce rates double between your two factions, and secondly, your units may stack theirs. This means closer military cooperation is possible, you may defend each other's bases, and your pact mate might even give you units "to defend your territory against aggression". When you first meet a faction, you have no formal relationship, or an informal truce. This means that you are not at war with this faction, but no actual agreements have been made. From this point, you may engage in war with the other faction, remain at an unease peace, or commit to a formal relationship. Whether the other faction agrees to a treaty or a pact depends on how they feel towards you, which is the next thing we're going to talk about. Informal Relationships & Reputation. The informal relationship with another faction is simply how much the other faction leader likes you. This value ranges from "Magnanimous" (or "Submissive" if threatened) to "Seething", and it hinges on three things: how strong your faction is (the stronger the faction, the more respect other factions have for you, and the more they like you), your actions towards this faction, and your Social Engineering choices. If you have attacked this faction (or worse; are at war with it) the faction leader will like you less, whereas if you have traded or presented gifts to this faction, they will like you more. As you might have guessed by now, a faction leader's opinion of you decides how likely it is that he or she will attack you. Another factor also plays into this, the faction leader's "personality". Some, such as Yang or Santiago, are more likely to attack you than others, such as Deidre and Aki-Zeta. This is important to keep in mind, especially in the beginning of the game, so that you can plan the training and construction of military forces accordingly. If you start next to, say, the Usurpers, you can be sure that unless you are far stronger than them, they will declare war soon, especially on higher difficulty levels, and even moreso if you have turned on the "Aggressive Factions" option. Faction leader personalities can be randomized under "Game Rules". Your Social Engineering choices also play a part in how other faction leaders behave. Each faction has one SE choice on their agenda, and one SE choice aversion (see Understanding the Factions). If you are currently running the SE choice on the agenda of a given faction, this faction will think more highly of you, and if you are employing their aversion, they will criticise you for it, and it may even be a contributing cause for open conflict. Faction leader agendas can also be randomized. In the course of the game, you will very likely make deals and trades with other factions, as mentioned. Whether or not the other faction leaders will accept the deal you propose depends on their opinion towards you (or "mood"), and your "reputation". Reputation starts at "Noble" and can diminish as a result of dishonourable actions; your reputation is affected by whether or not you honour formal agreements. If, for example, you have signed a Treaty of Friendship with another faction, and attack them "without" waiting for the treaty to expire, your reputation will incur a hit. The same applies to Blood Truce. Note that while you may not attack a pact mate (your unit will only stack with his or hers), you may still incur a reputation hit if your probe teams are caught trying to operate on one of your pact mate's bases or units. If one of your probe teams are indeed compromised, the target faction has sufficient reason, with regards to reputation, to move against you. This means that if you attempt to steal technology from a pact mate and are caught, your pact mate may declare vendetta against you without going through the normal channels. The same, of course, is the case for a human player. The Planetary Council. The Planetary Council is a rare feature among Civ games; just like the United Nations of Civilization IV. The Planetary Council consists of every human faction in the game (not counting those who have been eliminated or committed major atrocities). When a player has the commlink factions of all the other human factions, that player may convene the Planetary Council. (When this happens, all the human factions will have each others' comm links.) The first proposal the Council must consider is electing the Planetary Governor. Only the two factions with the most votes can be eligible. It is advantageous to be the Governor, therefore in some cases it may be best to wait before convening the Council if you haven't enough votes now but have a shot at eligibility within the next few turns. Proposals. The primary purpose of the Council is to consider various issues which may arise, such as electing a Planetary Governor. Elect Planetary Governor. The Planetary Governor can introduce new proposals more often and enjoys automatic infiltration of all factions. That means if the Governor isn't you, it should be somebody you trust. Global Trade Pact. Commerce rates are doubled for all factions. Since choice of faction, social engineering and technologies alter your commerce rating, this proposal can be good or bad accordingly. If your opponents will gain an advantage from increased trading, don't agree to a pact. Repeal Global Trade Pact. Commerce rates are halved for all factions. Launch Solar Shade. Causes global cooling and the sea levels to drop. If a solar shade has already been launched, this proposal will be called "Increase Solar Shade". Increase Solar Shade. "See" Launch Solar Shade Melt Polar Caps. Melts the polar ice caps of Chiron, raising sea levels all around. Repeal U.N. Charter. Repeals the U.N. Charter, meaning atrocities are counted as normal acts of warfare. The U.N. Charter is in effect when the game starts. Reinstate U.N. Charter. Self-explanatory: reinstates the U.N. Charter, once again making atrocities subject to harsh penalties. Salvage Unity Fusion Core. Salvage of the Unity core affords every faction 500 energy credits. Logically, you will not want to do this if you have lots of ECs and your rivals are strapped for cash. Unite Behind Me As Supreme Leader. All factions unify behind one faction leader, this faction wins and the game is over. When playing with Progenitor in Alien Crossfire, this option is only available after both alien factions are eliminated.
1,918
Occupational Health/Contributors. This book was written by Wikibooks contributors, and is dual-licensed under and the . Information on individual contributors can be found in the page history, or through a separate document provided by your book's distributor. References. The following sources were used to synthesize and create this book:
75
The Voynich Manuscript/Alphabet. The following alphabet layout is based on the number correspondences of f49v. When other researcher's letter values are laid against this table, distinct patterns are formed. First the number layout: X X X X 1 X X X 2 X X X 3 7 X X 4 X 9 X 5 X X X 6 X X X 8 X X X X X X X X X X X Here is the alphabet layout (in EVA): f p cFh cPh o q i x r ir iir iiir y s g b e ee ch sh l il iil iiil k t cKh cTh d a u j m im iim iiim n in iin iiin Glen Claston's Standard Glyph Set ("S" means "standard"): S S X X S S X X S X X X S S X X S S S S S X X X S S S S S S X X S X X X X S S X Jorge Stolfi's (c)rust-(m)antle-(k)ore paradigm: k k k k c c X c c X X X c c c X m m m m c X X X k k k k c c X X c X X X c X X X
335
Evolutionary Biology. Life on Earth is astonishingly complex. There are tens of millions of living "species", or kinds of organisms. Some endangered species have just a few individual organisms, while others have quadrillions. Every individual organism is, all by itself, an extremely complicated object, with many interacting parts. Further, organisms interact with other organisms, of the same species and of other species, to form an inconceivably complex network of causes and effects. Evolutionary biology studies the origin and methods of this complexity. Evolutionary biologists try to answer questions like: Why are there so many species, and how did they come to be? What are the relationships between species and how did these relationships arise? How did organisms develop their intricate structures and ways of life? Why do species become extinct? How did life originate in the first place? In the last two hundred years, great advances have been made in answering many of these questions. An overarching theory, the theory of "evolution by modification and natural selection", first expounded by Charles Darwin in the 1850's, has been very successful at explaining the origin of life's complexity in general, although many puzzling questions remain unanswered. This book will present our current understanding of how life on Earth got the way it is, and describe current research directions in this profound and fascinating field.
304
Evolutionary Biology/Microevolution. < Evolutionary Biology Changes within a gene pool occurring from generation to generation is called microevolution. Allele frequencies in a population may change due to gene flow, genetic drift, natural selection and mutation. These are referred to as the four fundamental forces of evolution. Note that only mutation can create new genetic variation. The other three forces simply rearrange this variation within and among populations. The main factors change frequencies of alleles for a single genetic locus and therefore cause genetic variation on a small scale. The following causes of microevolution allow violations of the Hardy Weinberg assumption Genetic Drift. In genetic drift there is a genetic variation among allele frequencies of that population due to random chance. [This is poorly written to the extent of possibly being false. Genetic drift is a binomial sampling error of the gene pool, or -- put more simply -- a change in allele frequencies due to chance.] Therefore a small population would allow for higher chance of sampling error and a change in allele frequencies as a result would lead to a misrepresentation of the parent generations gene pool. The misrepresentation of allele frequencies causing a change in the population is an evolutionary process. Bottleneck Effect. The bottleneck effect results in a drastic change of allele frequencies of a gene pool causing genetic drift. This dramatic change in allele's occurs as a result of natural disasters such as earthquakes or floods. The portion of the population that survives such a circumstance will then be overrepresented in the gene pool while causing a reduced population size. Genetic variation is reduced due to the smaller population size and over representation of certain allele frequencies. [This is very confused. When a population is greatly reduced in size, it is said to undergo a bottleneck. In smaller populations, the average size of allele frequency changes due to genetic drift is increased.] Founder Effect. Another dramatic mechanism for genetic drift is due to the a small number of individuals from an originally larger population inhabiting a new isolated geographic region such as an island, lake, or some other new habitat. This is not to be confused with immigration because in immigration a population already inhabits the region when new individuals to the region begin to inhabit it. These new individuals make up the gene pool of their original population and now represent it in the new habitat but in a smaller proportion. This affects the allele frequencies of that population. Inbred Populations. Inbreeding refers to non-random mating among closely related individuals. [No, inbreeding is a propensity for individuals to breed with those most closely related to them. The way it is worded now confuses inbreeding (a process) with being inbred (a state, which can result from inbreeding or simply being a member of a small population.] These situations tend to increase the chance of the homozygous condition, thus leading to lower fitness and survival rates. [The first clause is poorly written and the second clause is just plain wrong. My PhD is in evolutionary biology and I am a writer by profession. I'd like to help.] Inbreeding and homozygous conditions lead to higher-possibilities in expressing recessive or negative traits. Natural Selection. A population can evolve by natural selection where the traits characterizing a population can change over time when its individuals differ in heritable traits that are responsible for differences in survival and reproduction. Gene Flow. Gene flow refers to changes in allele frequency that result from migration of individuals between populations. In the absence of gene flow, populations can become genetically distinct from one another through genetic drift, or due to differing natural selection pressures in the different populations. Gene flow has the effect of minimizing the genetic differences between populations. Surprisingly little gene flow is needed to keep populations from diverging. Sewall Wright demonstrated that only one migrant per generation is necessary to prevent two populations from diverging. Natural selection can cause microevolution (change in allele frequencies), with fitness-increasing alleles becoming more common in the population. Fitness is a measure of reproductive success (how many offspring an organism leaves in the next generation, relative to others in the group). Mutation. Mutation is the "ultimate" source of all new genetic variation. Mutations are random, heritable changes in DNA that can alter gene expression. However, they occur rarely. Most new mutations are expected to be neutral to mildly deleterious, with relatively fewer highly advantageous or highly deleterious mutations. How quickly a mutation spreads through a population depends on its effect of fitness (advantageous vs. deleterious), and also whether it is dominant, co-dominant, or recessive. In general recessive mutations should spread slowly, since they initially will show up in heterozygotes, so the effect of the new mutation is not seen until two of these heterozygotes mate to produce offspring which are homozygous for the mutation (and therefore the effect of the mutation can be seen). In contrast, dominant mutations may spread quickly, since their effects are seen immediately when they are present in heterozygous form. Mutations are the ONLY source of new alleles.
1,160
Data Structures. This book is about the creation and analysis of efficient data structures. It covers: To understand the material in this book you should be comfortable enough in a programming language to be capable of working with and writing your own variables, arithmetic expressions, if-else conditions, loops, subroutines (also known as functions), pointers (also known as references or object handles), structures (also known as records or classes), simple input and output, and simple recursion. Because many different languages approach the construction of data structures differently, we use pseudo-code so that you can translate the code into your own language. Contribute to the development of this book! A is an undertaking similar to an open-source software project: A contributor creates content for the project to help others, for personal enrichment, or to accomplish something for the contributor's own work (e.g., lecture preparation). An open book, just like an open program, requires time to complete, but it can benefit greatly from even modest contributions from readers. For example you can fix "bugs" in the text (where the bug might be typographic, expository, technical, aesthetic or otherwise) in order to make a better book. If you find an opportunity to fix a bug, simply click on "edit", make your changes, and click on save. Other contributors may review your changes to be sure they are appropriate for the book. If you are unsure, you can visit the discussion page and ask there. Use common sense. If you would like to make bigger contributions, you can take a look at the sections or chapters that are too short or otherwise need more work and start writing! Be sure to skim the rest of the book first in order to avoid duplication of content. Additionally, you should read the Guidelines for Contributors page for consistency tips and advice. Note that you don't need to contribute everything at once. You can add the template "", to pages and perhaps someone else will finish those parts for you. This book is intentionally kept narrow-in-focus in order to make contributions easier (because then the end-goal is clearer). This book is part one of a series of three computer science textbooks on algorithms, continuing on to the techniques of algorithms in "Algorithms" and ending with "Advanced Data Structures and Algorithms". If you would like to contribute a topic not already listed in any of the three books try putting it in the "Advanced" book, which is more eclectic in nature. Or, if you think the topic is fundamental, you can go to either the or the discussion page and make a proposal. Additionally, implementations of the data structures (in either Ada, C, C#, Perl, Python, Java, Ruby, or Scheme) as an appendix are welcome. References. Additionally, as an online reference to the scope of algorithms today: Dictionary of Algorithms
621
Lucid Dreaming/FAQ. This page is created solely for people to edit in any questions they may have regarding lucid dreaming. The authors (or others) can then post their answers (not necessarily definite—remember that we aren't author-ities *grin*). If you have a question, edit it in here and someone will try to answer it for you. And if you have an answer, by all means do contribute! When using the counting technique for induction, I always stop counting at some point and crash. The other techniques have their own little issues I can't work out (being a programmer, this really puts my nads in a salad shooter). Are there any computer programs I can run on a laptop that will somehow remind me that I am dreaming? -- () 22:59, 10 May 2009 (UTC) Yes, there are computer programs you can use. Just look at the software section in induction techniques. As for the counting technique, when you "crash", simply start counting from 1 again. As lucid dreams are rare for me, this little bug really sucks. I gain lucidity, and when I try to give my dream a basic command (Like turning my hands blue, or making my sister explode), I wake up as the command takes effect. Even when I focus on something (my hands or the explosion), I wake. How do I combat this? When doing some things (that wont work in real life) I sometimes start to slip out of it. What I do is just stop for a second (as the dream has become simply me with my eyes closed, imagining things) and just relax. Dont do any fast movements and soon you'll slip back into your little fantasy of blue hands and exploding siblings Why do people want to move during sleep paralysis? I have had it about 3 times and have never tried to move.. Because for many of the people who experience this it is entirely accidental and so it is not a comfortable feeling at all. I have had sleep paralysis on roughly 4 occasions, all of them when I was younger except for one time around six months ago and none of them occured on purpose. I use the MILD, WILD, and counting induction processes at the same time. I experience sleep paralysis as "I'm breathing in, but I cant breathe out", and when ym lungs are full, it's REALLY uncomfortable. Also, if I stay this way for 20 secs, my entire room seems to twist, and I see a strange "screensaver" type thing. When I finally breathe out, everything clears, and I become lightheaded. Is there a chance that this is normal? Probably. A lot of weird things happen during sleep paralysis (frequently including discomfort), and I've never heard of anyone actually getting hurt or dying because of sleep paralysis. Just relax. Is it possible to use the WILD process with a little background noise? (Small pets moving in their cage, 20Db). Some actually prefer to have some background noise. They concentrate on the noise, after some time, it becomes distorted. I keep losing lucidity after I try to do something after "pausing" a lucid dream. How do I combat this? (Eg, pausing, then slapping the person in front of me, and I can't seem to lift my hand). -- () 00:29, 6 May 2009 (UTC) If you can't move your hand after slapping somebody, this is not losing lucidity. Rather, you probably regained the sense of your physical body and tried to move it rather than your dream body. To combat this, try focusing on the dream as much as possible and then try to move your hand. If this doesn't work, than try to genuinely believe that you will be able to move your hand in your dream, relying on the Placebo effect. For how long do u have to experience the buzzing sensation in WILD before you become paralyzed? anon: For me the paralysis goes pretty much hand in hand. After like a minute of buzzing I start to feel like I'm falling through my bed. If i try waking up after the "falling through my bed" has started, I almost every time end up having sleep paralysis. This freaked me out a lot of times in the beginning. Now, whenever i get the buzz, I just try to wait for it and let myself float away till my dream starts. Of course this could also be a placebo for me. A few of my normal dreams have had some good imagery, but none have had real vividness (e.g. proper sound, the brush of air etc.). I have not had a lucid dream, to the best of my ability, but am trying. Is it likely that a lucid dream would be more realistic in terms of my perceptions than a normal dream? Also, take into account that, although we perceive the world through the 5 senses, generally only one of them is the main neural path into the brain, so the other senses get, like, dimmed as our brain dedicates more resources to that main sense. What this means is that you can remember more of a dream's visuals but only some of the hearings, or more of the hearings but none of the touch; as a matter of fact, as far as I have known, few people remember the tastes of their dreams. Could someone please describe the sensation of sleep parilysis during WILD? Because I keep getting close to falling asleep while counting but I jerk myself awake because I suddenly think 'I'm gonna choke' or 'I won't be able to breathe!', And I want to be fully prepared for it.. vodkeiro: I once had a sleep parilysis. I'm not sure if I was trying to have a Lucid Dream. What happened to me was that, I was having a nightmare, so I started to think loudly (inside the nightmare) "I wanna leave this place, NOW!". Suddenly, I woke up, I was in my room, and as it happens when someone has a nightmare, i tried to sit on my bed. There was the problem, I couldn't move, I "moved", but on the next second, I was again at the beginning, like when in a game, where you die and go back to the beginning as if nothing had happened. I tried to yell, scream, shout, everything, but nothing happened. After a few tries, I could move, but I was still a little scared. So, I don't think you'll think "I'm gonna choke", as you'll get really scared by not being able to move, so you're probably not thinking anything else. Azmisov: Whenever I go into sleep paralysis my eyes start to flutter very rapidly and I see bright flashes of light. I have never had a painful deathly experience, although it can sometimes be a little uncomfortable. Usually, (I guess it depends on the person) it will last less that 30 seconds. This also depends on how fast you can transition into a lucid dream or astral travel. When going into your dreams using WILD you may feel things like vibrations, falling and yes, choking.these are perfectly normal and more importantly safe. just stay calm and the feelings will eventually stop. Alessandro ([email protected]) I have had lot of sleep paralysis, and I was very scared about it: gonna choke, gonna die, cannot move, arhg! But, after reading 'bout LD I got very interested in this phenomena and I started to wait fot getting it again. Just this night (I was very tired, it was 5o clock) it happened again. I just remained really quiet, enjoying this sensation: if you get sure that nothing is gonna harm you, 't's like a fantastic total body orgasm!Then I've had THREE consecutive LD, two false awakening and a long, long and very clear dream. So, just keep quiet and IMAGINE! -- () 12:34, 18 December 2007 (UTC) I have experienced sleep paralysis a few times, the first time was after a lucid dream, I saw myself in a white bed with me(in reality I was sleeping on the couch) from side view, and didn't feel like moving untill after I woke up; I was 3/4 asleep so I didn't panic. the second time was after a non-lucid dream that ended in me pressing a red button, I heard strange highly pleasant music, felt emotions of euphoria and tranquility, and saw a scary, conspicuously sharp toothed monster leaning over me. The other times I don't remember. Everything I've read about sleep paralysis has said something different, so I guess it varies from person to person. Is that possible to have a dream about having a lucid dream? I had a dream in which I had done a reality test and it showed that it was a dream. I walked through the wall, but I was too scared to jump from the window. In my nearly-lucid dreams I never think what I am doing, even when it is something strange. I just do. When I wake up, I often remember my dreams as if I were someone else watching myself in dream. Is that normal? -- () 12:42, 18 December 2007 (UTC) One question at a time mate. You cannot have a dream about having a lucid dream, that would be a lucid dream. I advise you to jump out of the window next time, doing something you are scared to do in a dream often has amusing results. It is normal to remember dreams as if you are someone else watching yourself, it's such a common feature in a dream that someone should come up with a name for such a dream. I suggest you ignore the above comment, it is certainly possible to have a lucid dream about having a lucid dream. I can attest to this from experience. This will feel like a normal dream, which is what you seem to be describing. You may be aware that concentrating on a subject heavily will often influence your dreams - if you have been studying for a difficult test, you might have a dream about passing or failing it. If you have been recently been enjoying the company of a new girlfriend or boyfriend, they may appear in your dreams too. Likewise, if you have been looking into lucid dreaming and consciously focusing on it, you may have a dream that you are lucid dreaming. Don't read into it too much. -- () Sometimes I've had dreams where I think I know I'm dreaming, but I still have limited control. I can never fly or anything, even though I actually try. Is there anything I can avoid just 'dreaming' that I know I'm dreaming? You must suspend all disbelief when attempting to do out of the ordinary things in a dream. Jumping off a building or a staircase is a good way to force yourself to fly. With time, you can just jump and fly wherever you want. Personally, during my first lucid experience, I couldn't move my body at all, but I got the hang of it eventually. This almost seems religious, the idea of becoming your own god in your dream. What effect does Lucid Dreaming have on your spiritual life? [Gene] Lucid Dreaming is an essential indicator of higher awareness in many spiritual systems. See Ken Wilber, Buddhism, Ramana Maharshi. The ability to remain self-identified in dreaming sleep and (non-dreaming) deep sleep indicates awareness of higher bodies, the subtle self and the causal Self, respectively. This is normally achieved only after many years of meditation (which itself can be said to be a practice of release from object-relations). Dreaming sleep is a subtle body (mental) experience and deep sleep is a causal body (spiritual) experience. Most people associate their waking state awareness as "consciousness", but this is a consciousness that is formed in a context of object-relations, which objects help to identify "me" and "not me". When there are no perceived (external) objects, such as in deep sleep, can you identify your Self? It is a milestone of human development when infants achieve object constancy (maintain awareness of where an object is even if it is no longer in view), and is is also a milestone of development, though rarely achieved, to maintain self awareness even in the midst of no perceptions, ie. deep sleep. (e.g. even in a sensory deprivation chamber, one can perceive or feel their body). Ramana Maharshi (probably acknowledged as a true spiritual adept across more religions and spiritual disciplines than anybody) said "if it's not real in deep dreamless sleep then it's not real" meaning only that the highest causal Self (god) is real, and that the rest of typical human experience is transitory. [b77] Expanding on Gene's comment above, I fully agree that restoring your self-awareness and retrieving your own identity during the LD is another milestone for humans' mental development. While I am deeply not convinced about any spiritual claims (religions and alike) and while I always try to find a 'scientific' reason for their existence, I believe that there is truly more to this universe than the science can account for or can 'reasonably' accept as plausible. So, if indeed death is not just The End, then the mere practice of restating/redefining yourself while in the middle of a LD would pave the way to controlling your death experiences, when the time comes. ...that is, if you're lucky enough to have time to prepare yourself... In other words, just as we have so much difficulty escaping those 'serious' nightmares—simply because we're not aware of their virtuality—I believe that whatever godly or ungodly experiences one may have on their final minutes are eventually conditioned by one's "expectations" and beliefs (see placebo question below). So, I would say that practicing LD and also keeping an eye on your own ideas and expectations about the other world could actually ensure a nice last trip out of here. And well, I would be happy to know that someone who is afraid of hell, of devils and alike, could eventually become aware that, whenever and wherever you may be, the one thing that cannot be destroyed in any way is your being (and staying) aware of yourself, as well as finding a single untouchable spot of self in the middle of whatever 'happens' around you. As someone who had to learn at some point to ignore an awful durable physical pain just to avoid losing mind, I eventually realized that a mental barrier between the self and the rest (including body), as hard to make and maintain as it is, may be the only apparent solution in such extreme cases. So yes, do play with LD, play it safe, don't ask too much too fast, and you'll surely be more than happy about your new invisible power :) What are the benefits of lucid dreaming (aside from achieving personal interests)? Are there any negative aspects? Question asked by 09:40, 24 Jan 2005 (UTC) There are stories in "Exploring the World of Lucid Dreaming" of people who found their dreams realistic enough to rehearse speeches, or create baking recipes. There were also stories that simply becoming lucid was an extremely fun experience in itself. A small amount of people have overcome the fears from their nightmares in their lucid dreams. The chapter about it in EWLD (the book) is available as a free sample here. Finally, there are people who use lucid dreams as a springboard to reach shared dreams (or "dreamwalking"), precognitive dreams, out-of-body experiences, and astral projection. I'm not sure myself why they want those (I imagine out-of-body experiences are fun because you can see your own body) but apparently some people do. I don't believe in shared and precognitive dreams myself and I also don't believe that out-of-body experiences and astral projection really are due to something (spirit, soul?) moving away from your body. As for negative, I think that the section in ../Introduction covers that very well. The only thing it omits is obsession. ;) 07:34, 27 Jan 2005 (UTC) One negative thing is it's harder to be an early riser. You want to sleep more. () 16:13, 5 January 2008 (UTC) What is the placebo effect? The placebo effect occurs when something happens just because you believe it will. It strongly affects the nature of lucid dreams. I suffered nightmares for many years (a result of abuse as a child), although they declined in my thirties. In my forties I began to become aware when a dream was beginning to turn into a nightmare, now 3 things can result from that lucidity: 1. My most satisfactory result is when I can I alter/divert the next stage of the dream, and it continues without nightmare; 2. I have difficulty diverting the dream sequence but tell myself I must wake up, and do; 3. I cannot just wake up, but I know I need to ask for help. I make myself speak/moan, which takes a lot of effort within the dream, but it always wakes my husband, who then wakes me up. When I try to use the WILD technique, I feel a stron urge or tiredness to stop concentrating and go to sleep. Is this normal? It happens early when I first start.. -- () 12:54, 18 December 2007 (UTC)This has happened to me when I tried holding my arm up to keep myself awake. Is that what you are doing? Maybe you are staying too awake, In that case you should relax and let your "awareness" drop, try to find out how aware you need to be before your awareness drops so far you fall asleep, and aim just above that level. it's possible to dream inside another dream?, I remember long time ago a lucid dream where I was in my home, then I tried go to bed to try sleep but when I tried to do that the dream ended spontaneously.... It is possible to dream that you are dreaming, or to even dream that you have a lucid dream. The difference between dreaming you are lucid and actually being lucid is the fact that when not actually lucid, you have no control over the dream. However, I am unsure if it is possible to have a dream in which you go to sleep and continue a different dream. Something like this happened to me. It felt like a normal dream, but i knew that i was dreaming. I had superpowers and this, but i couldn't control my dream. I had somehing odd happen to me. Many years ago I awakened as usual one morning. Everything looked and sounded as it should. My wife was still sleeping. When I looked at her again, she started shapeshifting, an obvious absurdity in reality. I was speechless and shocked. Suddenly I realized I was dreaming and greatly relieved. I woke up, got out of bed, went to the bathroom and something made me realize I was dreaming yet again. This was in a way more shocking than the first false awakening because it was all so real and I wondered how far could this regress. At that point I awoke and found myself still in bed. This time I was not dreaming. A false awakening has never happened since. i wanted to experience the OBE thing... how am i supposed to do that??? Azmisov: Many of the techniques shown here can be implemented into an OBE/astral travel experience. OBEs usually involve experiencing vibrational forces going through your body. (you should check out the Monroe Institute for more info on this) Another method is to just imagine yourself slipping out of your body. I really don't know if this technique is true OBE, it may just be another lucid dream. There are a lot of other methods I don't know about, so you can do some research to find more techniques. My occurrence for lucid dreaming varies from week to week, is this normal? For some weeks I can lucid dream everday for a week straight, then all of a sudden I can't for a month. Lately i have been able to lucid dream twice a night, sometimes three. Any clue what may cause this? Also when I do lucid dream a lot more, I act normal in a dream. I know I am dreaming, I can fly around, i can spawn things around me, but I still talk to people as if It was a real conversation.. <Daydreamer> Whether or not you were lucidly dreaming depends on whether you decided in your dream to fly, look in the mirror, etc. or whether you were only passively observing these events taking place in the dream. Realising you are in a dream and then remaining in the dream is a good sign that it was, as often the realisation you are dreaming is enough of a shock to wake you up, but the real test is your level of control. As far as not being able to swallow is concerned, if you were getting sick, especially if you were getting a temperature or something then this can also affect the vividness of your dreams. I have good dream recall, and when I sleep I never seem to lucid dream. When I am dreaming, really weird stuff happens to me. My mind never questions the bizzare circumstances I am put in. I have tried thinking that "I will have a lucid dream" over and over, and done some reality checks during the day. It never occurs to me to do them when I dream. Is there some way that will make me lucid dream for sure? Am I incapable of Lucid Dreaming? —Eponymous Anonymous - I know what you mean. I've been trying every way to get a lucid dream, but nothing works. It sucks. I sometimes get really close but freak out and wake up. But despite my inexperience, I know for sure that everyone is capable of lucid dreaming. Try doing a wider variety of reality checks maybe, or perhaps try a different technique. What technique are you using?; WILD and VILD need lots of practice. 11:57, 13 November 2007 (UTC) - Yeah, I tried to do WILD for the past few weeks. Only once i felt a heavy pain in my chest, I found it hard to move but i could open my eyes and I woke up soon without dreaming lucid :( -- () 13:07, 18 December 2007 (UTC) The correct way to do the MILD method is to go to sleep believing that you will "remember" that you are dreaming. Also, one key difference between lucid dreamers and non lucid dreamers trying to lucid dream is that lucid dreamers do not wonder if they are incapable of lucid dreaming, do not think that it never occors to them to do reality checks when they are dreaming, and tend to treat the phase "I did not lucid dream last night" as similar to the phase "I did not sleep on the couch last night", in other words, they tend to see lucid dreaming as something they can choose to do if they want to, rather than something they want to successfuly achieve at (long) last. -accepted- Is it possible to recall all waking memories in a lucid dream? I have had only two lucid dreams so far. I know these were lucid, because I did reality checks with positive results. I even managed to fly, create items, and etc. However, I couldn't recall a great deal of my waking memories. This cause me to lose lucidity half way through the dream.. In your book (en.wikibooks.org/wiki/Lucid_Dreaming) you've mentioned a forum www.lucidforum.net which doesn't seem to be opening AT ALL. It's on the internet and it kinda doesn't seem to exist.. What do I do?
5,399
Human Physiology/The Urinary System. Introduction. The Urinary System is a group of organs in the body concerned with filtering out excess fluid and other substances from the bloodstream. The substances are filtered out from the body in the form of urine. Urine is a liquid produced by the kidneys, collected in the bladder and excreted through the urethra. Urine is used to extract excess minerals or vitamins as well as blood corpuscles from the body. The Urinary organs include the kidneys, ureters, bladder, and urethra. The Urinary system works with the other systems of the body to help maintain homeostasis. The kidneys are the main organs of homeostasis because they maintain the acid base balance and the water salt balance of the blood. Functions of the Urinary System. One of the major functions of the Urinary system is the process of excretion. Excretion is the process of eliminating, from an organism, waste products of metabolism and other materials that are of no use. The urinary system maintains an appropriate fluid volume by regulating the amount of water that is excreted in the urine. Other aspects of its function include regulating the concentrations of various electrolytes in the body fluids and maintaining normal pH of the blood. Several body organs carry out excretion, but the kidneys are the most important excretory organ. The primary function of the kidneys is to maintain a stable internal environment (homeostasis) for optimal cell and tissue metabolism. They do this by separating urea, mineral salts, toxins, and other waste products from the blood. They also do the job of conserving water, salts, and electrolytes. At least one kidney must function properly for life to be maintained. Six important roles of the kidneys are: Regulation of plasma ionic composition. Ions such as sodium, potassium, calcium, magnesium, chloride, bicarbonate, and phosphates are regulated by the amount that the kidney excretes. Regulation of plasma osmolarity. The kidneys regulate osmolarity because they have direct control over how many ions and how much water a person excretes. Regulation of plasma volume. Your kidneys are so important they even have an effect on your blood pressure. The kidneys control plasma volume by controlling how much water a person excretes. The plasma volume has a direct effect on the total blood volume, which has a direct effect on your blood pressure. Salt(NaCl)will cause osmosis to happen; the diffusion of water into the blood. Regulation of plasma hydrogen ion concentration (pH). The kidneys partner up with the lungs and they together control the pH. The kidneys have a major role because they control the amount of bicarbonate excreted or held onto. The kidneys help maintain the blood Ph mainly by excreting hydrogen ions and reabsorbing bicarbonate ions as needed. Removal of metabolic waste products and foreign substances from the plasma. One of the most important things the kidneys excrete is nitrogenous waste. As the liver breaks down amino acids it also releases ammonia. The liver then quickly combines that ammonia with carbon dioxide, creating urea which is the primary nitrogenous end product of metabolism in humans. The liver turns the ammonia into urea because it is much less toxic. We can also excrete some ammonia, creatinine and uric acid. The creatinine comes from the metabolic breakdown of creatine phospate (a high-energy phosphate in muscles). Uric acid comes from the break down of nucleotides. Uric acid is insoluble and too much uric acid in the blood will build up and form crystals that can collect in the joints and cause gout. Secretion of Hormones The endocrine system has assistance from the kidney's when releasing hormones. Renin is released by the kidneys. Renin leads to the secretion of aldosterone which is released from the adrenal cortex. Aldosterone promotes the kidneys to reabsorb the sodium (Na+) ions. The kidneys also secrete erythropoietin when the blood doesn't have the capacity to carry oxygen. Erythropoietin stimulates red blood cell production. The Vitamin D from the skin is also activated with help from the kidneys. Calcium (Ca+) absorption from the digestive tract is promoted by vitamin D. CC: Chapter Check: Name the role of the kidneys and how they work? Organs in the Urinary System. Kidneys And Their Structure. The kidneys are a pair of bean shaped, brown organs about the size of your fist.It measures 10-12 cm long. They are covered by the renal capsule, which is a tough capsule of fibrous connective tissue. Adhering to the surface of each kidney is two layers of fat to help cushion them. There is a concaved side of the kidney that has a depression where a renal artery enters, and a renal vein and a ureter exit the kidney. The kidneys are located at the rear wall of the abdominal cavity just above the waistline, and are protected by the ribcage. They are considered retroperitoneal, which means they lie behind the peritoneum. There are three major regions of the kidney, renal cortex, renal medulla and the renal pelvis. The outer, granulated layer is the renal cortex. The cortex stretches down in between a radially striated inner layer. The inner radially striated layer is the renal medulla. This contains pyramid shaped tissue called the renal pyramids, separated by renal columns. The ureters are continuous with the renal pelvis and is the very center of the kidney. Renal Vein. The renal veins are veins that drain the kidney. They connect the kidney to the inferior vena cava. Because the inferior vena cava is on the right half of the body, the left renal vein is generally the longer of the two. Unlike the right renal vein, the left renal vein often receives the left gonadal vein (left testicular vein in males, left ovarian vein in females). It frequently receives the left suprarenal vein as well. Renal Artery. The renal arteries normally arise off the abdominal aorta and supply the kidneys with blood. The arterial supply of the kidneys are variable and there may be one or more renal arteries supplying each kidney. Due to the position of the aorta, the inferior vena cava and the kidneys in the body, the right renal artery is normally longer than the left renal artery. The right renal artery normally crosses posteriorly to the inferior vena cava. The renal arteries carry a large portion of the total blood flow to the kidneys. Up to a third of the total cardiac output can pass through the renal arteries to be filtered by the kidneys. Ureters. The ureters are two tubes that drain urine from the kidneys to the bladder. Each ureter is a muscular tube about 10 inches (25 cm) long. Muscles in the walls of the ureters send the urine in small spurts into the bladder, (a collapsible sac found on the forward part of the cavity of the bony pelvis that allows temporary storage of urine). After the urine enters the bladder from the ureters, small folds in the bladder mucosa act like valves preventing backward flow of the urine. The outlet of the bladder is controlled by a sphincter muscle. A full bladder stimulates sensory nerves in the bladder wall that relax the sphincter and allow release of the urine. However, relaxation of the sphincter is also in part a learned response under voluntary control. The released urine enters the urethra. Urinary Bladder. The urinary bladder is a hollow, muscular and distendible or elastic organ that sits on the pelvic floor (superior to the prostate in males). On its anterior border lies the pubic symphysis and, on its posterior border, the vagina (in females) and rectum (in males). The urinary bladder can hold approximately 17 to 18 ounces (500 to 530 ml) of urine, however the desire to micturate is usually experienced when it contains about 150 to 200 ml. When the bladder fills with urine (about half full), stretch receptors send nerve impulses to the spinal cord, which then sends a reflex nerve impulse back to the sphincter (muscular valve) at the neck of the bladder, causing it to relax and allow the flow of urine into the urethra. The Internal urethral sphincter is involuntary. The ureters enter the bladder diagonally from its dorsolateral floor in an area called the trigone. The trigone is a triangular shaped area on the postero-inferior wall of the bladder. The urethra exits at the lowest point of the triangle of the trigone. The urine in the bladder also helps regulate body temperature. A bladder when operating normally empties completely upon a complete discharge, otherwise it is a sign that its elasticity is compromised, when it becomes completely void of fluid, it may cause a chilling sensation due to the rapid change of body temperature. Urethra. The urethra is a muscular tube that connects the bladder with the outside of the body. The function of the urethra is to remove urine from the body. It measures about 1.5 inches (3.8 cm) in a woman but up to 8 inches (20 cm) in a man. Because the urethra is so much shorter in a woman it makes it much easier for a woman to get harmful bacteria in her bladder this is commonly called a bladder infection or a UTI. The most common bacteria of a UTI is E-coli from the large intestines that have been excreted in fecal matter. Female urethra In the human female, the urethra is about 1-2 inches long and opens in the vulva between the clitoris and the vaginal opening. Men have a longer urethra than women. This means that women tend to be more susceptible to infections of the bladder (cystitis) and the urinary tract. Male urethra In the human male, the urethra is about 8 inches long and opens at the end of the head of the penis. The length of a male's urethra, and the fact it contains a number of bends, makes catheterisation more difficult. The urethral sphincter is a collective name for the muscles used to control the flow of urine from the urinary bladder. These muscles surround the urethra, so that when they contract, the urethra is closed. Human males have much stronger sphincter muscles than females, meaning that they can retain a large amount of urine for twice as long, as much as 800mL, i.e. "hold it". Nephrons. A nephron is the basic structural and functional unit of the kidney. The name nephron comes from the Greek word (nephros) meaning kidney. Its chief function is to regulate water and soluble substances by filtering the blood, reabsorbing what is needed and excreting the rest as urine. Nephrons eliminate wastes from the body, regulate blood volume and pressure, control levels of electrolytes and metabolites, and regulate blood pH. Its functions are vital to life and are regulated by the endocrine system by hormones such as antidiuretic hormone, aldosterone, and parathyroid hormone. Each nephron has its own supply of blood from two capillary regions from the renal artery. Each nephron is composed of an initial filtering component (the renal corpuscle) and a tubule specialized for reabsorption and secretion (the renal tubule). The renal corpuscle filters out large solutes from the blood, delivering water and small solutes to the renal tubule for modification. Glomerulus. The glomerulus is a capillary tuft that receives its blood supply from an afferent arteriole of the renal circulation. The glomerular blood pressure provides the driving force for fluid and solutes to be filtered out of the blood and into the space made by Bowman's capsule. The remainder of the blood not filtered into the glomerulus passes into the narrower efferent arteriole. It then moves into the vasa recta, which are collecting capillaries intertwined with the convoluted tubules through the interstitial space, where the reabsorbed substances will also enter. This then combines with efferent venules from other nephrons into the renal vein, and rejoins with the main bloodstream. Afferent/Efferent Arterioles The afferent arteriole supplies blood to the glomerulus. A group of specialized cells known as juxtaglomerular cells are located around the afferent arteriole where it enters the renal corpuscle. The efferent arteriole drains the glomerulus. Between the two arterioles lies specialized cells called the macula densa. The juxtaglomerular cells and the macula densa collectively form the juxtaglomerular apparatus. It is in the juxtaglomerular apparatus cells that the enzyme renin is formed and stored. Renin is released in response to decreased blood pressure in the afferent arterioles, decreased sodium chloride in the distal convoluted tubule and sympathetic nerve stimulation of receptors (beta-adrenic) on the juxtaglomerular cells. Renin is needed to form Angiotensin I and Angiotensin II which stimulate the secretion of aldosterone by the adrenal cortex. Glomerular Capsule or Bowman's Capsule. Bowman's capsule (also called the glomerular capsule) surrounds the glomerulus and is composed of visceral (simple squamous epithelial cells) (inner) and parietal (simple squamous epithelial cells) (outer) layers. The visceral layer lies just beneath the thickened glomerular basement membrane and is made of podocytes which send foot processes over the length of the glomerulus. Foot processes interdigitate with one another forming filtration slits that, in contrast to those in the glomeruluar endothelium, are spanned by diaphragms. The size of the filtration slits restricts the passage of large molecules (e.g., albumin) and cells (e.g., red blood cells and platelets). In addition, foot processes have a negatively-charged coat (glycocalyx) that limits the filtration of negatively-charged molecules, such as albumin. This action is called electrostatic repulsion. The parietal layer of Bowman's capsule is lined by a single layer of squamous epithelium. Between the visceral and parietal layers is Bowman's space, into which the filtrate enters after passing through the podocytes' filtration slits. It is here that smooth muscle cells and macrophages lie between the capillaries and provide support for them. Unlike the visceral layer, the parietal layer does not function in filtration. Rather, the filtration barrier is formed by three components: the diaphragms of the filtration slits, the thick glomerular basement membrane, and the glycocalyx secreted by podocytes. 99% of glomerular filtrate will ultimately be reabsorbed. The process of filtration of the blood in the Bowman's capsule is ultrafiltration (or glomerular filtration), and the normal rate of filtration is 125 ml/min, equivalent to ten times the blood volume daily. Measuring the glomerular filtration rate (GFR) is a diagnostic test of kidney function. A decreased GFR may be a sign of renal failure. Conditions that can affect GFR include: arterial pressure, afferent arteriole constriction, efferent arteriole constriction, plasma protein concentration and colloid osmotic pressure. Any proteins that are roughly 30 kilodaltons or under can pass freely through the membrane. Although, there is some extra hindrance for negatively charged molecules due to the negative charge of the basement membrane and the podocytes. Any small molecules such as water, glucose, salt (NaCl), amino acids, and urea pass freely into Bowman's space, but cells, platelets and large proteins do not. As a result, the filtrate leaving the Bowman's capsule is very similar to blood plasma in composition as it passes into the proximal convoluted tubule. Together, the glomerulus and Bowman's capsule are called the renal corpuscle. Proximal Convoluted Tubule (PCT). The proximal tubule can be anatomically divided into two segments: the proximal convoluted tubule and the proximal straight tubule. The proximal convoluted tubule can be divided further into S1 and S2 segments based on the histological appearance of it's cells. Following this naming convention, the proximal straight tubule is commonly called the S3 segment. The proximal convoluted tubule has one layer of cuboidal cells in the lumen. This is the only place in the nephron that contains cuboidal cells. These cells are covered with millions of microvilli. The microvilli serve to increase surface area for reabsorption. Fluid in the filtrate entering the proximal convoluted tubule is reabsorbed into the peritubular capillaries, including approximately two-thirds of the filtered salt and water and all filtered organic solutes (primarily glucose and amino acids). This is driven by sodium transport from the lumen into the blood by the Na+/K+ ATPase in the basolateral membrane of the epithelial cells. Much of the mass movement of water and solutes occurs in between the cells through the tight junctions, which in this case are not selective. The solutes are absorbed isotonically, in that the osmotic potential of the fluid leaving the proximal tubule is the same as that of the initial glomerular filtrate. However, glucose, amino acids, inorganic phosphate, and some other solutes are reabsorbed via secondary active transport through cotransport channels driven by the sodium gradient out of the nephron. Loop of the Nephron or Loop of Henle. The loop of Henle (sometimes known as the nephron loop) is a U-shaped tube that consists of a descending limb and ascending limb. It begins in the cortex, receiving filtrate from the proximal convoluted tubule, extends into the medulla, and then returns to the cortex to empty into the distal convoluted tubule. Its primary role is to concentrate the salt in the interstitium, the tissue surrounding the loop. Distal Convoluted Tubule (DCT). The distal convoluted tubule is similar to the proximal convoluted tubule in structure and function. Cells lining the tubule have numerous mitochondria, enabling active transport to take place by the energy supplied by ATP. Much of the ion transport taking place in the distal convoluted tubule is regulated by the endocrine system. In the presence of parathyroid hormone, the distal convoluted tubule reabsorbs more calcium and excretes more phosphate. When aldosterone is present, more sodium is reabsorbed and more potassium excreted. Atrial natriuretic peptide causes the distal convoluted tubule to excrete more sodium. In addition, the tubule also secretes hydrogen and ammonium to regulate pH. After traveling the length of the distal convoluted tubule, only 3% of water remains, and the remaining salt content is negligible. 97.9% of the water in the glomerular filtrate enters the convoluted tubules and collecting ducts by osmosis. Collecting ducts. Each distal convoluted tubule delivers its filtrate to a system of collecting ducts, the first segment of which is the connecting tubule. The collecting duct system begins in the renal cortex and extends deep into the medulla. As the urine travels down the collecting duct system, it passes by the medullary interstitium which has a high sodium concentration as a result of the loop of Henle's countercurrent multiplier system. Though the collecting duct is normally impermeable to water, it becomes permeable in the presence of antidiuretic hormone (ADH). As much as three-fourths of the water from urine can be reabsorbed as it leaves the collecting duct by osmosis. Thus the levels of ADH determine whether urine will be concentrated or dilute. Dehydration results in an increase in ADH, while water sufficiency results in low ADH allowing for diluted urine. Lower portions of the collecting duct are also permeable to urea, allowing some of it to enter the medulla of the kidney, thus maintaining its high ion concentration (which is very important for the nephron). Urine leaves the medullary collecting ducts through the renal papilla, emptying into the renal calyces, the renal pelvis, and finally into the bladder via the ureter. Because it has a different embryonic origin than the rest of the nephron (the collecting duct is from endoderm whereas the nephron is from mesoderm), the collecting duct is usually not considered a part of the nephron proper. Renal Hormones 1. Vitamin D- Becomes metabolically active in the kidney. Patients with renal disease have symptoms of disturbed calcium and phosphate balance. 2. Erythropoietin- Released by the kidneys in response to decreased tissue oxygen levels (hypoxia). 3. Natriuretic Hormone- Released from cardiocyte granules located in the right atria of the heart in response to increased atrial stretch. It inhibits ADH secretions which can contribute to the loss of sodium and water. Formation of Urine. Urine is formed in three steps: Filtration, Reabsorption, and Secretion. Filtration. Blood enters the afferent arteriole and flows into the glomerulus. Blood in the glomerulus has both filterable blood components and non-filterable blood components. Filterable blood components move toward the inside of the glomerulus while non-filterable blood components bypass the filtration process by exiting through the efferent arteriole. Filterable Blood components will then take a plasma like form called glomerular filtrate. A few of the filterable blood components are water, nitrogenous waste, nutrients and salts (ions). Nonfilterable blood components include formed elements such as blood cells and platelets along with plasma proteins. The glomerular filtrate is not the same consistency as urine, as much of it is reabsorbed into the blood as the filtrate passes through the tubules of the nephron. Reabsorption. Within the peritubular capillary network, molecules and ions are reabsorbed back into the blood. Sodium Chloride reabsorbed into the system increases the osmolarity of blood in comparison to the glomerular filtrate. This reabsorption process allows water (H2O) to pass from the glomerular filtrate back into the circulatory system. Glucose and various amino acids also are reabsorbed into the circulatory system. These nutrients have carrier molecules that claim the glomerular molecule and release it back into the circulatory system. If all of the carrier molecules are used up, excess glucose or amino acids are set free into the urine. A complication of diabetes is the inability of the body to reabsorb glucose. If too much glucose appears in the glomerular filtrate it increases the osmolarity of the filtrate, causing water to be released into the urine rather than reabsorbed by the circulatory system. Frequent urination and unexplained thirst are warning signs of diabetes, due to water not being reabsorbed. Glomerular filtrate has now been separated into two forms: Reabsorbed Filtrate and Non-reabsorbed Filtrate. Non-reabsorbed filtrate is now known as tubular fluid as it passes through the collecting duct to be processed into urine. Secretion. Some substances are removed from blood through the peritubular capillary network into the distal convoluted tubule or collecting duct. These substances are Hydrogen ions, creatinine, and drugs. Urine is a collection of substances that have not been reabsorbed during glomerular filtration or tubular reabsorbtion. Maintaining Water-Salt Balance. It is the job of the kidneys to maintain the water-salt balance of the blood. They also maintain blood volume as well as blood pressure. Simple examples of ways that this balance can be changed include ingestion of water, dehydration, blood loss and salt ingestion. Reabsorption of water. Direct control of water excretion in the kidneys is exercised by the anti-diuretic hormone (ADH), released by the posterior lobe of the pituitary gland. ADH causes the insertion of water channels into the membranes of cells lining the collecting ducts, allowing water reabsorption to occur. Without ADH, little water is reabsorbed in the collecting ducts and dilute urine is excreted. There are several factors that influence the secretion of ADH. The first of these happen when the blood plasma gets too concentrated. When this occurs, special receptors in the hypothalamus release ADH. When blood pressure falls, stretch receptors in the aorta and carotid arteries stimulate ADH secretion to increase volume of the blood. Reabsorption of Salt. The Kidneys also regulate the salt balance in the blood by controlling the excretion and the reabsorption of various ions. As noted above, ADH plays a role in increasing water reabsorption in the kidneys, thus helping to dilute bodily fluids. The kidneys also have a regulated mechanism for reabsorbing sodium in the distal nephron. This mechanism is controlled by aldosterone, a steroid hormone produced by the adrenal cortex. Aldosterone promotes the excretion of potassium ions and the reabsorption of sodium ions. The release of Aldosterone is initiated by the kidneys. The juxtaglomerular apparatus is a renal structure consisting of the macula densa, mesangial cells, and juxtaglomerular cells. Juxtaglomerular cells (JG cells, also known as granular cells) are the site of renin secretion. Renin is an enzyme that converts angiotensinogen (a large plasma protein produced by the liver) into Angiotensin I and eventually into Angiotensin II which stimulates the adrenal cortex to produce aldosterone. The reabsorption of sodium ions is followed by the reapsorption of water. This causes blood pressure as well as blood volume to increase. Atrial natriuretic hormone (ANH) is released by the atria of the heart when cardiac cells are stretched due to increased blood volume. ANH inhibits the secretion of renin by the juxtaglomerular apparatus and the secretion of the aldosterone by the adrenal cortex. This promotes the excretion of sodium. When sodium is excreted so is water. This causes blood pressure and volume to decrease. Hypernatremia. An increase in plasma sodium levels above normal is hypernatremia. Sodium is the primary solute in the extracellular fluid. Sodium levels have a major role in osmolarity regulation. For excitable cells the electrochemical gradient for sodium across the plasma membrane is critical for life. Water retention and an increased blood pressure usually are signs of hypernatremia. If the plasma sodium levels are below normal it is called hyponatremia. Signs of this are low plasma volume and hypotension. Diuretics. A diuretic (colloquially called a water pill) is any drug that elevates the rate of bodily urine excretion (diuresis). Diuretics also decrease the extracellular fluid (ECF) volume, and are primarily used to produce a negative extracellular fluid balance. Caffeine, cranberry juice and alcohol are all weak diuretics. In medicine, diuretics are used to treat heart failure, liver cirrhosis, hypertension and certain kidney diseases. Diuretics alleviate the symptoms of these diseases by causing sodium and water loss through the urine. As urine is produced by the kidney, sodium and water – which cause edema related to the disease – move into the blood to replace the volume lost as urine, thereby reducing the pathological edema. Some diuretics, such as acetazolamide, help to make the urine more alkaline and are helpful in increasing excretion of substances such as aspirin in cases of overdose or poisoning. The antihypertensive actions of some diuretics (thiazides and loop diuretics in particular) are independent of their diuretic effect. That is, the reduction in blood pressure is not due to decreased blood volume resulting from increased urine production, but occurs through other mechanisms and at lower doses than that required to produce diuresis. Indapamide was specifically designed with this is mind, and has a larger therapeutic window for hypertension (without pronounced diuresis) than most other diuretics. Chemically, diuretics are a diverse group of compounds that either stimulate or inhibit various hormones that naturally occur in the body to regulate urine production by the kidneys. Alcohol produces diuresis through modulation of the vasopressin system. Diseases of the Kidney. Diabetic nephropathy (nephropatia diabetica), also known as Kimmelstiel-Wilson syndrome and intercapillary glomerulonephritis, is a progressive kidney disease caused by angiopathy of capillaries in the kidney glomeruli. It is characterized by nodular glomerulosclerosis. It is due to longstanding diabetes mellitus, and is a prime cause for dialysis in many Western countries. In medicine, hematuria (or "haematuria") is the presence of blood in the urine. It is a sign of a large number of diseases of the kidneys and the urinary tract, ranging from trivial to lethal. Kidney stones, also known as nephrolithiases, urolithiases or renal calculi, are solid accretions (crystals) of dissolved minerals in urine found inside the kidneys or ureters. They vary in size from as small as a grain of sand to as large as a golf ball. Kidney stones typically leave the body in the urine stream; if they grow relatively large before passing (on the order of millimeters), obstruction of a ureter and distention with urine can cause severe pain most commonly felt in the flank, lower abdomen and groin. Kidney stones are unrelated to gallstones. Case Study I was 34 weeks pregnant when I noticed blood in my urine. I immediately went to my OBGYN where I was told that I had a bladder infection and given an antibiotic. The next morning I experienced the most intense pain. I was rushed to the ER where I was told that I had kidney stones. The doctors explained that there was nothing they could do as long as I was pregnant. The next 3 weeks of my life were filled with intense pain and multiple painkillers. After I delivered my baby, CAT scans were done and I was informed that I had 6 kidney stones. It took three more weeks for me to pass all of the stones the largest measuring 5 mm. The stones were tested and I was informed that my body had been building up calcium due to my pregnancy and this was the cause of the kidney stones. I continued to have kidney pain for 6 months after passing the stones. I now live my life on a low calcium diet and the hope that my body will not develop more kidney stones. Pyelonephritis When an infection of the renal pelvis and calices, called pyelitis, spreads to involve the rest of the kidney as well, the result is pyelonephritis. It usually results from the spread of fecal bacterium Escherichia coli from the anal region superiorly through the urinary tract. In severe cases, the kidney swells and scars, abscesses form, and the renal pelvis fills with pus. Left untreated, the infected kidney may be severely damaged, but administration of antibiotics usually achieve a total cure. glomerulonephritis Inflammation of the glomerular can be caused by immunologic abnormalities, drugs or toxins, vascular disorders, and systemic diseases. Glomerulonephritis can be acute, chronic or progressive. Two major changes in the urine are distinctive of glomerulonephritis: hematuria and proteinuria with albumin as the major protein. There is also a decrease in urine as there is a decrease in GFR (glomerular filtration rate). Renal failure is associated with oliguria (less than 400 ml of urine output per day). Renal Failure Uremia is a syndrome of renal failure and includes elevated blood urea and creatinine levels. Acute renal failure can be reversed if diagnosed early. Acute renal failure can be caused by severe hypotension or severe glomerular disease. Diagnostic tests include BUN and plasma creatinine level tests. It is considered to be chronic renal failure if the decline of renal function to less than 25%. Diabetes Insipidus. This is caused by the deficiency of or decrease of ADH. The person with (DI) has the inability to concentrate their urine in water restriction, in turn they will void up 3 to 20 liters/day. There are two forms of (DI), neurogenic, and nephrogenic. In nephrogenic (DI) the kidneys do not respond to ADH. Usually the nephrogenic (DI) is characterized by the impairment of the urine concentrating capability of the kidney along with concentration of water. The cause may be a genetic trait, electrolyte disorder, or side effect of drugs such as lithium. In the neurogenic (DI), it is usually caused by head injury near the hypophysisal tract. Urinary tract infections (UTI's). The second most common type of bacterial infections seen by health care providers is UTI's. Out of all the bacterias that colonize and cause urinary tract infections the big gun is "Escherichia coli". In the hospital indwelling catheters and straight catheterizing predispose the opportunity for urinary tract infections. In females there are three stages in life that predispose urinary tract infections, that is menarche, manipulation between intercourse, and menopause. However, a small percentage of men and children will get urinary tract infections. In men it is usually due to the prostate gland growth which usually occurs in older age men. In children it can occur 3% to 5% in girls and 1% in boys, uncircumcised boys it is more common than circumcised ones to have a urinary tract infection, in girls it may be the result of onset of toilet training, some predispositions for getting urinary tract infection include family history and urinary tract anomalies. In neonates urinary tract infections is most common when bacteremia is present. Dialysis and Kidney Transplant. Generally, humans can live normally with just one kidney. Only when the amount of functioning kidney tissue is greatly diminished will renal failure develop. If renal function is impaired, various forms of medications are used, while others are contraindicated. Provided that treatment is begun early, it may be possible to reverse chronic kidney failure due to diabetes or high blood pressure. If creatinine clearance (a measure of renal function) has fallen very low ("end-stage renal failure"), or if the renal dysfunction leads to severe symptoms, dialysis is commenced. Dialysis is a medical procedure, performed in various different forms, where the blood is filtered outside of the body. Kidney transplantation is the only cure for end stage renal failure; dialysis, is a supportive treatment; a form of "buying time" to bridge the inevitable wait for a suitable organ. The first successful kidney transplant was announced on March 4, 1954 at Peter Bent Brigham Hospital in Boston. The surgery was performed by Dr. Joseph E. Murray, who was awarded the Nobel Prize in Medicine in 1990 for this feat. There are two types of kidney transplants: living donor transplant and a cadaveric (dead donor) transplant. When a kidney from a living donor, usually a blood relative, is transplanted into the patient's body, the donor's blood group and tissue type must be judged compatible with the patient's, and extensive medical tests are done to determine the health of the donor. Before a cadaveric donor's organs can be transplanted, a series of medical tests have to be done to determine if the organs are healthy. Also, in some countries, the family of the donor must give its consent for the organ donation. In both cases, the recipient of the new organ needs to take drugs to suppress their immune system to help prevent their body from rejecting the new kidney. Review Questions. 1. While reading a blood test I notice a high level of creatinine, I could assume from this that 2. Direct control of water excretion in the kidneys is controlled by 3. Nephrons 4. If I am dehydrated, my body will increase 5. Which part of the nephron removes water, ions and nutrients from the blood? 6. Kidneys have a direct effect on which of the following 7. Why do substances in the glomerulus enter the Bowman's capsule? 8. What happens in tubular excretion? 9. The countercurrent exchange system includes_________and_________. 10. The function of the loop of the nephron in the process of urine formation is: 11. Name the six important roles of the kidneys. Glossary. Antidiuretic: lessening or decreasing of urine production or an agent that decreases the release of urine. Catheterisation: a catheter is a tube that can be inserted into a body cavity, duct or vessel. Catheters thereby allow drainage or injection of fluids or access by surgical instruments. The process of inserting a catheter is catheterisation. In most uses a catheter is a thin, flexible tube: a "soft" catheter; in some uses, it is a larger, solid tube: a "hard" catheter. Dehydration: condition resulting from excessive loss of body fluid. Diabetes: a general term for a disease characterized by the beginning stages and onset of renal failure. It is derived from the Greek word diabaínein, that literally means "passing through," or "siphon", a reference to one of diabetes' major symptoms—excessive urine production. Diuresis: secretion and passage of large amounts of urine. Diuretic: increasing of urine production, or an agent that increases the production of urine. Erythropoietin: hormone that stimulates stem cells in the bone marrow to produce red blood cells Fibrous Capsule: the kidney's loose connective tissue Glomerulus: capillary tuft that receives its blood supply from an afferent arteriole of the renal circulation. Gluconeogenesis: the cycle of producing a glucose form fat or protein; preformed by the kidney in times of long fasting, initially gluconeogenesis is preformed by the liver Juxtaglomerular (JG) cells: Renin-secreting cells that are in contact with the macula densa and the afferent arterioles of the renal nephron. Juxtaglomerular apparatus (JGA): A site of juxtaglomerular cells connecting with the macula densa where renin is secreted and sensor for control of secretion of golmerular filtration rate. Loop of Henle/ Nephron Loop: u-shaped tube that consists of a descending limb and ascending limb; primary role is to concentrate the salt in the interstitium, the tissue surrounding the loop Medullary Pyramids or Renal Pyramids: the cone shaped masses in the kidney Micturition: another name for excretions Nephron: basic structural and functional unit of the kidney; chief function is to regulate water and soluble substances by filtering the blood, reabsorbing what is needed and excreting the rest as urine Podocytes: filtration membrane, in the visceral layer of the bowman's capsule Renal Calculi: kidney stones, solid crystals of dissolved minerals in urine found inside the kidneys Renal Cortex: outer portion of the kidney Renal Lobe: each pyramid together with the associated overlying cortex Renal Pelvis: a central space, or cavity that transmits urine to the urinary bladder via the ureter Renin: hormone released by the Juxtaglomerular (JG) cells of the kidneys when blood pressure falls TURP: transurethral resection of the prostate. During TURP, an instrument is inserted up the urethra to remove the section of the prostate that is blocking urine flow. This is most commonly caused by benign prostatic hyperplasia (BPH). A TURP usually requires hospitalization and is done using a general or spinal anesthetic. It is now the most common surgery used to remove part of an enlarged prostate. Urethra: a muscular tube that connects the bladder with the outside of the body Ureters: two tubes that drain urine from the kidneys to the bladder Urine: liquid produced by the kidneys, collected in the bladder and excreted through the urethra Urinary Bladder: a hollow, muscular and distensible or elastic organ that sits on the pelvic floor Urinary System: a group of organs in the body concerned with filtering out excess fluid and other substances from the bloodstream
10,211
C Programming/Pointers and arrays. A pointer is a value that designates the address (i.e., the location in memory), of some value. Pointers are variables that hold a memory location. There are four fundamental things you need to know about pointers: Pointers can reference any data type, even functions. We'll also discuss the relationship of pointers with text strings and the more advanced concept of function pointers. Declaring pointers. Consider the following snippet of code which declares two pointers: struct MyStruct { int m_aNumber; float num2; int main() int *pJ2; struct MyStruct *pAnItem; Lines 1-4 define a structure. Line 8 declares a variable that points to an int, and line 9 declares a variable that points to something with structure MyStruct. So to declare a variable as something that points to some type, rather than contains some type, the asterisk (codice_4) is placed before the variable name. In the following, line 1 declares codice_7 as a pointer to a long and codice_8 as a long and not a pointer to a long. In line 2, codice_9 is declared as a pointer to a pointer to an int. long * var1, var2; int ** p3; Pointer types are often used as parameters to function calls. The following shows how to declare a function which uses a pointer as an argument. Since C passes function arguments by value, in order to allow a function to modify a value from the calling routine, a pointer to the value must be passed. Pointers to structures are also used as function arguments even when nothing in the struct will be modified in the function. This is done to avoid copying the complete contents of the structure onto the stack. More about pointers as function arguments later. int MyFunction(struct MyStruct *pStruct); Assigning values to pointers. So far we've discussed how to declare pointers. The process of assigning values to pointers is next. To assign the address of a variable to a pointer, the codice_1 or 'address of' operator is used. int myInt; int *pPointer; struct MyStruct dvorak; struct MyStruct *pKeyboard; pPointer = &myInt; pKeyboard = &dvorak; Here, pPointer will now reference myInt and pKeyboard will reference dvorak. Pointers can also be assigned to reference dynamically allocated memory. The malloc() and calloc() functions are often used to do this. struct MyStruct *pKeyboard; pKeyboard = malloc(sizeof *pKeyboard); The malloc function returns a pointer to dynamically allocated memory (or NULL if unsuccessful). The size of this memory will be appropriately sized to contain the MyStruct structure. The following is an example showing one pointer being assigned to another and of a pointer being assigned a return value from a function. static struct MyStruct val1, val2, val3, val4; struct MyStruct *ASillyFunction( int b ) struct MyStruct *myReturn; if (b == 1) myReturn = &val1; else if (b==2) myReturn = &val2; else if (b==3) myReturn = &val3; else myReturn = &val4; return myReturn; struct MyStruct *strPointer; int *c, *d; int j; c = &j; /* pointer assigned using & operator */ d = c; /* assign one pointer to another */ strPointer = ASillyFunction( 3 ); /* pointer returned from a function. */ When returning a pointer from a function, do not return a pointer that points to a value that is local to the function or that is a pointer to a function argument. Pointers to local variables become invalid when the function exits. In the above function, the value returned points to a static variable. Returning a pointer to dynamically allocated memory is also valid. Pointer dereferencing. To access a value to which a pointer points, the codice_4 operator is used. Another operator, the codice_12 operator is used in conjunction with pointers to structures. Here's a short example. int c, d; int *pj; struct MyStruct astruct; struct MyStruct *bb; c = 10; pj = &c; /* pj points to c */ d = *pj; /* d is assigned the value to which pj points, 10 */ pj = &d; /* now points to d */ bb = &astruct; (*bb).m_aNumber = 3; /* assigns 3 to the m_aNumber member of astruct */ bb->num2 = 44.3; /* assigns 44.3 to the num2 member of astruct */ The expression codice_13 is entirely equivalent to codice_14. They both access the codice_15 element of the structure pointed to by codice_16. There is one more way of dereferencing a pointer, which will be discussed in the following section. When dereferencing a pointer that points to an invalid memory location, an error often occurs which results in the program terminating. The error is often reported as a segmentation error. A common cause of this is failure to initialize a pointer before trying to dereference it. C is known for giving you just enough rope to hang yourself, and pointer dereferencing is a prime example. You are quite free to write code that accesses memory outside that which you have explicitly requested from the system. And many times, that memory may appear as available to your program due to the vagaries of system memory allocation. However, even if 99 executions allow your program to run without fault, that 100th execution may be the time when your "memory pilfering" is caught by the system and the program fails. Be careful to ensure that your pointer offsets are within the bounds of allocated memory! The declaration codice_17 is used to declare a pointer of some nonspecified type. You can assign a value to a void pointer, but you must cast the variable to point to some specified type before you can dereference it. Pointer arithmetic is also not valid with codice_18 pointers. Pointers and Arrays. Up to now, we've carefully been avoiding discussing arrays in the context of pointers. The interaction of pointers and arrays can be confusing but here are two fundamental statements about it: The first case often is seen to occur when an array is passed as an argument to a function. The function declares the parameter as a pointer, but the actual argument may be the name of an array. The second case often occurs when accessing dynamically allocated memory. Let's look at examples of each. In the following code, the call to codice_19 effectively allocates an array of struct MyStruct items. struct MyStruct { int someNumber; float otherNumber; float returnSameIfAnyEquals(struct MyStruct *workingArray, int size, int bb) /* Go through the array and check if any value in someNumber is equal to bb. If * any value is, return the value in otherNumber. If no values are equal to bb, * return 0.0f. */ for (int i = 0; i < size; i++) { if (workingArray[i].someNumber == bb ) { return workingArray[i].otherNumber; return 0.0f; // Declare our variables float someResult; int someSize; struct MyStruct myArray[4]; struct MyStruct *secondArray; // Notice that this is a pointer const int ArraySize = sizeof(myArray) / sizeof(*myArray); // Initialization of myArray occurs someResult = returnSameIfAnyEquals(myArray, ArraySize, 4); secondArray = calloc(someSize, sizeof(struct MyStruct)); for (int i = 0; i < someSize; i++) { /* Fill secondArray with some data */ secondArray[i].someNumber = i * 2; secondArray[i].otherNumber = 0.304f * i * i; Pointers and array names can pretty much be used interchangeably; however, there are exceptions. You cannot assign a new pointer value to an array name. The array name will always point to the first element of the array. In the function codice_20, you could however assign a new value to workingArray, as it is just a pointer to the first element of workingArray. It is also valid for a function to return a pointer to one of the array elements from an array passed as an argument to a function. A function should never return a pointer to a local variable, even though the compiler will probably not complain. When declaring parameters to functions, declaring an array variable without a size is equivalent to declaring a pointer. Often this is done to emphasize the fact that the pointer variable will be used in a manner equivalent to an array. /* Two equivalent function prototypes */ int LittleFunction(int *paramN); int LittleFunction(int paramN[]); Now we're ready to discuss pointer arithmetic. You can add and subtract integer values to/from pointers. If myArray is declared to be some type of array, the expression codice_21, where j is an integer, is equivalent to codice_22. For instance, in the above example where we had the expression codice_23, we could have written that as codice_24 or more simply codice_25. Note that for addition and subtraction of integers and pointers, the value of the pointer is not adjusted by the integer amount, but is adjusted by the amount multiplied by the size of the type to which the pointer refers in bytes. (For example, codice_26 can be thought of as codice_27.) One pointer may also be subtracted from another, provided they point to elements of the same array (or the position just beyond the end of the array). If you have a pointer that points to an element of an array, the index of the element is the result when the array name is subtracted from the pointer. Here's an example. struct MyStruct someArray[20]; struct MyStruct *p2; int i; /* array initialization .. */ for (p2 = someArray; p2 < someArray+20; ++p2) { if (p2->num2 > testValue) break; i = p2 - someArray; You may be wondering how pointers and multidimensional arrays interact. Let's look at this a bit in detail. Suppose A is declared as a two dimensional array of floats (codice_28) and that pf is declared a pointer to a float. If pf is initialized to point to A[0][0], then *(pf+1) is equivalent to A[0][1] and *(pf+D2) is equivalent to A[1][0]. The elements of the array are stored in row-major order. float A[6][8]; float *pf; pf = &A[0][0]; Let's look at a slightly different problem. We want to have a two dimensional array, but we don't need to have all the rows the same length. What we do is declare an array of pointers. The second line below declares A as an array of pointers. Each pointer points to a float. Here's some applicable code: float linearA[30]; float *A[6]; A[0] = linearA; /* 5 - 0 = 5 elements in row */ A[1] = linearA + 5; /* 11 - 5 = 6 elements in row */ A[2] = linearA + 11; /* 15 - 11 = 4 elements in row */ A[3] = linearA + 15; /* 21 - 15 = 6 elements */ A[4] = linearA + 21; /* 25 - 21 = 4 elements */ A[5] = linearA + 25; /* 30 - 25 = 5 elements */ negative indices are sometimes useful. But avoid using them as much as possible. */ We also note here something curious about array indexing. Suppose codice_29 is an array and codice_30 is an integer value. The expression codice_31 is equivalent to codice_32. The first is equivalent to codice_33, and the second is equivalent to codice_34. These turn out to be the same, since the addition is commutative. Pointers can be used with pre-increment or post-decrement, which is sometimes done within a loop, as in the following example. The increment and decrement applies to the pointer, not to the object to which the pointer refers. In other words, codice_35 is equivalent to codice_36. long myArray[20]; long *pArray; int i; /* Assign values to the entries of myArray */ pArray = myArray; for (i=0; i<10; ++i) { *pArray++ = 5 + 3*i + 12*i*i; *pArray++ = 6 + 2*i + 7*i*i; Pointers in Function Arguments. Often we need to invoke a function with an argument that is itself a pointer. In many instances, the variable is itself a parameter for the current function and may be a pointer to some type of structure. The ampersand (codice_1) character is not needed in this circumstance to obtain a pointer value, as the variable is itself a pointer. In the example below, the variable codice_38, a pointer, is a parameter to function codice_39, and is passed as an argument to codice_40. The second parameter to codice_40 is an int. Since in function codice_39, codice_43 is a pointer to an int, the pointer must first be dereferenced using the * operator, hence the second argument in the call is codice_44. The third parameter to function codice_40 is a pointer to a long. Since codice_46 is itself a pointer to a long, no ampersand is needed when it is used as the third argument to the function. int FunctOne(struct someStruct *pValue, int iValue, long *lValue) /* do some stuff ... */ return 0; int FunctTwo(struct someStruct *pStruct, int *mValue) int j; long AnArray[25]; long *pAA; pAA = &AnArray[13]; j = FunctOne( pStruct, *mValue, pAA ); /* pStruct already holds the address that the pointer will point to; there is no need to get the address of anything.*/ return j; Pointers and Text Strings. Historically, text strings in C have been implemented as arrays of characters, with the last byte in the string being a zero, or the null character '\0'. Most C implementations come with a standard library of functions for manipulating strings. Many of the more commonly used functions expect the strings to be null terminated strings of characters. To use these functions requires the inclusion of the standard C header file "string.h". A statically declared, initialized string would look similar to the following: static const char *myFormat = "Total Amount Due: %d"; The variable codice_47 can be viewed as an array of 21 characters. There is an implied null character ('\0') tacked on to the end of the string after the 'd' as the 21st item in the array. You can also initialize the individual characters of the array as follows: static const char myFlower[] = { 'P', 'e', 't', 'u', 'n', 'i', 'a', '\0' }; An initialized array of strings would typically be done as follows: static const char *myColors[] = { "Red", "Orange", "Yellow", "Green", "Blue", "Violet" }; The initialization of an especially long string can be split across lines of source code as follows. static char *longString = "Hello. My name is Rudolph and I work as a reindeer " "around Christmas time up at the North Pole. My boss is a really swell guy." " He likes to give everybody gifts."; The library functions that are used with strings are discussed in a later chapter. Pointers to Functions. C also allows you to create pointers to functions. Pointers to functions syntax can get rather messy. As an example of this, consider the following functions: static int Z = 0; int *pointer_to_Z(int x) { /* function returning integer pointer, not pointer to function */ return &Z; int get_Z(int x) { return Z; int (*function_pointer_to_Z)(int); // pointer to function taking an int as argument and returning an int function_pointer_to_Z = &get_Z; printf("pointer_to_Z output: %d\n", *pointer_to_Z(3)); printf("function_pointer_to_Z output: %d", (*function_pointer_to_Z)(3)); Declaring a typedef to a function pointer generally clarifies the code. Here's an example that uses a function pointer, and a void * pointer to implement what's known as a callback. The codice_48 function invokes a caller supplied function codice_49 with caller data. Note that codice_48 really doesn't know anything about what codice_51 refers to. typedef int (*MyFunctionType)( int, void *); /* a typedef for a function pointer */ int DoSomethingNice( int aVariable, MyFunctionType aFunction, void *dataPointer ) int rv = 0; if (aVariable < THE_BIGGEST) { /* invoke function through function pointer (old style) */ rv = (*aFunction)(aVariable, dataPointer ); } else { /* invoke function through function pointer (new style) */ rv = aFunction(aVariable, dataPointer ); return rv; typedef struct { int colorSpec; char *phrase; } DataINeed; int TalkJive( int myNumber, void *someStuff ) /* recast void * to pointer type specifically needed for this function */ DataINeed *myData = someStuff; /* talk jive. */ return 5; static DataINeed sillyStuff = { BLUE, "Whatcha talkin 'bout Willis?" }; DoSomethingNice( 41, &TalkJive, &sillyStuff ); Some versions of C may not require an ampersand preceding the codice_49 argument in the codice_48 call. Some implementations may require specifically casting the argument to the codice_54 type, even though the function signature exacly matches that of the typedef. Function pointers can be useful for implementing a form of polymorphism in C. First one declares a structure having as elements function pointers for the various operations to that can be specified polymorphically. A second base object structure containing a pointer to the previous structure is also declared. A class is defined by extending the second structure with the data specific for the class, and static variable of the type of the first structure, containing the addresses of the functions that are associated with the class. This type of polymorphism is used in the standard library when file I/O functions are called. A similar mechanism can also be used for implementing a state machine in C. A structure is defined which contains function pointers for handling events that may occur within state, and for functions to be invoked upon entry to and exit from the state. An instance of this structure corresponds to a state. Each state is initialized with pointers to functions appropriate for the state. The current state of the state machine is in effect a pointer to one of these states. Changing the value of the current state pointer effectively changes the current state. When some event occurs, the appropriate function is called through a function pointer in the current state. Practical use of function pointers in C. Function pointers are mainly used to reduce the complexity of switch statement. Example with switch statement: int add(int a, int b); int sub(int a, int b); int mul(int a, int b); int div(int a, int b); int main() int i, result; int a=10; int b=5; printf("Enter the value between 0 and 3 : "); scanf("%d",&i); switch(i) case 0: result = add(a,b); break; case 1: result = sub(a,b); break; case 2: result = mul(a,b); break; case 3: result = div(a,b); break; int add(int i, int j) return (i+j); int sub(int i, int j) return (i-j); int mul(int i, int j) return (i*j); int div(int i, int j) return (i/j); Without using a switch statement: int add(int a, int b); int sub(int a, int b); int mul(int a, int b); int div(int a, int b); int (*oper[4])(int a, int b) = {add, sub, mul, div}; int main() int i,result; int a=10; int b=5; printf("Enter the value between 0 and 3 : "); scanf("%d",&i); result = oper[i](a,b); int add(int i, int j) return (i+j); int sub(int i, int j) return (i-j); int mul(int i, int j) return (i*j); int div(int i, int j) return (i/j); Function pointers may be used to create a struct member function: typedef struct int (*open)(void); void (*close)(void); int (*reg)(void); } device; int my_device_open(void) /* ... */ void my_device_close(void) /* ... */ void register_device(void) /* ... */ device create(void) device my_device; my_device.open = my_device_open; my_device.close = my_device_close; my_device.reg = register_device; my_device.reg(); return my_device; Use to implement this pointer (following code must be placed in library). static struct device_data /* ... here goes data of structure ... */ static struct device_data obj; typedef struct int (*open)(void); void (*close)(void); int (*reg)(void); } device; static struct device_data create_device_data(void) struct device_data my_device_data; /* ... here goes constructor ... */ return my_device_data; /* here I omit the my_device_open, my_device_close and register_device functions */ device create_device(void) device my_device; my_device.open = my_device_open; my_device.close = my_device_close; my_device.reg = register_device; my_device.reg(); return my_device; Examples of pointer constructs. Below are some example constructs which may aid in creating your pointer. int i; // integer variable 'i' int *p; // pointer 'p' to an integer int a[]; // array 'a' of integers int f(); // function 'f' with return value of type integer int **pp; // pointer 'pp' to a pointer to an integer int (*pa)[]; // pointer 'pa' to an array of integer int (*pf)(); // pointer 'pf' to a function with return value integer int *ap[]; // array 'ap' of pointers to an integer int *fp(); // function 'fp' which returns a pointer to an integer int ***ppp; // pointer 'ppp' to a pointer to a pointer to an integer int (**ppa)[]; // pointer 'ppa' to a pointer to an array of integers int (**ppf)(); // pointer 'ppf' to a pointer to a function with return value of type integer int *(*pap)[]; // pointer 'pap' to an array of pointers to an integer int *(*pfp)(); // pointer 'pfp' to function with return value of type pointer to an integer int **app[]; // array of pointers 'app' that point to pointers to integer values int (*apa[])[]; // array of pointers 'apa' to arrays of integers int (*apf[])(); // array of pointers 'apf' to functions with return values of type integer int ***fpp(); // function 'fpp' which returns a pointer to a pointer to a pointer to an int int (*fpa())[]; // function 'fpa' with return value of a pointer to array of integers int (*fpf())(); // function 'fpf' with return value of a pointer to function which returns an integer sizeof. The sizeof operator is often used to refer to the size of a static array declared earlier in the same function. To find the end of an array (example from ): int main(int argc, char *argv[]) char buffer[10]; if (argc < 2) fprintf(stderr, "USAGE: %s string\n", argv[0]); return 1; strncpy(buffer, argv[1], sizeof(buffer)); buffer[sizeof(buffer) - 1] = '\0'; return 0; To iterate over every element of an array, use #define NUM_ELEM(x) (sizeof (x) / sizeof (*(x))) for( i = 0; i < NUM_ELEM(array); i++ ) /* do something with array[i] */ Note that the codice_55 operator only works on things defined earlier in the same function. The compiler replaces it with some fixed constant number. In this case, the codice_56 was declared as an array of 10 char's earlier in the same function, and the compiler replaces codice_57 with the number 10 at compile time (equivalent to us hard-coding 10 into the code in place of codice_57). The information about the length of codice_56 is not actually stored anywhere in memory (unless we keep track of it separately) and cannot be programmatically obtained at run time from the array/pointer itself. Often a function needs to know the size of an array it was given -- an array defined in some other function. For example, /* broken.c - demonstrates a flaw */ int sum( int input_array[] ){ int sum_so_far = 0; int i; for( i = 0; i < NUM_ELEM(input_array); i++ ) // WON'T WORK -- input_array wasn't defined in this function. sum_so_far += input_array[i]; return( sum_so_far ); int main(int argc, char *argv[]) int left_array[] = { 1, 2, 3 }; int right_array[] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; int the_sum = sum( left_array ); printf( "the sum of left_array is: %d", the_sum ); the_sum = sum( right_array ); printf( "the sum of right_array is: %d", the_sum ); return 0; Unfortunately, (in C and C++) the length of the array cannot be obtained from an array passed in at run time, because (as mentioned above) the size of an array is not stored anywhere. The compiler always replaces sizeof with a constant. This sum() routine needs to handle more than just one constant length of an array. There are some common ways to work around this fact: /* fixed.c - demonstrates one work-around */ int sum( int input_array[], size_t length ){ int sum_so_far = 0; int i; for( i = 0; i < length; i++ ) sum_so_far += input_array[i]; return( sum_so_far ); int main(int argc, char *argv[]) int left_array[] = { 1, 2, 3, 4 }; int right_array[] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; int the_sum = sum( left_array, NUM_ELEM(left_array) ); // works here, because left_array is defined in this function printf( "the sum of left_array is: %d", the_sum ); the_sum = sum( right_array, NUM_ELEM(right_array) ); // works here, because right_array is defined in this function printf( "the sum of right_array is: %d", the_sum ); return 0; It's worth mentioning that sizeof operator has two variations: sizeof (type) (for instance: sizeof (int) or sizeof (struct some_structure)) and sizeof expression (for instance: sizeof some_variable.some_field or sizeof 1).
6,882
Hindi/Speaking and Writing. Example of Hindi writing: मनमोहन सिंह मंत्रिमंडल में मंत्रालयों का बटवारा पूरा हो गया है। कपिल सिब्बल को मानव संसाधन विकास और आनंद शर्मा को वाणिज्य एवं उद्योग विभाग दिया गया है। Hindi consists of 11 vowels, 40 consonants, and two sound modifiers. The Hindi syllabary is ordered according to how the sounds are created in the mouth. Vowels. First are the vowels, which, with one exception, come in pairs: अ आ इ ई उ ऊ ए ऐ ओ औ अं अः Using the International Alphabet of Sanskrit Transliteration (IAST), these vowels would be represented thus: a ā i ī u ū ṛ e ai o au All vowels in Hindi have two forms: Their standalone form and their "mātrā" form. The "mātrā" form modifies consonants. Here are the eleven vowels paired with the syllable क ("k"): Regular Consonants. There are 25 regular consonants (consonants that stop air from moving out of the mouth) in Hindi, and they are organized into groups ("vargas") of five. The "vargas" are ordered according to where the tongue is in the mouth. Each successive "varga" refers to a successively forward position of the tongue. The "vargas" are ordered and named thus (with an example of a corresponding consonant): The five consonants in each group are ordered thus: The difference between voiced and unvoiced consonants is as simple for an English speaker to understand as understanding the difference between the consonants "k" and "g" or "j" and "ch." However, aspiration is a distinction foreign to most English speakers. To understand the difference, do this simple exercise: Hold your palm about an inch in front of your mouth. Say the word "pit." Notice that your hand will likely feel a short burst of air coming from your mouth. Now say the word "spit" and notice that there is little or no burst of air. Now attempt to say "pit" again, this time without letting the burst of air happen. Here are the five "vargas" of regular consonants, followed by their corresponding IAST characters: Notes: Semivowels. There are four semivowels in Hindi: य र ल व "y r l w (v)" Sibilants. There are three sibilants: श ष स "ś ṣ s" Fricative. There is one fricative consonant: ह"h" Modified Consonants. There are many sounds found in Hindi that are not part of the traditional listing. These all have a नुक़्ता ("nuqta") - a dot below the letter - with one exception: Sound Modifiers. The anusvara is notated with a small dot above the corresponding letter. In IAST, it is notated "ṃ". It can have two different effects: The halant is a small diagonal line which indicates that the default vowel अ -- "a" is not to be pronounced. It only appears at the end of words. In Hindi, however, this symbol is almost never seen, as, unlike Sanskrit, the default vowel is almost never pronounced on the final consonants of words. Example: नाम् -- "nām" (name). Conjuncts. Very often, two or more consonants are combined. This is done by physically connecting it to the next one, in various different ways.
970
Hindi/Core grammar. This page is part of the Hindi course. Word order. The word order in Hindi/Urdu is: Hindi: N1 A1 N2 postp1 N3 postp2 N4 cmkr3 LtV1 LtV2 VectorVerb AuxBe English: N1 Verb prep3 N4 prep2 N3 prep1 A1 N2 The word order can change to put emphasis on a part of the sentence. So to say "My friend's pretty mother cooks food very well", "Mere dost ki khoobsurat ma khana aachese banathi." Translated word for word, this is "My friend of pretty mother food well cooks." Simple way to order words in a sentence: Adjective subject object verb adverbs Sentence components. Case markers. Subjects, objects, and destinations are sometimes not marked at all. Compound post-positions. Most English prepositions (which don't otherwise translate with a case marker) will translate with a ke/ki followed by a noun. It is useful to think of the ke/ki paired with these particular nouns as being a compound post-position. e.g. - "Anyone" + "ke khilaf" means "against" + "Anyone"
307
Kinematics/Linear Motion. Problems. Prerequisite: Calculus Solutions. 1. 3 s. Use the kinematics equation y = y0 + v0t + 1/2 at^2. Let the rock's initial height y be 0. Plugging the values into the equation yields 0 = 15t - (1/2) 10t^2. Factoring and solving for t yields solutions of 0 s and 3 s. Hence it takes the rock 3 s to return to its original height. 24. The quickest solution is to write the Taylor series for x, this yields the solution immediately. Another route to the solution is to solve the differential equation by separating the variables. 25. e cm. The Taylor series for positions is x = x0 + v0 t + (1/2!) a0 t^2 + (1/3!) j0 t^3 + ... . Since x0, v0, a0, ... are all equal to one and t, t^2, t^3, ... are all equal to one, you have the following series: x = 1 + 1 + 1/2 + 1/6 + ... . This is a series that sums to e, thus the cockroach travels e cm after one second.
297
General Mechanics/The Continuum Limit. Introduction. In principle, we could use the methods described so far to predict the behavior of matter by simply keeping track of each atom. In practice, this is not a useful approach. Instead, we treat matter as a continuum. In this section we will see how this is done, and how it leads us back to waves. For an example, we will consider a set of "N"+1 identical springs and masses, arranged as in the previous section, with spring 0 attached to the wall, and mass "N" free. We are interested in what happens for large "N", the "continuum" limit. The system has three other parameters; the spring constant "k", the particle mass "Δm", and the spring rest spacing "Δa", where variable names have been chosen for future convenience. These can be combined with "N" to give a similar set of parameters for the system. Suppose all the masses are displaced by "d" from rest, with total displacement "D"="dN" of the system end, then the total potential energy is "kNd"2/2 = "kD"2/(2"N"), so If, as we increase "N" we change the other three parameters to keep "K", "m", and "a" constant then in the large "N" limit this "discrete" system will look like a spring with mass "continuously" distributed along its length. For coordinates, we will use the displacements of each mass, "x""n". For large "N" the displacement will vary approximately continuously with distance. We can regard it as a continuous function, "x", with The kinetic energy of the system is then simply The total potential energy is similarly From this we may deduce the equations of motion in two different ways. Equations of motion: First approach. If we take the large "N" limit first, these sums become integrals. where "s" is the distance from the wall, and Since the springs always remain attached to the wall, "x"(0)=0. The integrand for "T" is the product of the density and the square of the velocity, just as we might naively expect. Simalarly, "V" is the integral of the potential energy of a infinitesimal spring over the length of the system. Using the Lagrangian will let us get equations of motion from these integrals. It is The action of the system is Here, we are integrating over both space and time, rather than just space, but this is still very similar in form to the action for a single particle. We can expect that the principle of least action will lead us to the natural extension of Lagrange's equations to this action, This equation can be proven, using the calculus of variations. Using it for this particular Lagrangian gives This is a "partial differential equation". We will not be discussing its solution in detail, but we will see that it describes waves. First, though, we will confirm that these equations are the same as we get if we find the equations of motion first, then take the large "N" limit. Equations of motion: Second approach. First, we will look at the potential energy to see how it depends on the displacements. formula_10 Notice that we need to treat the displacements of the first and last masses differently from the other coordinates, because the dependence of the Langragian on them is different. The kinetic energy is symmetric in the coordinates, Using Lagrange's equations, we get that, for "x"0 for "x""N", and, for all the other "x""n" We can replace "k" and Δ"m" by the limiting values K and m using giving us Looking at the general structure of the right hand side, we see difference between the displacement at nearby points divided by the distance between those points, so we expect that in the limit we will get differentials with respect to "s", the distance from the wall. As "N" tends to infinity both "x"0 and "x"1 tend to "x"(0), which is always zero, so the equation of motion for "x"0 is always true. In the continuum limit, the equation for "x""N" becomes Since Δ"a" tends to zero, for this to be true we must have x'=0 at "a". For the other displacements, so we get the equation just as with the other approach. Waves. It is intuitively obvious that if we flick one of the masses in this system, vibrations will propagate down the springs, like waves, so we look for solutions of that form. A generic travelling wave is Substituting this informed guess into the equation gives so this wave is a solution provide the frequency and wavenumber are related by The speed of these waves, "c", is Thus, we've gone from Newton's laws to waves. We can do the same starting with a three-dimensional array of particles, and deduce the equations for longitudinal and transverse waves in a solid. Everything we said about waves earlier will be true for these systems. This particular system has two boundary conditions: the displacement is zero at the wall, and a local extrema at the free end. This is typical of all such problems. When we take account of the boundary conditions we find that the correct solutions is a combination of standing waves, of the form where "b" is any integer. If we also knew the initial displacement we could use Fourier series to obtain the exact solution for all time. In practice, "N" is typically large but finite, so the continuum limit is only approximately true. Allowing for this would give us a power series in 1/"N", describing small corrections to the approximation. These corrections can produce interesting effects, including solutions, but we will not calculate them here. The continuum limit also fails for small wavelengths, comparable with the particle spacing. Fields. In the continuum limit, the spring is described by a variable which is a function of both position and time. Variable such as this are commonly referred to as "fields." At first sight, classical fields look quite different to classical particles. In one case position is the dependent variable; in the other, it is an independent variable. However, as the above calculations suggest, fields and particles have an underlying unity, if we take a Lagrangian approach. We can deal with both using essentially the same mathematical techniques, extracting information about both the field and the particles in that field from the same source. E.g., once we know the Lagrangian for electromagnetism, we can deduce both the partial differential equations for the EM fields, and the forces on charged particles in those fields, from it. We will see precisely how later, when we come to study electromagnetism. In the example above, the field Lagrangian was the continuum limit of a Lagrangian for the discrete system. It did not have to be. We can investigate the fields described by any Lagrangian we like, whether or not there is an underlying mechanical system. So far, we've looked at waves and movement under Newton's law, and seen how the study of movement can lead us back to waves. Next, we will look at special relativity, and see how Einstein's insights affect all this.
1,647
Physics Exercises/Kinematics in One Dimension. Kinematics in one dimension involves motion where the position can be represented by a single number. Motion in other directions (if any) are ignored. For solving kinematics problems without calculus, use of following equations is necessary (these can be derived using calculus): formula_1.
78
Physics Exercises/Kinematics in 2-3 Dimensions. Kinematics in 2 or 3 dimensions is essentially the same as ../Kinematics in One Dimension/ with an extra step added: one must separate the motion into 2 or 3 perpendicular directions (for each problem, one particular choice of axes is better than others) and solve motion in each direction separately as it is done in ../Kinematics in One Dimension/.
104
Civ/Sid Meier's Alpha Centauri/Citizens. Citizens. Empath. Replaces Doctor Engineer. Replaces Technician Thinker. Replaces Librarian Transcend. Replaces Empath and Thinker
68
General Chemistry/The Quantum Atom. The Quantum Numbers. These four numbers are used to describe the location of an electron in an atom. Principal Quantum Number ("n"). Determines the shell the electron is in. The shell is the main component that determines the energy of the electron (higher "n" corresponds to higher energy), as well as size of the orbital, corresponding to maximum nuclear distance (higher "n" means further possible distance from the nucleus). The row that an element is placed on the periodic table tells how many shells there will be. Helium ("n" = 1), neon ("n" = 2), argon ("n" = 3), etc. Note that the shells will have different numbers, as described by the table above; for example, argon will contain the formula_1, formula_2, and formula_3 subshells, for that total of 3. Angular Momentum Quantum Number ("l"). Also known as azimuthal quantum number. Determines the subshell the electron is in. Each subshell has a unique shape and a letter name. The "s orbital" is shaped like a sphere and occurs when "l" = 0. The "p orbitals" (there are three) are shaped like teardrops and occur when "l" = 1. The "d orbitals" (there are five) occur when "l" = 2. The "f orbitals" (there are seven) occur when "l" = 3. (By the way, when "l" = 4, the orbitals are "g orbitals", but they (and the "l" = 5 "h orbitals") can safely be ignored in general chemistry.). The numbers of the subshells in each shell can be calculated using the principal quantum number like so. formula_4 For example, in the formula_2 shell, the subshells are an formula_6 subshell, and 3 formula_7 subshells. You will learn how to determine the number of orbitals for each subshells in the next section. This number also gives information as to what the angular node of an orbital is. A node is defined as a point on a standing wave where the wave has minimal amplitude. When applied to chemistry this is the point of zero-displacement and thus where no electrons are found. In turn angular node means the planar or conical surface in which no electrons are found or where there is no electron density. The models shown on this page show the most simple representations of these orbitals and their nodes. More accurate, but more complex depictions are not necessary for the scope of this book. Here are pictures of the orbitals. Keep in mind that they do not show the actual path of the electrons, due to the Heisenberg Uncertainty Principle. Instead, they show the volume where the electron is most likely to occur, i.e. the is largest. The two colors represent two signs (phases) of the (the choice is arbitrary). Each of the depicted orbitals is a superposition of two opposite "m" quantum numbers (see below). Magnetic Quantum Number ("m"l). Magnetic quantum number determines the orbital in which the electron lies. The number of orbitals in each subshell can be calculated like so: formula_8formula_9formula_10. "m"l determines how rapidly the complex phase increases around the z-axis. Without magnetic field, these orbitals all have the same energy, they are degenerate and can be combined into different shapes and spatial orientations. The orbitals in a subshell with degeneracy are called degenerate orbitals. This simply means that the orbitals in each p subshell all have the same energy level. The difference in shapes as well as orientation of higher formula_9 subshells is not important during general chemistry, and the orbitals in the same higher formula_9 subshells are still degenerate regardless of shape differences. Spin Quantum Number ("m"s). Does not determines the spin on the electron. +½ corresponds to the up arrow in an electron configuration box. If there is only one electron in an orbital (one arrow in one box), then it is always considered +½. The second arrow, or down arrow, is considered -½. Every orbital can contain one "spin up" electron, and one "spin down" electron. Some Examples. Let's examine the quantum numbers of electrons from a magnesium atom, 12Mg. Remember that each list of numbers corresponds to ("n", "l", "m"l, "m"s). The Periodic Table. Notice a pattern on the periodic table. Different areas, or blocks, have different types of electrons. The two columns on the left make the s-block. The six columns on the right make the p-block. The large area in the middle (transition metals) makes the d-block. The bottom portion makes the f-block (Lanthanides and Actinides). Each row introduces a new shell (aka energy level). Basically, the row tells you how many shells of electrons there will be, and the column tells you which subshells will occur (and which shells they occur in). The value of ml can be determined by some of the rules we will learn in the next chapter. The value of ms doesn't really matter as long as there are no repeating values in the same orbital.
1,197
Japanese/Vocabulary/Dates. This is a list of Japanese vocabulary for dates. It includes months, days, weeks and ect.
31
Scouting/BSA/Backpacking Merit Badge. Requirement 1. Show that you know first aid for injuries or illnesses that could occur while backpacking, including hypothermia, heatstroke, heat exhaustion, frostbite, dehydration, sunburn, insect stings, tick bites, snakebite, blisters, and hyperventilation. Requirement 2. Do one of the following: Requirement 3. Do one of the following: Requirement 4. Tell environmental considerations that are important for backpackers and describe five ways to lessen their impact on the environment. Describe proper methods for disposing of solid and liquid wastes. Requirement 5. Demonstrate two ways to purify water and tell why water purification is essential. Requirement 6. Demonstrate that you can read topographic maps. While on a hike, use a map and compass to establish your position on the terrain at random times and places. Requirement 7. Tell how to prepare properly for and deal with inclement weather while on a backpacking trek. Requirement 8. Do the following: Requirement 9. Do the following: Requirement 10. Take three backpacking treks. Each must consist of at least three days duration with two different overnight campsites, and each must cover at least 15 miles. Carry everything you will need throughout the trek. Requirement 11. Do five of the following:
348
Compiler Construction/Semantic Analysis. Semantic Analysis. This is roughly the equivalent of checking that some ordinary text written in a natural language (e.g. English) actually means something (whether or not that is what it was intended to mean). The purpose of semantic analysis is to check that we have a meaningful sequence of tokens. Note that a sequence can be meaningful without being correct; in most programming languages, the phrase "x + 1" would be considered to be a meaningful arithmetic expression. However, if the programmer really meant to write "x - 1", then it is not correct. Name Table. Time to read Aho & Ullman/Dragon book carefully. Semantic analysis is the activity of a compiler to determine what the types of various values are, how those types interact in expressions, and whether those interactions are semantically reasonable. For instance, you can't reasonably multiply a string by class name, although no editor will stop you from writing "abc" * MyClass To do this, the compiler must first identify declarations and scopes, and typically records the result of this step in a set of symbol tables. This tells it what specific identifiers means in specific contexts. It must also determine the types of various literal constants; "abc" is a different type than 12.2e-5. Then it must visit all locations where identifiers and literals are used, and verify that the use of the identifier/literal, and the results computed, are compatible with the language definition (as in the above example). As to how this is done: typically the source code is parsed, some representation of the program is constructed (syntax trees are very popular), and that representation is walked ("visited") element by element to collect/validate the semantic information. The symbol table is usually just a set of hash tables associated with the syntax tree representing a scope, hashing from identifiers to structures containing type declarations. Type Checking. In a statically typed language, immediately following the parsing phase is the type checking phase. This attempts to catch programming errors based on the theory of types. In practice this is checking things like a variable declared as a string is not used in an expression requiring an integer. In a dynamically typed language no type checking is performed (it is actually deferred until runtime).
502
Cryptography/Digital signatures. As of 2014, installing apps is probably the most common way people use digital signatures. Both Android and iOS require an app to be digitally signed before it can be installed. Cryptography is generally used to provide some form of assurance about a message. This assurance can be one or more of four general forms. These forms are message "confidentiality", "integrity", "authentication", and "non-repudiation". Up until the advent of public key encryption, cryptography was generally only used to provide confidentiality, that is, communications were encrypted to keep their contents secret. This encryption generally implies the sender to know the scheme and key in use, and therefore provides some rudimentary authentication. Modern digital signatures are much better at providing the assurance of authentication, integrity, and non-repudiation than historical symmetric-key encryption schemes. Digital signatures rely on the ability of a public-key signing algorithm to sign a message—to generate a signature from the message with a private key. Later, anyone with that signature can verify the message using the corresponding public key. (This uses the keys in the opposite order as public-key encryption and public-key decryption to provide confidentiality—encryption with a public key and decryption only with the private key). However, to provide digital signing, a signer must use his private key to sign the message—or some representation of the message—that he wants to sign with his private key, so that anyone who knows his public key can use it to verify that only his private key could have signed that message. There are a number of relevant details to proper implementation. First, the signature itself is useless if the recipients do not have a verified copy of the signer's public key. While perhaps the best method for exchanging that key would be to meet face-to-face, this is often not possible. As a result, many public key infrastructures require the creation of a Certificate Authority whose public key is pre-shared via some trusted method. An example of this would be SSL CA's like VeriSign, whose certificates are pre-installed in most popular browsers by the computer manufacturer. The CA is what's known as a "Trusted Third Party", an individual or organization who is trusted by all parties involved in the encrypted communications. It is the duty of this organization to keep its private key safe and secret, and to use that key to sign public keys of individuals it has verified. In other words, in order to save the trouble of meeting face-to-face to exchange keys with every individual you wish to communicate with, you might engage the services of a trusted third party whose public key you already have to go meet these individuals face-to-face. The third party can then sign the public keys and send them along to you, so that you end up with a verified copy without the trouble of exchanging each key pair face-to-face. The details of signing itself we will get to in a moment. An alternative method commonly used for secure e-mail transmission via PGP or GPG is known as a "web of trust". A web of trust is similar to the creation of a certificate authority, with the primary difference being that it is less formal. Rather than creating an organization to act as a trusted third party, individuals will instead sign keys of other individuals they have met in person. In this manner, if Alice has Bob's key, and Bob signs Charlie's key, Alice can trust Charlie's key. Obviously, this can be extended over a very complex web, but this ability is also a great weakness; one compromised individual in the web—the weakest link in the chain of trust—can render the rest useless. The actual implementation of signing can also vary. One can sign a message simply by encrypting it with his private key—it can be decrypted by his public key, and the act of valid encryption can only be performed by that secret key, thus proving his identity. However, often one may want to sign but not encrypt messages. To provide this functionality at a base level, one might send two copies of the message, one of which would be encrypted. If a reader wishes to verify that the unencrypted message he has read is valid, he can decrypt the duplicate and compare the two. However, even this method is cumbersome; it doubles the size of every message. To avoid this drawback, most implementations use Hash Functions to generate a hash of the message, and use the private key to encrypt that hash. This provides nearly the same security as encrypting a duplicate, but saves space. Many early explanations of public-key signature algorithms describe public-key signing algorithms as "encrypt a message with a private key". Then they describe public-key message verify algorithms as "decrypt with the public key". Many people prefer to describe modern public-key cryptosystems as having 4 independent high-level functions—encrypt, decrypt, sign, verify—since none of them (if properly padded to avoid chosen-ciphertext attacks) can be substituted for any of the others.
1,100
C Sharp Programming. C# (pronounced "C Sharp"||"C#") is a multi-purpose computer programming language suitable for a wide variety of development needs. This Wikibook introduces C# language fundamentals and covers a variety of the base class libraries (BCL) provided by the Microsoft .NET Framework. Introduction. Although C# is derived from the C programming language, it introduces some unique and powerful features, such as delegates (which can be viewed as type-safe function pointers) and lambda expressions which introduce elements of functional programming languages, as well as a simpler single class inheritance model (than C++) and, for those of you with experience in "C-like" languages, a very familiar syntax that may help beginners become proficient faster than its predecessors. Similar to Java, it is object-oriented, comes with an extensive "class library", and supports exception handling, multiple types of polymorphism, and separation of interfaces from implementations. Those features, combined with its powerful development tools, multi-platform support, and "generics", make C# a good choice for many types of software development projects: rapid application development projects, projects implemented by individuals or large or small teams, Internet applications, and projects with strict reliability requirements. Testing frameworks such as NUnit make C# amenable to test-driven development and thus a good language for use with Extreme Programming (XP). Its strong typing helps to prevent many programming errors that are common in weakly typed languages.
326
Cryptography/Breaking Vigenère cipher. Plain text is encrypted using the Vigenère cipher by first choosing a keyword consisting of letters from the alphabet of symbols used in the plain text. The keyword is then used to encrypt the text by way of the following example. Using: Plain text: I Like A Book and choosing: Keyword: cta 1. Map all the plain text to numbers 0-25 or however long your alphabet is ilikewikibooks converts to 8 11 8 10 4 22 8 10 8 1 14 14 10 18 2. Map your keyword to numbers the same way cta maps to 2 19 0 3. add your key to your plain text in the following manner 8 11 8 10 4 22 8 10 8 1 14 14 10 18 2 19 0 2 19 0 2 19 0 2 19 0 2 19 resulting in 10 30 8 12 23 22 10 29 8 3 33 14 12 37 4. take each resulting number mod 26 ( or for the general case mod the number of characters in your alphabet) resulting in 10 4 8 12 23 22 10 3 8 3 7 14 12 11 5. map each number back to a letter to get the resulting cypher text keimxwkdidhoml The message can easily be decrypted with the keyword by reversing the above process. The keyword can be any length equal to or less than that of the plain text. Without the keyword the primary method of breaking the Vigenère cipher is known as the Kasiski test, after the Prussian major who first published it. The first stage is determining the length of the keyword. Determining the key length. Given an enciphered message such as: Plaintext: TOBEORNOTTOBE Keyword: KEYKEYKEYKEYK Ciphertext: DSZOSPXSRDSZO Upon inspection of the ciphertext, we see that there are a few digraphs repeated, namely DS, SZ, and ZO. It is statistically unlikely that all of these would arise by random chance; the odds are that repeated digraphs in the ciphertext correspond to repetitions in the plaintext. If that is the case, the digraphs must be encoded by the same section of the key both times. Therefore, the length of the key is a factor of the distance in the text between the repetitions. The common factors (indeed, the only factors in this simple example) are 3 and 9. This narrows down the possibilities significantly, and the effect is even more pronounced with longer texts and keys. Frequency analysis. Once the length of the key is known, a slightly modified frequency analysis technique can be applied. Suppose the length of the key is known to be three. Then every third letter will be encrypted with the same letter of the key. The ciphertext can be split into three segments - one for each key letter—and the procedure described for the Caesar cipher can be used.
773
Introduction to Philosophy/What is Metaphysics. The branch of philosophy called "metaphysics" concerns itself with the nature of reality itself. It is in this branch that the fundamental questions of our existence and our universe reside. For example, is our perception of time real, or is it merely an illusion? Are there fundamental properties that all things that exist must have? What does it mean for something to "exist"? Does an abstract thing, such as a number, or the Mandelbrot set, fundamentally "exist" in the same way our universe does? What are properties, anyway? What is a person, or "the self", really? Do we have "free will"? These difficult questions, which in and of themselves already build on assumptions, are often brushed against within contemporary physics. Importantly, however, they are not quite the same. The behavior of time, for example, can be described by using Einstein's theories of relativity, entropy, and so forth. However, these "physical" theories merely describe the behavior of observed phenomena, and can be proven or disproven by comparing them to these observations. Metaphysics goes beyond what we can observe or infer from observations, and asks questions about the fundamental nature of reality and the potential implications this would have. This gives it a bit of a risk to be rather vague. After all, with no way to test any of the answers, how can we know if something is true or not? The only way we can is to use rigorous logic. For a select few questions, this will allow us to rule out certain worldviews, such as when this results in a paradox. But unfortunately, most of the time, metaphysics will yield us no concrete answers. Instead, we must apply what we have done so far: start with a few core assertions, and explore the implications of these. If it results in a contradiction, then we can reject the set of assertions. However, if not, that is not proof of their truthfulness either. In this way, we can create many possible, self-consistent and competing worldviews, and assign a value of confidence to each. For example, it may be the case that you, the reader, are just a brain in a vat and stuck inside a simulation. Although potentially perfectly self-consistent, using the things we learned from epistemology, it may be better to only give this a small likelihood of being true, even if we cannot fully rule it out. It is not inconceivable that questions that are now firmly within metaphysics will enter physics later down the line. The theory that all matter is composed of tiny particles called atoms was considered metaphysics at one time. When people began to invent instruments capable of detecting such tiny things, atomic theory moved out of metaphysics into physics. So metaphysics is always "at the frontier", and some of it may become physics in the future. The definition of metaphysics. Although we have given a hint at what metaphysics is, it is hard to define concretely. The term itself can be interpreted as meaning "beyond physics", but it's tricky to get more precise without inviting controversy. Early use of the term simply referred to the topics covered by the work placed "after" (hence "meta") the "Physics" section in the traditional edit of Aristotle's works by the Greek Peripatetic philosopher Andronicus Of Rhodes. Perhaps it is better, then, to look at what metaphysics is "not". Newton's theories about gravity, Einstein's theories of relativity, and most of the work on quantum mechanics are clearly not metaphysics. These theories make specific predictions about observable phenomena, and can be disproven when shown not to match these observations. Religion is also not metaphysics. Religion is based on a set of convictions that may well make predictions about the world, or explain why certain phenomena occur, but they do so by authoritatively asserting a single worldview regardless of its logical integrity. Metaphysics, as a branch of philosophy, is bound by using logic and reason to approach each question, speculatively and critically examining different options side-by-side. This raises another interesting problem for metaphysics: it may often tread on sacred ground and come into conflict with religion. Socrates was one casualty of this tendency. These considerations give us some boundaries, and we can define metaphysics more readily inside those boundaries. Metaphysics is concerned with explaining the way things "are" in the physical world. It is concerned primarily with 'being as being', i.e. with anything in so far as it has act of existence. However, metaphysics is not concerned with examining the physical properties of things that exist, but is, instead, the study of the underlying principles that give rise to the unified natural world. As such, the statement that "evil does not exist" is metaphysical because it is a statement that deals with the object 'evil' as opposed to 'good' which is a metaphysical subject, whereas the statement that "all things are composed of atoms, which are in turn composed of electrons, protons, and neutrons" is definitely not metaphysics, utmost a concern of physical sciences. Dinstinguishing metaphysical questions from physical questions. Metaphysics is a branch of philosophy, and part of the answer to the question "What is Metaphysics" requires us to define the difference between science and philosophy. 'Science' is taken here as empirical sciences or non-empirical sciences. In physical science, it's important for new explanations to make predictions that can be tested by experiments. But this is not a requirement of philosophy, specifically that of metaphysics. Instead, we reduce any philosophical statement to its ultimate concept or propositions. The ultimate concept of metaphysics is being while that of propositions is the principle of contradiction. In the case of the above statement that all things are made up of smaller things and so on to infinity, this explanation is clearly untestable because we'll never have an instrument capable of detecting anything that is infinitely small. But then, metaphysically, one can be sure that it is impossible to have an infinite regression of materiality but must arrive at the ultimate or smallest particle of matter. But then, the philosopher can further ask: What is the ultimate composition of matter?" this time the answer cannot be anymore 'the smallest particle of matter' since the smallest particle of matter is matter also. Thus, Thales' question: 'What is the ultimate stuff?' is a metaphysical question, and not an empirical one. His question separated physical science from philosophy. Aristotle offered an answer: his hylomorphic doctrine which states that any material reality is ultimately composed of prime matter (not the matter as we know it) and substantial form. Metaphysics is not religion because religion involves act of faith, faith guiding reason. In case of metaphysics, it limits its certitude on reason alone. In summary, here is one answer to the question "What is Metaphysics?": "Metaphysics is not the branch of philosophy that explains physical phenomena using reason and logic in a way that falls outside the bounds of either religion or science, rather it is a philosophical science which deals with transcendental concepts such as being, one, true and good which in its simplest form is 'being as such'. What really makes Metaphysics hard to define is its object: being. Being cannot be defined properly, but only descriptively."
1,669
General Relativity/Notes to GR editors. Since I am sure I'm not the only one who will be editing this page, let's agree on some standards so that everything is cohesive. Here are my suggestions: 1. Certainly we should use follow the Einstein summation convention. 2. Let's agree to use the same signature for the Minkowski metric. I propose the formula_1 signature, i.e., the Minkowski metric formula_2 is given by formula_3. E-mail me or edit the discussion page if you have questions or comments.
128
General Relativity/Einstein Summation Notation. <General Relativity In the last sections we talked about a number of operations involving tensors. One of them is to take a covariant vector and a contravariant vector and turn them into a scalar. Another is to get a contravariant vector and put it into a tensor and get out a force. Since we want to do math with these, let us try to see how we can represent these. We take as an example trying to combine a contravariant vector (v) which represents the direction and speed we are travelling in and a covariant vector (w) which represents the rate of "distance" at which a temperature is changing in a certain direction. We want to get the scale invariant quantity describing the rate of "time" at which the temperature is changing as we move in direction v. Now we could do it really abstractly. For example if we want to combine a contravariant tensor and covariant tensor to get a scalar we could write... formula_1 This is just our old friend the dot product. This has the advantage that it is short and simple to write. However, the problem with this is that it doesn't let us know what f, v, and w are. f is a scalar. v is a contravariant tensor. w is a covariant tensor. This wasn't a problem in basic vector calculus, where we just had to deal with scalars and vectors. But it is a problem now that our mathematical zoo has more animals. The next approach would be to write everything as a component. So we have formula_2 The trouble with this is that it is a lot of typing of the same numbers, over and over again. Lets write it out in summation notation. formula_3 Better... But that summation sign, do we really want to write it over and over and over and over? What does it give us? We can be really clever and just write formula_4 and just know that when we see the same index on top and on the bottom, we mean to take a sum. This is called Einstein summation notation. Whenever one sees the same letter on both superscript ("upper") indices and subscript ("lower") indices in a product, one automatically sums over the indices. Note that in GR, indices usually range from 0 to 3. (Note: Greek letters typically range from 0 to 3, while Roman letters range from 1 to 3). Here are some more examples of the Einstein summation notation being used: 1. formula_5 2. formula_6 etc. (16 terms total) 3. formula_7 Identities. Several identities arise from indicial notation. Since formula_8 if formula_9,
641
Statistics/Summary/Averages. Averages. An average is simply a number that is representative of data. More particularly, it is a measure of central tendency. There are several types of average. Averages are useful for comparing data, especially when sets of different size are being compared. It acts as a representative figure of the whole set of data. Perhaps the simplest and commonly used average the arithmetic mean or more simply which is explained in the next section. Other common types of average are the median, the mode, the geometric mean, and the harmonic mean, each of which may be the most appropriate one to use under different circumstances. Statistics | Summary Statistics | » Mean, Median and Mode
152
Prolog/Variables. A PROLOG variable can represent anything; a number, a name, a structure, an array, something as complicated as the known universe. A PROLOG program works by constraining the variables until eventually they have particular values; then telling you what the values are. A simple program might be X is 3+2. and when you run it, the result will be X=5 Yes. The program might not go as far as to constrain the variables to have exact values, so you might get equal(A,A). % Explains that things are equal to themselves X is 3+2, equal(f(X,Z),Y). X=5 Y=f(5,_) Yes where the '_' means that you have a variable remaining as part of the solution. You can also get a 'Yes' result for more than one value of the variables; this is called 'nondeterminism', and is OK. If no values of the variables will make a solution, PROLOG will say 'No'. prev: Recursive Rules next: Lists
247
Statistics/Summary/Averages/mean. Mean, Median and Mode. Mean. The mean, or more precisely the arithmetic mean, is simply the arithmetic average of a group of numbers (or data set) and is shown using -bar symbol formula_1. So the mean of the variable "formula_2" is formula_3, pronounced ""x"-bar". It is calculated by adding up all of the values in a data set and dividing by the number of values in that data set Here is a more complicated data set: {10,14,86,2,68,99,1}. The mean would be calculated like this: Median. The median is the "middle value" in a set. That is, the median is the number in the center of a data set that has been ordered sequentially. For example, let's look at the data in our second data set from above: {10,14,86,2,68,99,1}. What is its median? Because our data set had an odd number of points, determining the central position was easy - it will have the same number of points before it as after it. But what if our data set has an even number of points? Let's take the same data set, but add a new number to it: {1,2,10,14,68,85,99,"100"} What is the median of this set? When you have an even number of points, you must determine the "two" central positions of the data set. (See side box for instructions.) So for a set of 8 numbers, we get (8 + 1) / 2 = 9 / 2 = 4 1/2, which has 4 and 5 on either side. Looking at our dataset, we see that the 4th and 5th numbers are 14 and 68. From there, we return to our trusty friend the mean to determine the median. (14 + 68) / 2 = 82 / 2 = 41. find the median of 2, 4, 6, 8 => firstly we must count the numbers to determine its odd or even as we see it is even so we can write: M=(4+6)/2=10/2=5 5 is the median of above sequential numbers. Mode. The mode is the most common or "most frequent" value in a data set. Example: the mode of the following data set (1, 2, 5, 5, 6, 3) is 5 since it appears twice. This is the most common value of the data set. Data sets having one mode are said to be unimodal, with two are said to be bimodal and with more than two are said to be multimodal . An example of a unimodal dataset is {1, 2, 3, 4, 4, 4, 5, 6, 7, 8, 8, 9}. The mode for this data set is 4. An example of a bimodal data set is {1, 2, 2, 3, 3}. This is because both 2 and 3 are modes. Please note: If all points in a data set occur with equal frequency, it is equally accurate to describe the data set as having many modes or no mode. Midrange. The midrange is the arithmetic mean strictly between the minimum and the maximum value in a data set. Relationship of the Mean, Median, and Mode. The relationship of the mean, median, and mode to each other can provide some information about the relative shape of the data distribution. If the mean, median, and mode are approximately equal to each other, the distribution can be assumed to be approximately symmetrical. If the mean > median > mode, the distribution will be skewed to the right. If the mean < median < mode, the distribution will be skewed to the left. Questions. 1. There is an old joke that states: "Using median size as a reference it's perfectly possible to fit four ping-pong balls and two blue whales in a rowboat." Explain why this statement is true.
968
Statistics/Summary/Averages/Geometric Mean. Statistics | Mean Geometric Mean. The Geometric Mean is calculated by taking the "n"th root of the product of a set of data. formula_1 For example, if the set of data was: 1,2,3,4,5 The geometric mean would be calculated: formula_2 Of course, with large "n" this can be difficult to calculate. Taking advantage of two properties of the logarithm: formula_3 formula_4 We find that by taking the logarithmic transformation of the geometric mean, we get: formula_5 Which leads us to the equation for the geometric mean: formula_6 When to use the geometric mean. The arithmetic mean is relevant at any time several quantities add together to produce a total. The arithmetic mean answers the question, "if all the quantities had the same value, what would that value have to be in order to achieve the same total?" In the same way, the geometric mean is relevant any time several quantities multiply together to produce a product. The geometric mean answers the question, "if all the quantities had the same value, what would that value have to be in order to achieve the same product?" For example, suppose you have an investment which returns 10% the first year, 50% the second year, and 30% the third year. What is its average rate of return? It is not the arithmetic mean, because what these numbers mean is that on the first year your investment was multiplied (not added to) by 1.10, on the second year it was multiplied by 1.50, and the third year it was multiplied by 1.30. The relevant quantity is the geometric mean of these three numbers. Written by Hafiz G m It is known that the geometric mean is always less than or equal to the arithmetic mean (equality holding only when A=B). The proof of this is quite short and follows from the fact that formula_7 is always a non-negative number. This inequality can be surprisingly powerful though and comes up from time to time in the proofs of theorems in calculus. Source.
493
General Relativity/Authors. Brad Lathem () Roadrunner ()
16
Serial Programming. This book explains different aspects of serial data communication. Serial data communications is the foundation for most forms of data communications used with modern computing devices. The focus of the articles in this book will be around the implementation of RS-232 (aka RS-232C, aka V.24, aka EIA-232D, etc.) based serial data communication and will explore a wide range of implementations and uses for serial data transfer. Resources. See for other kinds of low-level serial interface hardware that typically have the same high-level programming interface as RS-232 (RS-422, RS-423, RS-449, RS-485, MIL-STD-188, Universal Serial Bus (USB), etc.) and hardware that happens to be serial (Serial ATA, Wifi, Ethernet, etc), although it usually uses a very different high-level protocol. External Links to Resources. __NOEDITSECTION__
226
General Relativity/Contravariant and Covariant Indices. < General Relativity Rank and Dimension. Now that we have talked about tensors, we need to figure out how to classify them. One important characteristic is the rank of a tensor, which is the number of indicies needed to specify the tensor. An ordinary is a rank 2 tensor, a vector is a rank 1 tensor, and a scalar is rank 0. Tensors can, in general, have rank greater than 2, and often do. Another characteristic of a tensor is the dimension of the tensor, which is the count of each index. For example, if we have a matrix consisting of 3 rows, with 4 elements in each row (columns), then the matrix is a tensor of dimension (3,4), or equivalently, dimension 12. The important thing about rank and dimension is that they are invariant to changes in the coordinate system. You can change the coordinate system all you want, and the rank and the dimensions don't change. This brings up the important question of how tensors do change when you change the coordinate system. One thing we shall find when we look at the question is that in reality there are two different types of vectors. Contravariant and Covariant Vectors. Imagine that you are flying a bomber at 1,000 kilometers per hour to the east, or along the positive x-axis. We shall call your velocity vector v. For now, we will keep the vectors one-dimensional. Suddenly you realize that you are in a meter-ish mood and so we want to figure out how fast you are going using meters instead of kilometers. Quickly changing your coordinate system, you find that you are traveling 1000 * 1000 = 1000 000 meters per hour easterly. We will call this vector v'. No problem. Now you decide to climb, and you notice the temperature changing. We then draw a map of how the temperature changes as we fly. We then travel along the path of steepest ascent, or fastest cooling. At our current position, the temperature falls at 10 Celsius degrees per kilometer toward the east. Let's call this temperature gradient vector w. Again, you go into a meter-ish mood. Doing a quick calculation you figure out that the gradient of the temperature change is -10/1000 = -.01 Celsius degrees per meter. We shall call this vector w'. Did you notice something interesting? Even though we are talking about two vectors we are treating them very differently when we change our coordinates. In the first case, the vector reacted to the coordinate change by a multiplication. That is to say, v'=k•v. In the second case, we did a division: w'=1/k•w. The first case we were changing a vector that was distance per something, while in the second case, the vector was something per distance. These are two very different types of vectors. The graphic below depicts the vectors representing v, v', w, and w' The mathematical term for the first type of vector is called a contravariant vector. The second type of vector is called a covariant vector. Sometimes a covariant vector is called a one form. These are, of course, just fancy mathematical names. As we can see contravariant vectors and covariant vectors are very different from each other and we want to avoid confusing them with each other. To do this mathematicians have come up with a clever notation. The components of a contravariant vector are represented by superscripts, while the components of a covariant vector are represented by subscripts. So the components of vector v are v1 and v2 while the components of vector w are w1 and w2. Scale Invariance. Now that we have contravariant vectors and covariant vectors, we can do something very interesting and combine them. We have a contravariant vector that describes the direction and speed at which we are going. We have covariant vector that describes the rate and direction at which the temperature changes. If we combine them using the dT/dt = 1000 · -10 = -10000 degrees Celsius per hour we get the rate at which the temperature changes, "f", as we move in a certain direction, with units of degrees Celsius per hour. The interesting thing about the units of "f" is that they do "not" include any units of distance, such as meters or kilometers. So now suppose we "change" the coordinate system from meters to kilometers. How does "f" change? dT/dt = 100,0000 · -.01 = -10000 degrees Celsius per hour It doesn't. We call this characteristic scale invariance, and we say that "f" is a scale invariant quantity. The value of "f" is "invariant" with changes in the "scale" of the coordinate system. Now so far we have been treating w as if it were just an odd type of vector. But there is a another more powerful way of thinking about w. Look at what we just did. We took v, combined it with w and got something that doesn't change when you change the coordinate system. Now one way of thinking about it is to say that w is a function, that takes v and converts it into a scale invariant value, "f". In plainspeak, w would be the function that takes in any velocity of a particle and produces the change in temperature that the particle experiences each hour (for the specific temperature field declared earlier). Vector Spaces and Basis Vectors. This fact that a covariant vector like w can convert any contravariant vector like v into a scale invariant value like "f" is summarized by saying that w is a linear functional. Let us be more precise about the word "like". Mathematical operations, such as "converting one sort of vector into another sort of vector", are done on vector spaces. See vector space for a careful definition of vector spaces. Here, loosely speaking, let us say that a vector space is a set of vectors which can be added together and multiplied by numbers and that the result is always another vector in the same vector space. Let us define formula_3 to be the vector space of contravariant vectors like v. Then, the set of all covariant vectors like w, which convert vectors like v from formula_3 into scalars like "f", which we can also call the set of all linear functionals w on formula_3, can be given the name formula_6, which we call the dual space. formula_6 is also a vector space. Remember, we can view w as a vector or as a function, depending on which of its properties we wish to emphasize. Now we can be more careful about the word "like" by saying which spaces w and v must be a member of: any vector w in formula_6 (called a covariant vector, or a 1-form) can convert any vector v in formula_3 (called a contravariant vector) into a scale invariant value like "f". (We have not said what space or set "f" is a member of: in practice, we will usually only be interested in "f" as a member of the set of real numbers.) Any vector space has a set of basis vectors. That is to say, if formula_10, then formula_11 may be written as formula_12 where, Note that although components of contravariant vectors are written with superscript ("upper") indices, the basis vectors are written with subscript ("lower") indicies. If the set {formula_15} is a basis for formula_3, then formula_10 is written as the linear combination formula_21. (We are using Einstein summation notation, detailed in the next section; this is shorthand for formula_22.) Before moving on to covariant vectors, we must define the notion of a dual basis. Remember that elements of formula_6 are linear functionals on formula_3. So we can "apply" covariant vectors to contravariant vectors to get a scalar. For example, if formula_25 and formula_10, then formula_27 returns a scalar. Now, the dual basis is defined as follows: if {formula_15} is a basis for formula_3, then the dual basis is a basis {formula_30} for formula_6 which satisfies formula_32 (where formula_33 is the Kronecker delta) for every formula_34 and formula_35. Now, the components of covariant vectors are written with subscript ("lower") indices. As {formula_30} is a basis for formula_6, we can write a covariant vector formula_38 as formula_39. We can now evaluate any functional (covariant vector) applied to any vector (contravariant vector). If formula_25 and formula_10, then by linearity formula_42. Finally, if we define formula_43, we see that formula_44.
2,060
Managerial Economics/Cash Flow. The basics of cash flow can be summed up by the concept of time value of money. This concept is the idea that having money now is better than money in the future, since you can spend it or put it to use. As a result you should be compensated for the time you do not have the use of your money. To make equivalent the differences in time we use a flip sided principle knows as discounting (bringing future cash flows to the present) or income (taking present values to the future). The rate of change required to make cash flows equivalent over time periods is known as the discount rate (both i d and r are common variables for the discount rate, although i is usually reserved for inflation). This rate can change with time or for different people. Imagine how high your discount rate would be if you had won a large cash prize in a radio contest, but had to phone the station within a minute and had no quarters. The time that cash flows are discounted to sets a frame of reference for series of cash flows. This time is usually known as t0 pronounced "t not." While any frame of reference can be chosen the most common reference time is now. In retirement problems the frame of reference can be the date of retirement. The basic cash flow equation is FV=PV*(1+r)^t, where FV is the future value (time at some future time), PV is the present value (value at t0, r is the discount (interest) rate, and t is the time between the future value and present value. The units of time do not matter, but must be the same as the period rate in which r is quoted. Both are usually in annual terms. An example of this is the future value of $100 in one year with a discount rate of 5%. To solve this problem you would evaluate the following statement: FV=$100*(1+0.05)^1 FV=$100*1.05 FV=$105 See that was pretty easy wasn't it. All of finance can be summed up with variants of that basic formula. According to this principle, if a decision affects costs and revenues in long-run, all those costs and revenues must be discounted to present values before valid comparison of alternatives is possible. This is essential because a rupee worth of money at a future date is not worth a rupee today. Money actually has time value. Discounting can be defined as a process used to transform future dollars into an equivalent number of present dollars. For instance, $1 invested today at 10% interest is equivalent to $1.10 next year.
584
Serial Programming/Introduction and OSI Model. Introduction. Welcome to the wonderful world of serial data communications. This is a part of a series of articles that will cover many aspects of serial data communications. We begin with fundamentals and follow a layered approach. By the end of the book, the reader should be able to transfer almost any data over wires between computers. Some forms of wireless communication will also be addressed. There are so many aspects about this subject that sometimes it is a very hard nut to crack. I'm going to dive down and try to start with the basics and introducing the RS-232 serial data communications standard. Why Serial Communication? First of all, the basic standards that will be described here are, from the perspective of computer technology, positively ancient. Some of you reading this could perhaps find your grandparents or even great-grandparents using this protocol when they were in College. At the same time, it is so solid in concept that the reason for abandoning it should always be questioned. Indeed, there have been several other data transmission methods that have been developed since the RS-232 serial data protocol was established, but this workhorse is still widely used and seems to go through a rebirth every once in a while. Serial communication means transmission of one bit at a time. It could be compared against parallel communication where multiple bits are transmitted in parallel at a time. Parallel communication enable higher speed of communication than serial communication but requires more data wires than serial communication which only requires one data wire. When all else fails, RS-232 serial communication can be relied upon. When you are trying to get two pieces of computer equipment together, sometimes newer communications methods have hard limitations that can't be worked out due to number of connections, RF interference, distance limitations, being behind physical barriers, in sensitive areas like medical equipment where stray voltages can be a problem, or that you absolutely need to rely upon the data being transmitted. A sister protocol to RS-232, the RS-422 protocol, even allows transmissions for several miles of cable. Serial data communication is widely implemented. While it is sometimes presumed that a PC can deal with just about any problem you want to throw at it, there are a number of electronic devices that are full of data which needs to be recorded. In part because of the age of this protocol, there are many legacy devices that have RS-232 serial data as the only access to the outside world. But even many of the latest network devices have RS-232 "console" ports to facilitate initial configuration and provide a means of troubleshooting when the network itself is broken. Because the hardware is so widely implemented and available, together with many software tools, it is also relatively cheap to develop equipment and software using this system. Particularly when transmission speed isn't important, but data needs to be sent on a regular basis. RS-232 serial data is a very reasonable solution instead of a more expensive 10BASE-T TCP/IP solution or high-speed fiber optics. Serial data communication is also versatile. While the usual method of transmission is over copper wires between two fixed points, recently there have been some converters that transmit serial data over fiber optic lines, wireless transmitters, USB devices, and even over TCP/IP networks. What is really surprising here is that all of these transmission methods are totally transparent to the device receiving or transmitting the serial data. It can also be a carrier for TCP/IP, and be used for private networks. OSI Layered Network Communications Model. While serial data communication is not strictly a network communication protocol, it is still important to understand the layered communications model when dealing with any sort of communications protocols. Often people implementing serial data software have to build multiple layers of this model, even if they are not totally aware of it when they are doing it at the time. Network Layers: Often serial data communication does not implement all of these different layers, and even more often these different layers are combined in the same module or even the very same function. This model was originally developed by the International Organization for Standards (ISO) in 1984 to help give a good idea of where different networking structures could be separated and intermingled. The point here is to know that you can separate different parts of communications sub-systems to help with the debugging process, and to move structures from one sub-system to another. If your software is well written using a model similar to this one, the software subroutines in layers above and below do not have to be rewritten if the module at a particular layer is changed. To achieve this you need to establish strong standards for the interface between the layers, which will be covered in other sections of these articles. For example, a web browser does not need to know if the HTML is being sent over fiber optic cables, wireless transmissions, or even over a serial data cable. Serial Communication Layers. For serial data communication, I see this layer model as more common: In the case of many serial data applications, not all of these layers are implemented. Often it is just raw packets being transmitted in one direction, but sometimes even just a signal of any kind can indicate some action take place on a computer, regardless of content. It is possible to simply take the logic level of a raw RS-232 signal in your software, but at some point the data does need to be converted and the voltages involved with RS-232 can damage hardware, so this is very seldom done. Software Examples. I don't want to get into a holy war over programming languages with this series of articles. For the moment, I'm going to be using Turbo Pascal and Delphi as the programming languages, if for no other reason then the fact that I am most comfortable programming in this development environment. If a good C/C++ guru would like to "translate" these routines, I would welcome that, as well as other programming languages where applicable. Serial communication is complicated enough so please avoid esoteric languages like Intercal or Malbolge. A good BASIC implementation would be welcome, as would LISP. I'll try to avoid language-specific features and simply deal with functions in a generic sense, which good programmers should be able to translate to the language of their choice. These articles are meant to teach you the basics of serial data communication, not to be a functioning serial data driver. Still, all code examples will be checked and sent through an actual compiler before being listed in the articles, and hopefully fully debugged. There is no one single way to accomplish these steps and tasks, so I am going to encourage a hands-on approach to dealing with software and setting up networks. While I've had quite a bit of experience in dealing with several serial data protocols (on the packet level), I am by no means the topmost expert at this. As I said earlier, I have considerable experience in dealing with communications at many levels, and I'd like to share some of my very hard-won knowledge. Applications in Education. While I am only a Software Engineer and don't have the "formal" credentials necessary for making an educational textbook, I do believe that there is much that could be taught about computer networking by students experimenting with serial data communication. The audience that I am aiming for with these articles are the High School hackers/computer geeks and undergraduate CS majors. A High School teacher that wanted to tackle a subject like this, or if you wanted to cover a special topic course in a university setting where students could get some very hands-on experience with communications protocols. Every layer of the OSI model could be demonstrated in a manner that students would learn from first-hand experiences why certain rules/systems have been implemented on the Internet, what standards documents mean, and perhaps even participate in creating standards documents. If you are a professor or High School instructor interested in using this text, I would be particularly interested in adapting this text to better suit your needs, or working with you in covering this subject. From a professional perspective, this is a topic that is seldom taught at a university, and usually only in passing when they are rushing through a whole bunch of other protocol suites. Software developers are usually introduced to this topic by having their supervisor dump a bunch of specification documents on their desk, a driver disk with API documentation, and perhaps a typically short deadline in order to get something working that should have been working sometime last year. Software developers who really understand serial data communication are worth gold, and often even these developers only learn just enough to get the immediate job done. I've also found that skills learned from developing serial data communications also translate into other projects and give a deeper understanding of just about any data transmission system. In addition to the other groups I mentioned, I am also aiming for those unfortunate software engineers who are trying to learn just about anything about this very difficult subject and don't know where to begin. Documentation about serial communication is sparse, and sometime contradictory. This doesn't have to be that complicated of a subject, and it is possible for mere mortals to be able to understand how everything works.
1,979
Statistics/Summary/Variance. Measure of Scale. When describing data it is helpful (and in some cases necessary) to determine the "spread" of a distribution. One way of measuring this spread is by calculating the variance or the standard deviation of the data. In describing a complete population, the data represents all the elements of the population. As a measure of the "spread" in the population one wants to know a measure of the possible distances between the data and the population mean. There are several options to do so. One is to measure the average absolute value of the deviations. Another, called the variance, measures the average square of these deviations. A clear distinction should be made between dealing with the population or with a sample from it. When dealing with the complete population the (population) variance is a constant, a parameter which helps to describe the population. When dealing with a sample from the population the (sample) variance is actually a random variable, whose value differs from sample to sample. Its value is only of interest as an estimate for the population variance. Population variance and standard deviation. Let the population consist of the N elements x1...,xN. The (population) mean is: The "(population) variance" σ2 is the average of the squared deviations from the mean or (xi - μ)2 - the square of the value's distance from the distribution's mean. Because of the squaring the variance is not directly comparable with the mean and the data themselves. The square root of the variance is called the Standard Deviation σ. Note that σ is the root mean squared of differences between the data points and the average. Sample variance and standard deviation. Let the sample consist of the n elements x1...,xn, taken from the population. The (sample) mean is: The sample mean serves as an estimate for the population mean μ. The "(sample) variance" "s"2 is a kind of average of the squared deviations from the (sample) mean: Also for the sample we take the square root to obtain the (sample) standard deviation "s" A common question at this point is "why do we square the numerator?" One answer is: to get rid of the negative signs. Numbers are going to fall above and below the mean and, since the variance is looking for distance, it would be counterproductive if those distances factored each other out. Example. When rolling a fair die, the population consists of the 6 possible outcomes 1 to 6. A sample may consist instead of the outcomes of 1000 rolls of the die. The population mean is: and the population variance: The population standard deviation is: Notice how this standard deviation is somewhere in between the possible deviations. So if we were working with one six-sided die: "X" = {1, 2, 3, 4, 5, 6}, then σ2 = 2.917. We will talk more about why this is different later on, but for the moment assume that you should use the equation for the sample variance unless you see something that would indicate otherwise. Note that none of the above formulae are ideal when calculating the estimate and they all introduce rounding errors. Specialized statistical software packages use more complicated logarithms that take a second pass of the data in order to correct for these errors. Therefore, if it matters that your estimate of standard deviation is accurate, specialized software should be used. If you are using non-specialized software, such as some popular spreadsheet packages, you should find out how the software does the calculations and not just assume that a sophisticated algorithm has been implemented. For Normal Distributions. The empirical rule states that approximately 68 percent of the data in a normally distributed dataset is contained within one standard deviation of the mean, approximately 95 percent of the data is contained within 2 standard deviations, and approximately 99.7 percent of the data falls within 3 standard deviations. As an example, the verbal or math portion of the SAT has a mean of 500 and a standard deviation of 100. This means that 68% of test-takers scored between 400 and 600, 95% of test takers scored between 300 and 700, and 99.7% of test-takers scored between 200 and 800 assuming a completely normal distribution (which isn't quite the case, but it makes a good approximation). Robust Estimators. For a normal distribution the relationship between the standard deviation and the interquartile range is roughly: SD = IQR/1.35. For data that are non-normal, the standard deviation can be a terrible estimator of scale. For example, in the presence of a single outlier, the standard deviation can grossly overestimate the variability of the data. The result is that confidence intervals are too wide and hypothesis tests lack power. In some (or most) fields, it is uncommon for data to be normally distributed and outliers are common. One robust estimator of scale is the "average absolute deviation", or "aad". As the name implies, the mean of the absolute deviations about some estimate of location is used. This method of estimation of scale has the advantage that the contribution of outliers is not squared, as it is in the standard deviation, and therefore outliers contribute less to the estimate. This method has the disadvantage that a single large outlier can completely overwhelm the estimate of scale and give a misleading description of the spread of the data. Another robust estimator of scale is the "median absolute deviation", or "mad". As the name implies, the estimate is calculated as the median of the absolute deviation from an estimate of location. Often, the median of the data is used as the estimate of location, but it is not necessary that this be so. Note that if the data are non-normal, the mean is unlikely to be a good estimate of location. It is necessary to scale both of these estimators in order for them to be comparable with the standard deviation when the data are normally distributed. It is typical for the terms "aad" and "mad" to be used to refer to the scaled version. The unscaled versions are rarely used.
1,415
Statistics/Displaying Data/Histograms. Histograms. It is often useful to look at the distribution of the data, or the frequency with which certain values fall between pre-set bins of specified sizes. The selection of these bins is up to you, but remember that they should be selected in order to "illuminate" your data, not "obfuscate" it. A histogram is similar to a bar chart. However histograms are used for continuous (as opposed to discrete or qualitative) data. The defining property of a histogram is: If each bin has an equal width, then this can be easily done by plotting frequency on the vertical axis. However histograms can also be drawn with unequal bin sizes, for which one can plot frequency density. To produce a histogram with equal bin sizes: Worked Problem. Let's say you are an avid roleplayer who loves to play Mechwarrior, a d6 (6 sided die) based game. You have just purchased a new 6 sided die and would like to see whether it is biased (in combination with you when you roll it). What We Expect. So before we look at what we get from rolling the die, let's look at what we would expect. First, if a die is unbiased it means that the odds of rolling a six are exactly the same as the odds of rolling a 1--there wouldn't be any favoritism towards certain values. Using the standard equation for the find that "μ" = 3.5. We would also expect the histogram to be roughly even all of the way across--though it will almost never be perfect simply because we are dealing with an element of random chance. What We Get. Here are the numbers that you collect: Analysis. Referring back to what we would expect for an unbiased die, this is pretty close to what we would expect. So let's create a histogram to see if there is any significant difference in the distribution. The only logical way to divide up dice rolls into bins is by what's showing on the die face: If we are good at visualizing information, we can simple use a table, such as in the one above, to see what might be happening. Often, however, it is useful to have a visual representation. As the amount of variety of data we want to display increases, the need for graphs instead of a simple table increases. Looking at the above figure, we clearly see that sides 1, 3, and 6 are almost exactly what we would expect by chance. Sides 4 and 5 are slightly greater, but not too much so, and side 2 is a lot less. This could be the result of chance, or it could represent an actual anomaly in the data and it is something to take note of keep in mind. We'll address this issue again in later chapters. Frequency Density. Another way of drawing a histogram is to work out the Frequency Density. The advantage of using frequency density in a histogram is that doesn't matter if there isn't an obvious standard width to use. For all the groups, you would work out the frequency divided by the class width for all of the groups. External Links Return to "Statistics".
716
Compiler Construction/Run-time Considerations. Run-time Considerations. Storage Management - Garbage Collector. In computing there are new tools that are waiting to emerge when developers can find the technology capable of supporting them. One good example is that 50 years ago John L. McCarthy came up with an idea to automatically reclaim the memory of objects that are no longer needed during the execution of Lisp programs. It was the origin of the garbage collection concept in computer science. One of the tasks performed at runtime--as the compiled program is run by the user--is the management of allocated memory blocks, so as to minimize memory usage by deallocating blocks that will no longer be used. This is referred to as "garbage collection." Garbage collection is not available in all languages and compilers, but it is implemented in many of the most widely used. It takes much of the burden of memory management off of the programmer--when implemented correctly--and improves performance. Ideally, garbage collectors (hereinafter GC) would remove every allocation that will never be used again. In practice, we can assume that if there is any way to reference to a block, it can be used again; if not, it would not be used (except accidentally). So GC works by retaining memory blocks that can be reachable by tracing every reference path at a moment and freeing the rest. For example, function concat (string1, string2) new_string = alloc (string1.length + string2.length); copy (string1, new_string); copy (string2, new_string + string1.length); return new_string; This function returns a newly allocated memory block that is the concatenation of given two strings. Because the function only returns a new string and does not know how it is going to be used, it is the caller of this function that is responsible for freeing it, like: var old = null var string = 'Writing compilers is ' if you have not finished this book { string := concat (string, 'anything but ') old := string string := concat (string, 'fun!') if old != null { free (old) By letting GC free memory blocks when needed, the above can be simplified to: string = 'Writing compilers is ' if you have not finished this book { string := concat (string, 'anything but ') string := concat (string, 'fun!') In practice, an execution path and reference dependencies can be far more complicated than the above; thus, it should be easy to imagine how GC would be a great help. Brief History of Garbage Collection. In the Beginning, there was Static Allocation, and for a Time, it was Good. FORTRAN, circa the mid-1950's, had no garbage collection at all. Once a block of memory was allocated, it stayed allocated. The programmer could not deallocate it, even if he tried. Circa 1958, Algol implemented a form of memory management called stack allocation. Following that, languages like C implemented heap allocation, which allows the programmer to arbitrarily allocate and de-allocate memory from the heap of available memory. In C, this is done with the call codice_1. While this allows very flexible memory allocation and de-allocation by the programmer, careless (mis)use often results in memory leaks and dangling pointers; programmer errors are not handled by the compiler or runtime environment. In order to overcome the barriers of programmer error, we must either better instruct our programmers, or provide better systems for memory management. The string of non-accredited technical institutes that seem to have sprung up in the United States obviously do nothing to solve the former problem, so it is up to us to approach the latter. Implementing Garbage Collection. There are two basic approaches to garbage collection: reference counting and batching (or tracing). Reference Counting. In reference counting, a reference counter is associated with every allocated object. Whenever a reference is made to that object, the counter is incremented. When one dereferences that object, the counter is decremented. When the counter reaches 0, there are no existing references to this allocated object, so it can be safely removed (because there is no way for it to be accessed in the future). When an object O is created, we also create a reference counter for O, calling it codice_2. At creation, codice_3. When we create a reference to O, we perform codice_4. When we destroy a reference to O, codice_5. When we decrement, we check to see if the counter is now 0. If it is, we free O. To allow allocation of memory, we maintain a list of free memory blocks. When we allocate blocks, we remove them from the free list. When we deallocate, we add them to the list. Obviously, a major drawback of this method of allocation is fragmentation; having to defragment memory to allow allocation in the requested size can create inexplicable slowdowns for memory allocation. To prevent this, one can defragment the memory at some set interval, or perform more complex deallocation to keep memory contiguous, but the solution to this problem is likely to be non-trivial. Reference counting has the primary advantages of being simple to implement, requiring no work at an interval, and thus avoiding the necessity to pause the current operating to sort out our garbage collection (which can lead to highly inexplicable pauses during seemingly ordinary operation). However, reference counting has a number of severe limitations, namely it's inability to detect cyclical pointers (e.g. A references B and B references A, in which case neither A nor B will ever be collected), it's cost to pointer operations and use of space, and it's computational cost to allocation as a result of fragmentation. Some of these problems have solutions in the form of augmented reference counting, but some are best solved by using a different form of garbage collection. Batching/Tracing. In batching, the heap is viewed as a directed graph, with pointers as edges between allocated space (which we view as nodes in the graph). To do garbage collection, we traverse the graph and mark each node we reach. If a node is not marked, it cannot be reached and can be safely deallocated. Unlike reference counting, this method must be run at a specific time (reference counting, of course, is performed as a feature of ordinary allocation and deallocation). Garbage collection--when it must be performed at a specific time rather than simply as the program runs, as with reference counting--can be performed when storage is exhausted, before a segment of code that needs to run quickly is executed, or simply during idle time when there's nothing for the computer to do. The best way depends somewhat on the type of program running; for example, in Microsoft Word, there is enough idle time (while the user sits thinking up funny parenthetical statements) that the third option is best. On a real-time system, however, it might be better to do garbage collection always before certain code runs. Batching relies on accurate identification of memory pointers. There are a number of issues here; something that appears to be an integer may be a pointer, while something that appears to be a pointer may not be. A language could be designed specifically to avoid this confusion, but many popular languages, such as C and C++, are not designed in such a way. The compiler could mark at compile-time as pointers anything used as a pointer, but again this requires extra overhead. Some of the same methodology could be applied at runtime, but with additional runtime costs. Regardless of how this is done, however, it is important to be conservative with pointer identification. When it doubt, it is best to assume something is a pointer than is not. After all, it is far better to have extra un-collected garbage than to eliminate blocks that will later be used.
1,861