A glass of water with ice-cubes in it. Where's the water the coldest; at the top or bottom?

Question: Suppose that I fill a glass with ice water.  As the ice melts, it cools the water around it.  Given that cold water is denser than hot water, I would presume that the cold water would sink to the bottom … but it would warm as it sinks, reducing the density.  Meanwhile, the ice is still melting and giving off its cold to the surrounding water.
So is drinking ice water with a straw going to get you cooler or warmer water than drinking from the lip of the glass?
Comment: https://en.wikipedia.org/wiki/Grashof_number
Comment: Hm, but the ice is near the top... shouldn't the water immediately surrounding it be colder than water farthest from it? Cold water isn't lead, it takes a while to sink...
Comment: No stirring with a significant amount of just water from melting ice and much ice floating on the surface. The temperature of the ice is 0 Celsius or lower. Since the ice is melting the surface T of the ice is 0 C and the water surrounding it is infinitesimally lower. Any water removed from the ice must again be slightly warmer the warmer water   reaching 4 C will be at the bottom. The water at the top in contact with the ice is the coldest water so sip from the top to get cooler water; a straw from the bottom to get 4 C water. [provided enough ice to maintain 4 C.] Stir well for cold thruout
Comment: The water surrounding the ice is slightly warmer not lower. It pays to proofread!
Answer: Interesting question!
A few things first:

As the ice melts, it cools the water around it.

Technically, the ice cube melts because the water cools down. This may sound ridiculous at first, but you must consider the fact that the ice melts because it has drawn "heat" (energy) from its surroundings. The "surroundings" being the air and water that surround it (but the water's more important since it's a better conductor of thermal energy).

Given that cold water is denser than hot water, I would presume that the cold water would sink to the bottom...but it would warm as it sinks, reducing the density.

You're right, cold water is denser than hot water. It is helpful to note that it shouldn't be too cold though. As the temperature of water drops to 4 °C, the density of water gradually increases. However, as the temperature drops below 4 °C the density of water actually begins to decrease and water in this range easily "floats" over water in the room temperature range.

Meanwhile, the ice is still melting and giving off its cold to the surrounding water.

Ice isn't giving off its "cold", rather, it takes in the water's "heat" (thermal energy).

Back to your question.
As Max mentions in his answer, you have done a particularly good job of indicating what physical parameters we're dealing with; the really important ones being the temperature of ice, temperature of water (at the time you put the ice in) and the quantity of ice used (at least with respect to the water).
But assuming you're drinking water (originally at room temperature) out of a 250 ml styrofoam or plastic cup, and you used two (normal-sized) ice cubes and that you began drinking the water a minute after you plonk in the ice cubes, the water should be colder at the top than at the bottom.
Consider minute, imaginary layers/regions/packets of water in the cup (thinking about this in terms of water "packets" rather than water molecules is easier to comprehend). Also, think of the cup as having three (crudely demarcated) regions: Top, middle, and bottom.
Packets of water immediately adjacent to the ice cubes are in thermal equilibrium with the outermost regions of the ice. However, these packets soon gain some thermal energy from other water packets that are adjacent to them. So as these packets slowly rise in temperature, from zero degrees to past 4 °C, they sink and new packets occupy locations adjacent to the ice. The cycle repeats for as long as the ice is there.
Now, as those packets of ice sink, they gain more thermal energy from the packets of water they come in contact with on their way down. This, coupled with the viscous effects of water results in the mild "warming up" of the sinking packets.
Now since they warm up a bit, they tend to rise back up. Back at the top, they're get cooled and sink again. This process repeats for as long as the ice remains in the water.
Take a step back, and you'll see that the middle of the cup ought to be cold, the bottom of the cup ought to be colder, and the top of the cup is the coldest.
So even if the ice cubes aren't actually touching your lips, you'll find sipping the water at the top to be colder than sucking out water from the bottom through a straw.
Answer: The convection to produce uniformity depends on a number of nebulous factors:

How much ice?
How tall is the glass?
Diameter of the glass?
Is the "glass" really a glass or paper cup, styrofoam cup, or perhaps a metal cup?
Initial temperature of the water.
Mass of water to mass of ice.

The gist is this. Lakes don't freeze solid in the winter. Without stirring, the lake water forms layers that mix very, very slowly. So the frozen ice floats on top of the lake.
So without stirring, the water at the lip is likely to be colder than the liquid at the bottom of the glass.

EDIT - This is an experiment that you can easily do at home. Fill a large clear glass (a real glass glass...)  about 2/3 full with tap water and add food coloring with stirring to make the liquid fairly dark. Then add enough ice to fill the glass without stirring. Let the glass sit on a solid counter until the ice melts. (Nice experiment to run overnight....) Because the water has layered, the layer of water on top will be noticeable lighter in color than the layer on the bottom.
Answer: Heat flows by radiation, conduction and convection. First, I have to quibble over the term "ice water". Ice water may or may not contain ice. What it clearly implies is that the water is at 0°C. Consider a system where there is minimal air flow (hence minimal air-water conduction). Consider a system where the water (here water = liquid water) is at 0°. Ice is typically created at between -15°F and +25°F, depending on the freezer. It is in all cases, below 0°C (obviously). Now what happens in an ideal case when I put a "tiny bit" of ice into water at 0°C? Yup, the water all freezes. Now of course because the real world is not continuous, this won't really happen and it is possible to construct a system in which water and ice are at equilibrium at 0°C - but it is definitely not "easy".
I mention the above to show you that you've failed to adequately specify your system. The masses and temperatures of the water and the ice matter. As does the temperature of the air, the temperature of the container, and the temperature of the bench/table. With a sufficiently insulating container, you still have to worry about the mass flow (currents) you've given to the water by pouring it. (These currents may take hours and possibly days to completely dissapate - even under near isothermal conditions!) And of course the shape of the pieces of ice matters. Consider a (perfectly insulating) capillary tube and a shallow tray with the same total volume capacity. The mass-flow and the thermal flow will be much different. Hydrodynamic calculations can be (and almost always are) enormously difficult. The water can't be any colder than 0° (ignoring supercooling). That clearly must occur in contact with the ice. But consider a cylindrical cup 10 cm in diameter (i.d.) Do you think that the answer would be different if I placed a 1 cm3 ice cube in 1 L of water in that cup OR if I placed a 1 cm thick disk with an diameter (o.d.) of 9.9cm into the cup? Yeah, under-specified system, big time. Another obvious missing piece is what you mean by temperature. Not in the sense that it's not a well defined (macroscopic!) property, but in the sense that you are (probably) thinking of the average temperature over some volume. As I said, the coldest water will be found "in contact" with the ice, but this doesn't mean the entire surface will be on average colder than the bottom 0.1 cm in the cup since it obviously depends on things you've not specified. Imagine as a final "monkey wrench" in the attempt to answer this, that the cup contains an insert and that metallic insert has been cooled to -200°C. You pour the 0°C water in, along with some unspecified amount of ice and you get some freezing of the water on the entire inside surface of the cup. Now even if we include this ice when we specify the volume and temperature of the ice, do you really think this ice would have the same effect as floating cubes? Or consider a ring of ice instead of a disk, and what about the surface roughness of the cups lining?
Answer: When the temperature goes down the kinetic energy decreases, the volume is decrease and then density goes up. Therefore solid is sink and liquid is on top.
It is related to the water but only up to the 4 °C. When there is water 10 °C, the temperature of the water goes down to 9 °C, the 9 °C water will go down because of the more density.
But when we take 4 °C water temperature goes down to 3 °C. It is different. You know that there is hydrogen bonds between each $\ce{H2O}$ molecule. The shape of $\ce{H2O}$ molecule is 'bent'. The two hydrogen atoms can make two hydrogen bonds with two oxygen atoms, and two lone pairs of electrons of the oxygen atom makes two hydrogen bonds with another two molecule's two hydrogens. Then it can have a tetrahedral shape. You know that solid has a regular structure. (Liquid) water has no regular shape, there are molecules and hydrogen bonds everywhere irregularly. When the temperature goes down from 4 °C as to the regular shape the tetrahedral $\ce{H2O}$ molecules tries to increase the distance and come to a regular shape. So, the volume goes increase and the density goes down. Then after 4 °C to down temperatures (3, 2, 1, 0, −1) the (water) floats on the top.
Answer: For the cold water to sink to the bottom of the glass, it has be colder than the water at the bottom that is displaced. So yes, the coldest water will be at the top.


Unable to flip the fog upside down

Question: I am relatively new to Blender and am doing Andrew Prices' tutorial on Youtube for "Make a Grassy Meadow". I am at minute 44:25 where he flips the mist cube upside down. Unfortunately for me when I flip my cube the gradient remains the same, with the fade ending at the bottom. Does anyone know how to work around/ fix this?
Answer: For something simple like this, I would just separate the generated coordinates into XYZ and use the Z value plugged into a ColorRamp node.
This will give you a far better control of your scattering density.
The object orientation should be world oriented (at least if you're using Generated or Object coordinates), so that the Z axis is aligned to the world Z axis.

On the right 3DViewport you can see that the local axis for the box has at least the Z axis (blue arrow at the center of the box) aligned with the world Z axis (the blue arrow at the bottom left corner of the viewport).
The Z axis is then used from the 'Generated' coordinates, which are mapped from the bottom/top to a scale of 0 to 1 and plugged into a color ramp, that defines the vertical density map.
Comment: Okay, I have been looking at my file, but again I'm pretty new to blender, I can't figure out how to do this. Is there any way you can send a picture of how the nodes should look, and how to make the object world oriented? Thanks for any additional help.
Comment: Picture included! ;)
Answer: It's likely that you have 'flipped the cube upside down' in Edit mode. This will leave the coordinate mapping unchanged. Instead, ensure you're in Object mode before trying to flip it.

Unable to flip the fog upside down


Running windows under virtual box for software development - performance issues?

Question: So I have a question about what system I should use to do some C# development. In my course this year at least half of my courses require me to be using Windows specific programs i.e visio, MSSQL, C# etc. I know there are alternatives but I would like to stick to these. I'm wondering about two choices and wanted to know what people could suggest - I am more concerned with performance issues. I have a Macbook Pro and I could run windows 7 on it under virtualbox where I could give it 4gb of ram. Remember I would need windows open a lot with potentially multiple programs running. I also have a desktop gaming rig from a year ago which is much more grunty and am contemplating just using that instead where I could run windows natively. I would prefer to use the mac, but really what I wanted to know is if anyone else uses windows under vb with 4gb of ram dedicated to it with no performance issues?
Comment: What about dual boot?
Comment: if I am going to do that I may as well use desktop
Answer: It depends on what type development do you want to do ?  If you will develop desktop,web,console application 4gb ram will work fine for you but if you develop mobile projects or games it will be a problem future times. I have co-worker friend who using MacBook Air and developing C# programs he is using two OS one of them is orginal MacBook OS other one W8 if you have 2 section HDD you can create another OS on your notebook. I think best solution for this stuiation is setup Windows 8 to your computer.


Development Tools

Question: I just downloaded and installed the latest version of Ubuntu 18.04 (ISO was ubuntu-18.04-desktop-amd64.iso).  I noticed that no development tools are installed by default (git, gcc, g++, make). Is there a developer ISO that has the distribution with the usual development tools installed or do I have to manually install all of these?
Comment: @muru I interpreted the question as Are developer tools installed by default? (ps not saying this because I wrote an answer **:)**
Comment: @ubashu and it seems to me that the answers to the other question will always directly lead to an answer to this question (if they were installed by default, the other question would have had an answer: these tools are installed by default). This q is just a minor rephrasing.
Comment: If by manually install you mean go out and find some binary tarball and install that, nope. APT has nice and easy packages for that. Takes about a minute to install everything if you have a fast Internet connection.
Answer: No, there is no developer ISO. Yes, you do have to manually install them. Ubuntu is made to be a distribution aimed at ease of use on the desktop meaning that the main use is word processing, etc.
To install basic development tools, run:
sudo apt install build-essential

Any other tools can be installed with:
sudo apt install tool-name

Comment: @James, using that analogy, when you are done installing Windows, do you have Visual Studio, all the windows SDK's, etc? Would kind of be upsetting if that was the case for most people to have that must disk chewed up. Oh, and if you aren't a Windows developer, perhaps you'd prefer Eclipse etc. That really is the point.... to be productive developing on any OS, you need to install what you know you need. The good news is, once you know what you need it is all a snap or apt away: https://www.ubuntu.com/desktop/developers
Comment: @James as i said, **on the desktop**. This means for the average home user, nto for developers.
Comment: How is it "ease of use" if I have to manually install 200 little pieces of software to make it useable for work?
Comment: But people who use their computer for work use the desktop as well. The success of Windows was exactly due to people being able to use the same system both for work and for home use. I don't see why 'ease of use on the desktop' should exclude 'ease of use for developers'. Desktop includes development work.
Answer: DKMS installs gcc and make automatically
DKMS (Dynamic Kernel Module Support) automatically installs gcc and make in order to compile kernel modules from manufacturer's source code. It's often necessary to compile source for some WiFi Drivers, Graphics cards, etc.
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

You are definitely correct that git is not installed by default however I don't consider it a programming language, more of a library system.

Development Tools included by default
The preferred (IMO) methods of development within the Ubuntu family is using interpretive languages like Bash, Python and Perl. These are all installed by default. With additional GUI interfaces such as dialog, zenity and yad (this one requires manual installation), there is more than enough development tools to keep people busy learning and experimenting.
Comment: No version or flavour of Ubuntu has `g++` installed by default. (`gcc` used to be, I think until about 14.04, but never `g++`, nor `make`.)
Comment: @muru It appears `gcc` and `make` were automatically installed by `dkms` for compiling kernel modules from manufacturer source code.
Comment: @WinEunuuchs2Unix very good point

Development Tools


What kind of electronic device is this?

Question:
I have been taking apart a old television circuit board and I found several of these things. They look like resistor but when I test them with the multimeter the resistance is very low, around 10 to 20 ohms.
Comment: about 3 cents :)
Comment: Are they labeled on the PCB? R = resistor, L = inductor/ferrite bead, FB = ferrite bead. My guess (from the rounded shape) is that it's an inductor, but I could be wrong.
Comment: Yes, there is a L.
Comment: So if it is a inductor, what is its value?
Answer: That would be an inductor with a resistor style color code.
Here's a picture from that Wikipedia page showing some similar 100 µH axial lead inductors:

Vahid alpha at English Wikipedia CC BY 3.0, via Wikimedia Commons
Comment: Didn't know  they packed inductors into this shape. I always imagine them as unsightly spools of wire taking up space on the top sides of many PCBs.
Answer: It seems very likely that it is a small-value inductor.
There is an open-source LCR meter available from dozens of vendors on Ebay for USD 15~20. Quite ingenious, dirt cheap, and excellent for identifying not only what a mystery component is, but also measuring all the key parameters. (Like inductance and series resistance for your inductor, for example.)  Recommended for anyone who recycles electronic components.
Search for "Transistor Tester Diode Triode inductor Capacitance ESR Meter LCR" There are many to chose from.
Answer: This is what a 10mH looks like. BRN-BLK-BLK
Since there are so many turns, it looks fat. The resistance determines how many mA can be passed thru with DC for filtering purposes in a low noise LC LPF supply.
http://www.digikey.com/product-search/en/inductors-coils-chokes/fixed-inductors/196627?k=&pkeyword=&pv7=3&pv19=90&FV=fff40003%2Cfff80013&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=500
Answer: That's a 10 μH inductor (brown-black-black = 10e0).
Low-value axial inductors of this sort are colored green to distinguish them from resistors.
With the increasingly common use of surface-mount technology, axial inductors (and resistors) aren't common in low-power circuits these days, except in some very cheaply made, hand-soldered devices where the factory doesn't have a pick-and-place machine (the stuff often associated with super-low-cost Chinese labor).
Answer: Given that the colour bands appear to be
Brown Black Black =
1 0 x 10^0 = 10 Ohms
then concluding that it MAY be a resistor may be a good guess.
However, it may also be an inductor or "choke".
If you are happy to destroy one, carefully scrape the outer layers off.
If it is an inductor it will probably have a ferrite bobbin core plus many turns of very fine wire.

What kind of electronic device is this?


Validation error slightly smaller than training error?

Question: If my validation error is smaller than my training error, what does this imply? Does this mean the model is 'underfit'?
Comment: Could you elaborate on your question? Perhaps post some code or results?
Answer: A model is considered to be 'underfitting' when both the training and validation error are high. When your validation error is lower than your training error than the fit is obscure and inconclusive.
There are multiple reasons why this can happen but one can't be completely certain. It could be because the test cases during the validation belonged to the type of data that influenced the model the most while training or maybe because the test cases contain the type of data that your model is good at predicting. If there is a very small difference, it could be random.
Although, based on your question it is difficult to comment more specifically without knowing the train-test split method or the evaluation metric.
Regarding underfitting and overfitting you can keep these in mind:

Underfitting: High Validation and Training Error
Overfitting: High Validation Error and Low Training Error


How to create an infrastructure for node endpoint resolution on a multi-node network

Question: I'm building a multi node private ethereum network with Quorum. I would like to give users of it a single url, like https://eth.domain.com, to connect to.
At the moment, eth.domain.com resolves to a single node. If that node is down, nobody could connect to the network even if other nodes are up. Is there any "standard" mechanism in place in Ethereum networks to support such a scenario, apart from using Infura?
First possible solution that came to my mind is to use Round robin DNS, but this approach has drawbacks and doesn't prevent to be directed to a node that is down.
Another possible solution would probably be to use a load balancer that checks specific node health and direct traffic only to healthy ones. In this case I don't have any experience, so I would appreciate any hints on how to implement it. Of course this would become then the new SPOF, but this seems easier to manage than single eth nodes that could "easily" get offline. Thanks in advance.
Answer: Never used it, but this seems promising: https://github.com/emeraldpay/dshackle


Exception while deserializing DataTable with custom DataType columns using BinaryFormatter

Question: I'm writing a client-server application. I want to send DataTable table where most of columns are of type Pair. I have that public class Pair inside public class Struct on both Server and Client.
[Serializable]
public class Struct
{
    public class Pair
    {
        public int a { get; set; }
        public int b { get; set; }
            ...
        public override string ToString()
        {
            return this.a.ToString() + " " + this.b.ToString();
        }
    }
        ...
}

I send it from server:
(new BinaryFormatter()).Serialize(nStream, table);

Accept on client:
DataTable table = (DataTable)(new BinaryFormatter()).Deserialize(nStream);

And here I get a

TargetInvocationException "Exception has been thrown by the target of an invocation" with
  InnerException: ArgumentException "Column requires a valid DataType".

How to send this table over network and deserialize it?
Answer: You need to mark the inner class as [Serializable] also:
[Serializable]
public class Struct
{
    [Serializable]
    public class Pair
    {
        public int a { get; set; }
        public int b { get; set; }
    }
}

A nested class is not a subclass, it's an independent type that happens to have access to the protected and private members of its containing type.
Also, are you actually linking the same assembly that contains your Struct in both the client and server, or did you just copy the code?  BinaryFormatter actually records the assembly name and version of the types being serialized, and if, upon deserialization, that specific assembly is not found, deserialization will fail.  See How to serialize/deserialize an object loaded from another assembly?


Are these microscopic star-like structures on a dead leaf some sort of organism? If so, which one?

Question: I'm wondering what these star-shaped organisms are on a dead leaf I found in my backyard (Texas, USA). This was taken under my microscope at 40x magnification. They seem to be clear organisms with multiple outgoing "rays" that somehow benefit with being on the leaf. What's the identification? Are they even organisms? They appeared stationary. Response to comment asker: The leaf did not feel hairy.
Answer: These are stellate ("star-shaped") [and possibly peltate ("borne on a stalk")] hairs ("trichomes") of the leaf itself.

From Harris & Harris's (2001) ""Plant Identification Terminology: An Illustrated Glossary":

Peltate. a flat structure borne on a stalk attached to the lower surface

Stellate. Star-shaped, as in hairs with several to many branches radiating from the base. Figure 1686.

Trichome. A hair or hair-like outgrowth of the epidermis.

You can see a magnified image of stellate peltate trichomes on a leaf of a Texan native, Croton monanthogynus below:

 Leaf surface (abaxial) showing stellate, peltate trichomes. SOURCE: Nickrent, D.L., Costea, M., Barcelona, J.F., Pelser, P.B. & Nixon, K. (2006 onwards) PhytoImages. Available from: http://www.phytoimages.siu.edu
Comment: this looks like a cactus
Comment: @Féileacán I don't believe common species of cacti have stellate hairs. See https://www.nature.com/articles/ncomms2253 for an example. (Also, note: that cactus "hairs" you're used to observing are actually [spines](https://en.wikipedia.org/wiki/Thorns,_spines,_and_prickles#Spines) not trichomes -- specifically, spines that tend to be more delicate are called [glochids](https://en.wikipedia.org/wiki/Glochid). Trichomes on cacti typically associate with clusters of glochids for water capture, but such clusters of trichomes would appear clumped and apeltate unlike the imaged stellate trichomes.


allow vs. allow for

Question: Could anybody tell me which of the following is correct?
(1) This app allows up to 100 actions per day.
(2) This app allows for up to 100 actions per day.
Answer: They have slightly different connotations but generally mean the same thing.
"Allows" simply means a general meaning of allowance of something. "Allows for" generally means allowing a particular event or action that may happen in the future. Both are correct here. The second one is slightly more specific, however.
I can think of two examples that would best fit the connotations of these word forms:

Users can earn coins in-app. The app allows up to 1,000 coins to be stored in the virtual wallet.
Users can earn coins in-app. The app allows for the accumulation of up to 1,000 coins.

To allow for is to make an allowance for something. In your second example, your app is making an allowance for up to 100 actions to be performed per day. In the first, it is simply permitting this number of actions per day.
Honestly, it's hard to know which example I'd choose without the context. It depends how much you want to emphasise the actions as an action (the action part of it) or as a unit (the value it contributes to the total).
Edit: I would probably go with "allows".
Answer: Allows for up to for means "facilitates" or "is instrumental in providing," whereas allows up to without for means "exercises authority and restricts to no more than."
Use "allow" if you wish to communicate that your app is limiting people from performing more than 100 actions a day (like, because you are trying to get them to pay to do more, or you have some reason for disallowing more than 100/day).
Use "allow for" if you are stating that for some non-intentional reason, your app may not be suitable for those who need to make more than 100 actions per day.
Comment: 'Allow for' usually means 'be designed to cope with'.

allow vs. allow for


Sorcery supercedes instant?

Question: If I cast a sorcery spell to force the opponent to discard two cards, and he/she then casts one of those cards as an instant, would the instant apply first or would the sorcery take precedence?
Comment: Recommend learning about the concept of the stack, which is pretty fundamental to understanding MtG... http://wizards.custhelp.com/app/answers/detail/a_id/406/~/magic%3A-the-gathering---the-stack
Comment: In simple terms to add with all the answers below. A spell has to resolve however during the times where people can activate abilities, cast instant spells, that original spell has not resolved yet until the abilities or instants spells resolved. TL DR, Wait till what happens next finishes before yours if you start of course.
Answer: In simplest terms possible:  Your opponent can cast any instants in response to your sorcery, but he'll still have to discard 2 cards if he has any.
so, if you cast mind rot, your opponent can't choose 2 instants to discard and cast them instead.  He can cast instants before he chooses.
If you cast duress, your opponent can't cast the instant that you pick for him to discard.  He can cast instants before he shows you his hand.

Here's how It works

You have priority
You cast the sorcery.
You pass priority to your opponent
Your opponent may cast instant speed spells
You get priority
You pass priority to your opponent
Your Opponent passes priority
The instant spell resolves
You get priority
You pass priority to your opponent
The sorcery spell resolves from start to finish
You get priority
...

Everything that the sorcery spell does happens while it's resolving.  If you look at your opponents hand and choose the cards, than that would happen while it resolves.  If your opponent chooses, he chooses while it resolves.
Once the spell has begun to resolve, You cannot cast any spells until the spell has finished resolving.
Comment: @StevenStadnicki sorry about that.  It said that you **pass** priority, not that you lose it.  I've updated the list to be more explicit though
Comment: Would that still apply if opponent only has 2 cards?
Comment: I might add a tiny 'you get priority' or the like between 'You cast the sorcery' and 'You pass priority to your opponent' - by the rules of the game, you have priority immediately after casting the sorcery, and someone might read this as saying otherwise. (Though of course the floor rules sort of tweak this a bit)
Comment: @sandy, I think you're asking "if I play Mind Rot on my opponent, is he prevented from performing any actions before it resolves, that would reduce his hand size to less than two?" The answer being, no. He is still free to cast instants, even if doing so reduces or eliminates the usefulness you get out of Mind Rot.
Comment: @SamIAm Your bulleted list has an issue: If your opponent casts an instant, your *opponent* receives priority afterwards. You were probably thinking that it defaulted to the active player, but that only occurs at the beginning of steps and phases or when a spell resolves.
Comment: @Rainbolt It's just that the model I like to imagine is that you cast multiple spells during priority.  I know that's not how it's spelled out in the rules, but it's a cleaner model
Comment: @SamIam No, you don't understand. The way you have it worded is not unclear. It's wrong. Starting at the second bold bulleted point: **(1)** Your opponent may cast instant speed spells **(2)** Your opponent passes priority **(3)** You pass priority **(4)** The instant spell resolves. You have **(2)** and **(3)** completely reversed.
Answer: Short Answer: As long as they chose to cast the instant before you chose the cards to discard, then the Instant applies (resolves) first.
Magic the gathering uses a stack for casting spells. This means that literally all spells being cast go on the stack.
Each time a player casts a spell they get priority back after the spell is cast so they can continue to put spells on the stack. If they choose to be done casting spells at that moment then they pass priority to their opponents who can add spells to the stack.
After everyone is done adding spells to the stack, it starts to resolve from the top down.
This means the last spell cast is the first spell to resolve.
So the instant would apply first because it went on the stack last and was cast in response to the sorcery.
Because of this there is almost never a time where you can cast a spell that your opponent can not react to, if they have the mana and cards to react with.

405.1. When a spell is cast, the physical card is put on the stack (see rule 601.2a). When an ability is activated or triggers, it goes
  on top of the stack without any card associated with it (see rules
  602.2a and 603.3).
601.2. To cast a spell is to take it from where it is (usually the hand), put it on the stack, and pay its costs, so that it will
  eventually resolve and have its effect. Casting a spell follows the
  steps listed below, in order. If, at any point during the casting of a
  spell, a player is unable to comply with any of the steps listed
  below, the casting of the spell is illegal; the game returns to the
  moment before that spell started to be cast (see rule 717, "Handling
  Illegal Actions"). Announcements and payments can't be altered after
  they've been made.
601.2h Once the steps described in 601.2a-g are completed, the spell becomes cast. Any abilities that trigger when a spell is cast or put
  onto the stack trigger at this time. If the spell's controller had
  priority before casting it, he or she gets priority.
608.1. Each time all players pass in succession, the spell or ability on top of the stack resolves. (See rule 609, "Effects.")

Personal Note:
Magic is very deceptive because on the surface it seems to be an aggressive game but in truth is an extremely reactive game. Mastering timing and priority can take a long time and is one of the key points of strategy for the game.
It can be a bit confusing when first starting out but I suggest reading the comprehensive rules section 116 - Timing and Priority.
Comment: Needs a tl;dr...
Comment: already on it :)
Comment: Why the down vote?
Comment: There is only one stack.  It is a game zone.  Spells do not "start a stack."  It's always there.  Mixing terminology with Yu-Gi-Oh chains is a bad path to follow :)
Comment: Best answer in my opinion.

Sorcery supercedes instant?


What happens for hardware Interrupts in non-preemptive scheduling?

Question: In non-preemptive scheduling, the running process cant be interrupted  .But what will when the CPU receive a hardware interrupt such as the an interrupt from the printer indicating that the current job has been completed ? Does the CPU will preempt the current running process and handles the interrupt ( run its interrupt service routine ) or this interrupt will be stored and then handled when the current running process leaves the CPU ?
Answer: In a non-preemptive scheduler, the running process cannot be interrupted by another process.  The running process can be interrupted by hardware interrupts.


.htaccess converting id to user via mySQL database

Question: I'm looking to use mod_rewrite to mask user profiles on my site. However, their profiles are decided by their id in the format /profile.php?id=1. Both 'user' and 'id' are in the mySQL table 'users'. Is there a way to reroute the URL to read /user? Sorry if that's badly explained!
Answer: RewriteEngine on
RewriteRule ^profile/([^/\.]+)/?$ /profile.php?user=$1 [L]

This will cause all /profile/username to be redirected to profile.php?user=username. You can then check in your PHP:
if (isset($_GET['user'])) {
  // Check if the username exists.
  // SELECT ... FROM users WHERE username = ..
}

Comment: Thanks for the reply, that's almost what I'm looking for. How would I be able to do it so that if the page is www.domain.com/profile?id=1 to reroute it to www.domain.com/user where this user's id=1?
Comment: In PHP, simply find the user by ID, and use header('location: ') to redirect him to the url.
Answer: .htaccess will not be able to use the info from the database to do what you desire. Even if it could you shouldn't do it :).
But what you can do is to change the profile.php to be able to read an user by the name. Let's say to make profile.php able to process a new parameter name= and you add logic in it to look in the database either via an id or via the name. If you have this then is actually trivial to route / to /profile.php?name=.
You will also have to change the website generation to output proper urls.
Also look at Cristian's answer for more technical details. It's the same idea in the end.
Answer: You wouldnt change this in htaccess, or with any kind of config/rewrite rule.  This would be done in your application PHP if I understand what you want.
in /profile.php?id=1 profile.php is (rewrite rules aside) the source PHP file, and id is a GET parameter.  Its like an argument to profile.php when it executed.  They come in the form source.php?get1=val1?get2=val2.... and you access them through the array $_GET
If you don't want users to see that id, you can do one of two things.

Replace it with user, as you suggest.  URL would be 'profile.php?username=XXX'

Then in your code you will presumably need to perform a simple database query to get the id from the user name.  Should be about 5 lines towards the top of the code in profile.php and the rest can remain unchanged  Beware that this demands unique user names in case you werent before, and some special characters might be a problem with get parameters in the URL?  For most user names, uniqueness is required and special characters are not allowed, so hopefully this isnt a problem.

Keep id but make it a POST peremeters.  URL would be 'profile.php'
  POST parameters are similar to get but they are not visible to the user because they aren part of the URL string.  Just switch $_GET to $_POST in profile.php.  The code will still identify users by id, but they won't be able to see their IDs.

In either situation you will need to change any incoming links.actions that lead to the descrubed URL that we are changing.
EDIT - Christian's has a good suggestion which is similar to #1 above but would allow for nicer looking URLs like profile/XXX rather than 'profile.php?username=XXX'.  Code within profile.php would ne hte same, his changes are in profile.php are the same


Choosing advantages of one tradition over another

Question: Like all religions, there are different branches, traditions, whatever you want to call them.  Why would you choose one over the others?  Do you think one is right and the others are wrong?  Does one fit with your lifestyle?  I can see being born into one you might not have a choice.  If they are all the same thing at heart, why have the differences?  What if you choose the wrong one?
Comment: OyaMist's answer suggests to me that the people able to answer this question from their personal experience are those who experienced the advantages of several (instead of having chosen only one over another).
Comment: @ChrisW that implies they tried one and found it lacking.  Then they tried another.
Answer: The Buddha taught all, but such an attainment is rare. Even in the Buddha's time, Ānanda asked about the difference in practice.

MN64:16.1: "Sir, if this is the path and the practice for giving up the five lower fetters, how come some mendicants here are released in heart while others are released by wisdom?"
MN64:16.2: "In that case, I say it is the diversity of their faculties."

Buddhist practice actually consists of three practices. Different teachers may be adept at one or more of these and appeal to different students:

AN3.89:1.1: "Mendicants, these are the three trainings.  What three? The training in the higher ethics, the higher mind, and the higher wisdom.

The three practices support each other. If one cannot find a teacher for all three, one can certainly choose a teacher who teaches what one lacks.
Different traditions emphasize different practices. I first trained in Zen for mind/immersion, but later studied the suttas themselves for ethics and wisdom.
Answer: Participating re a particular organisation or group wouldn't necessarily imply rejection of other organisations; there are typically relatively few monasteries /temples /ji /otera/ within walking distance etc, often may meet less than once per day, some places may benefit from some help with things, or maybe only meet in early morning etc. Its re The Teachings of The Buddha, and Sangha, so sharing with many is good. May have friends at different places.
Or some may use different conversational languages from others, or different outfits, but thats ok. Or have acquaintances who are at different places. Nice places can be different but nice places can be the same. Nice people.
Different Branches have tended to develop in different places & regional contexts & regions over centuries & millenia.
Answer:
The Six qualities of the Dhamma:

Svakkhato: The Dhamma is not a speculative philosophy, but is the Universal Law found through enlightenment and is preached precisely. Therefore it is Excellent in the beginning (Sila — Moral principles), Excellent in the middle (Samadhi — Concentration) and Excellent in the end (Panna — Wisdom),
Samditthiko: The Dhamma is testable by practise and known by direct experience,
Akaliko: The Dhamma is able to bestow timeless and immediate results here and now, for which there is no need to wait until the future or next existence.
Ehipassiko: The Dhamma welcomes all beings to put it to the test and to experience it for themselves.
Opaneyiko: The Dhamma is capable of being entered upon and therefore it is worthy to be followed as a part of one's life.
Paccattam veditabbo vinnunhi: The Dhamma may be perfectly realized only by the noble disciples who have matured and enlightened enough in supreme wisdom.

(from Anguttara Nikaya 11.12)

In essence, the Dhamma:

is not a speculative philosophy (which is unactionable and cannot be put to practice) and
gives tangible and verifiable, empirical and experiential results

OP: Why would you choose one over the others?

You should choose a system which

de-emphasises speculative philosophies which are unactionable or cannot be put into practice and
has well laid-out a practice or training system which gives quantifiable and tangible empirical and experiential results fast

OP: Do you think one is right and the others are wrong?

The onus is on oneself to figure out through validating the practice and experiences. If you do not get quantifiable and tangible empirical and experiential results, then this might not be the right system.
Buddhism is like medical treatment but where the treatment is is for maladies of the mind. Say there are different courses of treatment administered to different groups. If one group is getting results as anticipated then this is the right system to achieve the anticipated goal. Similarly one should choose a system which produces the best results, which would be the right system to achieve the Buddhist goal.

OP: Does one fit with your lifestyle?

One should fit the lifestyle to the practice than the other way around.
The practice starts with Sila — Moral principles and is the foundation upon the next strategies are built. If one's lifestyle lacks:

Right speech
Right action
Right livelihood
one will not be able to get tangible results

I can see being born into one you might not have a choice.

Though on is born into one system one may get attached to it but one can always choose something else.

OP: If they are all the same thing at heart, why have the differences?

I think these have arisen since people have created, modified, added and subtracted from techniques they have learned, mostly in good faith. These modifications can have an impact on results and effectiveness, which one can verify by trying it out and figuring out what is the best.
Also, some techniques are better suited for some people. This is something one has to figure out through trial and error.
In terms of meditation subjects, there are ones which are suitable based on personality.

OP: What if you choose the wrong one?

You would not get the desired results, which will make it evident that one has chosen the wrong technique or practised the technique the wrong way, perhaps due to misunderstanding or missing out some of the instructions. If one is practising the wrong way one can correct it. If the techniques are not giving results one can choose another, which one can put to practice and verify if it gives the desired results.
Essentially the take away is to do what works and actionable.
Answer: According to the earliest texts The Buddha said that his teaching would eventually be counterfeited.
He said that his true Dhamma would last 500 years and that it wouldn't disappear all at once but as gold disappears when counterfeit gold gets into circulation so the true Dhamma would start to disappear with the arising of the fake Dhamma.
There have been schisms and schools have different canons, thus some of the schools consider others to be based on the counterfeit Dhamma with counterfeit texts and counterfeit doctrines.
I can't say much more due to site rules but there is a good reason for choosing carefully and at least doing basic research.
The schools are definitely not the same, alike or equal.


What is the difference between "event" and "incident"?

Question: "Leaving home was a major event in his life." Can I use "incident" instead of "event" in that sentence?
Are they synonyms or not?
Answer: An event is usually a planned thing. Leaving home, a birth, a wedding, a party, those are generally considered events.
An incident is usually unplanned. It is something that happens unexpectedly, and often there is a negative connotation.
For example, at a help desk, people register incidents, meaning that something happened (a bug, a problem, a system failure) that was not only unplanned, but also unwanted.
If you say that leaving home was an incident, you give the impression it happened by accident, and probably because something bad happened.
Answer: In this case, "event" and "incident" are not synonymous. "Incident" has a common connotation of "accident" or "problem," which doesn't fit your sentence.
Comment: What is the difference between them?
Comment: I think oerkelens explains it well.
Comment: yeah right. I know
Answer: Events are when something happens that is (most of the time) unusual, whether planned or unplanned.
Incidents, on the other hand, are when something happens and it interrupts something else.
Events and Incidents are not mutually exclusive. All incidents are events but not all events are incidents.
For example:
"He got hit by a bus" is both an incident and an event but
"He went downstairs" is only an event but not an incident.
However it also depends on the context of the situation. For example in your case, "Leaving home" is an event on its own, but if "he" is not allowed to leave the house and "he" "leaves home" then it becomes an incident.


How to set up a face rig

Question: I am creating an Optimus Prime, based around the model from the movie,but not exact. I have just run into the problem of setting up a facial rig. I mostly need to know what the best approach would be to creating a rig for his mouth.
Comment: This question is really a request for a tutorial, voted to close.
Answer: Well facial rigs can be hard, it's better to learn simpler rigs first. For the model you're attempting, I would recommend joints, they work quite well. Remember that he is a rigid character so apply bones to mesh parts with "Bone" not any others as it wont distort different sections but rotate like using R on the object.
Blender cookie has great tutorials on facial rigging, especially David Ward's tutorials.
Comment: Can you send me a link to that tut
Comment: http://cgcookie.com/blender/2011/03/16/creating-an-advanced-face-rig-part-one/

How to set up a face rig


Is there a way to set up a custom trackpad gesture for Mission Control?

Question: I was wondering whether it was possible to set-up a custom trackpad gesture for Mission Control. I don't want to swipe up for Mission Control, I'd like to, just like I did with Exposé in SL swipe up.
Thank you.
Answer: Check the Trackpad Preferences in System Preferences. Under the 'More Gestures' tab.


If I am Lost in Time and Space during a reckoning effect resolution, do I continue to resolve remaining reckoning effects?

Question: Being lost in time and space leaves you immune to reckoning effects, but what if the reckoning effect of a mythos card is what causes you to become lost in time and space, and you still have a few other conditions to resolve (for the reckoning effect)? Can you stop as soon as you become lost in time and space?
Answer: I have changed my mind but I have no official ruling on this.
In general, you have to resolve all the reckoning effects and order should not matter.
However, during a reckoning: If you are devoured, that would end your turn right there. If you are either killed or driven insane, that does end your turn. Thus, it would seem logical that Lost In Time and Space would end your turn as well.
Thus you would not be doing any reckoning events after those ones.  You dodge those bullets for this turn.
Lost In Time And Space was added in an expansion, I am not sure if this is covered by the FAQ or not.
Even going by the golden rule of cooperative games: If a rule can be interpreted in several ways, the right one is the least helpful to the players, the reading would be that yes, you stop doing any reckoning events once you are Lost In Time And Space.
Comment: Do you have documentation to back this? I have found none, so my default conclusion is that because Lost in Time and Space is a feature added after the base game, that its qualifier that one with that condition cannot be affected by reckoning effects means all reckoning resolution is halted for that investigator the moment he gains that condition.
Comment: Then again, there is the general rule (I thought I read somewhere) where if there is ambiguity you are to use the ruling that makes the game harder for the investigators, so I'm really not certain which ruling to go with at this point without a reference.
Comment: @Joey: Answer edited.


extending an image with Python Imaging Library

Question: I am trying to increase the height of an image using PIL but I don't want the image to be resized; I actually want a strip of blank pixels at the bottom of the image. Any way of doing this with PIL?
I guess one way would be to make a new image of the required size and copy the old image into it but I can't seem to find the right function to do this.
Answer: Oops, just realized you can do image.crop() and it will resize the image for you.


How does one tune down to 40 cents with a snark tuner?

Question: I am trying to play along to

 and standard tuning isn't quite matching up... so it must be down tuned a bit, but how much? I have the Snark SN-8 Super Tight All Instrument Tuner and I haven't used it to its full extent yet
Comment: Not being flippant. Try adjusting the guitar's tuning by ear. You could get pretty quick and good at it. It's not that big a deal. But - you've bought the gismo, and want to use it. Understandable. Learn to do it by ear, and people will be well impressed ! Comment, not answer.
Answer: Here are two methods to match your guitar to the video: one way with the tuner (using the 40-cent adjustment cited in the OP) and one without the tuner.
Recalibrating the tuner
According to the SN-8 user manual, to change the pitch calibration, one should

push the round "PITCH CAL" button on the back side of the tuner and immediately press either the up or down triangular buttons to choose a new tuning reference. The pitch reference can be set anywhere from 415 - 466Hz. Pressing the power switch on the front of the tuner resets the tuner to A-440.

Tuning 440Hz down by 40 cents gives gives 430Hz.

(SOURCE)
Not using the tuner
Tune any of the pitches you're certain of against the recording, preferably an open string. Then tune the rest of the guitar from there.
Comment: Back in the '60s not using a tuner was the preferred method - in fact, the only method. Playing along to stuff on the radio necessitated changing tuning every few songs. Got very quick at it.


Unknown Startup Disk

Question:
My problem is that I don't have any Windows install on my MacBook yet but for some reason the Windows Startup Disk keeps showing up when I hold down option key for startup. As far as I know, I have tried everything to remove it but it's not working, I tried look in Startup Disk under System Preferences but the only thing I see is the Mac OS, I even tried installing Windows then removed it but the bugged Windows is still there I really don't know what else to do.
Answer: This post seems to have a solution. It's probable that there's still an entry in the EFI for Windows even though the partition isn't there any more.

Unknown Startup Disk


How to call the Wolfram Engine from swift?

Question: I'd like to call the Wolfram Engine within a swift project in Xcode. Are there any known methods or available resources on how to do this? I'm hoping to include it as a resource library for use inside a MacOS or iPadOS project.
Comment: I don't know but I expect the answer is to train Swift to call a C function which in turn calls *Mathematica* (or the *Wolfram Language* if you prefer).
Comment: You can run Python in Xcode so you can use the Wolfram Engine for Python to call through.
Answer: Try using this repo I wrote a while back:
https://github.com/arnoudbuzing/wolfram-server
In the "clients" directory there are examples for various languages (not for swift, but if you know swift you can probably figure this part out yourself).
Comment: Please contact Wolfram Research for (redistribution) licensing options (firstname.lastname@example.com). Technically speaking you can include Wolfram Engine in an app without too much effort.
Comment: This would require bundling the wolfram engine into xcode and building the app with it. This existed for ipados as CDFKit, would about for macos apps?
Comment: Also, a webserver doesn't work directly on files
Comment: You could use this: https://www.wolfram.com/engine/ ?
Comment: I get that anyone can installed the engine on their machine, but I'm developing a desktop app, so requirements need to be bundled within the .app file


Hardware Degradation by Leaving Laptop on Permanently?

Question: Consider a standard laptop build. Now suppose you leave it running (not just plugged in) permanently. To what extent will this produce hardware degradation or increase the risk of hardware failure?
Comment: The biggest problem is the battery, it is not good for the battery.  Take it out and save it for when you need it.  The rest of the hardware will not degrade due to being plugged in.
Comment: "hardware degradation"? whats that? If the laptop isn't doing anything then why would it fail? The environment would effect it more than anything (dust/heat).
Comment: Stuff fails eventually. Its the law of entropy. Hard drives wear out, or even slow down. Fans seize up. All flesh and metal eventually fails, and leaves it crumbled into a pile of dirt and dust. ;p
Answer: If it's not in a clean room (by which I don't mean your mom thinks it's clean, unless your mom works at a nano-fab or assembling/recovering hard drives), it will pull in more dust, dirt, hair, lint etc. running than it will sitting powered down. Dust, et al, gradually reduces the effectiveness of the cooling system, so depending on its thermal control logic it will either run hotter or slower as a result. Running hotter does impact life expectancy of most components. How much (your actual question) would basically be time running (total) divided by time running (actual use) – any more than that is too variable based on the conditions of the room (have you got pets and various other environmental factors) , and the design of the laptop.


Get raster expression

Question: In Arcmap I have made a new raster with ArcToolBox -> Spatial Analyst Tools -> Map Algebra -> raster calculator.
Now, months later, I have forgotten the source formula expression.
How can I display?
Answer: If you have the original output of this process and you actually ran it from a geo-processing tool then why not have a look at the metadata (ESRI call metadata Item Description) of this dataset? It will contain a log of this tools execution which includes the inputs, one of which will be the raster expression it was built from.
If you did not run it this way or did further processing of the data that wiped the metadata then you are pretty much out of luck. But there is a lesson to be learned here! If you are the source of the dataset why are you not documenting how you created it (in the metadata)? You've just demonstrated to the World that you'll not be able to to replicate your processing\analysis. Would you want to employ someone who could not explain how they constructed their dataset?
So you should always add some description to your metadata about what you did, it can often be just a few lines to yourself and adding that type of information is really helpful as no one remembers what they did 6 months ago...
Answer: How long ago ? There is a way tha you can look back, if possible, is to go to ArcGIS  Geoprocessing menu and then you scroll down to Results. Check to see if you have that result of what you did save in that .

If you want to keep these results, open Geoprocessing Options and go to Results Management and change to whenever you want. There is a list to choose from 2 weeks to never delete,
I hope this helps.

Get raster expression


Official insignia for regions?

Question: I'm doing some design work on my Pokémon fan-game, and I was just wondering if there was anything at all that could be considered an official flag or other insignia that could be used to identify each of the regions in the Pokémon games?
Comment: I did a little bit of research, and couldn't find anything like official flags or emblems or the sort. The best I could find were official artwork of the respective regions' map. I'm guessing Nintendo never bothered designing region flags, so you're pretty much free to do whatever.
Comment: Other than the cover art of the different legendaries (and starters in RBY's case), there's no 'official' insignias that I'm aware of. You might have more luck watching the anime - Kanto's series heavily used the 'Pokeball' icon/insignia, whereas Johto's was centred around the 'GS Ball' IIRC. I didn't watch the rest, but certainly each series has been represented by different themes/ideas
Answer: There are no official insignias, flags, or logos for each region. The closest representation I was able to find was either the badge collections for each region, or map artwork. There are lots of other options for things you can do to uniquely represent each region, however, including referring to them by name, by their Kanji, or by League Trophies (though Hoenn and Sinoh are very similar, and Kalos doesn't have one yet). There are also a number of different fan created variations on what flags might look like all over the web, including some inspired by the real life regions the maps are from, which may work as well.

Official insignia for regions?


Multi-Massive Research -- any interest in this?

Question: Will provide missing details soon.
Comment: I'm interested, with the major caveat on my end that I'm out of academia for now. How to give credit is one thing, and what platform to collaborate through is another, as SE's don't seem the best suited for a task like this. Care to elaborate?
Comment: Im definately interested
Comment: I would be interested. I am submitting my PhD thesis next week and have broad research interests. Looking forward to more details.
Answer: One of the strongholds of nationalism is access to detailed statistical data. So a multi-massive research project will at the very least benefit from being able to undertake a cross-country empirical application at a novel scale, while also benefiting from local insights as regards interpretation.
So let's see the formalization of this proposal.
Comment: For the economics discipline, six will be massive
Comment: It seems that, tentatively, there are four of us willing to work on this? Also - I agree that whatever we focus on ought to leverage to novelty of the approach. This will work better if we can get more researchers on board. Four people is more like a paper co-authored by amicable strangers.


staff lounges Vs. staffroom

Question: What's the room of a medical staff only enter to it to rest and eat. Can I call it 'staffroom'? (I saw on Wikipedia that it's more for teachers' staff.
Comment: Note that the Wikipedia page 'has issues'. It is incorrect in implying that staffrooms are only found in schools and colleges.
Comment: On the American medical TV drama "Grey's Anatomy" there's such a room called the "on-call room".
Comment: According to what I found this room has bed/s, and I'm asking about a room in any medical department not necessarily attended for sleep and doesn't have beds but may have chairs and sofa for a temporary sitting or having a coffee, lunch, or supper.
Comment: See also this https://english.stackexchange.com/questions/279451/what-is-a-room-a-company-provides-for-eating-food-called
Answer: I can only answer for the UK. The term staff room is commonly in use for a room provided for the medical and other staff to relax and gossip. It may also have food and drinks. The term doctors mess is also used, here is a link to one in the south of the UK http://www.sghdoctorsmess.co.uk/. I would expect that if such a facility were restricted to a specific grade of staff it would be called, for example, the consultants' mess as saying the consultants' staff room seem a bit tautological. (Consultants in the UK are the highest grade of registered medical practitioners. Whether in these more egalitarian times they still have separate facilities I do not know, it is some time since I worked in a hospital.)

staff lounges Vs. staffroom


little question; nonseperable Hilbert spaces: what kind of basis...?

Question: It is well known that every separable Hilbert space has a countable orthonormal basis. This type of basis is a schauder basis. If the Hilbert space is nonseperable, the Hilbert space has a orthonormal basis wich is not countable. By definition, it isn't a Hamel basis and it isn't a Schauder basis, right? What kind of basis is this? There has to be a definition of basis which doesn't assume "countability", but I only know "Hamel basis" and "Schauder basis". Could you tell me, what kind of basis a nonseperable Hilbert space has? Regards
Answer: I'm not sure whether this helps you, it's taken from Weidmanns Book about Hilbert spaces (which is in German). He defines an orthogonal basis of a Hilbert space $H $ (without introducing a special name for it other than that) as a system of vectors $M=\{e_i\}_{i\in X},e_i\in H$ for some index set $X$ such that

$\langle e_i, e_j\rangle = \delta_{ij}$
$H  \subset \overline{L(M)}$

where $L(M)$ is the set of finite linear combinations of $e_i$. Here $X$ is allowed to have arbitrary cardinality. Note that this allows infinite sums   $\sum_{i\in X} a_i e_i $ (taking the closure makes this a non algebraic definition), but these only make sense if at most countable many $a_i$ are nonzero.
He then shows that every Hilbert space has such an orthonormal base. This does not seem to be true for pre Hilbert spaces. He also shows that $H$ is separable iff $X$ is countable and that the cardinality of each two orthogonal bases is the same.
Comment: okay, thank you, your answer is helpful. I'm from Germany and I didn't know this book. I always use "Werner- Funktionalanalysis", maybe you know it:). Regards
Comment: @NewBunny If the anwser really is helpful then you may consider upvoting my answer, unless you consider this request as shameless. I don't really mind, but if you continue to ask questions here and forget to appreciate (good) answers you may, some day, get no more answers at all...
Comment: hi, yes I know and I will do that. But I couldn't finish signing up / registration for my account at the moment because I forgot my passwort of my email-adress to confirm my registration. In a few days I'm back at home and then I will finish my registration and then I'm able to vote up the answer. At the moment, I can't do this. But don't worry, I will vote up all the answers here which are helpful, and your answer I will vote up too


Add new variable in Computed field

Question: Can I add new variable in Computed field?
The added variable will be used only in the computed field
Answer: Yes you can
<code>Computed Field is a very powerful field module that lets you add a custom "computed
fields" to your content types.
</code>

These computed fields are populated with values that you
      define via PHP code.

Add new variable in Computed field


Why are the error and conditional expectation unrelated?

Question: I'm trying to read mostly harmless econometrics. They give a proof for the Anova Theorem in which they use that fact that E[y|X] and $\epsilon$ are uncorrelated. I assume they say that as before they have shown that E[h(X)$\epsilon$] is 0. So I guess the conditional expectation is just one possible function of X? This confuses me, however. After all $\epsilon$ is defined as y - E[y|X], how can they be uncorrelated?
Comment: Actually in regression Y=aX+b+ $\epsilon$ where $\epsilon$ is assumed to be uncorrelated with X with mean 0. Then E(Y|X=x)=ax+b and not $\epsilon$.  So I can't make sense of your question.
Answer: In the conditional expectation function set up of a relation,
$$y = E(y \mid x) + e$$
it is true that
$$E(e \mid x) = 0 \implies E[h(x)e] = 0$$
because
$$E[h(x)e] = E[E(h(x)e\mid x)] = E[h(x)E(e\mid x)] = E[h(x)\cdot 0] = 0$$
Now let's examine
$$E[E(y\mid x) \cdot e]$$
To avoid confusion denote $E(y\mid x) \equiv Z$. Then applying the same tatic as before,
$$E[Z \cdot e] = E[ E(Ze\mid x)]= E[Z E(e\mid x)] = E[Z \cdot 0] = 0$$
And yes, this holds because $E(y \mid x)$ is just another function of $x$.
Answer: Per the above comment, I think you asked the question in a way that your notation is wrong.  It sounds like you are asking, in a model that is $Y=c+aX+\epsilon$ why $\epsilon$ is independent/uncorrelated with the other variables, namely $X$ and $E[Y|X]$ - as well as why each $\epsilon_i$ is independent of the others.
It is an assumption.  If you assume that, then normal regression (OLS, or Ordinary Least Sqaures) (1) works in a straighforward way and (2) has desirable/optimal properties (like giving unbiased estimators).
If that weren't true, you would need to fiddle with the data or do more complex regressions.  For example, if the $\epsilon$'s were correlated with each other, you have a problem called autocorrelation.
In theory one ought to review the $\epsilon$'s to make sure they are independent and normally distributed.  When I asked an econometrics professor once why people don't do that, he laughed and said "because they wouldn't be what you want, and you couldn't publish".
Comment: Hey eSurfsnake, I have follow up question which i posted here: https://stats.stackexchange.com/questions/311791/conditional-expectation-function-and-the-conditional-indepence-of-residuals, you have been so helpful with this one would you mind taking a look at the other? :)
Comment: this is exactly what i thought. but the authors made it seems like you could prove (and not assume) that it was uncorrelated. I found the pages here (http://econ.lse.ac.uk/staff/spischke/mhe/ex_ch3.pdf). I thought the key lies in Theorem 3.1.1 proof ii. After all, if epsilon is uncorrelated with ANY function of X then it also has to be uncorrelated to the traditional linear regression you wrote? I'm probably misunderstanding something.
Comment: I don't love the pedagogical approach they are taking, and I suspect this is causing confusion.  What they are really saying is that, for every $i$ (corresponding to some number of years of schooling), the random distribution for that year has an average (which is all $E[Y_i|X_i]$ is, really - the average for data for index $i$), and then there is some random distribution $\epsilon_i$ about that mean.  That is certainly sensible.  But the issues that come up in regression often occur when the $\epsilon_i$'s are not iid normally distributed, or correlated with each other.


Difference between gain and normalization whole track in Audacity

Question:
In Audacity there is a gain slider on left side of a track. To increase volume i can use either gain or Normalize the whole track to a certain level. Is there any technical difference in terms of increasing volume?
Answer: The process is identical, but one is tested, the other is not.
Gain will not test for overs, it will just clip if you add too much.
Normalisation will scan the entire track & only allow gain to be increased until the single loudest sample is at 0dBFS [or very slightly less if you want to avoid clipping on cheaper equipment. I've always used -0.3 as a 'safe margin'.]


American English Word Stress Last Content Word

Question: I read that as a general rule, the last content word of a phrase gets the most stress. So, in the sentence "I'm late" late will get the most stress. Now if we add the word "Sorry" at the beginning of the sentence "Sorry I'm late" will the word "sorry" change the stress of late? Do we need to stress both the word "Sorry" and "late"? Any suggestion appreciated. Thank you!
Comment: It depends on whether you want to emphasize how sorry you are or just state that you're late.
Answer: To put the main stress of a phrase on the last main stress of the last word or phrase in the phrase was called the "nuclear stress rule" for English in a very influential article by Chomsky, Halle, and Lukoff in 1956.  It's a good rule, as such rules go, but there are many exceptions.  I think the main stress of "Sorry I'm late" could have the main stress on "late", conforming to the NSR, but the main stress might perhaps go on the first syllable of "sorry", instead.  (What I just called "main stress" is also called "primary stress" and annotated with a raised "1", with lesser stresses marked with higher digits "2", etc.)
Answer: We like to put a special musical stress called the NUCLEUS (sometimes called the TONIC) on the last new content word in the sentence. By content word we generally mean nouns, verbs, adjectives, adverbs and wh- question words. Most negative words like not and so forth are also usually stressed. The kinds of words you learn in grammar lessons: pronouns, auxiliary verbs, prepositions determiners and so forth are usually unstressed as a rule of thumb. By new content word we mean w rod or concept that hasn't been being discussed yet.
The nucleus is sometimes the loudest syllable in the sentence, but not always. It has musical prominence in that the pitch will be markedly different from what came before it. Nucleuses in English also have their own special musical tone which starts on the nucleus and continues to the end of that intonational phrase (an intonational phrase is like a musical sentence, a musical chunk as opposed to a grammatical one).
It is a mistake to think that the nucleus should be louder than the other musical stresses (formally known as ACCENTS) in the sentence. Very often the first accent in a sentence will be the loudest.
In the phrase Sorry I'm late, whether late takes  the nucleus or not will probably depend on whether it's taken as already given from the context that you're late. In other words late here may have the status of old and not new information. It may therefore be de-accented. It would be quite common to hear this with the tonic on the first syllable of sorry, perhaps with a fall-rise nuclear tone.


Issuing client certificates to customers

Question: What's the best approach for issuing client certificates to customers? Should we run our own certificate services (we're on Win 2008 R2), and issue them that way? Is there a CA that will issue them for us? Comodo will issue client certificates for email purposes, but we need them for allowing our clients to access our website (via browser and API).
Answer: A professional certificate authority business has more experience in securing CA transactions and can handle that outsourced, for a fee. This may be $10 a certificate but it can likely meet government or commercial standards that are applicable to regulated industries and general risk transfer (off your company).
While $10 a pop may be daunting, keep in mind that a CA will also pick up for you all proper costs associated with running a real CA

Certificate Authority Physical Enclosures
Trained PKI staff
Certificate Policy (CP)
Certificate Practice Statement - (CPS) an SOP on how it works
Annual Auditing via an independent auditor
hardware security module procurement and operation
certificate authority software operation (root CA)
certificate authority software operation (Sub CA)
validation authority software operation
servers
datacenter space
security auditing of above infrastructure

Working with a CAs could enable you to run a registration authority that determines who will get credentials, and hand off the more painful part to a CA, depending on the specific model of that CA.
Windows based PKI implementations are generally insecure, have online and easily compromised PKIs that expose companies to risk.  They rarely use HSMs, and a domain admin compromise can yield a complete PKI compromise.
Standard digital certificates can be used for both accessing websites, as well as logon to domains, email encryption, signatures and physical entry, depending on the certificate and object IDs (OIDs).  Digital certificates can be in software (vulnerable to theft) or hardware (more secure, but still compromise-able via malware MITM attacks).
Many companies faced with the same decision as you partner with a PKI provider that will advise.  But, there are several models for this

train staff up and go internal
engage a consultant and go internal
use an external provider
hybrid internal and external

You can easily issue an RFI to several different CAs and PKI providers in order to determine their costs, and sample implementations they have performed for similar requirements as yourself.  With a more detailed RFP, you could do extensive cost comparison between running PKI services internal to your company, outsourcing it, or a hybrid.
With above data, and knowing your company's core competencies, you are prepared to make that decision about whether you should do it internally, externally, and with whom.  Even if you decide to stay internal, you'll have learned a great deal more in the process.
Comment: thanks for the in-depth response. $10/certificate is not an issue, but big up front minimum fees in the thousands are - and that seems to be the case with every CA we've spoken to. We're talking a handful of certificates to start with. Do you know of any that do not have minimum spends? Thanks
Comment: While this is an old question, I tend to mention these days that the market for hardware solutions that generate certificates have matured - and it might be interesting to look into companies that offers it as a service. There you might get all sorts of price models and offers.


Deploying ASP.NET Core with EF migrations to Azure

Question: When trying to publish a asp.net core 1.0.1 project using EF to Azure, I get an error:
<code>System.InvalidOperationException: The migration 'Björk\AppData\Local\Temp\PublishTemp\obj\....ApplicationDbContext.sql' was not found.
</code>
It works fine if I uncheck the "Apply this migration on publish", but of course the database will not be updated accordingly if I don't check that box.
This should probably be a bug report and not a stackoverflow question... :)
Answer: The issue is probably in the path, the swedish letter "ö" caused an issue.
Workaround:
Uncheck the "Apply this migration on publish" so that you are able to publish everything except migrations from your normal account.
Make a new account/profile on your PC without any non-english letters. Login to that account and publish your project every time you have a pending migration.
Answer: I reached out to someone on the team, and it looks like this is a known issue that will be fixed in VS "15". Until then, you can download the latest version of publish-module.psm1 which includes the fix.
Comment: Thanks for your input. This does not seem to work for me though, so I still have to use the workaround above.


How to determine queries per hour executed by a particular MySQL user?

Question: I am trying to implement user based quota system in MySQL to limit MAX_QUERIES_PER_HOUR  for a particular user. I have an option to set this limit via MAX_UPDATES_PER_HOUR 10.
But my problem is that I want know that how many queries a user has executed this hour.  I followed this thread but this is for global statistics of dba.  I want this information for every user of my database. I am sure that MySQL is storing this schema somewhere but after a lot of scrutinizing some of databases like information_schema , performance_schema , mysql I can't figure out how it will be achieved.
Comment: `information_schema.USER_STATISTICS` does have some minimal information but it does not have any data related to query statistics
Answer: I talked to the MySQL engineers, and the philosophy of the metrics you will find on performance_schema is to store only global metrics (even if it can also store individual queries and events), as in, no temporal (differential) breakdown. The way they suggested would be to take hourly snapshots of the interesting metrics (query or user statistics) and then store those somewhere else. Because performance_schema stores metrics on memory since restart, you would only have to sample those every hour, or average them over the SHOW GLOBAL STATUS like 'Uptime' seconds.
I normally use performance_schema using sys, as it is way easier to query (but all data there comes from performance_schema). You can install it even if you are using an older MySQL version and it will use the performance_schema data already stored, assuming it is enabled (default).

sys.user_sumary contains the summary status per user, including total statements, total_latency, total_connections, etc.
sys.user_summary_by_statement_type contains the breakdown per user and statement type.

You could enable individual query<->user storage, but you would convert
performance_schema into the general log, and either storing only a small window, or -if increased the backlog- taking a huge amount of memory.
So to "know that how many queries a user has executed this hour" query the above tables, wait 1 hour, and query it again, and substract the first value from the second. You will have available, the amount of queries, inserts, updates, deletes, rows read, and other resources used. There are tools that will automate the collection for you. If for some reason you cannot use performance_schema, there are plugins such as user_statistics that will create new tables in information_schema with similar information (this was the only way on older MySQL versions).


Ascending Hi Cut Filter?

Question: I Tracked a guitar track and for a certain section there is a transition guitar part, and it would sound amazing with an ascending hi cut filter, but i have no idea how to implement that into the recording. Any suggestions? :)
Answer: I assume you're talking about what I would call a lowpass filter sweep: a lowpass (hi-cut) filter starts out cutting out most of the signal, and gradually raises the cutoff frequency until the whole signal is heard.
I assume you're using some kind of DAW software like Reaper or Pro Tools or something like that. Generally, what you'll do is insert a lowpass filter as an effect on your guitar track. Set the filter's cutoff frequency where you want it to start, and then use the DAW's automation feature (this is very common for DAWs to have) to make the cutoff rise over time.
I personally like how this effect sounds with a little bit of resonance: if your filter has a resonance (sometimes called "peak") dial, try turning it up a little bit. It emphasizes the current cutoff frequency, which makes the effect a little bit more obvious. Careful not to turn it up too high - some filters will self-oscillate at high resonances, which makes terrible and hugely loud sounds. Sometimes this is desirable. Often it is not.
Comment: yeah i am talking about a low pass filter, and im using logic express 9, i tried to do what you said, accept while we were recording the track and i raised it over the time i wanted it to, but there was no effect. shouldn't there be one?
Comment: Worth noting that what you've done there is nothing else but, you've implemented a Wah-Wah pedal in software.

Ascending Hi Cut Filter?


Diode built-in voltage and barrier voltage (forward bias voltage) are they almost equal? how do they relate to each other?

Question: I am little confused between the built in potential that is built up in the diode depletion region and the barrier voltage that needs to be applied across the PN junction to start conducting. My thoughts say that barrier potential must overcome the built in potential for the diode to start conducting through depletion region but I am not sure if am all correct. If that is the case, does barrier voltage equal or little greater than the built in voltage of diode?
Answer: I think, there is a small confusion on your side regarding the meaning of "barrier voltage".
Caused by a diffusion process across the pn-junction there is a "barrier" consisting of a potential difference (called voltage). This "built-in voltage" causes the diffusion to stop at a certain equlibrium.
Hence, "barrier voltage" and "built-in voltage" are two different expressions for the same quantity.
For a current to exist through the device there must be an external voltage which is able to reduce this barrier. Thus, this voltage further supports the diffusion process and allows a exponentially rising current. This effect is visible already at an external forward voltage of app. 0.1 Volt).


bash: Searching with ls

Question: Is there a bash command that can be used as Spotlight or an option with ls that only prints files containing certain text? I want to be able to open Terminal and type something ls -SOMEOPTION filename and find all the files that have filename in their name, and this option could be used with -R and it would work as a replacement for Spotlight.
Answer:  find . -type f -name "*filename*" -exec grep -il 'mywordinthefile' {} \;

find search for file recursively in a directory.
First parameters is the directory you want to look in. Here it's . so the current directory. You could use ~/Documents for example or any other directories.
-type f- option is to only return files, not directories.
-name option takes a pattern to find specifics filenames.
grep is used here to find the word/pattern you want in the files found by find.
Comment: I copied the command into Terminal, I replaced myword with "test" because I have a file called test.txt in the directory, but I get no output.
Comment: -exec grep is only needed if you ant to find something in the file. For the file name, replace the `-name`
Answer: To find all files which contain a certain string, you can use just grep on its own:
grep -R /path/to/directory "myword"
In the example above, "myword" is what you're looking for, and /path/to/directory is the directory you want to search through. -R tells grep to run a recursive search (i.e. to start at the path you specified, and go into each subdirectory in there).
EDIT
I've re-read your question and I think you're looking for how to find files that have a certain filename. For this use:
find /path/to/directory -name "*glob*" -print
where /path/to/directory is where you want to start your search (and find will also look in the subdirectories) and "*glob*" is a full or a partial file name that you want to look for. Please note, you can use wildcards (. and * for any single and any multiple characters match, respectively) in the glob. As a variation to this, you can use, as proposed by others:
find /path/to/directory -name "*glob*" -exec ls -la {} \;
in the above, what you put after the option -exec is any UNIX command with paramteres (in this case ls -la). The {} will be substituted by the file name find finds, and the \; is a termination string.
EDIT 2
Please note, the commands above give you similar results to Spotlight, but they don't use Spotlight at all.
If you'd like to use Spotlight from command line, you can use mdfind command, which is a command-line interface for Spotlight. Typing mdfind on its own will give you a quick help for using it with a few examples. man mdfind will give you a more detailed manual for it.
Essentially mdfind takes a search string (and optional modifiers) as it's argument and it's the same as you would type in Spotlight's text field when using it in a GUI.
Answer: To find files with a specific string in the filename, use
    find . -type f -name '*<filename>*' 2> /dev/null

Substitute <filename> with the string that you would like to look for in the filename.
The redirection at the end is to avoid printing errors when certain files/folders are not accessible.

You can put this command in a shell script, called say, lsf that would contain the following:
find . -type f -name "*$1*" 2> /dev/null

Then make it executable using
chmod +x lsf

You can also put this in your ~/.bashrc or ~/.bash_profile file instead of a shell script as described above (the command is still named lsf here):
myls()
{
    find . -type f -name "*$1*" 2> /dev/null
}
alias lsf=myls

bash: Searching with ls


How to switch off the GPS (but not disable location tracking) on an iPhone?

Question: Is there any way to switch off the GPS on an iPhone 4, so that the location tracker application can use GSM instead (this is only to save my battery)?
Answer: It can't be done.  It really depends on the application that is requesting your location.  App Developers, when requesting the device's location, can choose how accurate of a location they need.  If they decide they need less accuracy, then iOS will only fire up WiFi or use GSM to determine the approximate location.  If the developer decides they need very specific location, then the phone will fire up the GPS.


Query all UTXO's from a single Yoroi wallet via CLI?

Question: I wanted to list all assets from my Yoroi wallet via Cardano CLI when I noticed separate privacy addresses had their own UTXO's. Is there a way to resolve all UTXO's from a single  wallet?
Answer: The root key of a wallet is derived from BIP39 keywords. Then additional keys are derived beyond that. You would need to check each one individually for funds. You can use the cardano-serialization-lib for this. Many lite wallets like yoroi or ccwallet.io use this. More information about BIP39 can be found in my youtube video on the subject. https://youtu.be/5P1jx1ELUHk


Utility for resizing partitions

Question: Is there a partition utility in Ubuntu from which I can break my existing 'ext4' partition into more partition w/o loosing this partition's data?
Comment: possible duplicate of http://askubuntu.com/q/51272/4982
Answer: You can with gparted it is part of ubuntu.
Be sure to resize that partition first (shrink it) and freespace that left will be turned in unallocated space. Make new partition from that unallocated space.
You can shrink it with graphic slider.
Comment: the partition that i need to resize has the filesystem, on gparted this partition is not showing the option of 'resize' whereas other small partition does. Moreover it is showing an option of 'unmount' is it safe to unmount the drive when it has the ubuntu file system?
Comment: Gparted should show option "resize/move" and shouldn't show option "unmount". If you have installed Windows run chkdsk for file system errors. Don't click on unmount im meantime. Are yoou running ubuntu from live media or you instaled it previously on hard drive?
Comment: windows is not install, i have yet to install windows, the partition is flaged 'boot' and is not showing 'resize/move'. The only available options are 'Unmount' and 'Manage flags'
Comment: ubuntu is installed on a hard drive
Comment: can you upload printscreen of your gparted screen. im intrested how bar that shows partitions look alike
Comment: attached screenshot
Answer: you can use  gparted which can be installed by typing into a terminal
"sudo apt-get install gparted" (without quotes)
and then by either pressing alt-f2 or in a terminal write "gksudo gparted" (without quotes)
gparted help is located here http://gparted.sourceforge.net/help.php

edit: read your modification to the question.
you have to unmount the partition to edit it. also you may use a live cd/usb to edit the partition, too. with same steps.
Answer: I think you can,t make another partition because you already have 4 primary partitions. AFAIK is the maximum primary partitions supported, you could make new partitions inside the Extended partition but it is small so...
You would have to delete the swap partition and then shrink the root partition to get space and then make the swap partition again and will need to set the new swap partition in Fstab to be mounted at startup.

Utility for resizing partitions


Can a client change their "authenticated" send-from domain after the fact?

Question: I have a client that chose a specific domain on the SAP form to be used as their "authenticated", "send from" domain.  We are in the middle of IP Warming, and now the customer is coming back and asking if they can change the domain?  To kind of describe this, the client's main domain is (example) abc.com.  All of their employees use this domain for email.  The domain they entered onto the SAP form is abc-email.com which is not set up for email.  The client wants to switch the domain to abc.com.  Is this possible or does a new IP address need to be provisioned and IP warming started all over?
Answer: IP warming is not an exact science, but a lot of advice you will get is to avoid making a mistake in sending too quickly from a new IP address. If your client's volume is relatively low, SAP on a private IP may actually do more harm than good since your IP address has to earn credibility all on its own, and with low volume, that's very hard to do. If you avoid using SAP and just use the Marketing Cloud's shared IP addresses and domains you might even be able to skip the warm-up since it's not a new IP address and is already a trusted domain, but your reputation will be shared with the larger pool of Marketing Cloud customers and bad tenants will impact your deliverability.
You may also want to avoid using the same top level domain as your corporate email when using marketing cloud, because too many SPF records can dilute your sender reputation. Using a subdomain is a viable option, like mail.abc.com and helps build trust.
When it comes down to what's right for you and for your client, this is a discussion best held with a deliverability expert at Marketing Cloud where you can share more specific information about the company and how it applies to what they're trying to do.
Comment: I think if their end-goal is to send in the millions it might be worthwhile to warm up a private IP, as long as that goal is in the foreseeable future.
Comment: Thanks @Matt.  Do you have any guidance on if the client does send a low volume of emails, then, at some point, bumps up to millions of emails - should they remain on the Shared IP or move to a dedicated IP and go through IP Warming in the middle of their Marketing Cloud subscription?


I can't link my opengl program to math3d.h

Question: I was writing an OpenGL program and it happens that I have a problem with linking with math3d.h.
I am using Ubuntu and g++.
The thing is that I didn't install the package for the math3d because I got the header file and a cpp file from the net with OpenGL superbible. So I just copied the header file and .cpp file to the local directory and did
#include "math3d.h"

But the thing is that I used to use switches to link the other header files like gl.h, glu.h ,glut.h by giving.
g++ test.cpp -lGL -lGLU -lglut.

But I don't know what to give for math3d. I get an error saying undefined reference to the functions. This error I used to get when I don't give -lGL etc. for the functions in those respective libraries.
I am totally stuck here and I don't know what to do and without this I cannot go forward.
Comment: could you please use some punctuation? no offense, but it's really hard to read like this.
Comment: fixed ;>. OP, could you paste what your compiler is complaing about?
Answer: You don't link header files. You include them, and then link the object files produced by the *.cpp files together.
Short answer
g++ test.cpp math3d.cpp -lGL -lGLU -lglut

... and it works.
Long Answer
What you are lacking is any kind of build system (read up on Makefile). You need to first build the math3d.cpp, then your test program.
Sample Makefile:
CC=g++
CFLAGS=-c -Wall
LDFLAGS=-lGL -lGLU -lglut
SOURCES=test.cpp math3d.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=test

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
    $(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
    $(CC) $(CFLAGS) $< -o $@

Well, y'know, this one might even work :>
Comment: sir thank you for the help. lemme try to use the makefile thank you :)
Comment: the added benefit is that you won't need to retype the whole command line every time, and just type `make` instead. Not to mention it will be easy to add further files.
Answer: There are a couple of problems with your question:

You don't link to header files - you include header files, you link object files or libraries
Besides including the appropriate header files you need to link in the library - you said you copied the .cpp file from the 'local directory' does this mean you added one of the .cpp files from the OpenGL project into your project?  This can work if you make sure you get all the .cpp files you need (the functions you use that are declared in 'math3d.h' may be implemented across a number of .cpp files).  However, it is MUCH better to build openGL as a library and link against that.  You may want to consult the OpenGL documentation to see how to build it.
Comment: so what am i supposed to do with this
how can i solve it?
can u explain?
Comment: @yuneek, I am not familiar with OpenGL - I was simply pointing out some general C++ problems with the way you stated your question.  It sounds like you need to link in another library or compile the necessary .cpp files along with your project.
Answer: Need to compile math3d.cpp as well:
g++ test.cpp math3d.cpp -lGL -lGLU -lglut


What should I do to use my hard drive on a Samsung Tablet?

Question: I have a 2 TB hard drive full of movies.  I am getting bored watching movies on the computer so I decided buy a Samsung Galaxy Tab.  My hard drive is NTFS and my friends told me that I have to convert NTFS to exFAT to able to see my files on the tablet.  My question is, if I convert my hard drive from NTFS to exFAT, will I be able to watch the files on the tablet?  If not, what should I do to be able to do so?
Comment: How are you connecting the hard drive?  If it's connected to a computer already, it would likely be easiest to access it via SMB over Wi-Fi.  Unless the files are massive or your router very slow, playback should work fine.
Comment: I would try connecting a USB thumb drive formatted in those different formats first to see if your tab recognizes either, before I wiped my hard drive.  I agree with @Matthew Read that accessing it over a network is a lot better.
Comment: i am connecting hard drive to tab with usb but tab does not recognise my hard drive and my friend told me that i have to convert it. i am asking if it is true or not.
Answer: The Galaxy Tab appears to support exFAT, so yes — you could back up your files, format the drive, and restore the files.  Then the connection should work.
If you are rooted, there are ways to mount NTFS drives directly.  Paragon Mounther should be able to do so.


What is the best method to use your own itemstyle.xsl on a CQWP?

Question: Im using sp2010. I have created programmatically a module where I copy my custom itemstyle.xsl. I named it customItemStyle.xsl. How can I programmatically set this customItemStyle.xsl file as default on an existing CQWP?
Answer: You'd have to update the ItemXslLink on every single one of them - It can be done programmatically, but then you have to run a console job each time an CQWP is inserted on any page anywhere on the site.
The best way secure that CQWPs you insert in the future have your custom ItemStyle.xsl, is by downloading an already inserted CQWP, open it and change it's ItemXslLink property to your own.
Then after you have changed the ItemXslLink, upload the modified CQWP to the Webpart gallery.
Here is a good blog with a simple walkthrough on how to do just that.