Where do bitcoins come from and what gives them their value?

Question: Where do bitcoins come from?  From the WeUseCoins.com video it appears they are just being produced by "miners" and sold to people.  So who backs Bitcoin or gives it its value?
Comment: if there are only 21,000,000 bitcoins where/who do the mined bitcoins copme from?
Comment: @Jonah There will only ever be around 21 million Bitcoins. Right now, there are fewer than that. The mined Bitcoins come from the mining process. Bitcoins are basically just numbers and the process of mining is the process of generating numbers.
Comment: What gives the Mona Lisa value? What gives your house value? Value is what people say it is. Scarcity is a quality that humans look at when assigning value e.g. gold, art, diamonds and of course the provably scarce... Bitcoin.
Answer: Although individual bitcoins enter the Bitcoin economy as miners are rewarded for processing transactions, it's much more helpful to think of all 21 million bitcoins as having been created when Satoshi Nakamoto defined the Bitcoin protocol and launched the Bitcoin network in 2009.
The reason for this is that the Bitcoin protocol specifically defines and controls when and how a limited total number of coins are rewarded to miners for the job of securing the Bitcoin network.  These "bitcoins" are really just mathematical tokens which are very carefully controlled by the network protocol to prevent counterfeiting, theft, etc.
By agreeing to use these mathematical tokens as money, the larger Bitcoin community is essentially "backing" their value and turning them into a currency in the same way traditional African and Asian societies used the money cowry despite the absence of any central bank.  Unlike the money cowry:

there will never be more bitcoins
they are impossible to counterfeit
they can be divided into as small of pieces as you want
and they can be transferred instantly across great distances via a digital
connection such as the internet.

Presumably, the members of the Bitcoin community who choose to accept them as money consider these features to be worth something, and value the bitcoin accordingly based on supply and demand on open currency exchanges.
Because bitcoins are given their value by the community, they don't need to be accepted by anyone else or backed by any authority to succeed.  They are like a local currency except much, much more effective and local to the whole world.
So to sum up, bitcoins come from the Bitcoin community's agreement to follow a set protocol, and are backed by everyone who uses them as money.
Comment: The Bitcoin protocol certainly prevents theft in that it has stronger built-in security mechanisms than cash.  Of course, if someone doesn't _use_ those mechanisms properly (i.e. by securing their private keys), then the built-in mechanisms don't really help.  Cash basically has no built-in anti-theft mechanisms except physicality.  Bitcoin done properly is much more theft-resistant than physicality.  Bitcoin done poorly is much, much less theft-resistant.
Comment: As we could see over the last days and weeks the Bitcoin protocol DOES NOT prevent theft. It is as easy to steal BTC as it is to steal cash.
Comment: "they can be divided into as small of pieces as you want" is factually incorrect. The smallest unit a bitcoin can be divided into is 1 satoshi which is 1/100,000,000th of a bitcoin.
Comment: "Bitcoin economy as miners are rewarded for processing transactions". Today miners are almost entirely rewarded for mining blocks, not processing transactions. You can mine a block with no transactions and you still get the mining reward, which is massively larger than the tiny transaction fees.
Comment: "there will never be more bitcoins" This is almost universally accepted to be untrue by people who deeply understand the protocol and dynamics. This paper does a good job explaining why... https://bfi.uchicago.edu/working-paper/the-economic-limits-of-bitcoin-and-anonymous-decentralized-trust-on-the-blockchain/
Answer: That is basically it. They have value because they are scarce, fungible (one Bitcoin is as good as another), easily transferred, and easily verified.
The only other component they need to have value is a general agreement that they will be used as a medium of exchange or a prevailing belief that they will be in the future. It is the variation in these two factors that accounts for most of the volatility in the value of Bitcoins today.
They aren't backed by anything because they're a commodity. What is gold backed by?
Comment: Gold is backed by having uses other than just as money. If gold was being used as money, but then it fell out of favor, it would still be useful for its industrial purposes and use as jewelry (which would limit how low gold could go.)
Comment: +1 it might be worth formatting the above as a list to ease quick scanning later
Comment: @dg123 Right, but that limit is so low as to be of no practical value. It's also creates two disadvantages to using gold as a currency. First, if those uses change in popularity, the value of the currency will change. Second, the cost of gold for those uses is artificially inflated by the use of gold as a currency, which discourages economically efficient uses of gold.
Comment: This answer has been moved to this question through merging an exact duplicate question into this one. It might need slight editing to fit here.
Comment: I'd push back on " fungible (one Bitcoin is as good as another)". We are already seeing that people are willing to pay a premium for "provence" bitcoins - that is, coins who's ownership chain can be traced back to an environmentally clean miner and does not include any questionable transactions (mixers, thefts, etc).
Comment: @bigjosh This happens with coins and bills as well, yet they are considered fungible. Fungible means I can give you a bill for some amount and we don't have to negotiate beyond that.
Answer: The value comes from their scarcity. To use something as a medium of exchange, it only has to have a certain set of properties. Bitcoins have these properties, so they can be used as a medium of exchange.
They are fungible. That is, 10 bitcoins is 10 bitcoins. This makes Bitcoins more useful as a medium of exchange than, say, apples, which vary widely in quality, size, and so on.
They are scarce. The number of bitcoins is predictable over time.
They are easily transferred. They are not easily counterfeited.
That's pretty much all you need. Nothing needs to back them just like nothing backs gold. The primary purpose of a backing is to ensure scarcity. But the block generation algorithm does that for Bitcoins.
Comment: Gold backing a currency does more than just ensure scarcity. It also sets a floor value for how low a unit of currency can go. If $1 is backed by 1 oz. of silver, and the value of the $1 went under an oz. of silver, people could exchange their dollars for the more valuable silver until the value of the dollar was brought back up to the value of what was backing it (the oz. of silver.)
Comment: "The primary purpose of a backing is to ensure scarcity."  good!
Answer: Bitcoins are just ledger entries. Like all modern currencies they are not backed by anything, but have value based only on their usefulness and their supply.
The addition of bitcoins into the money supply is controlled by the bitcoin software and is limited to a pre determined amount and rate of distribution.
The reason mining causes new bitcoins to be created is two-fold.  On the one hand it's a mechanism to introduce bitcoins into the money supply that is controllable and essentially random (like winning little lotteries).  On the other hand it motivates people to run the mining software which helps to secure the entire system.
Answer: From my research the best short answer is that they have use value as a medium of value exchange. Their use value comes from having properties of gold (limited supply), and digitally transferable over the internet so can be called digital cash. There is no central authority, so you can trust the wisdom of the crowd. Another good described is a digital distributed notary system.
Also see this larger discussion: http://bitcoinweekly.com/articles/bitcoin-what-is-it
Answer: Like fiat money, the valuation of BitCoin stems from its changing share per unit of world GDP transacting in it -   the share of world economic activity expected to transact in BitCoin vs. the supply of BitCoin.  Consider what gives fiat money value: is it the "faith in and credit of" the issuing government or its quantity relationship to real GDP?
The CPI or purchasing power (valuation) of fiat money is clearly determined by its supply relationship to real GDP wherein excess money vs. production of goods and services determines the CPI.
Figure 1: U.S. M3/Real GDP vs. CPI 1981-2006 (latest date for M3 available data from Fed)
The period of CPI trending above the ratio of M3/real GDP coincided with massive (in relation to GDP) increase in foreign investment in the U.S.  A broader measure would look at the world stock of dollars vs. world transactional share of GDP in dollars.  This can be done for gold during the pure world gold standard.
When gold was the money supply under the pure Gold Standard, and CPI was measured in relation to gold, the same determinant of the CPI held.   The world above ground gold stock/world real GDP vs. World CPI relationship demonstrates this in Figure 2.
Figure 2: World Gold Stock/World Real GDP vs. World CPI 1820 – 1913 Pure Gold Standard
This article does not deal with the effects of political agendas as they may aid or impede transactions in BitCoin or technical issues relating to the security of either BitCoins themselves or the code generating them; but rather strictly with the economics of BitCoin valuation.  The former most certainly can in a moment remove large swaths of GDP from BitCoin transaction and thus move its price in relation to the share of GDP change – as China recently did.
The U.S. dollar, gold, and BitCoin are world media of exchange since, in fact, transactions are taking place denominated in each of these media globally.  The fundamental economic differences are that the growth rate of the stock of gold and BitCoin (the latter having a finite future maximum quantity) are less than the growth rate of world real GDP and are thus deflationary (inherently grow in purchasing power).  Some may question this assertion about gold in view of its historic price swings and may choose to read my Seeking Alpha articles on gold and published academic journal papers to see why.
BitCoin has a further economic distinction from both fiat money and gold: its global acceptance curve as a medium of exchange is just beginning.  Thus, its price is mostly a function of the share of world GDP accepting it in relation to supply.  Fait money and gold in contrast have reached acceptance maturity.   At a current market cap of $7.1 billion (see www.bitcoinwatch.com) and an estimated world GDP of about $88 trillion, its share of world GDP acceptance may be in the range of .000081.
A simple model of the potential value of BitCoin, other factors (which are crucial and beyond scope here) aside, may be built as shown below where if the world GDP acceptance share of BitCoin was 1%, its price per unit would be about $40,000 if its supply was also at its maximum 21 million units.  Of course, by the time the maximum is reached, world GDP is likely to be much greater and the transaction share may be greater.
While there are other factors affecting the valuation of BitCoin, which factors also affect the price of gold, they are minor in relation to its global acceptance growth curve.  Those other factors include the real yield, fiat exchange rates, the expected world inflation rate and the cumulative world inflation rate.
Other digital currencies may affect BitCoin valuation to the extent they compete for world transactional acceptance by offering attributes such as superior technical, security and transactional ease features or compliance with regulatory requirements.
Answer: Although a simple question, "What gives Bitcoin value?", the answer is not as simple as the question.  What gives Bitcoin it's value, can best be answer by the formula
PB = (SW + TX) / BC
The value of a Bitcoin is derived from the total value of the Bitcoin used for storage of wealth (SW) plus the total amount of the Bitcoin required for concurrently transacting in it (TX).  The sum of these two numbers divided by the amount of Bitcoins in circulation (BC) (currently 12.2 million, ultimately 21 million), will give you the price of Bitcoin (PB).
There are estimates of the total amount of gold in existence (mined) in the $10-13 Trillion range. If $1 Trillion (10%) of the amount of wealth that would have gone into gold, instead lands in Bitcoin, that would increase the price of Bitcoin to ($1Trillion + TX) / 12.2 million, or by $83,000 per Bitcoin.  Remember, this leaves out the TX component, which will further increase the price of Bitcoin.  Over time, funds will shift from other asset classes being used for wealth storage to Bitcoin.
There are many advantages to storing wealth in Bitcoin as opposed to specifically gold, for example, as you can divide Bitcoin into very tiny pieces (difficult with gold) and you can send Bitcoin to someone on the other side of the planet within minutes (impossible with physical gold). These use cases illustrate why Bitcoin is a good alternative for gold (and other assets) for storage of wealth.
From a transaction perspective, as more citizens, businesses, and governments transact in Bitcoin, the amount of 'wealth' that must be placed into Bitcoin must be large enough to allow these transactions to happen.
For example, if it becomes common place for real-estate purchase payments to be processed via Bitcoin, then the amount of value in Bitcoin required to allow this to happen will need to be as large as the current working set of real estate transactions in progress.  This logic applies to online sales and brick and mortar sales.  If, on a daily basis, $250 Billion is required to allow all Bitcoin transactions to occur, the Bitcoin price only in terms of TX requirements, is $20,500.
The price of Bitcoin (PB) = (SW + TX) / BC.  SW and TX will both change as time passes. In geek terms, SW, TX, and BC are functions of time f(t). Therefore to more accurately predict the price of Bitcoin, you need to estimate these two components for a given time, and then divide by the number of Bitcoins in circulation.  BC can easily be obtained from many websites and is updated live.
Bitcoin works well as a storage of value and for financial transactions, therefore it will often be used as a substitute for both currency as well as common wealth storage assets (e.g., gold).  Bitcoins utility (global register – the block chain) is what makes this possible.  The worth of Bitcoin comes into play because of this utility, wealth storage and transactions will happen ontop of this platform.  And using the formula above, the price of Bitcoin (PB) can be computed by estimates of these two quantities.
Answer: The value of bitcoin is created by demand and offer by the need of market.
If you want deeper estimation let assume two hypothetical examples:
Hypothesis 1:
 * All people in USA has equal savings and all savings are in BC. BC is used only in USA
 * Average Savings Amount for Americans is 3,800$.
 * USA population is 317,161,000

Because the number of bitcoins is restricted, let divide the bitcoins equally among people.
317,161,000 / 21,000,000 = 15.10 BC. In this hypothetical example has every American 15.10 BC and it correpsond to 3800$ of saving. It implies:
1 BC = 3,800/15.10 = 251.66 $

Let estimate another hypothesis.
Hypothesis 2:
    * Bitcoin will replace all gold.
    * There is 171,300 tons of gold in the world.
    * The price of gold is 1,245.5 USD/Troy ounce.

1245.5$/Troy ounce = 40042.825 $/kg
Price of all gold in the world is 40,042.825* 171,300,000 = 6,859,335,922,500$
If we replace the gold with the bitcoin, we get price:
1BC =  6,859,335,922,500 $ / 21,000,000 BC = 326,635 $

Another hypothesis:
Hypothesis 3:
 * All people in the world has it's savings only in BC.
 * World population is 7,127,000,000

21,000,000 / 7,127,000,000 = 0.0029BC
It means that median saving amount of people is only 0.0029BC. It includes babies and poor people in Africa, India..
With three different (unreal) hypothesis and very simple estimate and we can get three different prices.
Answer: The question is not very well worded, but I this article is the best response to the question of "What backs Bitcoins?"
libertariannews.org/2011/12/01/why-do-people-want-a-gold-standard-when-history-shows-us-it-does-not-last/


Is there software that allows multiple users to simultaneously and independently share a personal computer running Mac Os?

Question: Like BeTwin. For example, I have Macbook Pro with one Mini DisplayPort (for additional monitor) and two USB port (for additional mouse and keyboard).
How can i implement it on Mac OS Snow Leopard?
Answer: Not aware of anything quite like BeTwin, but you may not be aware that is is possible to run 2 user accounts simultaeniously out of the box without the need for any extra software, at least in Lion (And I have seen, but cannot find, that this can be retroconfigured on SL).  You mention SLin your question, but have also tagged, Lion, so I will reply anyway.
When you use screen sharing, you are able to choose which display to connect to, either the physical or the virtual display.  Connecting to the physical display will allow you to take over the screen of the target computer, taking control of the kb/mouse etc.  But if you use the virtual display, you are able to log in as a new user, and run processes entirely independently of the peron who is physically logged onto the machine.
Whilst I have only tested this with a a Mac initiating the screen sharing, there is no reason why with an up to date VNC client any old netbook, or thin client etc shouldn't be able to connect in this way, as the Screen Sharing technology is only VNC under the hood.
Edit: Read this for more information on getting this working using Snow Leopard


Are general 3-to-1 or specific 2-to-1 ports better in Settlers of Catan?

Question: Which type of ports do you find more useful in Settlers of Catan, General 3-to-1 ports or 2-to-1 ports for a specific resource?
Answer: Unfortunately, it depends.
After the initial layout you want to try to identify which resources will be scarce and dominate them.  At the same time you want to try to identify which resources will be plentiful and dominate them and position yourself for the related 2-1 port.
It's unusual that you will be able to accomplish all of that :)
Once the layout is down, and folks have placed their initial cities you can then work to determine if you will have significant extra of a commodity.  If so, see if you can angle towards the 2-1 port.  If not, the 3-1 can work out just fine.
Answer: It depends on your personal situation in the game.  In some situations, both have no value at all.
With my usual tactics, 3:1 ports are much more useful.  2:1 ports are better only when they are of a specific resource that I have too much of in a given game, which generally happens when I have several settlements on several hex of that resource with values between 5 and 9.  The 2:1 port of the resources you lack is useless.  Since the resources you get changes during later stages of the game, the 3:1 has the advantage of staying useful during all the game.
Ideally, it's always better to not need a port.  If you use your resources to build without exchanging, or exchanging with other player at 1:1, or getting 2 (or more) for 1.  You don't need a port.
You should also compare the opportunity to build of a port compared to the other building opportunities.  When a good spot that gives three resources is available, your port will be a more valuable investment only if you desperately need to trade.  When those places are gone and the only 3 resources spot are the ones with a 2 or 12, 2 resources and a port become one of the best places you can still build.
The situation also changes when you build new settlements or cities.  At some point in the game, you might need to trade a lot to establish a settlement providing the missing resource, and after building it, you don't need to trade anymore.  If you lack wood or brick, a port is useful when your strategy is focused on new settlements, but it becomes useless when the good spots are all taken and you change your focus to cities and development cards.
If you know that you will run out of available settlement spots (when there are still several turns to play), you should should consider a wood or brick port, since you will have to exchange those resources after you run out of settlement spots.  (You can still compete for the  longest road, but if you have it, you can't get anymore points by building more roads).
Answer: It's probably just a psychological memory bias, but I keep finding that when I reach a 2-to-1 port, even when I'm on good numbers for its associated resource, I start collecting a surplus of something else.  Usually something relatively worthless.
Comment: I've noticed that myself.
Answer: Usually, I find that 2-to-1 ports are more valuable. They produce resources of your choice at half again the rate as 3-to-1, and you will usually have a resource that you will have a surplus of and can shoot for the 2-to-1 in that resource.
Of course, it does depend on the circumstances; sometimes, you just can't reach the appropriate 2-to-1 or really have an even balance of resources, and it's better to shoot for a 3-to-1 instead. But I'd say that all else being equal, a 2-to-1 that you have a good chance of a surplus in is preferable to 3-to-1.
Answer: We always found that a 3:1 port is useful, but never dominating. A 2:1 port combined with cities on that specific resource can be completely dominating. If there are three sheep hexes next to each other, then go for getting the six-sheep city and the sheep 2:1 port.
Answer: When placing your 1st settlment, you don't usually consider a port when choosing a location.  There are just too many unknowns.  When placing your 2nd settlement, you can build on a 2:1 port or consider building towards it.  You would do this if there was an excess of one resource, and you expect to have good access to that resource.
To implement this strategy, you must look ahead and see where your opponents will place their second settlements.  Try to determine which strategy your opponents are using based on their first settlement, and figure out what the logical second location is.  If you don't build on the 2:1 port, and instead try to build towards it, you must consider that an opponent will get there first.
There are 3 problems with trying to use a 2:1 port as part of an overall strategy.  First, you many not be able to predict where you opponents will place their 2nd/3rd settlements.  Second, if you have 2 settlements on a 5-6 or 8-9 hex of that resource, your oppenents will target this hex when they roll a 7.  Third, you will start getting resources in chunks later in the game after you have upgraded to a city/settlement on a hex.  Getting your resources in chunks increases the risk of loosing resources to the robber.
If you are placing 3rd-4th, you will often only have 1 viable location to get access to brick or ore (since there are only 3 hexes of each).  If the hex is a lower probability (3-4, 10-11), you can build 2 settlements on it without drawing your oppenents attention.  If one of those happens to be on a 3:1 port, it enhances the value of the settlement.  Since it won't get rolled a lot, you won't have excess of this resource type, but you may have an excess of something else.
Answer: For CITIES AND KNIGHTS, things change: 2-1 Wheat and 2-1 Brick become very valuable, as the other resources produce only one resource even with a city, whereas cities on wheat or brick produce two.
Comment: Being brick heavy (for city walls) and the 2:1 brick port can be VERY powerful in C&K.  The early brick allows you to expand across the island, and the later brick is just gold for commodities.
Answer: Use 2-1 ports if at all possible, provided of course that you will be getting the resource in abundance, and can do so without sacrificing the necessary probability and variety of resources.  Placing on an abundance of wheat or brick, especially in Cities and Knights (C&K), and then placing on the special harbor allows you to make up for a deficit in any resource or commodity.  This is especially useful if you are "last", and you get to place your city and settlement at the same time.
BEWARE: if you don't have a reasonable variety of resources with a reasonable probability, no amount of 2-1 can make up for all the 1-1 that other players get, when they are well placed to get a good mix of resources (and commodities in C&K).
Answer: A 3-for-1 port is more generically useful, since you can trade down any excess cards.
A 2-for-1 is situational. If you can focus your production on that resource AND get to the port, you can gain a lot of advantage.
To answer the question, I'd put it this way: If you're heavy in a specific resource, and can get to the 2-for-1 without too much trouble, go for it. Otherwise, save the roads and take the 3-for-1.


What is high cohesion and how to use it / make it?

Question: I'm learning computer programming and at several places I've stumbled upon the concept of cohesion and I understand that it is desirable for a software to have "high cohesion" but what does it mean? I'm a Java, C and Python programmer learning C++ from the book C++ Primer which mentions cohesion without having it in the index, could you point me to some links about this topic? I did not find the wikipedia page about computer science cohesion informative since it just says it's a qualitative measure and doesn't give real code examples.
Comment: http://en.wikipedia.org/wiki/Cohesion_\(computer_science\)
Comment: High cohesion: related behavior to sit together, and unrelated behavior to sit elsewhere.
Answer: High cohesion is when you have a class that does a well defined job. Low cohesion is when a class does a lot of jobs that don't have much in common.
Let's take this example:
You have a class that adds two numbers, but the same class creates a window displaying the result. This is a low cohesive class because the window and the adding operation don't have much in common. The window is the visual part of the program and the adding function is the logic behind it.
To create a high cohesive solution, you would have to create a class Window and a class Sum. The window will call Sum's method to get the result and display it. This way you will develop separately the logic and the GUI of your application.
Comment: Honestly I don't define Cohesion like that. Your definition is SRP (single responsiblity principle). And cohesion is about whether package wise, same-feature-orbiting classes are close to each other or not.
Comment: The SRP (Single Responsiblity Principle) is just another way of expressing the same concept. Cohesion is more of a metric; the SRP is a pragmatic guideline that if followed will lead to cohesive classes.
Comment: I think class window should not call any object of class sum as its only purpose is to render it does not need to know about the "existence" of class sum or any other class.There should be another class say Driver which should get result from the sum class and would pass the result to class Window to render
Comment: I don't get it. This is not cohesion according to clean code from uncle Bob. This is SRP
Comment: Cohesion is about how inter dependent the functions with in a module (Class) , more dependent means more cohesive so increasing cohesion means functions in a class work together to achieve a common task. When someone out side an observer of a Class  look at a class it will have a few exposed public methods the observer will have no idea whats happening inside that class as that complex task is achieved by these maximally cohesive functions with in that class, if these class functions doesn't share anything in common or are unrelated we call them less cohesive, they don't stick together.
Answer: An explanation of what it is from Steve McConnell's Code Complete:

Cohesion refers to how closely all the routines in a class or all the
code in a routine support a central purpose. Classes that contain
strongly related functionality are described as having strong
cohesion, and the heuristic goal is to make cohesion as strong as
possible. Cohesion is a useful tool for managing complexity because
the more code in a class supports a central purpose, the more easily
your brain can remember everything the code does.

Some way of achieving it from Uncle Bob's Clean Code:

Classes should have a small number of instance variables. Each of the
methods of a class should manipulate one or more of those variables.
In general the more variables a method manipulates the more cohesive
that method is to its class. A class in which each variable is used by
each method is maximally cohesive.
In general it is neither advisable
nor possible to create such maximally cohesive classes; on the other
hand, we would like cohesion to be high. When cohesion is high, it
means that the methods and variables of the class are co-dependent and
hang together as a logical whole.

The notion of cohesion is strongly related with the notion of coupling; also, there is a principle based on the heuristic of high cohesion, named Single Responsibility Principle (the S from SOLID).
Comment: I think your answer is more complete than the accepted one, because it describes both SRP and cohesion, and so it helps to understand the specificities and the differences between these two concepts.
Answer: High cohesion is a software engineering concept. Basically, it says a class should only do what it is supposed to do, and does it fully. Do not overload it with functions that it is not supposed to do, and whatever directly related to it should not appear in the code of some other class either.
Example is quite subjective, since we also have to consider the scale. A simple program should not be too modularized or it will be fragmented; while a complex program may need more level of abstractions to take care of the complexity.
e.g. Email class. It should contains data members to, from, cc, bcc, subject, body, and may contain these methods saveAsDraft(), send(), discardDraft(). But login() should not be here, since there are a number of email protocol, and should be implemented separately.
Comment: It is the definition of SRP: "a class should only do what it is supposed to do, and does it fully."
Answer: Cohesion is usually measured using one of the LCOM (Lack of cohesion) metrics, the original LCOM metric came from Chidamber and Kemerer. See for example:
http://www.computing.dcu.ie/~renaat/ca421/LCOM.html
A more concrete example:
If a class has for example one private field and three methods; when all three methods use this field to perform an operation then the class is very cohesive.
Pseudo code of a cohesive class:
class FooBar {
  private SomeObject _bla = new SomeObject();

  public void FirstMethod() {
    _bla.FirstCall();
  }

  public void SecondMethod() {
    _bla.SecondCall();
  }

  public void ThirdMethod() {
    _bla.ThirdCall();
  }
}

If a class has for example three private fields and three methods; when all three methods use just one of the three fields then the class is poorly cohesive.
Pseudo code of a poorly cohesive class:
class FooBar {
  private SomeObject _bla = new SomeObject();
  private SomeObject _foo = new SomeObject();
  private SomeObject _bar = new SomeObject();

  public void FirstMethod() {
    _bla.Call();
  }

  public void SecondMethod() {
    _foo.Call();
  }

  public void ThirdMethod() {
    _bar.Call();
  }
}

The class doing one thing principle is the Single Responsibility Principle which comes from Robert C. Martin and is one of the SOLID principles. The principle prescribes that a class should have only one reason to change.
Staying close to the Single Responsibility Principle could possibly result in more cohesive code, but in my opinion these are two different things.
Answer: Most of the answers don't explain what is cohesion, It is well defined in uncle bobs book clean code.

Classes should have a small number of instance variables. Each of the
  methods of a class should manipulate one or more of those variables.
  In general the more variables a method manipulates the more cohesive
  that method is to its class. A class in which each variable is used by
  each method is maximally cohesive. In general it is neither advisable
  nor possible to create such maximally cohesive classes; on the other
  hand, we would like cohesion to be high. When cohesion is high, it
  means that the methods and variables of the class are co-dependent and
  hang together as a logical whole.

Let me explain it with a class definition
class FooBar {
private _bla;
private _foo;
private _bar;

function doStuff()

   if(this._bla>10){
     this._foo = 10;
     this._bar = 20;
   }

}
function doOtherStuff(){

    if(this._foo==10){
       this._bar = 100;
       this._bla = 200;
    }
}

}

If you see the above example the class is cohesive that means the variables are shared among the class to work together more variables are shared that means the class is highly cohesive and work as a single unit.
Answer: This is an example of low cohesion:
class Calculator
{

     public static void main(String args[])
     {

          //calculating sum here
          result = a + b;
          //calculating difference here
          result = a - b;
          //same for multiplication and division
     }
}

But high cohesion implies that the functions in the classes do what they are supposed to do(like they are named). And not some function doing the job of some other function. So, the following can be an example of high cohesion:
class Calculator
{

     public static void main(String args[])
     {

          Calculator myObj = new Calculator();
          System.out.println(myObj.SumOfTwoNumbers(5,7));
      }

     public int SumOfTwoNumbers(int a, int b)
     {

          return (a+b);
     }

     //similarly for other operations

}

Answer: The term cohesion was originally used to describe modules of source code as a qualitative measure of how well the source code of the module was related to each other. The idea of cohesion is used in a variety of fields. For instance a group of people such as a military unit may be cohesive, meaning the people in the unit work together towards a common goal.
The essence of source code cohesion is that the source code in a module work together towards a common, well defined goal. The minimum amount of source code needed to create the module outputs is in the module and no more. The interface is well defined and the inputs flow in over through the interface and the outputs flow back out through the interface. There are no side effects and the emphasis is on minimalism.
A benefit of functionally cohesive modules is that developing and automating unit tests is straightforward. In fact a good measure of the cohesion of a module is how easy it is to create a full set of exhaustive unit tests for the module.
A module may be a class in an object oriented language or a function in a functional language or non-object oriented language such as C. Much of the original work in this area of measuring cohesion mostly involved work with COBOL programs at IBM back in the 1970s so cohesion is definitely not just an object oriented concept.
The original intent of the research from which the concept of cohesion and the associated concept of coupling came from was research into what where the characteristics of programs that were easy to understand, maintain, and extend. The goal was to be able to learn best practices of programming, codify those best practices, and then teach the practices to other programmers.
The goal of good programmers is to write source code whose cohesion is as high as possible given the environment and the problem being solved. This implies that in a large application some parts of the source code body will vary from other parts as to the level of cohesion of the source code in that module or class. Some times about the best you can get is temporal or sequential cohesion due to the problem you are trying to solve.
The best level of cohesion is functional cohesion. A module with functional cohesion is similar to a mathematical function in that you provide a set of inputs and you get a specific output. A truly functional module will not have side effects in addition to the output nor will it maintain any kind of state.  It will instead have a well defined interface which encapsulates the functionality of the module without exposing any of the internals of the module and the person using the module will provide a particular set of inputs and get a particular output in return.  A truly functional module should be thread safe as well.
Many programming language libraries contain a number of examples of functional modules whether classes, templates, or functions. The most functional cohesive examples would be mathematical functions such as sin, cosine, square root, etc.
Other functions may have side effects or maintain state of some kind resulting in making the use of those functions more complicated.
For instance a function which throws an exception or sets a global error variable (errno in C) or must be used in a sequence (strtok() function is an example from the Standard C library as it maintains an internal state) or which provides a pointer which must then be managed or issues a log to some log utility are all examples of a function that is no longer functional cohesion.
I have read both Yourdon and Constantine's original book, Structured Programming, where I first came across the idea of cohesion in the 1980s and Meilir Page-Jones' book Practical Guide to Structured Systems Design, and Page-Jones did a much better job of describing both coupling and cohesion. The Yourdon and Constantine book seems a bit more academic.  Steve McConnell's book Code Complete is quite good and practical and the revised edition has quite a bit to say about good programming practice.
Comment: You say `The minimum amount of source code needed to create the module outputs is in the module and no more` this is not related to Cohesion but to [DTSTTCPW](http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html)
Comment: @v.oddou, minimum amount of code is indeed related to Cohesion. The more code in a module that is unrelated to the module outputs the more likely the code has side effects hence lower Cohesion. Every concept has different perspectives especially concepts such as Cohesion which are somewhat ambiguous. The measurements for Cohesion are qualitative requiring a kind of fuzzy logic to allocate a particular module to one category or another using a rubric of some kind. Saying minimum code for the outputs is not a sufficient characteristic for high Cohesion just one of several.
Answer: A general way to think of the principle of cohesion is that you should locate a code along with other code that either depend on it, or upon which it depends. Cohesion can and should be applied to levels of composition above the class level. For instance a package or namespace should ideally contain classes that relate to some common theme, and that are more heavily inter-dependent than dependent on other packages/namespaces. I.e. keep dependencies local.
Answer: cohesion means that a class or a method does just one defined job. the name of the method or class also should be self-explanatory. for example if you write a calculator you should name the class "calculator" and not "asdfghj". also you should consider to create a method for each task, e.g. subtract() add() etc...
the programmer who might use your program in the future knows exactly what your methods are doing. good naming can reduce commenting efforts
also a principle is DRY - don't repeat yourself
Answer: MSDN's article on it is probably more informative than Wikipedia in this case.


What are the differences between "manual", "guide" and "instruction"?

Question: What are the differences between the three, especially in this context:

User manual
User guide
User instruction
Answer: There is considerable overlap among the three, and to some extent they can be interchangeable. They can be coupled together or with other terms, as in instruction manual or reference guide. In addition, there are a number of similar terms like handbook, guidebook, primer, or vade mecum.
Manual refers specifically to a reference document which provides detailed information about operation and maintenance of a product. Manufacturers will often provide an official manual for a product to provide assistance to its owners or users: cars, for example, usually come with an owner's manual,  machinery with an operator's manual, and official documentation for Unix programs with manual pages.
Guide is a more generic term. Whereas manual implies a written document, one that could be a booklet for a video game or a large book for a complex product such as a car, a guide can be just a card, or in another medium altogether such as a video. It may be a detailed reference, but it can also indicate a very simple overview or instructions for a small subset of features.
Because "manual" has connotations of dense, boring text, some manufacturers or technical writers prefer the label "guide" for what would traditionally be called a "manual."
Instructions is the most generic term, and may be synonymous with directions— step-by-step guidance on how to perform a specific task or function. A manual or guide will include many sets of instructions. Used alone, however, "instructions" can refer to the simplest explanatory text— push cap and twist to open, or use other door.
The presence of user in the phrases you cited suggests an electronic or software product , in which case I would say all three phrases you cited are synonymous. For example, Apple labels the documentation section of its website as "Manuals," yet the documents themeselves are the iPhone User Guide, iPad User Guide, and so on.
I think it would be very rare to be supplied with three different references labeled user manual, user guide, and user instructions. In such a case, I would expect the manual to be the main, canonical reference; the guide to be a short overview of features; and the instructions to be the most rudimentary introduction to the use of the product in question.
Comment: A fantastic and thorough answer.
Comment: Does anyone actually say "vade mecum"?
Comment: @Pacerier You'll find it in some industries and occupations. It probably isn't a word you would use in anything consumer-facing, except to be humorously pretentious.
Answer: Agreeing with Choster, I believe a manual is the official, comprehensive reference to the operation and maintenance of a product or device. Manuals may also provide conceptual information, such as design theory. Some "all-in-one" manuals are comprehensive enough to include information that would otherwise be found in separate guides or instructions, such as usage scenarios, diagnostic procedures, installation instructions, etc.
A guide coaches the user on how to use a product effectively and efficiently, typically by providing application examples and usage scenarios. Some marketing professionals prefer using the term "guide" instead of "manual" without regard for this distinction because "guide" sounds helpful and easier to read.
Instructions are simply procedures (presumably tested procedures) for accomplishing specific tasks. The instructions can be contained in a manual or guide, or they can be standalone documents such as instruction sheets for assembling furniture or replacing a battery.
Answer: Agreeing with chessmath and choster, I'd like to add a few cents of my own. User documentation may refer to subject matter i.e. Project, Team, Test, System, Administrative, Marketing or Miscellaneous types. For every such subject matter, certain instructions (for using i.e. a user guide) or reference manuals need to be created for packaging it along with a certain product or service. IMHO, there's only two types of documentation;

Reference Material
Instructional Material

From here onwards, you can start building (or expanding) certain documentation requirements specific (or as required by law) to a product or service.
Answer: Manual is related how to operate something (usually an electronic device). The word comes from Latin "manus" hands and in this context means operate something with your hands.
User guide give us the idea of introducing some device giving all the aspects and capacities as if you were doing a tour to know each delightful task that your device can do.
User instruction is related to give you instructions for you do a given task then you should follow strictly the instructions to performance well an activity.
Summarizing:
Manual focuses on the (Object device): How to operate it.
Guide focuses on all the capacities of the device.
Instruction focuses on leading you to do determined tasks on a device.


How to easily import aerial imagery into gvSIG?

Question: I have used ArcView GIS 3.x for years. I have decided to try some of the free GIS desktop software. I am now trying gvSIG. One feature I was hoping for was the importation of aerial imagery relatively easily. In the past I would download tiles of images from various repositories but now want to work like I am in Google Earth and simple have nice aerial images easily available for various regions that I am focusing on. In particular I am working with New York State and Google earth aerial images would be perfect. Can anyone help me out. Thanks
Answer: I'm afraid yo can not import a folder of tiles recursively. In gvSIG 2 that will be quite easy to perform. Right now you can load any number of files from a particular folder with the typical "add data" dialog.


How long should I let caulking dry before exposing to water?

Question: I am redoing my bathroom and going from a tub with shower to just a shower base and walls. The walls are fiberglass and caulking is being used to seal everything up. How long should I let everything dry before using this shower?
Answer: Check the directions of the caulking product you used, but usually 24-48 hours.
Answer: It depends on the type of caulk you're using. If you've already selected and purchased the caulk, check the directions on the tube. If you're still in the process of deciding what you want to use, there are a few different factors such as type, full cure time, and "shower ready" time.
GE makes a version of its Silicone II caulk that is "30 minute shower ready." This means that it isn't fully cured, but it can get wet without any ill effects. Just don't touch it, wipe it, or spray it directly with a high pressure shower head, since it takes a whole 24 hours to cure completely.
They also make a "3 hour shower ready" version which should give you a bit more time to apply and smooth if you're new to caulking.
(I have no affiliation with GE, I just think they make good products. They're my go-to brand when I need to caulk something.)


Extending Solutions To Hamilton's Equations to Whole Time Axis

Question: In Arnold's Classical Mechanics book, he says "We assume that every solution to Hamilton's equations can be extended to the whole time axis", and adds that 'For this it is sufficient, for example, that the level sets of $H$ be compact'. How so?
Answer: He is assuming that there are no local issues with the solution of the differential equation, which is reasonable. This means that you can always extend the solution a little bit in time around any point.
Then the only way that a solution will fail to extend in time is if the limit at some point is not in the phase space, so that the solution runs away to infinity. An example is for a Hamiltonian of the form
$$p^2 - x^4$$
If you start off at a certain position, by conservation of energy, the speed of the particle when it reaches position x goes as ${x^2}$ and the time required to reach infinity is proportional to the integral
$$ \int {1\over x^2} dx$$
which is convergent. There are similar blow ups in finite time in many systems where the energy isn't bounded below, including Newtonian gravitating point particles. He is pointing out that if the energy surface is compact, you can't run away.
The formal statement is that the local extension property allows you to continue from any point a little ways, and the compactness property means that the limit of the trajectory is in the space, so that you have a standard connectedness proof of global existence.


Arduino Bootloader

Question: If I upgrade my arduino from the ATMega168 to ATMega328 will I be able to use the ATMega168 like a stock chip from the factory or will the bootloader prohibit this? In other words, will I be able to overwrite the bootloader, with my usbtiny ISP programmer, on the 168 to use as a Atmel stock chip with Avrdude?
Is there any special steps I would need to take like reseting fuses?
Answer: Yes, you can reprogram the chip.  I did the same when I upgraded my Arduino from a 168 to a 328 two weeks ago.  The chip works great in another application.
Take note, of course, that you may need to change fuses depending on what kind of board you had and what kind of board you are moving it to.  The most common, I would imagine (and the ones I had to reset) dealt with changing to the internal oscillator and setting dividers instead of using an external crystal.  There is no comprehensive list of fuse changes, though, because it depends on what kind of circuit you're moving the chip to.  YMMV.
--Edit--
As JohnC said, yes, reprogramming of fuses should be done BEFORE you remove it from the Arduino.  Since the Arduino is fused to use an external oscillator, the chip will not do a darn thing if placed on a board without an oscillator.
Answer: I would reset the fuses to factory default whilst the 168 is still in the Arduino board. If the fuses are configured for an external oscillator (as they are in the Arduino) and there isn't one then you will not be able to re-program without using a high voltage programmer. Setting to factory default sets the chip up to use an internal oscillator.
Answer: I've done this - pulled the 168 from an arduino, programmed it with the USBtinyISP.  You'll need some form of target board for the USBtiny ISP.  I used one of these from Evil Mad Scientist Labs, along with a ZIF socket from Sparkfun.  The actual circuit needed to program them is simple enough that you can build it on a protoboard without much trouble.  EMSL also has a handy article on just what that circuit needs to be so you can DIY.
In order for a target board to work, it needs to be set up with at least an approximation of how the chip is already fused.  That means having the right amount of power (if the brownout detection circuit is enabled) and having an oscillator if the chip is set to use an external one (AFAIK the chip will ignore an external oscillator if not fused to use it).  You either need to first set the fuses to use the internal oscillator before removing from the Arduino or put an oscillator on your target board.  I don't think the Arduino comes with brownout detect enabled, so you're probably safe on that score.  I'd suggest just using the jumper on the USBtiny to supply power to the target board, rather than bothering with an external power supply.
I can't recommend using the Arduino board as the programmer target because it has a normal socket instead of a ZIF socket. I find that I'm much less likely to mangle the pins on my MCU when I use a ZIF socket.  Going in and out of a breadboard is bad enough.  Sparkfun seems to have the cheapest prices on ZIF sockets, if you decide to go that route.
Since you already have an ISP programmer, you can save a little money on your 328 chip and buy one without the Arduino bootloader.  Just use the Arduino software to burn the appropriate bootloader to it once you've got it installed.

Arduino Bootloader


What's a good running goal for getting started?

Question: I used to be fit and have started at the gym to get fit once again. I've never really been a runner but have started on the treadmill (along with bikes) to improve my cardio fitness. I want to set myself a goal to reach with running, the problem being that I'm not really sure what a good time or distance to aim for is for a novice runner?
Comment: "The best way to start is to start".
Comment: @Ryan Miller Lucky for me I've started :)
Comment: what gets you excited about running? speed? distance? social?  Why did you choose running over swimming or other sports?
Comment: Also have a look at http://fitness.stackexchange.com/questions/2629/what-are-the-best-ways-for-a-beginner-to-ease-into-running/2630#2630
Answer: I would say, since you're a beginner, take things slowly to determine what level of running commitment you're comfortable with.  Start with a half mile.  Time yourself and try to get your time below 3 1/2 minutes.  If you're comfortable committing more time to running, move to a mile per session.  Try to get this time below 7 minutes.  A 7 minute mile is a very good time for an athlete.  It will take some time for a novice to reach this goal but I think this distance is a very healthy amount of running.  If you are running several times per week, remember to take things slowly and give yourself enough time to recuperate.
Continue in this fashion until you have reached a level you're comfortable with both in terms of time commitment and energy expense.  From my experience, running a 7 minute mile twice a week will keep you in great shape and at a high cardio fitness level.
Comment: He asked for a good time/distance for a novice runner.  That was my recommendation from past experience.  If someone wanted to commit more time/distance to the exercise, they could challenge themselves to run 2 miles under 14 minutes or 3 miles under 21 minutes (both great times by most measurements).  Also, studies continually show that time isn't as important as intensity when exercising so it's more about fitting that distance into your time window than just running for a set time.
Comment: If the recommendation for cardio health is 15 - 30 minutes, 3 - 5 time a week, how exactly is _ running a 7 minute mile twice a week will keep you in great shape and at a high cardio fitness level_ accurate? It's not.
Answer: "Good" is a relative term and it would have to be adjusted for your age, sex, and any noteworthy medical conditions. In a very general sense, someone under the age of 40 with a reasonable level of fitness should be able to run a 5k in under 40 minutes.
Since you're trying to improve your fitness, run 5k and mark the time. Make your goal to trim off 10% of your time in 60 days. If you haven't been running much, that should be easy to ramp up to.
Comment: This "Couch to 5k" is a handy beginner workout plan I'm in the middle of: http://www.coolrunning.com/engine/2/2_3/181.shtml
Answer: The goal for getting started is to actually just get out there and get moving, get sweating, 4-5 days per week, every week. All you need is 30 minutes a day 4-5 times per week and you will get in shape.
As a beginner your goal will be to try to do 30 minutes of running straight without walking.
If you're not quite that out of shape, then an excellent goal is to run 5km in 30 minutes. And/or try to do 60 minutes straight.
If you are a superior athlete, then you could try 5km in 20 minutes.
Answer: I started running nearly two years ago, as I hit 40. I'd never been a runner, or very fit up to then.
Start slow. The walk-run-walk is not to be sneezed at -- I couldn't run more than 100 m at a time when I started. Think of it as interval training. Go a bit further each week, running 3-4 times a week, or whatever you can fit in. Don't over do it as you feel fitness starting to come on; you need to harden up your legs and even lower back. Better that than hurting yourself and going backward.
After 6-8 weeks, you should be able to do a 3-4 miles. FWIW, I find that you need to be doing around 8-9 miles every second day to really get in the zone when running (i.e. really enjoying the run, not wondering when you'll finish). Maintaining this isn't always possible -- work, travel, family, etc. But it's a buzz when you are.
Summary:
1. You have to start somewhere. It will hurt, but fitness will come.
2. Pay money for good shoes. Your whole body will thank you.
3. Get a heart rate monitor -- will let you know how hard you are really working, and if you can upload to web, great motivational tool to watch progress.
4. Mix it up -- bike ride, walk, weights.
5. Upper body weight lifting will improve your times if you get to that point.
6. OK to have a slower week every 3-4 weeks or so -- actually helps your body.
7. Start slow, build slow, and know that it will come. In three months you'll feel great.
Good luck !!!
Answer: I started running again after a few years hiatus from failed marathon training (knee gave out after 18 miles).  I ran a 5k with my office team and that got me spirited again.  A goal that I reached last year was to run 1 5k a month for the entire year with no time limit except to complete.  The winter ones were suprisingly a lot of fun (and invigorating).
Just my $.02 on a running goal.


Network connection problem

Question:  I am using ubuntu 11.10 LTS.
when I switch on my lappy, the network connections i have created works fine, but after sometime (not always) they disappear and no connection lefts available for use. the default wired connection also disapprears along with DSL connection i have created. I restart my PC and again start using network but the same thing happens again. Sometimes network connections work smooth sometime continuously same problem gets repeated without any reason. I only browse internet on Mozilla when such thing happens, no other network tool or other any other software is running when this problem occurs. So it is not triggered by other software or network tool, it happens automatically. This time I am using DSL connection for more than 1 hour and its working smoothly. before this i switched off my lappy several times and then again started up again problem occurred again switched off.... .. . dont knw what is wrong with this...I am using HP Laptop intel core i 5.
Answer: I think you should should reconnect the modem (or anything you use) whenever you log in your account. It is because of the reason that linux does not identify the modem when you log in ....... It needs a booster dose !!
Answer: If you are using Ubuntu, please try the below solution, it works for me.
Netplan
Change your /etc/netplan/01-network-manager-all.yaml file to look like this:
network:
  version: 2
  renderer: NetworkManager
sudo netplan generate

sudo netplan apply

Reboot.
You shall see the wired connection in the network manager.

Network connection problem


When did you let your child play around your house unattended? (by herself)

Question: My daughter is almost 6 years old and we live across from a park. Can I tell to her to play and check her only like every 5-10 minutes? I know the answer will be it depends on the kid, and the area, but I would really like to hear from older parents when did they start letting their kid play independently. e.g., at age 7 vs. 10 vs. 12.... definitely at some age it is quite OK.
Answer: We let our two eldest play together down the bottom of our garden (which is out of sight, but within a high fence) from the ages of 3 and 5, but didn't let them go up to the park until 8 and 6. It is about 5 minutes walk away, with only one minor road to cross, and is in full view of 8 or 9 houses, but we just felt that at that distance if something did happen (like one of them falling from a high climbing point etc) we couldn't get there in time to do anything useful.
Now our eldest is 11 we do let him take our youngest (5 years old) along there unsupervised, but he takes along one of our mobile phones in case of emergencies.
Comment: Thanks @deworde - in general I am against mobiles for kids, but for things like this it just gives us that extra rapid response. And our 11 year old is responsible enough not to abuse the privilege.
Answer: The answer is heavily depends.  Several questions needs to be answered like:

How safe is your area in general?
Will she have anyone to play with in the park?
How likely are your neighbors to report you to the authorities?
Do you see her from your window or do you need to actually walk there?

Once you answer all of these you will have a better idea of whether or not to allow your daughter to play in the park.  When I was growing up we played alone starting at 6 but this was usually in groups.  Nowadays this in large part isn't the case.
Comment: *How likely are your neighbors to report **you** to the authorities?* I don't understand this - what would they report the OP for?
Comment: @Treb In the US?  Child endangerment for example.
Comment: Really??? I think I am having a cultural shock here... It's amazing how big the differences between our countries can be!
Comment: @Treb http://news.google.com/newspapers?nid=1876&dat=19970514&id=9UgoAAAAIBAJ&sjid=ic8EAAAAIBAJ&pg=2471,3998516   Found this which might interest you about mother being jailed
Comment: @Treb  Yes ... the nanny state is encouraging people to think that the government needs to get involved in everything.
Answer: In Germany, it is quite common that kids go to elementary school on their own, starting at the age of 6 or 7. Of course, this involves prior training on the way to preschool, and not too long and difficult ways.
But regarding the question if a 6-year-old can be left alone directly opposite the house for 10min, I think the comparison is clear.
Regarding the authorities: A German court decided recently, that the parents of a 6-year-old did not violate their obligatory supervision when he damaged a car with his bike while he was unattended, because he had been trained for 2 years and was generally driving safe.
If somebody reported parents of kids that were playing peacefully in a park next to their houses, he would be laughed at.
I don't want to brag about my country, your country, but I see developments (here and according to media reports even more the USA, Karlson also implied that) that I don't think should be welcome.
Answer: If the area is safe, I see no problem per se. I played by myself, for hours, at 6 (or even 5, I'm not entirely sure) years old in an area with block houses and no cars. Of course bad things can happen, but they can happen when you are 18 as well.
So in the end it depends on the area and on your kid. Does the kid know to stay away from streets, trains, brooks, etc? Are there other people around, generally? Is the area safe? Are your kid generally reckless? Is the playground toys dangerous? What does your neighbors do and think (they may be wrong, but you probably don't want to alienate them), etc, etc.


My last bars of chocolate

Question: A box contains 8 pieces each of milk chocolate, white chocolate, and dark chocolate. The box is passed around the six of us, with each person taking 4 pieces. Assume that each person chooses at random without replacement from the available pieces. I am the last person to whom the box is passed. Find the chance that I pick 4 dark chocolates.
Answer: The fact that there are 6 people picking is irrelevant. The fact that you pick last is irrelevant. The fact that there are milk and white is irrelevant.
You get 4 chocolates, for them to be all dark you have to choose 4 dark from your 4 choices.
$$p=\frac{8}{24}\frac{7}{23}\frac{6}{22}\frac{5}{21}$$
Answer: HINT:
You have to calculate the number of combinations to pick 8 milk chocolates, 8 white chocolates and 4 dark chocolates among 3 persons.
So let $X$ be the number of combinations that 3 persons can pick from $8$ mc, $8$ wc and $4$ dc.
Let $Y$ be the number of combinations that 3 perons can pick from $8$ mc,$8$ wc and $8$ dc.  Than you will get your probability $$P= \frac{X}{Y}$$
Answer: Here's a generalization:
There are $m$ sets size $r$ each, so the total number of items is $mr=n$. $k$ people select $s$ items each, hence $ks$ items are selected before the last person makes his selection. The first $k$ people can select anything, but leave at least $s$ items from the marked set $j$. If this is not the case, then the probability of your event is obviously 0.
The number of ways to select any $ks$ items out of $n-s$ is $\binom{n-s}{ks}$, the number of ways to select $ks$ items out of $n$ is $\binom{n}{s}$, the number of ways to select exactly $s$ items out of the marked set $j$ is $\binom{r}{s}$, and the number of ways to select $s$ items out of the remaining $n-ks$ is $\binom{n-ks}{s}$, hence the probability of your event is
$$
P(S)=\frac{\binom{n-s}{ks} \cdot \binom{r}{s}}{\binom{n}{ks} \cdot \binom{n-ks}{s}}
$$
This can be easily extended to the case when each person selects $t>s$ items.

My last bars of chocolate


Has my Guitar Rig 2 installation messed up Cubase 5?

Question: So I upgraded from Cubase SX3 on XP Home to Cubase 5 on Windows 7. Groove Agent went in just fine. Then came Guitar Rig 2 and the mixer in Cubase won't load in any reasonable amount of time. Go make a cup of tea and a sandwich and enjoy both and it might have loaded, with all manner of things 'not mapped'. It was all fine before Guitar Rig 2 went back on the hard drive, any thoughts?

Edit:
Guitar Rig loads fine on its own. When I change patches there are different types of hum. The trouble comes when Cubase becomes involved. Cubase without Guitar Rig is fine. When instances of Guitar Rig are involved, things are as previously described.
Also tried installing SX3 as well and the same trouble exists in both. I tried changing the properties of Guitar Rig's .exe file so that it opens as if in XP sp2 and that's no good either.
Wondering if there is some kind of security problem with the various dongulators or if Windows 7 simply doesn't like Guitar Rig 2. Tried XP Pro sp3 as well but there are all manner of troubles with drivers for the motherboard as it is fairly new.
Comment: Does the same thing happen even without loading Guitar Rig up in Cubase?  Does the mixer still take forever to load if you so much as have Guitar Rig installed?

The only other factor I can think of is that you have moved to Windows 7.  Are there any known incompatibilities with your software or your hardware on that OS?
Answer: This is actually not the solution for you but a way you might find the solution on your own:
Go and grab Process Monitor. This will monitor every action any process does on your system. Check what Cubase does during the mixer load up.
Here is also a blog post which may help you get started with Process Monitor: Mark Russinovich - The Case of the Slow Logons
EDIT:
Here is one who had a similar problem. Perhaps the solution works for you: Cubase 5 won't open projects with Guitar Rig after update 5.5.2
Answer: We have latest versions of Cubase and Guitar Right in Windows 7 with no problems, in fact it is much faster than the old Win CO setup we had.
So I think you just need to look at processes as per Eduard's post. You could have a clash somewhere, or an inadvertent time out.


How can I make outlet wall plates mount flush after removing wood paneling?

Question: I recently removed some old wood panelling in my basement that was up against drywall. I refinished the walls and painted but now the outlet covers don't mount flush against the wall anymore because they were originally installed when the walls had the extra thickness of the wood panelling. What can I do about this?
Comment: Are the outlet boxes protruding from the drywall or are they flush?
Answer: Presumably the issue is that the outlet boxes protrude from the drywall.
Before doing anything else, turn off the power to the outlet.
Generally these boxes are typically nailed into the studs.  If this is the case, simply pry the nails out, reseat the boxes deeper in, and re-nail them into place.
If you can't reseat the boxes deeper (e.g. if something impinges on the rear of the boxes), there's a few options.  Replace the boxes with shallower ones.  Use a dremel or similar to cut off the protruding parts of the box.  Or add a "frame" around the box.
Comment: This will require opening up drywall, as the nails heads will be on the side of the box opposite the stud.
Answer: Like it has been said here a few times, remove the old box with a hacksaw or a sawzall.  Then you can slide the box off and work the wires through the box clamps.  If you can find this style of box it will be easier to use.

As you can see this can easily be screwed in to were the old box was and you will be able to get the box to the correct depth.
Answer: Assuming that the boxes protrude (alternatively, the fixtures may be extended from the box -- if that's the case, you can probably just tighten the screws).
Probably the easiest fix would be to make a trim piece out of something about the same thickness as the paneling that was removed.   Cut a piece approximately 1/2" wider than the outlet cover (vary according to your taste), and use a jigsaw to cut a hole to match the outlet box (it may be easiest to buy a similar box -- they're pretty cheap -- to use as a template).  Paint to match your wall (or your trim color), put it over the outlet box, and install the plate.   The plate will hold it against the wall, or you can use a couple short screws (keep in mind that you have wires in the wall above and/or below the outlet box).
If you have access to a router, you could put rounded (or fancier) edges on the trim piece, round the corners, etc.
Answer: If you want to get a flush finish (and not hide it some other way) then you are going to need to remove and replace the electrical box.  This is not that difficult of a job.
First, turn the power off.  Remove the cable clamp(s) as well as the ground wire from the box.  Figure out which side of the box is the stud, and pry the box away from the stud enough that you can see the nails. You can use either a hacksaw of a sawzall (more fun, but careful not to cut your drywall) to cut the nails.  Now remove the box.  You have two options to replace it with. Either you can use a remodel box; these are boxes that have tabs on them that screw in to secure the box into the wall, or you can use a regular electrical box and try and screw it to the stud from inside of the box.  First pull the cable(s) through the appropriate locations in the box (you will have to remove the knock-outs) and then secure the box place.  Re-attach the ground wire to the ground screw, tighten the cable clamps and replace the outlet. Before you put on the cover, turn the breaker on and test your work. I always like to screw in my outlets before I test them because I've had the side of the outlet make contact with the electrical box and short out.


How do you say "not now"?

Question: Sometimes children (say 3-5 years of age) want you to play with them, but for whatever reason, you cannot participate.
How do you say "not now" without hurting their feelings or making them feel rejected?
Answer: I found two ways of dealing with this.
First, when we get home I give my kids about 15 minutes of my time before attempting what I think 'needs' to get done.  This way I have given them my attention and then I can say something like, I need to make dinner it will take about 10 minutes and then I will be back.  this avoids the whole issue.
Second, when the issue does come up I tell them about how long it will be and what we will do when that time comes, I then suggest what they can do while waiting.
Answer: The best thing is to let them know when. They won't mind "not now" if they know that their time will come.
We do this by using a timer. If I am working on something and the kids want some time that I don't have immediately, I will set a timer for 30 minutes, or 60 minutes and then when the timer goes off I make some time (even as little as 10-15 minutes). This way they know when their daddy time is coming and can see how long it will be. And when the timer goes off they can come get me.
Hope this gives you an idea.
Answer: I know how it goes... you're cooking dinner, or are in rush hour traffic, or on the phone arguing with your exwife (ahem) and your kid is all about "can I do bla bla bla?" while your brain is occupied and can barely eek out the cycles to say "not right now" let alone come up with a coherent answer.
My answer to your question is to change your own habit. Change-up into something just as low-cycle, but more meaningful... "ask me in a couple minutes" or "lets get home and then we can talk" . . .
Or, my personal favorite "Dude, i'm on the phone and you're interrupting. what are you supposed to do when I'm having a conversaton?" "Say 'excuse me dad'." "Right so let's try it again." . . . . "Excuse me, dad?" "Not right now."
Comment: Except that they learn that "excuse me dad" gets them nowhere which is why they don't use it. Come up with a hand signal if you want but better to communicate "not right now, I will come find you when _____ (I finish this call, etc)
Comment: @ChristineGordon If that's what works for you, great. With my almost 70 collective years of parenting, I've found this to work with my kids over a hand in the face. Besides... the last paragraph was humor.
Answer: So in addition to the other wonderful advice offered already.  If it is just attention they want, it is often possible to involve your kids in what it is you need to do.  Even if the request is, "Will you play with us Dad?" your answer can be, "Actually, I could use your help with something.  Will you help me so I can get this done?"
For example, if you are getting dinner ready, why not have them help by measuring something out?  "rinsing dishes" - yes, you'll probably have to do it again, but still - or just sitting and talking about their day while you listen and do whatever it is that needs doing.
With Laundry, I always asked my little one to fold washcloths and kitchen towels and to match the socks.
Even if I was creating a shopping list, I had (my own and sitting charges) "write" the list down for me just in case I lost my own list along the way. At three, you will just get scribbles, but that is okay because they can read it to you (and you made your own too).  This often helped me because it prevented the request being made 100 times in ten minutes.  Since I rarely used, "give me five minutes" or "you'll have to wait just a bit" they tended to be more respectful when they did have to wait (most of the time).
The answers from monsto, chris M, and Morah H all offer up great ideas for how to delay things when "doing with" absolutely will not work (like finishing up that argument with the ex - ahem).
Comment: Matching socks is a great cognitive tool for little ones! Sorting is so important at that age. And how nice when it is something you actually need sorted :)
Answer: As usual, I love @balanced mama's answer, but to add:
Schedule special time once weekly with each of your children. Let them suggest several activities and you choose one from their list that you could agree to. Going to Starbucks, playing games, working on projects (a car, treehouse, etc) are examples. Even if its just an hour a week, your child knows they are a priority and that spending time with you is fun. This is a fantastic way to bond with your child and to keep it up through the years. The key is that it is something you both enjoy doing and that it provides opportunity for conversation (ie not movies). Both parent should do this with the child separately, and it should be a consistent, regular schedule.
It is far too easy for life to get in the way of quality time with each child so scheduling it really helps ensure it happens.
The younger your child when you start, the better!

How do you say "not now"?


Home networking with win7

Question: Ubuntu natty installed and I want to see the windows machines on my home network. I cannot browse the network from the Ubuntu machine, nor can I see it from any win machine (mix of win7 and vista).
Ubuntu machine is wireless and working just fine.
I would like to share files across the network as well. Any help would be awesome! Thanks!
Answer: Use ipconfig in a dos shell to get the ip address. On Ubuntu use ifconfig in a terminal to get the same.
Now try to ping your boxen. If they ping then you know that they are 'on the same network'.
You can also put the IP address in the explorer window address bar on the Windows PC. If you have your shares etup correctly on Ubuntu machine it will show them.
A more useful tool from the Ubuntu box is zenmap. You have to run it as root and install nmap dependency. This lets you see everything visible on your network, even if you cannot see it normally as it is a clever network scanning tool.
Establish the basic connectivity, make sure your shares are setup, make sure they can be found by IP and then you will be part way there.
Another thing is you need DHCP rather than static IPs unless you want lots of 'hosts' files in your boxen.
Answer: When networking with Vista and Windows 7, you need to disable all of the security within the network settings of all windows machines.  The "HomeGroup" function adds a type of authentication that will not function with the Samba client that Ubuntu uses to access Windows shares.  Turning all this off will allow you to browse.  The individual permissions of your shared folders may keep you from reading or writing, so be sure to check those as well.  Also, make sure you have your network in the Windows machines to be a "private" network, realxing the firewall a bit.
bertmanphx

Home networking with win7


How can you reveal your product to the masses while still protecting your idea?

Question: There are sites like kickstarter which allow you to demo/display/show off your product with hopes that these viewers will help you and invest/donate capital. How can I raise capital on an idea without the huge patent investment? Should I apply for a patent pending application first?
Answer: A good option for you is to file a provisional patent. It costs a few hundred bucks ($250, or $125 for a "small entity") and can be as informal as you like. It could even be the exact same description you put on your Kickstarter page. However, note that whatever is in the provisional application limits what you can "claim priority to" later, so you want it to be as detailed as possible.
A provisional application secures a "priority date" (holding your place in line, as it were,) and to keep it, you must file a proper non-provisional patent application within a year of the provisional filing date. In a year's time you may be better-informed to decide whether to fork out for the costs of a non-provisional patent, e.g. depending on if your Kickstarter has reached its goal.
Answer: You can also file a defensive publication. This creates prior art and makes it so other people can't patent. Downside is that if you do this prior to filing any provision patent applications you cannot file for a patent. Check out ip.com or http://www.defensivepublications.org/
Answer: Generally speaking, there is no such thing as a "patent on a product" (with the exception of design patents and the like). Rather, individual aspects of technology can be patented. Such a patentable aspect has to solve a technical problem using a technical solution to cause a technical effect. Generally, one cannot obtain a patent for instance on the overall appearance or a generic formulation of the "purpose" of a device. The first question would be, do you have a good idea of what such a technical aspect would be? And if yes, is it actually necessary to reveal your technical solution in order to market your project? Generally, you should be able to make the public claim that your product does xyz and/or does it in a better way, if you do not reveal HOW it does that.
Obviously, this is a tricky issue, and filing a patent application (then with an as-detailed-as-possible description of all potentially patentable aspects) is the only sure way to secure a priority date.
Also, you have to decide what your main objective is: Do you want to prevent other people from copying your idea, do you want to prevent them from getting a patent on the same idea first, or do you want to make sure that you will be able to obtain a patent at a later date yourself? These are slightly different issues and may require different strategies. A defensive publication, for instance, precludes competitors from obtaining a patent on the same idea, but also yourself. And since your idea has been published, you can be sure it will be copied if it is relevant.


Noled -- Ossur on Yom Tov, Muter on Shabbos?

Question: Why is it that there apparently are some poskim (Halachic authorities) that hold Noled (something that didn't exist before the onset of Shabbos or Yom Tov) is Muter on Shabbos but Ossur on Yom Tov? (At the moment I don't have any good sources to back up this claim...)
Answer: The Gemora (Beitza 2b) explains that since Yom Tov in general is more lax than Shabbos, they were more stringent about mutkzah in order that people should not disregard it. See Shulchan Aruch Harav (OC 495:13) for the various opinions l'halacha.
Answer: What @Michoel said.
Note that it's not just nolad that's more machmir. There is a machlokes generally by muktzeh between R' Shimon (lenient) and R' Yehudah (machmir). On Shabbos we follow R' Shimon, and on Yom Tov we follow R' Yehudah.
The gist of the machlokes is whether your intentions affect the muktzah status of an item. For example, if you have a pile of seforim but you have them to sell, not to read, R' Yehudah says that is muktzeh since you didn't have intention to use them on Shabbos/Yom tov, and R' Shimon says it isn't because he doesn't hold of that restriction.
So lemaaseh, on Yom Tov when we go like R' Yehudah, whatever could be classified as not intended to be used when Yom Tov came in, will be muktzeh. Obviously ask your LOR for specific cases.
(I don't have the sources here, I think it's the second or third siman in hilchos yom tov in Tur/Shulchan Aruch - see there)


Can I transfer my Xbox 360 content licenses to another gamertag/account?

Question: I know that I can transfer licenses between Xbox 360 consoles (say, if replacing a broken console), but is there any way to transfer (permanently move) licenses/ownership from one gamertag to another (say, when retiring a gamertag)?
Answer: You can not transfer the license of content you purchased to another account.  You can, however, set content you've purchased to be accessible by other profiles on another Xbox (possibly what you're already aware of).
See here for details:
http://support.microsoft.com/kb/963711
And another link I found:
http://support.xbox.com/en-US/xbox-live/marketplace-and-purchasing/download-content
Answer: Actually, you can transfer it to another account! It's easy: you need to create your new account and then call Microsoft and they will help you transfer your licenses to the new account.


Does searing meat lock in moisture?

Question: I just saw a claim to this end in another thread, and it is perpetuated about the internet and in many cookbooks.
So: Is it true? Does making a nice crust (maillard reaction) on a roast seal in juice and yield a juicer end product?
Answer: No. As you noted, searing beef performs what's called the Maillard Process (or Reaction) which is a specific form of caramelization. Nothing is "sealed" into the meat because the meat isn't sealed by the process. It's still porous and will therefore leech moisture during cooking. You can retain moisture in cooked beef by buying quality beef and not cooking it beyond medium-rare to medium.
Comment: Here's an actual test: http://www.seriouseats.com/2009/12/the-food-lab-how-to-cook-roast-a-perfect-prime-rib.html See 'The Myth of the Sear' "meat that was seared first them [sic] roasted lost 1.68% more juices"
Comment: The Maillard reaction is not "a specific form of caramelization". It is a different chemical process altogether.
Answer: Alton Brown did an experiment in an episode of Good Eats called "Myth Smashers". http://www.youtube.com/watch?v=AW9npAc2Sgw
If you are measuring the overall progress by internal temperature, then searing the outside will not result in juicier meat.
However, if you are new to cooking and trying to measure doneness by the outward appearance you see at a steakhouse, then by the time the steak looks "done enough", it will probably bone dry inside.
On the other hand, there is usually a reason behind most myths. It might be that the savory result of the crust combined the greater contrast between the texture of the crust and the center of the meat makes your brain interpret it as juicier.
What matters most is what you enjoy, so cook one steak with searing and another without. Do a blind taste test and see which one you actually like more.
Answer: Searing meat is beneficial for developing color (color = flavor in cooking) and for "jump-starting" the cooking process.
As noted in the previous answers the more browning and crusting (within reason) that you develop the more flavorful the meat will be.  A good experiment to compare the difference that browning has on the flavor of food is to saute a piece of chicken breast and poach another chicken breast.  The sauteed will have a richer "meatier" flavor than the poached one.
Searing also "jump-starts" the cooking process by quickly transferring the heat to the interior of the meat so that it will take less time when roasting in the oven. If a large roast is simply seasoned and placed in a preheated oven the exterior of the meat has to first heat up before the heat is conveyed to the interior.    If another roast of the same size is first seared and then transferred to the oven at the same time the first one is put in, the second roast will reach its finished desired temperature quicker because the exterior has already been heated and the oven heat will continue to keep the exterior temp. elevated to quicker convey to the center and cook.
Answer: Bill Buford in [HEAT][1] discussed this, and came up with the conclusion that we brown meat simply because it tastes better.
There are many fallacies that have crept into our kitchen culture because of careless cookbook authors.  For example, The Joy of Cooking is responsible for the American need to rinse off pasta before saucing.  (Something you should never! do).
As well, it has been shown that there is no harm in washing mushrooms, other than the hot fat/water splatter if you don't pat them dry.
[1]: http://www.amazon.com/Heat-Adventures-Pasta-Maker-Apprentice-Dante-Quoting/dp/1400034477/ref=sr_1_3?ie=UTF8&s=books&qid=1279638666&sr=8-3 HEAT!
Comment: Minor quibble: when preparing pasta for some cold applications (e.g. a salad), rinsing is usually a good move to prevent clumping and over-thickening the dressing.
Comment: @roux.  I agree.  I always rinse pasta before making a salad.  However, the post was referencing rinsing BEFORE SAUCING, which I hope was clearly about hot pasta and sauce.
Comment: Aye, just wanted to correct the slight myth that was in the myth correction ;)
Answer: To eliminate the juice, the best thing to do is to let the meat rest for around 10 minutes after you take it off the heat.
If you start cutting the meat before it has rested, the juices will run no matter how much it was seared.

Does searing meat lock in moisture?


What are some resources to help understand child development?

Question: I would like some recommendation for resources that will help me understand physical, social and mental development in a child. Also, it would be great to have some resources that suggest activities/topics/etc. that would help the child develop at different ages.
Comment: ... you could also ask specific questions here on this site, and the crowd will provide answers and experiences ...
Answer: I would say that the best resource (INHO) is your pediatrician. Honestly it is their business to know what your child's needs are.
I also found Baby Center to be a great reference with regular email updates and a nice community.
Then there is the classic "What to expect when..." series of books.
Answer: In addition to speaking with your pediatrician when you have a specific question, I liked the "The What to expect" books for the most part, but I actually found Dr. Sears' Book, "The Baby Book" more useful (especially in regard to suggestions etc.)  during my daughter's early years.  Here is a link to a related website with contributors that are all pediatric physicians or nurses.
I have also thoroughly enjoyed a book called "The Busy Book" with all kinds of ideas for activities to do with your toddler.  I also offer up ideas from my daughter's own toddlerhood, time with a little boy I nanny, and memories from my years as a preschool teacher on my website for activities that are particularly fun from time to time.


Adobe After Effects vs. Final Cut Express for chroma keying

Question: Which is better for chroma keying, Adobe After Effects or Final Cut Express and why?
Comment: have a look at Mocha for After Effects (it ships with it)
Answer: I haven't tried chroma keying in Final Cut Express, but I'm pretty sure it depends on your needs and workflow. If you use Premiere for editing movies than AE should be more integrated.
Yet, if you really want to get awesome results and have some spare bucks, I'd say you look at some plugins. After all neither AE nor FCE is specialized in chroma keying. There are plenty of companies out there that build specialized plugins that might give you better results, and they usually offer them for all video solutions (AE, Premiere, FC, etc)
Answer: After Effects is well know as a finishing software. The best chroma key plug-in I saw in A.E. was keylight. Very nice full controls, to handle even color/light correction of borders key. I don't know if keylight is avaliable for FCE. Maybe the only benefit inside FCE is rendering time. Real tests can talk a lot more.
My vote goes for After Effects.
Answer: While AE has a chromakey plugin in the box, I have good experience with:
http://www.redgiantsoftware.com/news/featured/KeyingSuite11/
There are several tutorials on there website, and this gave me the best results.
Of course, your footage is the key


bottle.py WSGI server stops responding

Question: I'm trying to build a simple API with the bottle.py (Bottle v0.11.4) web framework. To 'daemonize' the app on my server (Ubuntu 10.04.4), I'm running the shell
nohup python test.py &

, where test.py is the following python script:
import sys
import bottle
from bottle import route, run, request, response, abort, hook

@hook('after_request')
def enable_cors():
  response.headers['Access-Control-Allow-Origin'] = '*'

@route('/')
def ping():
  return 'Up and running!'

if __name__ == '__main__':
  run(host=<my_ip>, port=3000)

I'm running into the following issue:
This works initially but the server stops responding after some time (~24hours). Unfortunately, the logs don't contain any revealing error messages.
The only way I have been able to reproduce the issue is when I try to run a second script on my Ubuntu server that creates another server listening to a different port (ie.: exactly the same script as above but port=3001). If I send a request to the newly created server, I also do not get a response and the connection eventually times out.
Any suggestions are greatly appreciated. I'm new to this, so if there's something fundamentally wrong with this approach, any links to reference guides would also be appreciated. Thank you!
Answer: Can you make sure the server isn't sleeping.
If it is, try enabling Wake On LAN http://ubuntuforums.org/showthread.php?t=234588

bottle.py WSGI server stops responding


Spam to deleted e-mail addresses

Question: I keep getting delivery status notification failure for contacts no longer in my address book, for e-mail links I'm not actually sending. Any way I can stop this?
Answer: Not really, no. You are the unfortunate victim of a spammer that's using your email address in the from and/or fail-to fields in the messages that they're sending. I believe it's a way to try to get around anti-spam measures that check to see if the sending address is valid.
I've been the victim of some of these myself, at various times over the years. They usually calm down after a little while (or the Gmail filters get smarter).

Spam to deleted e-mail addresses


Do BSD and SunOS have multithreaded architectures?

Question: I'm interested in operating systems that have a multithreading architecture, like Mach and BeOS; not ones that depend on libraries like POSIX to be multithreading. Do BSD and SunOS have a multithreading architecture?
Comment: Can you clarify what versions you mean ? Both BSD and SunOS cover a wide set of operating systems that have evolved quite a lot during the last three decades.
Answer: The name "SunOS" covers at least 2 families of operating systems.
The original "SunOS" was a 4.2BSD-derived system, and Sun put out versions up to 4.1.4. The Sun version only handled multi-CPU systems towards the end of its life, around 1994.  A company out of Longmont, Colorado, Solbourne Computer, made multi-SPARC-cpu machines, and had modified SunOS (don't remember the version) to be multi-threading. About May 1990, I got to use a multi-CPU Solbourne box.
The SunOS family that more popularly goes by the name "Solaris" was an ATT System V derivative.  It could most definitely handle multi-cpu hardware.
You could and can do multi-threaded userland programs under both families of SunOS. Someone put out a signal-handler-based threading package that worked well for SunOS 4.1.x versions, and Solaris came with Pthreads and some other threading package that were almost exactly the same in terms of API. The Solaris threads could be made to run 1:1 against a kernel thread, or you could run multiple userland threads on a single kernel thread.
Answer: FreeBSD's kernel is multithreaded; user-space applications use the POSIX pthreads API to do multithreading, but those APIs are implemented on top of the kernel's native multithreading capabilities.
Last I knew, POSIX threads on OpenBSD were implemented in user-space, not using kernel-based threads.
Answer: FreeBSD has a SMP friendly kernel with multiple threads of execution and many parts of the kernel can run independant and it supports preemption.
NetBSD has been working on the same thing for many years.  DragonFly BSD started over on the work (from FreeBSD4) and use message passing, etc.
OpenBSD and MirBSD do not have complete GIANT lock free SMP implementations for their kernels and the latter does not want to ever do it.
MidnightBSD is basically the same as FreeBSD 7.