Preference of BJT to MOSFET

Question: Why do we use BJTs in discrete applications, but prefer to use CMOS in integrated circuits?
Comment: We don't; it's much leveller than what your question implies.
Comment: There is no general preference. Each choice may depend on hardware system requirements. Learn about systems engineering.
Comment: Why CMOS but not pMOS or nMOS?
Comment: CMOS is "Complementary"-MOS. It combines both NMOS and PMOS as symmetrical pairs. It's 'easier' to design things like simple logic gates using CMOS. With CMOS you end up with smaller circuits which is great because we can fit more logic gates into our designs which may be quite small.
Answer: Not necessarily, MOSFETs are very useful components in discrete applications, too.
For example MOSFETs have lower source-drain voltage drop than BJTs have collector-emitter voltage drop if you have reasonable (not too high) currents. Low voltage switched mode power supplies usually use MOSFETs. Also MOSFETs don't have a wasted gate current like BJTs have a wasted base current.
BJTs are good for class B and AB amplifiers so you usually see BJTs in those cases.
The reason digital devices are all CMOS is because of the low power consumption. Neither NMOS nor PMOS nor any kind of BJT logic allows such a low power consumption. CMOS ideally uses only power when switching states, although with modern processes the gates are becoming so thin there may be constant leakage too -- but in cases where low power really matters, you wouldn't use the latest and greatest process anyway.
Comment: "but in cases where low power really matters, you wouldn't use the latest and greatest process anyway." I work in a field where power consumption is important (smartphone RF transceivers) and we currently use TSMC's 7nm node. Leakage is a problem but only really at higher temperatures. We have a low supply voltage, we use bigger, slower low-leakage cells (and memories) where possible and we split the chip into several power domains.
Comment: However with the newer processes and a design shrink you usually lower the voltage, keeping leakage down.
Answer: CMOS transistors on an integrated circuit can be much much smaller (1000's of times) than BJTs. That, together with the ease of driving them (no base current; no need for current limiting resistors) makes them easier to use.
BJTs have more precision and specialized uses in some analog circuits, but modern CMOS processes can approach their performance.
Generally a CMOS (analog) design achieves performance (accuracy, bandwidth, circuit functions) by designing with different sized transistors (length and width) to achieve specific performance. This is not a common in BJT-based designs and usually resistors are used to change circuit performance and parametrics (e.g. gain, noise etc.).
Discrete small MOSFETs would be very delicate and sensitive to ESD; therefore they are not comonly available or used. In addition, it would take a huge number of different devices (length, width) to give the range of attributes that are needed in a circuit design.
Comment: It is worth noting that while there are physically tiny discrete MOSFETs on the market, they are **huge** compared to the ones used inside a microchip. The smallest gate capacitance discrete MOSFETs are in range of 1-10 pF, while the ones on a microchip are less than 0.1 pF for internal logic. The MOSFETs used for IO pins are much larger to handle ESD and higher currents.
Comment: MOSFETs on a chip can have gate capacitances of femtofarads. Of course this is not practical or useful in a discrete device
Answer: Ease of use.
Lone BJTs have higher gain, lower VBE, and tighter VBE matching, making even current mirrors feasible, to a limited extent (low accuracy say 5-20%, and preferably at low voltage or power dissipation; note the latter can be extended with a cascode e.g. Wilson current mirror).  And they depend critically on matching characteristics, so it's no small feat that this is possible (well, kind of it is, but it's nice in any case).
Whereas FETs vary by whole volts between random parts of a given type, and Vgs(th) is higher and gain is lower.  So you get less value per part, and they can be harder to use.  For example, the VBE drop of a BJT emitter follower can be quite tolerable in some applications (consider the Sziklai switch in  the LM2596 and similar bipolar switching regulators; the minimum ~0.7V drop is pretty modest compared to say a 24V supply, where these parts shine the brightest), though annoying in others (conversely, check the same chip's efficiency at low input voltage.. eep!)
The fact that the base also acts as a diode, is sometimes helpful and sometimes a hindrance, but overall more useful I think I would say.  For example, you don't have to worry about saturating VBE, just pull it up until it's dropping enough current and BJT physics handles the rest.  Whereas pulling up a MOSFET gate (from an unspecified voltage, let's say it could be a high voltage--) could simply blow it up.  So maybe you need an extra diode or resistor divider or something to deal with that.
On the other hand, MOSFETs don't require drive current, so if you have a switching application, and a fixed gate voltage source, it's no problem; and it can be much more efficient than for BJTs, not just from the lack of DC gate current, but the switching is intrinsically faster and the voltage drop can be lower (BJTs generally have a minimum (granted, typically small) VCE(sat), while MOSFETs simply drop voltage proportional to load current and Rds(on)).
In ICs, there are several reasons: one, the matching issues that plague discrete applications are completely absent, making MOS current mirrors for example trivial; indeed they have unlimited fanout so an entire amplifier chain can be biased with minimal additional bias current.  CMOS circuits can be much smaller than BJTs (at least, digital ones*).  Two: well, I mean, both BJTs and MOSFETs are very flexible in IC format of course (width, length, degree of interdigitation, etc.), but arguably there's a stronger effect on MOSFETs (short channel effects, etc.?), making for more interesting variation and flexibility.  (Or maybe not, I'm not an ASIC designer.)  And three -- CMOS processes are just so dominant these days, run a few wafers of something else, still using standard digital process levels even, but it happens to be analog circuits -- who cares right?  Pump out huge numbers of 'em no problem.
Overall, I, think, or get the impression that, BJTs would generally be better for op-amps and such -- but cost, and availability of processes, makes CMOS a big winner even if its performance might be inferior.
And that's not at all the complete story -- there are HBTs available (SiGe BJTs), which significantly outperform both (conventional Si transistors).  These are widely used for RF purposes, but one, good luck finding any discrete (other than ~60GHz fT parts for MMIC amp or transmitter application!), and two, they can be put to great effect in ICs, including for analog purposes, even at fairly pedestrian levels...
There was an, I think ~20MHz GBW op-amp that Analog made (makes?), on their XF3? SiGe process, that's... just an absolutely ordinary op-amp, modest fT, normal Vos, normal/low Iib, normal Vcc range... just with suspiciously better Iq.  Which is the real problem with op-amps: you can get as much speed as you like, but it'll cost you in current consumption.  And within Si alone, no one can do any better, even with the cleverest circuits.  But put SiGe to work, and you can suddenly knock off a whole factor of 2 or 3 from that figure of merit.
*Peak analog performance in CMOS is somewhere around the 60-200nm process node, as I recall.  IIRC, BJTs are effective at similar scales, but such fine BJT processes might not be... very common?  Or, if nothing else -- some of the most common BJT circuits today, take LM393 for example, it substantially predated such processes.  So, that's kind of an odd argument to make, but by quantity, what with so many legacy designs still proving useful, maybe there is higher density overall for CMOS analog, just because (or in part) so many old designs pull down the average?  Heh, I wonder.
Answer: In general, I would say that the types of MOSFET that you can buy as discrete components are better at switching than BJTs, and the types of BJT you can buy discrete are better at linear operation.
It's not impossible to use MOSFETs in linear regions (many ICs do internally), but the ones sold as discrete components (almost always a type called VDMOS) aren't ideal for it. Likewise, it's not impossible to use BJTs for switching (the earliest switching regulators did), but MOSFETs are far superior for that purpose due to their lower voltage drop when on.

I'd also like to note that your assumption of BJTs in discrete circuits and MOSFETs in ICs is an oversimplification at best, just plain wrong at worst. Discrete MOSFETs are used all the time when you need to switch power to something. If I need to turn something on and off, I'm definitely reaching for an Si2318 before I'd look to a MMBT4401.
It is true that BJTs are only rarely used in ICs, but rarely is not the same as never. I'm not experienced in IC design, however, so that's all I can say on that topic.
Comment: @mow However, when you can get SiC MOSFETs with a channel resistance in the single-digit milliohms (although they are currently rather expensive), I think you won't hit that break point until the currents get rather unreasonable for a single device to handle either way.
Comment: And then, you have a combination of the two in form of an IGBT ...
Comment: @mow Yes, though those are mostly a compromise to get higher voltage ratings. I wouldn't be surprised if IGBTs become obsolete old technology if and when SiC MOSFETs (or something else that can achieve those current and voltage ratings) become more affordable.
Comment: Even disregarding voltage, IGBTs are at advantage when the loss caused by the transistor's implicit diode is lower than that caused by the FET's channel resistance. And they don't have the need to account for the body diode in design.
Comment: @mow The main advantage of IGBTs right now is economic. They're far cheaper than the fancy new technology that is SiC (and potentially also GaN, though currently those aren't made--just lower-voltage, higher-current devices called HEMTs) MOSFETs. That advantage may well go away as wide bandgap semiconductors get cheaper--but it remains to be seen how much cheaper they will get.
Answer: BJTs consume current while idle.  That makes them unsuitable for high levels of integration because there is only so much power you can afford per component on a multimillion-transistor die.  MOSFETs have wide parameter variation which makes them more amicable to digital than analog applications and/or requires larger support circuitry around them which makes them more suitable for integrated circuits.
Also for discrete MOSFET applications, the body diode often ends up a real nuisance, and it is almost universally not externally available but tied to the source which can be a real nuisance for a number of applications.
I recently made a switchable phantom power supply to an existing amp and did use a dual MOSFET.  The wanted behavior essentially makes this a no-brainer: it's binary on/off, a low on-resistance is desirable, acting on a voltage is appropriate (in this case, the voltage after a pull-up resistor lighting an LED or not, depending on a switch).
And even in this simple application, the body diode made for a lot of nuisance to avoid having it come into play: if the inputs (on a combo XLR/TRS) socket are separated with capacitors, the XLR input where the phantom power may end up has to have (even if high-value) pull-down resistors for draining the capacitors if phantom power is off.  If phantom power is switched on without significant DC load, signal amplitude must not exceed the body diode voltage.
It's clearly the most suitable component to use here, but it comes with a bunch of nuisances in the discrete application that go away in most integrated circuits where the substrate is not tied to the FET source but is a separate die layer that will get tied to one of the supply voltages.
Add to that that you have to fear the part going to meet its maker until you managed to solder the gate into some voltage domain shared with source/drain because really small charge differences will blow out the gate when handling.
Answer: Because, CMOS have following advantages compare to BJT

high switching speed
low power consumption
low output noise etc
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

Preference of BJT to MOSFET


How much area man should cover his body in salah?

Question: If a man has to offer salah,how much minimum area of his body should be covered? answer with reference please
Answer: A man's awrah is the navel to the knees. There is mixed opinion on this subject. Some say that this is meant to signify the thighs, penis and behind. Others say it is the entire area that is told. To be safe, I would just cover it, and many people wear clothes that cover more than that.


3 wire RTD configuration Wheatstone bridge Vs. Constant Current Source

Question: I am trying to design a 3 wire RTD circuit. I've been looking into either a Wheatstone bridge or a constant current source with ratiometric measurements. I would like to know which is the better approach in terms of, linearity, precision, stability, drift etc.. What are the advantages and disadvantages for both approaches and the complexity involved in the design.
Answer: A Wheatstone bridge does not offer perfect cancellation of leadwire resistance changes, and the linearity is somewhat affected. Keep in mind that the 3-wire connection strategy does not perfectly correct in any case since the wires may differ in resistance between them.
Constant current sources are more complex and expensive and may add significant drift if they are badly designed. With a good design the voltage output will be ratiometric to a reference voltage, which may also be used for an ADC reference.
Comment: If I am connecting with a 3 wire pt100 RTD and a Wheatstone bridge. The resistor on the left branch should be 100 ohms(to balance the bridge at 0degrees), to the RTD. But how much should the other two resistors be on the right side of the branch? I would be doing a voltage excitation on the bridge input.
Comment: @UKNP Depends how much current you want to put through the sensor (more current = more output = good, but more self-heating = bad). Somewhere in the range of 0.2 to 1mA is typical, but if you're measuring air temperature vs. a solid or flowing liquid the answers may vary somewhat since the heat loss from the sensor (and thus self-heating error) will vary with the thermal resistance etc.
Comment: My concern is the values of the two identical resistors that would be on the opposite side of the sensor on the bridge. Does the current really matter on that branch? How much resistor values would you suggest I go with?  I'm not too worried about self heating, since I will be turning the sensor on/off for very short periods of time. I am measuring air temperature.
Comment: If you have a 5V power supply then 4K99 will give you a bit under 1mA. If you have more complex questions it might be better to open a new question.


MSTest Deployment not working with "../../path" but works with the full path on visual studio 2010

Question: I got a problem with MSTest Deployment,
i set folder deployment to something like that "..\MyProject\bin\debug\"
I know this path is relative to the test solution dir (C:\dev\MyApplication\Tests in my case) and it appears as
>Solution Directory>..\MyProject\bin\debug\ in the deployment GUI.
The problem is that there is no error at all but no folder or files are copied.
But if i put the full path like this
C:\dev\myApplication\MyProject\bin\debug\
i got a warning that it could not work on other computers as it's outside the solution folder.
despite that warning it works and all files from my debug folder are copied.
The problem is that i want relative pathes as every one on the team got a root path of the solution different of course.
Any Idea ???
I forgot to mention that this project was migrated from VS2008 where it worked to vs2010 where i have this problem.
Answer: The relativeroot is by default the solution directory. So this should be "MyProject\bin\debug\"


Battery 15 volts plus

Question: My car battery is running a 15.5 volts all the time yet at times has a slight struggle to start. It's been really cold lately in the teens and colder. Is my battery bad? Car was put in service in June of 2011 so it's almost 8 years old now.
Comment: 15.5V is not possible with a normal car battery - unless that is being measured while the engine is running which then says little about the battery itself.
Answer: Any lead storage battery over five years old is suspect.  In my 30 years' experience, waiting until eight years to replace the battery always leads to trouble.

Battery 15 volts plus


iPhone SE Random contacts

Question: Random contacts are appearing in my contacts, some are old friends, some I have no idea who they are. I have made sure that contacts from apps like Facebook and Linkedin, are not allowed to be synced. I thought that might be the end of it but no. A new contact appears on my phone with disgusting messages (redacted by IconDaemon) in the mobile number. I have a picture to show. I have deleted these contacts off my phone but can anyone help?
Answer: Open the contacts app and tap "groups" in the upper left.  This should list all potential sources of new contacts.  For instance, I only have groups listed under "iCloud" and "Facebook".  If you see a source that you're not expecting you might be able to narrow down where these contacts are coming from.
It might also help to restrict what apps have access to your contacts and perhaps disable some. To check go to settings... privacy... contacts.

iPhone SE Random contacts


Is it a crime to bring a device that resembles a bomb to a public place such as an airport?

Question: Is it a crime if someone is aware a device looks like a bomb and brings that device to a public place?
Comment: In what jurisdiction?
Comment: One does not need to be aware it looks like a bomb.  http://tech.mit.edu/V127/N40/simpson.html
Answer: Yes: Many states have laws against "hoax bombs" or "false bombs."  E.g., in Texas:

(a) A person commits an offense if the person knowingly manufactures,
  sells, purchases, transports, or possesses a hoax bomb with intent to
  use the hoax bomb to:

make another believe that the hoax bomb is
  an explosive or incendiary device; or
cause alarm or reaction of
  any type by an official of a public safety agency or volunteer agency
  organized to deal with emergencies.

In New York:

A person is guilty of placing a false bomb or hazardous substance in
  the second degree when he or she places, or causes to be placed, any
  device or object that by its design, construction, content or
  characteristics appears to be or to contain, a bomb, destructive
  device, explosive or hazardous substance, but is, in fact, an
  inoperative facsimile or imitation of such a bomb, destructive device,
  explosive or hazardous substance and which he or she knows, intends or
  reasonably believes will appear to be a bomb, destructive device,
  explosive or hazardous substance under circumstances in which it is
  likely to cause public alarm or inconvenience.

Even without the mens rea requirements of these crimes, the common-law standard for other crimes like Disturbing the Peace is the "reasonable person" doctrine.  So even if you honestly didn't think your device resembled a bomb, if a court concludes that a "reasonable person" would think it did then you can be convicted of such lesser crimes.
Comment: So wait, you are saying that the language of the TX statute, for example, which explicitly requires intent to use, is overridden by common law reasonable person so the actual intent need not be proven?
Comment: @jqning - No, I was merely noting that for other (I assume lesser) charges that may be applied to a scenario like this "intent" is not always a requirement.  However for the two examples specifically listed *intent* **is** a requirement.
Comment: I think "intent" is the intent to do the thing that you are doing, and not the intent to do something illegal.
Answer: This is my opinion based on my own travel experiences:
Assuming it is definitly not a bomb, but rather (for example) some mechanical engineers project (like a computer/sensor with wires going everywhere), that is fine. If you purposfully create panic, or present it in a questionable way, that is not ok and can be illegal. If it is supposed to resemble a bomb (but isn't one), thats not fine too, and you should have a valid reason to bring it and talk to the airport in advance that you will be bringing it (in a way that doesn't make them suspicious of your intentions). Either way, you'll likely expect to have security have a greater interest in you.
Answer: Many terrorism and public order laws have specific prohibitions of replica bombs and such, depending by country. To provide a comprehensive list would be difficult, especially as many anti-terrorism powers are quite generally and generously worded in grounds for arrest and confiscation.
Specifically regarding "if someone is aware", many offences in the UK have the mental component of subjective recklessness: seeing the risk and taking it anyway. For example, taking something bomblike and happening to scare people with it could constitute Assault (causing victim to apprehend immediate unlawful force).
Additionally, officials and security in public places such as at airports can confiscate more or less anything, especially anything which looks dangerous, at their discretion, without being particularly accountable to a higher power.


XNAvs Unity for Developing Kinect games

Question: I wold like to build a simple 3D game using Kinect for windows but I am confuse about what game engine to use.
 The game that I intend to build has simple graphics and static background however the  accepted user motion need to be accurate .
My question is what is better Unity3D or XNA ?? ANd is there any other game engine you recommends?
Answer: Unity3D has no support for the Kinect for Windows SDK (or vice versa). Unity3D uses a version of mono which has a subset of .NET 3.5 - and the KfW SDK is developed for .NET 4 and above. You can get the two working together using C++ interops but its a lengthy process, and not really documented anywhere. OpenNI/NITE has Unity support for Kinect but it is not the "offical" SDK and I'm not 100% sure how redistrubution works.
KfW has fully support for XNA, and samples are now included.
The huge difference however is the development environmenet. XNA is all code based, and provides a game loop and a C# based framework to edit the 3D objects. This means you code everything from scratch and are required to calculate all the math and physics. It's a great platform but has a steep learning curve.
Unity3D in comparison is a visual tool, allowing you to drag and drop assets, cameras, lighting on the screen to ensure you are getting the correct visual look and feel. You then write scripts and attach them to the assets instead of coding a whole game from the ground up.
In my experience I much prefer Unity for developing 3D games, however now having the full KfW support is always a problem for me. However this is a personal choice and for many scenarios OpenNI works just fine.
Answer: You might also want to consider using Motion Toolkit for Unity. Like OpenNI its not the "official" SDK, and uses a middleware by some company called Omek (At least according to the package description) but it integrated nicely into Unity, and works nicely for me.

XNAvs Unity for Developing Kinect games


GDM configuration on Solaris 11?

Question: On Solaris 10 it was located in /etc/X11/gdm/gdm.conf but that file is missing from a standard Solaris 11 install. When I run the command slocate gdm.conf the only file I get is /etc/dbus-1/system.d/gdm.conf which I don't this is the correct one.
Answer: found with
find / |grep gdm

It's in /etc/gdm. for xdmcp it should suffice to write enable=true under [xdmcp] in custom.conf.

GDM configuration on Solaris 11?


Partition function of an ideal gas (taking gravity into account)

Question: I am trying to solve the following problem from an old qualifying exam:
"Ideal gas in gravitational potential"
Consider an ideal gas of N indistinguishable molecules of mass m in a cylindrical volume $V=Ah$ with base area A and height h.
Calculate the canonical partition function of the ideal gas including the effect of gravity. (Hint: You may find useful the integral $\int_0^\infty  t^2 e^{-t^2}dt=\sqrt{\pi/4}$).
My work so far:
Since the partition function of a total system is the product of the partition function of the subsystems, i.e. if there are N subsystems, we'd have
$$
Z_{total} = Z_1 Z_2 Z_3 ... Z_N = \prod_i^N Z_i
$$
Moreover, if (as is the case in this instance) the subsystems are indistinguishable, we can (after correct Boltzmann counting) reduce this to,
$$
Z_{total} = \frac{1}{N!} (Z_1)^N
$$
where $Z_1$ is the partition function of 1 molecule of an ideal gas subject to gravity.
Question #1:
The solution accompanying this problem makes the following adjustment to my above expression for $Z_{total}$. Notably, they use Stirling's formula to write out N!. However, I'm either making a silly mistake, or the solution is wrong.
Using Stirling's formula
$$
N! \propto (\frac{N}{e})^N
$$
I would think that
$$
Z_{total} = \frac{1}{N!} (Z_1)^N = \bigg(\frac{Z_1 e}{N}\bigg)^N
$$
but the solution says
$$
Z_{total} = \bigg(\frac{Z_1 N}{e}\bigg)^N
$$
Question #2:
$Z_1$, the partition function for one of the gas molecules subject to gravity is
$$
Z_1 = \frac{1}{h^3} \int d^3p d^3q e^{-\beta H}
$$
where $h$ is Plank's constant, $\beta = 1/T$, and $H$ is the Hamiltionian for a single molecule accounting for both the particles momentum and gravity ($H=\frac{p^2}{2m} + mgy$, with y being the height of the particle).
The first step that the solution takes in evaluating this integral is the following
$$
\begin{align}
Z_1 &= \frac{1}{h^3} \int d^3p d^3q e^{-\beta H} \\
 &= \frac{1}{(2\pi \hbar)^3} \int  e^{-\beta \frac{p^2}{2m}} d^3p \int  e^{-\beta m g y} d^3q\\
&=\frac{1}{(2\pi \hbar)^3} \int  e^{-\beta \frac{p^2}{2m}} d^3p \cdot A \int_0^h  e^{-\beta m g y}dy
\end{align}
$$
where recall that A is the area of the cylinder and h in the height.
Now the next step is where I'm thoroughly confused,
$$
\begin{align}
Z_1 &=\frac{1}{(2\pi \hbar)^3} \int  e^{-\beta \frac{p^2}{2m}} d^3p \cdot A \int_0^h  e^{-\beta m g y} dy \\
&=\frac{4 \pi}{(2\pi \hbar)^3} \int_0^\infty  p^2 e^{-\beta \frac{p^2}{2m}} dp \cdot A \int_0^h  e^{-\beta m g y} dy
\end{align}
$$
My only guess is switching to polar and changing the limits of integration?
Can someone clarify these two questions for me?
Cheers
Answer: 1) I think, that this is typo in answers..
2) $d^3 p = 4\pi p^2 dp$ if we are consider quantity under integration, that depend only on on modulus of $p$.
To understand this imagine spherical coordinates in 3d:
$$
dxdydz = r^2 sin\theta \;dr d\theta d\phi
$$
And after integration over sphere you obtain $4\pi$.


Why do we use grand canonical ensemble for BEC description?

Question: The system we consider has constant $N$, $V$ and $T$ (the number of particles, volume and temperature) This is just the thermodynamic variables for the canonical ensemble, why we use fugacity $z$ or chemical potential $\mu$ there?
Answer: If you choose to set $N$, $V$ and $T$, then you are choosing the Canonical Ensemble, so $N$ is fixed. In this approach, the chemical potential $\mu$ is just a parameter that you've to determine by imposing that the total number of particles is $N$.
Viceversa, if you choose the grandcanonical ensemble, you fix $\mu$ and so the number of particles $N$, fluctuates around an average value $\langle N \rangle$. I hope that I've well understood your problem and answered properly.
Comment: *Once again, we have a canonical ensemble (N is fixed), ....*   After several years, I realized that I was completely wrong, of course we do have an  ensemble with $$  fixed, and this is equivalent using $\mu$ and grandcanonical ensemble, you were absolutely right
Answer: In the thermodynamic limit fluctuations in particle number should tend to $0$ and so we should get the same result whether we use the cannonical or grand canonical ensamble. If we are ultimately interested in a system with a fixed particle number, we can, if we so choose, set up the problem in the grand cannonical ensamble and then invert the equation for $\langle N \rangle$ to find what chemical potential will give us the desired mean particle number.
For systems of identical quantum particles we generally choose to use the grand cannonical ensamble because it turns out to be dramatically simpler. In such systems it is convenient to use an occupation number representation for states, rather than listing the state of each individual particle, since it can then be assumed that an appropriate (anti-)symmeturization procedure has been applied and not have to think about it. In the cannonical ensamble, however, we now encounter a problem; since the total number of particles is fixed the occupaion numbers of differnet states are not independant, but must satisfy a constraint. This leads to a rather convoluted combinatorics problem to list the set of allowed ocupation numers.
In the grand cannonical ensamble we do not encounter this problem, since all values of $N$ are allowed. We simply consider all possible sets of occupation numbers, but since states with very large or very small particle number are exponentially weighted against, they do not contirbute. In effect we allow the statistics of the problem to "automatically" find the states with the correct particle number for us.


Only sea water appears blue in color, why this is not happening in river water?

Question: Is the salt in the water the reason for scattering sunlight into blue?
Comment: Lakes look blue ...
Comment: @chris   The answer to the other question appears to explain why large masses of water, including swimming pools, appear blue.  But a river is bigger than a swimming pool, so it seems there is more to be said.
Comment: The "duplicate" explains why large masses of water can look blue.  It does not explain why rivers tend not to be.  I think this was prematurely closed.
Comment: Related meta discussion: https://physics.meta.stackexchange.com/q/10764/2451
Comment: @WillO Your comment is basically an answer. *Large* masses of water appear blue. So small rivers frequently do not appear blue.
Comment: Pictures that show blue ocean water likely are showing relatively shallow water with a white sand bottom.  Rivers are shallow (compared to the deep ocean), but river beds usually are not white.
Comment: P.S., In-ground swimming pools, on the other hand, are often painted white.
Comment: To clarify some of the above comments:  This was briefly closed as an alleged duplicate of this post:  https://physics.stackexchange.com/questions/120069/why-is-water-blue-on-a-quantum-leve
Comment: @ james, river bed is also white.
Comment: @HvacEngineer the answer you've marked "accepted" is wrong. Please do me a favor and read S. McGrew 's post for the correct answer. If you like S. McGrew 's answer better after you read it, please switch your "accept" vote if you understand why it is better. If you don't understand why it is better please reach out to me directly
Comment: @Pentane, Mcgrew explanation was realistic but Arpad answer is a basic science. I just need the real science behind it, that's why i have given green tick.
Answer: The reason is not salt water. Large masses of water seem to be blue, both oceans and swimming pools.
Water absorbs most of the red wavelength. Most materials have their color from their surface level valence electron's absorption and re-emission processes. In water, it is not like that, because most of the color is caused by vibration of the molecules. Because of the photons get inelastically scattered (instead of just being absorbed), part of their energies get transformed into the vibrational energies of the molecules.
Now when a photon interacts with an atom, three things can happen:

elastic scattering, Rayleigh scattering, when the photon keeps its energy and changes the angle
inelastic scattering, the photon gives part of its energy to the atom and changes the angle
absorption, the photon gives all its energy to the atom, and the absorbing electron moves to a higher energy level.

In the case of large masses of water, three things cause the color:

elastic scattering, Rayleigh scattering, on the surface of the water, sunlight is reflected and appears to be blue from certain angles
inelastic scattering, part of the photons' energies transfers into the energies of the vibrational energies of the molecules. This means, that because of Hydrogen bonding, the red color wavelength photons will be shifted to blue color wavelengths.
water can absorb and re-emit light too, but because of the high ratio of refraction and reflection in water, the ratio of photons absorbed is low.

This gives a body of water when looking through it a blue color. But then comes the question, why is a body of water when looking at it (not through) blue?
Light scattering by suspended matter is required for the color in this case, and the blue light needs to return to the surface to be visible. Such suspended matter can also shift the scattered light to green color, often seen in rivers. The answer to the question of why rivers appear green instead of blue is because of those three factors have different effects on different types of masses of water.
Pools appear usually more colorless, but still blue, and not green. This is because the effects come in this order of importance:

reflection of the bottom of pool is dominant
reflected light from the surface (blue) is less dominant, and vibrational shifts are less dominant than the color of the bottom
reflected light from suspended matter (green) is less dominant
angle of observation less dominant

Oceans appear bluer because:

reflected light from the surface is dominant and vibrational shifts
angle of observation (and depth) is important because oceans look blue from far away, when deep enough (so that the bottom is not reflecting)
reflected light from suspended matter is not so dominant because oceans tend to be clear

Rivers, shallow lakes:

Reflection from suspended matter (green) is important because shallow lakes and rivers tend to have more sand and dust then oceans and pools
Reflection of the bottom is important because they are shallow, and the bottom is not blue (more gray like sand)
angle of reflection is important because lakes from far away and certain angles appear bluer when the bottom is not visible and surface reflection becomes dominant
Vibrational shift become less dominant because the suspended matter is more dominant and the water is not deep enough
Comment: So, tl;dr: rivers are often muddy.
Comment: @pentane I say pools are more colorless, meaning, they have less of their own color, blue, because they are usually not deep enough to appear blue, because for light to make water appear blue, light needs to pass through water long enough (meaning several meters) to make it appear blue. Of course the bottom color will be visible. What I am saying is that pools are clear and more shallow, so the natural blueness of these waters is not so dominant. Water needs a certain depth (and cleanness) to appear blue.
Comment: "Pools appear usually more colorless, but still blue, and not green." This is wrong. See for example: https://aquamagazine.com/images/Magazine/2012/July/NNN-712-AQLG.jpg

Water is clear to visible light. It transmits visible light very well at all wavelengths of visible light. The water will appear to be whatever the color the paint at the bottom of the pool is.
Comment: @ÁrpádSzendrei http://www.fishpondinfo.com/photos/ponds/bigpond/fish03122.jpg
Answer: The color of a body of water is usually due primarily to light reflected from the sky and surroundings. Of course the ocean usually doesn't have a lot around it except the sky, but in a place where a lot of light from vegetation reflects off the water, the ocean can appear green.
This is a fresh-water lake; you can see reflections of white sky, blue sky, green trees, and so on.

The colors in the water, especially those in reflections from the sky, tend to be darker and different because the colors in the sky are often polarized.  When light glances off a smooth surface, the surface reflects light with horizontal polarization more effectively than light with vertical polarization (see Brewster's Angle), so some skylight can end up darkened - or brightened - relative to other colors depending on the angle of polarization and the angle of incidence.


Using offline storage

Question: I am trying to make a website which will store all the contacts of the user on the server database. The user can add, edit, delete or update a contact. I want the user to be able to do all these functionality even when he is offline. What should I use to achieve this. I came across web sql database  which can be use to store database offline. But I dont know how to synchronise the online and offline database. I am using Ruby on Rails
Answer: According to Web SQL's W3C page, the specification is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further (http://www.w3.org/TR/webdatabase/).
Why don't you give HTML5's persistent storage a try instead? There's a great tutorial here that also features a chapter on local storage hacks before HTML5, so you may read it if you're not planning to dive into HTML5 just yet.
You may also try Google Gears, as it features an interface to a local sqlite3 database in which you may store your offline data.
As for the synchronization mechanism try persistanceJS. It should help you with both HTML5 and Google Gears options.
EDIT
Apparently persistanceJS has no support for rails just yet, but there's a tutorial on how to use local HTML5 storage with rails here, and there's a rails plugin to easily enable gears on rails apps here. Those should get you started.
Answer: You can use Ruby on Rails to do it as well.  Check out the Railscast series of video tutorials.  Specifically episode 247 to get started with ROR and offline storage

Using offline storage


If the "Problem of Qualia" is valid, then how can we communicate?

Question: I was reading about qualia and how there's apparently the problem of qualia because a unique experience is constrained to one subject (?). But I don't see how this is meaningful in any way since communication between subjects is possible. Plus, we can imagine/dream a new experience by constructing it from past experiences. Seems like the "problem of qualia" belongs in the same category as solipsism, nihilism, absolute skepticism, etc. Why should I entertain such a concept? Thanks!
Comment: Does this answer your question? [Why is the existence of qualia considered an argument for dualism and against materialism?](https://philosophy.stackexchange.com/questions/29006/why-is-the-existence-of-qualia-considered-an-argument-for-dualism-and-against-ma)
Comment: It's not clear to me how your question is different from existing ones like https://philosophy.stackexchange.com/questions/32934, https://philosophy.stackexchange.com/questions/29006/ . Maybe you can quote what you read and explain what is still unclear after reading existing questions on the matter.
Comment: We can not communicate the qualia, we only communicate relational information. E.g. we can communicate that green looks different from red, but not what either green or red look like to us. I do not see how the ability to "imagine" new qualia from our own past qualia helps with that, others still do not have access to our qualia, either past or present. It is also unclear what the supposed relation to nihilism or solipsism is.
Answer: We can communicate although our experiences are personal because we share a universe, but our experience of perceiving this universe are personal and non shareable.
If I point to a red spot (a spot I personally perceive as red) and say "this is red" to a toddler, he will learn that what he is perceiving is to be named "red". The toddler can then proceed to ask me for "red shoes", knowing that we agree on what is red, but It does not mean we have the same experience of redness.
Although we perceive the same light frequency, the neurons that get activated in each of our brains are not the same. The way we perceive a same stimulus is not the same. IRM and other advanced imagery give us good reason to think it is very similar, but the fact is we don't have the same neurons, ordered in exactly the same manner, and thus what happens in each of our brain is personal, and something we can't share with each other.
As a materialist, I fail to see how qualia is a hint for dualism, but I find the concept of distinguishing between the stimulus, the name we give it through language and it's mapping in each individual's brain, to be, at least, thought provoking.
Comment: but a lot of brain structure is identical between humans....
Comment: @Hierarchist: yeah, a lot. But certainly not all. They're all grown organically. In the same way, all oak trees have the same structure, yet they are different.
Comment: Furthermore, even if we all had the exact same brain, we wouldn't be able to share how it feels to see a color, without using common ground like "I feel like you feel when you look at this red spot". Although we can see the neurons firing, how it feels to be the owner of those firing neurons is a personal, unshareable experience. Otherwise prostitutes would just have to explain to their client what an orgasm feels like to satisfy them.
Comment: have you ever had a wet dream?
Comment: Precisely. How would you share your wet dream with someone else ? It seems you don't get what qualms is in the first place.
Comment: I don't need to share my wet dream with you, you can junt have your own identical one.
Comment: The point is precisely that qualia is something only you can experience, the part of separation that is only in one's own consciousness. Seems you don't even try to understand.
Comment: If you have the same dream, you had the name qualia.
Answer: A thought or perception is analogous to a two-sided coin. One side is the objective brain signal and the meaning encoded by it. The other is the subjective, conscious experience of that meaning. For example if you see a red light then a particular signal pattern will arise in the region of your brain which processes consciousness. Accompanying that signal pattern is the subjective sensation of redness.
The problem is that science has no way to either predict or describe that quality of redness which you consciously experience. There is no objective criterion by which that quality can be communicated to another person. How do the perceptions of a fully sighted person compare to those of a color-blind person? Communicating things like "red is different from other colors" or "red and green look the same to me" works at the physical level but we have no idea what qualia are associated with those meanings. Worse, how do you and I know that our experiential perceptions of red and blue are not swapped over? We can check out the brain signals and deduce their meaning, but we cannot check out another consciousness's experiences to see how they are different or if they are swapped over.
This elusive subjective quality of "redness" is called a quale (pronounced "kwah-ley"). A more complex experience comprises many such qualia (plural of quale).
One cannot deny that qualia exist, as one's own consciousness comprises nothing more nor less than an ongoing stream of them.
But relating them to their objective brain events in any meaningful scientific way appears to be impossible. In the theory of mind and consciousness the nature of this relationship is known simply as "the hard problem".
Philosophers disagree profoundly as to whether one or the other side of the coin might be primary. Some, such as Dennett, regard the material world as primary and qualia to be a trivial distraction. Idealists believe quite the reverse, seeing objective reality as a delusion created by an entirely metaphysical or experiential reality. A third school, dualism, treats the material and the experiential as independent realms. And of course many variations and intermediate positions arise from these three approaches.
If you base your concept of "meaningful" on material scientific grounds, as you apparently do, then you paint yourself into the first of those schools. But that is your choice, it cannot be justified on its own terms any more than the verification principle can be - indeed, it is just the verification principle applied to consciousness.
A final note. The "problem of qualia" is quite different in kind from solipsism, nihilism or absolute skepticism. Those last are all negative approaches in that they deny or doubt the existence of something. Qualia affirm the existence of something.
Comment: There is no further help I can offer you.
Comment: but we can see what's going on in the brain, and compare two different brains and see where they have identical firings.
Comment: No, you really have not grasped the details, you need to re-read my answer slower. Firstly, brains vary hugely in their detail wiring so we can only ever hazily identify a "red" signal. Secondly, you have absolutely no way of knowing what that brain's **subjective** experience of the signal was like - it could be like your experience of what you call "blue", or something you cannot even imagine.
Comment: We can actually find identical firings.
Comment: @Hierarchist Define "identical" firings. Explain how two organic brains can have "identical" nerve connections with "identical" firing patterns. Then tell us all how a colorblind neuroscientist can know what the red quale feels like.
Comment: Just record the firing of someone who sees red, then induce that firing in the colorblind person. Or at least just give the colorblind person feedback while they're imagining color to tell them how close they are to an actual experience.
Comment: @Hierarchist, don't be silly. You cannot induce that firing in a colorblind person, their brain is lacking the necessary connections. If you cannot understand that, there is no further help I can offer you.
Comment: there is neurosurgery that can create neural connections.
Comment: ??? the eyes are still colorblind


Missing face texture

Question: I downloaded a model and the face texture is not showing but im not really sure why,
anyone knows whats up?

Here's the .blend file
Answer: You didn't include the textures, so I can't make a final judgement, however:
your character uses 2 materials for the body, 9 for the eyes and 5 for the mouth. I am guessing this is supposed to produce facial expressions cartoon-style by switching the materials. I would strongly suggest to take all the different face meshes and split them into several objects, so you can easily hide the ones you don't need. Also the normals of those exchangeable parts are flipped, I don't think that was intentional.
With this setup (and I don't think this is the way you want to approach this in Blender) you're multiplying with an alpha value. Specifically with that of the animalboyaeye_alb.5.png, that image, or at least its alpha channel seems to be wrong, but I can't judge, because the textures aren't there.
Try separating the face parts, it might already make the problem go away. If not, send us the .blend with the textures.
Comment: Oh my bad, here's the full folder with textures included https://drive.google.com/drive/folders/1m62bp_RbcHUOnd1z9CK9qiaO_vENu8eC?usp=sharing
Comment: Id also have to add the fact that is a MMD model imported to blender with an addon, so you might find some weird values. Yesterday i saved that file with a little change that screwed the rigging but it shows the face correctly in the solid 3d viewport shading somehow. Here it is too: https://blend-exchange.giantcowfilms.com/b/XMWXVXAJ
Comment: Ok last edit: I tried what you said and you are right, there were 9 different objects for the eyes stacked on each other. I separated them by material and left the only one that displays the texture correctly (animalboyaeye_alb.0.png).
May i ask you why the other 8 eye textures are missing? Feels like they should be included already in the .blend
Comment: I don't know what MMD is and how Blender treats the texture input.

Missing face texture


How to give Read_write users access to foreign tables imported through foreign data wrapper?

Question: I had a question regarding the extension postgres_fdw. I am trying to use postgres_fdw to import foreign tables from DB A to DB B.  These databases are on the same host.
In Database B, I have a set of users that have read_write access for each schemas.
I want them also have access to these foreign tables and any subsequent views and tables that are created from these tables.
My issue is: All the postgres_fdw commands, I've had to run as superuser.  I've run the following:
CREATE SERVER DB_A_server
  FOREIGN DATA WRAPPER postgres_fdw
  OPTIONS (host 'host_name', dbname 'Database_A');
CREATE USER MAPPING FOR read_write_user
  SERVER DB_A_server
  OPTIONS (user 'readonly_DB_A', password 'readonly_DB_A');
GRANT USAGE ON FOREIGN SERVER  DB_A_server to read_write_user;
SET ROLE read_write_user;

I'm unable to run these commands as the read_write_user for Databaase B.
My end goal is to have: read_write users import foreign tables as they please.
IMPORT FOREIGN SCHEMA completed LIMIT TO (Database_A_table1, Database_A_table2
)
FROM DB_A_server
INTO public
What would I have to do in order to give the read_write role access to these foreign tables?
Can I do something like: GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO ;
https://learn.microsoft.com/en-us/answers/questions/741419/create-foreign-data-wrapper-without-superuser-priv.html
Thanks!
Answer: Yes, you can run
GRANT USAGE ON FOREIGN DATA WRAPPER postgresql_fdw TO read_write_user;

and then run all yourcommands as read_write_user.


checking for convexity/concavity of a function

Question: i'm having some problem in establishing the convexity/concavity of the following two functions.
Check for the concavity/convexity of the following functions:
(a) $f_1:\mathbb{R}^2_+\rightarrow\mathbb{R}$ defined as $f_1(x, y) =\min\{\max\{x, 2y\}, \max\{2x, y\}\}$
(b) $f_2:\mathbb{R}^2_+\rightarrow\mathbb{R}$ defined as $f_2(x, y) =x^2 + y^2$.
thank you.
Comment: For $f_2$ you may want to calculate its Hessian matrix and check that it's definite positive. If you're not into that stuff, you can use the fact that it can be written as $f_2(x,y) = g(x)+h(y)$ where $g$ and $h$ are two convex functions on $\mathbb R$ and use the definition (with $\lambda U + (1-\lambda)V$ ...) to prove it.
Comment: If my answer for $f_1$ is OK for you, please just accept it.
Answer: In addition to the other answer and my other comments, for (a) $f_1$ is neither convex nor concave.
To see (and prove) it, just consider the intersection of the surface $z=f_1(x,y)$ with the vertical plane $x+y=10$. It's this 1D curve (parametrized by $x$) : $x \mapsto f_1(x,10-x)$.
You can see a plot here (hopefully). Clearly this is neither convex nor concave and provides sufficient counter-examples points to prove it.


How to take away shadows where I don't want them?

Question:
i only want to have the shadow of the rope showing, but as you can see somehow shadows are being cast onto the layers which doesn't look good. I'm pretty new to blender and tried to mess with the lamp settings but can't get it to work for the life of me. it seems to look okay in rendered view (with the layers only showing the shadows ofcourse) but when i render it always turns out like that no matter what i do.
Answer: You can turn the wall into a shadow catcher by looking at the Cycles Settings in the Object Panel.
In this case, select the wall object and enable Shadow Catcher. You might have to adjust the diffuse color of the wall to white in order to make the wall completely transparent.


Background App Refresh not updating apps

Question: Background App Refresh won't auto update apps — why not?
iPad 2, 64 GB, iOS 7
Answer: Background App Refresh won't update apps.

When Background App Refresh is on, apps that take advantage of this feature can refresh themselves in the background.

Source: Apple KB Article — iOS: Understanding multitasking
This means that the apps can refresh their content, but Background App Refresh is not responsible for the actual updating of the binary from the App Store.

With regards to the actual app updating, there is a criteria which must be met before an app can be updated:

Intelligently scheduled updates.
iOS schedules updates during power-efficient times. Like when your device is on and connected to Wi-Fi. So your battery isn't drained unnecessarily.

Source: Apple — iOS 7 — What's New, previously available at http://www.apple.com/ios/whats-new/
This means that just because the option is enabled, the update won't always take place.


A noun for a person who dominates as social conversation in a very loud voice

Question: What noun would one use for a person who dominates as social conversation in a very loud voice?
I have tried "monologist", but it doesn't sound appropriate. That sounds as though it refers to a profession.
Comment: There are terms for dominating conversation, and for speaking in a loud voice, but I'd be more surprised if there is one word implying both. Is one aspect of this more important than the other?
Comment: I might say _he's a loudmouth_, or _he's a talker_, with "talker" carrying a negative connotation.
Answer: That's a conversational narcissist:

A conversational narcissist will do their best to limit the discussion to topics where they are knowledgeable and can take up the most airtime.
In addition to both dominating the topic and airtime of a conversation, a narcissist might come across as incredibly arrogant and superior, making it even less likely that other people will cut in, for fear of being made to appear stupid, and thus enabling the narcissist to continue to monopolize everybody's time. (Men's Health)

It's a relatively new term (became common after 1970's)
Comment: It's hard to get a word for someone who does two things, monopolizing conversation and speaking in a loud voice. This is a good answer for the first part, and I don't think you'll do much better.
Comment: Narcissisme is only a particular sort of psychological complex; loudness is not necessarily an indication of narcissism. The love of oneself does not come through in mere loudness. all loud conversationalists would be narcissists then.
Comment: The behaviour described in your answer could stem from a superiority complex, and have nothing or little to do with narcissism.
Answer: Without further characterization of such a person you could refer to them as a "boisterous talker".

(SOED) boisterous 3 Of a person or action: rough or turbulent in behaviour or speech; (now esp.) exuberant, noisily cheerful

Complement after some more thinking about this question
Combining the answer of user Aled Cymro and the adjective shown above, a seeminly better term results.

A boisterous monologist

(SOED) monologist A person who talks in a monologue or solioloquizes. Also, a person who monopolizes conversation.

Note    I doubt there is a one-word term in which both ideas should be captured precisely enough.
Answer: Pontificator, perhaps? From pontificate, which Merriam-Webster defines as

to speak or express opinions in a pompous or dogmatic way

He does not pontificate about whether one ought to choose, if forced to it, to betray one's country rather than one's friends …
Robin W. Winks


meaning of verb 'come as'

Question: How would you translate 'what have you come as?' I've never heard this expression
Comment: *Come* is a very trigger-no-metric word.
Comment: The Halloween meaning refers to a _masquerade_.  Does this meaning seem to fit? You didn't give enough context in your question for us to be sure that's the meaning.
Comment: "come as" is a phrasal verb that is used as an _idiom_. See Dog Lover's answer.
Comment: It is either literally or figuratively referring to a sort of masquerade party, where you "come as" some character.  It might be used in the figurative sense when asking someone if, for example, they have come to a meeting in their official capacity as The Not So Big Kahuna, or, perhaps, as just another programmer on the team.
Comment: Thanks all for your replies. I want to tell you more about the context: the question is made by a girl who meets at a party another girl who is dressed up.
Answer: "What have you come as" can be used in party contexts, such as Halloween.

'What are you going to come as for Halloween?'
'I'm going to dress up as Homer Simpson.'
Answer: You probably won't come across too many instances of "What have you come as?" in AmE.
Dog Lover's "What are you going to come as?" is plausible, but unnecessarily complex - "What are you going as?" would serve.
"What have you come as?" is more commonly expressed as, "What/Who are you supposed to be?".
It's more common in the past tense, third person: "They came as the ghosts of George and Martha Washington." (US)

meaning of verb 'come as'


How to do feature transformation on data without knowing what the data mean?

Question: How to do feature transformation on data, without knowing what the data mean? What are the usual transformations that are done? Is there a proper method to do this in a structured way?
Comment: It might help to (1) define "feature transformation" - sometimes it seems to be used narrowly to refer to principal component analysis & related data reduction techniques, & sometimes to mean feature engineering/creation/construction; (2) explain what kind of situations you're imagining - what about the data *can* be taken for granted?; & perhaps (3) suggest what kind of analysis the features will be used for.
Comment: i am talking about in general so it includes what you have mentioned. And as I said you don't know what the data is about and the analysis of the features is used for regression in order to predict y for a new x.
Comment: So, to make it concrete: you've been given a table with fields $y$ & $x_1 \ldots x_k$; you *do* know that each row represents observations on an individual unit, & that these are (more or less) independent & representative of a population for which you'll have to predict $y$ for some members given only $x_1 \ldots x_k$ for each; you *don't* know anything about these $x_1 \ldots x_k$ other than what you can guess from the contents of these fields. Something like that? Or are you imaging that $x_1 \ldots x_k$ are already more or less suitable for regression, each being an individual real ...
Comment: Did you look at box-cox family of transformations ?
Comment: ... number representing the magnitude of some quantity?
Answer: I'll try to keep it as generic as possible.
You might have continuous, categorical or binary values.
If you have categorical values, let's say x1 takes values such as (Monday, Tuesday, Wednesday, etc) then you need to process and encode them somehow.
For the example above it's typical to encode monday as [1,0,0,0,0,0,0].
Tuesday would be encoded as [0,1,0,0,0,0,0] and so on.
You need to convert everything to numbers.
This page from scikit-learn explains it: http://scikit-learn.org/stable/modules/preprocessing.html
Feature transformation could then be:

Preprocessing -- This is typically: Scaling, Standardizing (z-score) or Normalization.

If you're not allowed to look at the data, I'd go with Normalization since it's a procedure that you can perform on streaming data immediately. This guarantees that none of your features will be greater than one or less than zero. You now have some bounds on each feature. This might be your answer, although I'll go further just in case.

Dimensionality reduction -- http://scikit-learn.org/stable/modules/classes.html#module-sklearn.decomposition

These methods project the data onto lower dimensions -- helpful with high dimensional data (e.g. think of is as compression, getting rid of non-essential information). Again, for streaming data you might need something like the Incremental PCA. Another option (vs PCA) is the RBM http://scikit-learn.org/stable/modules/neural_networks.html#neural-network
Either way, you have no guarantee that you will end up with an optimal solution since you're not taking the y's (regressor) into consideration.

Feature selection -- http://scikit-learn.org/stable/modules/feature_selection.html#feature-selection

Several options are (but not limited to): L2 (Ridge regression) L1 (Lasso) and L1+L2 ElasticNet. If you use the L1 norm to penalize then your solutions will be sparse (e.g. you get rid of some features completely, some weights are zero). If you use L2, then the algorithm adjusts the importance (weight) of each feature.
You don't have to use linear models (e.g. f(x) = x_1 + x_2 + ... x_n), you can choose whatever combination of features you want, e.g. (x_1^2 + x_2*x_1 + x_2 + etc). Then the regularization is performed on this model.
Or you could just use the random forests and you get this for free.

Generic answer without knowing what the data 'means' and not making any assumptions about it's distribution: encode non-numerical values to numbers, normalize (unit length) and use a regularized regression model.
Answer: One interesting answer is the No Free Lunch theorem. Basically it states that your ability to model data is inseparable from your understanding of it.
Features, though, suggest you are interested in obtaining the numerical inputs to model using a multivariate regression tool. If that is the case, it's a fairly well defined area that is documented by ML libraries such as Spark. Common examples are mapping words (or categories) into vectors, and normalizing a quantity's mean and stddev.
This topic gets way more complex if your input is text, or images and other multimedia formats. This is why zip files compress text well, but you need a specialized MPEG-4 video codec for that kind of data.
Answer: Most common statistical techniques are optimized for normally distributed data of roughly the same scale. The most common feature transformations are thus equating variance across variables and turning non-normally distributed data into normally distributed data.
A standard approach is to rescaling is to calculate the mean and standard deviation for every variable, throw away all variables whose standard deviation is 0, and then subtract off the mean and divide by the standard deviation. This has the virtue of preserving distances between measurements--if three points were at 4, 6, and 8 before, then afterwards we know the distance between the first point and second point will be equal to the distance between the second point and third point. This is unnecessary as pre-cleaning for most regression techniques, because this is part of the operation of the regression technique, but can be useful for feature selection techniques, including regularized regression.
I prefer explicit normalization instead. To explain it, I'll talk about units: we start off with the raw units (maybe this is a length measured in meters), convert it to fractiles (this is the amount of the data it is larger than, measured in fractions), and then convert to probits (this is what the z-score of a point with the same rank from a normally distributed variable would have been). This has the virtue of enforcing a multivariate Gaussian distribution on the data.
Which approach to prefer depends on what the underlying data means. If you have bimodal data, is the distance between the modes significant, or just the overall rank of the data? If you have skewed data, is the data 'centered' on the mean, or the median, and are movements to one side or the other equally meaningful?
Fractiles discard relative distances, focusing only on a point's position in the sample's order, and thus are a natural way to compare very different distributions. It easily handles outliers, which are always a concern with unfamiliar data. It's what I would start with if I had no special prior knowledge. But if we know the correct transformation, we should of course use that, as those distances may have actual meaning (and it will only sometimes be the fractile, or equivalently, the raw data if the data is normally distributed).
Comment: By converting to fractiles, keep in mind you are effectively modeling the single-variate distribution. I'd call this modeling, not normalization. The remaining multivariate data, having been normalized in this way, is called a copula.


At what point does kale stop producing?

Question: I have some kale that I planted in a raised bed.  It is growing well and I take out leaves as and when I need it.  Of course, it keeps growing new leaves.  My question is at what point will the kale stop producing (or die)?  The motivation for my question is to start planning for the next set of plants to put in place of the kale when they eventually stop producing.
Answer: Depending on the zone you are raising Kale the main sign that that Kale plant will stop producing is when it flowers/produces seed.  Bolts...keep those flowers off that plant, use higher nitrogen when fertilizing and it should last most of the season.  It is an annual normally.  An annual has only ONE purpose in life and that is to make seeds, babies.  You cut those babies/flowers/reproductive structures OFF and that annual gets bigger, healthier and REALLY starts producing.  Now an annual where you only want vegetative growth you make dang sure you NEVER allow any energy to go into seed making. You do that by using NPK ratios so that the N is higher in number than the phosphorus and potassium.  You cut off chop off any reproductive growth that starts.  When the daylight hours shorten you'll not be able to keep up as that is another trigger telling that plant time is short and you need to make seed!  I am not advocating LOTS OF FERTILIZER.  It is simply the PERCENTAGE between the three vital chemicals plants need to have in a domestic garden.  Higher the number on N, you get vegetative growth...leaves.  Lower than number below the P and the K and you'll get more reproductive growth.  Once that plant sets seed...hey its life is fullfilled and will start dying.
If a gardener wants more of a vegey, definitely what you intuit is to start fresh crops every 2 weeks apart...hey, what do you use your kale FOR?  I love Kale.
Comment: There you go, you got it.  Fundamental yet important.  When you want berries, or flowers or cucumbers...reproductive growth it makes A HUGE difference that you use lower percentage of nitrogen in relation to P and K.  Hey, my hubby bought me fertilizer that was 6-5-5 and it was TOO MUCH nitrogen lots of green leaves but stopped reproductive growth like now.  The fertilizer said for use with tomatoes, and vegeys and flowers and I tried it but just that little difference was all it took to screw up my vegetables...great for lettuce and kale...but.  Here is a great way to use Kale...
Comment: Break up kale leaves into chip size chunks, toss in peanut oil or olive oil...quit using corn oils btw, drain and organize on a cookie sheet with parchment, sprinkle with a little coarse kosher salt and bake at 250 until crispy like a chip!  YUMMERS.  Kale is an 'indicator' plant.  If you've got heavy metals, toxins in your soil that you don't know about.Kale and the brassicas (broccoli, cauliflower, etc) suck that stuff up and store & accumulate the stuff.  I worry about these persistent contrails as they spray heavy metals primarily to make...clouds for instance.  Test it if you can...grins
Comment: I deserve this, sigh.  I wasn't thinking clearly or something.  Arrrggg.  JStorage, just forget I said anything about 'indicator plant'  just something I've been involved with lately and shoot...you'll be fine.  You should get a soil test anyway.  Cheap...go through your closest University Extension Service for soil testing.  Tells you an awful lot, used to be free but still cheap...those kale chips are so yummy...honest injun!
Comment: Thanks for the lesson on NPK.  That is fundamental knowledge. So the way I interpret that is when growing cucumbers, bell peppers, etc., use less N and when growing leafy vegetables use more N.  Is that accurate?  BTW, I use Kale for salads and love it too.  Need to look at other recipes as well.
Comment: Can't wait to try out the recipe this weekend.  BTW, I did not understand your comment about "indicator" plant.  How would I know there is too much metal and toxins by looking at brassicas?
Comment: They get rusty?
Answer: I had kale survive on my allotment over winter to April this year ( middle of the UK, ~200m high ). The hardiness depends a lot on your variety, but as long as you keep pinching off the flowers it'll last for a long time. At some point the taste will become unpleasant as it puts all its energy into seed production. Its probably better for you to decide when you need to plant the next crop than to guess the lifetime of Kale.

At what point does kale stop producing?


Cassette upgrade

Question: I have a campy record 8 speed hub/cassette,11 through 23. The rear derailleur is a 7402 Dura Ace. I was hoping to upgrade the cassette to a 13 through 26/28 campy 8 speed. Will the derailleur handle the larger gears?  The crank is also campy record 42/52.
Comment: If you lack the smaller gears and do not need the smallest cog, think also about a compact crank. But that is extra and more expensive.
Comment: The compact won't make much difference on the high end.  It will give a slightly lower gear even than 42/28, but would also (in theory) require a GS derailleur.
Answer: Per Shimano's original spec, the max cog is 26t. But people have been successful using a 28t cog so you may be able to get it to work "as is".  If there isn't enough clearance and the jockey wheel runs into the large cog a longer B-screw will increase clearance.
The frame plays into the max cog specification as the distance from the center of the axle to the center of the derailleur hanger bolt varies with different bikes. So the 26t will be a worst case scenario where the center-to-center distance is a minimum and would be the situation where the longer B-screw will help.
Also note the maximum chain wrap for that derailleur is 28t which will be fine for what you're proposing:

28-13 = 15
52-42 = 10
10+15 = 25t wrap

Going to a compact crankset will easily exceed the chain wrap which you can work around by simply not using the small chainring with the smallest cog or two.

Cassette upgrade


Developing an Excel XLL using Mac OS X / Linux

Question: I've been developing C++ models using Visual Studio for the past 5 years, and wrapped them into Xll to be used with Excel (using xlw). The Excel add-in is the final product I want to deliver.
However, I believe C++ coding is way better using Linux or Mac OS X. But I also believe using my models with Excel through the Xll is also very practical, but sadly only works on Windows.
So I would like to know if there is a way to do the implementation on Mac OS X (or Linux), generate the Excel add-in and use it on Windows.
The only method to do so that I'm currently thinking of is doing the coding on Mac OS X, compile the project without including the part concerning the Xll, then load the project into Visual Studio and compile it entirely to generate the Excel add-in. But to be honest, this sounds a bit laborious, and I'm hoping for an easier way.
Answer: It is possible. You just need to use mingw (http://mingw-w64.sourceforge.net/) to compile from Linux. I should note that you can then use g++ 4.7, which is a very decent C++ compiler with support for C++ 11x. The cross-compilers work both in Mac and Linux, and because it is gcc, you can use them with your favorite tool ecosystem.
There are few unexpected quirks, but just in case:

Remember to use -Wl,--add-stdcall-alias to get functions exported with no underscore in the final dll.
Instead of declspec(__declexport) use __attribute((dllexport)). But you can also use the more antique .def trickery, if you wish. In any case, use the Windows sdk tools "Depends.exe" or similar to ensure that your dll exports correctly the names.
If your are using a virtual machine for testing, or any fresh Excel installation, remember to install all the bells and whistles that come with Office and Excel. Otherwise, in Excel 2007 and Excel 2010, the addins won't work, and you will mistakenly blame your build setup.

Also, if you are up for using http://kalx.net/xll/, which indeed can make your life simpler, you will have to update that library for strict C++ conformance.
Best regards.
Answer: I've developed a working example of a C++ Excel addin using Mac OSX, Eclipse CDT and XCode and a spreadsheet that uses the addin. An explanation is here http://www.smr.co.uk/excel-addin-on-mac-os-x-using-cdt/ including versions used etc and the code is here https://github.com/PollardsEtFilles/MacCPPExcelAddinExample.
There are two gotchas

Excel 2011 is 32 bit
Make sure the addin in the same directory as the excel spreadsheet

clang (included with Xcode) is a good replacement for g++
All you need to do is install Eclipse CDT and import the code you'll be away.
Comment: this is not an XLL addin but just a to a dylib.


Car wont start even though battery charger says it is fully charged

Question: I have a 2010 ford focus ran and drove just fine 2 days ago, i went out to start it today and nothing. There were no dash or internal lights on at all when i turned the key still nothing no noise at all even. I jump started it and it started just fine let it run for about 30minutes and shut it off can out an hour later to go to work and nothing again same as earlier. I put it on the charger for a few hours, said it was fully charged and still got nothing when i tried to start it. I've checked the cables and they seem fine, i checked the water and filled it with distilled. Im not sure what else would cause it, I've never had this problem before.
Comment: Where did you connect the jump leads to on the dead vehicle?  Were both leads connected directly to the battery terminals?
Answer: If you connected the jump leads directly to the battery terminal connectors on the dead vehicle, then there are really only 2 possibilities -

The battery is totally dead and needs replacing
There is a bad connection between the battery connectors and the battery terminals

If you connected the negative jump lead to the engine, then this adds an additional possible fault of a bad earth strap from the battery to the vehicle body work.
The first thing to do is check the battery.  Remove it from the vehicle, put it on charge for a few hours, maybe all day, then take it somewhere that can test it.  A totally dead battery seems the most likely fault to me, based on these symptoms.
If the battery is OK, then thoroughly clean the battery terminal connectors and either end of the earth strap.
Answer: I would remove the battery cables, clean the terminals and the inside of the cable clamps, and put it back together. Watch for any foreign matter or corrosion.
Also check the age of the battery.  A 2010 is about at the end of its second battery, given 4-7 year life of a car battery.   If you see a 2015-2018 date, it's probably time.
If you're having to add water that's not a good sign. 1990s and onward alternators charge very precisely and do not overcharge the battery, so batteries rarely lose water.  If you have a hygrometer you might check the specific gravity after charging... if it won't go above 1/3 charged the battery is done.
Lead-acid batteries are dirt cheap, and uniquely well-suited to starting engines. So annoying though it may be, it's still cheaper to replace a lead-acid 3-4 times in a car's lifespan than it would be to use a better technology of battery. In the future lithium may drop in price enough to be a player. We'll see.


Realtek ALC295, HP Spectre laptop - headphones play audio in Windows but don't play audio in Linux

Question: I have this laptop - HP Spectre x360 13-w023dx.
Basically my headphones work in Windows but they don't work in Linux (specifically Arch Linux). In Linux, my headphones are detected (i.e. the system volume changes when I connect my headphones) but I can't seem to get any audio to play out at all.
I have tried audio when booting from an Ubuntu Live CD and it still doesn't work.
I've tried hdajackretask and following this, but all it does is play audio through the speakers like nothing was connected to the headphone jack at all.
Also, playing audio via a USB-C audio interface only works in Windows, a similar problem happens when playing in Linux.
Here is the output of pactl list sinks when the headphones are connected, if it helps:
Sink #0
        State: SUSPENDED
        Name: alsa_output.pci-0000_00_1f.3.analog-stereo
        Description: Built-in Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 6
        Mute: no
        Volume: front-left: 16381 /  25% / -36.13 dB,   front-right: 16381 /  25% / -36.13 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC295 Analog"
                alsa.id = "ALC295 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xdc228000 irq 134"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1f.3"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "9d71"
                device.product.name = "Sunrise Point-LP HD Audio"
                device.form_factor = "internal"
                device.string = "front:0"
                device.buffering.buffer_size = "352800"
                device.buffering.fragment_size = "176400"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Built-in Audio Analog Stereo"
                alsa.mixer_name = "Realtek ALC295"
                alsa.components = "HDA:10ec0295,103c827e,00100002 HDA:8086280b,80860101,00100000"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Ports:
                analog-output-speaker: Speakers (priority: 10000, not available)
                analog-output-headphones: Headphones (priority: 9000, available)
        Active Port: analog-output-headphones
        Formats:
                pcm

Any help to get my headphones to work (and also USB-C audio) would be appreciated. Thanks!
Answer: there is an audio codec 'fixup' for this laptop
use this command in terminal
echo 'options snd-hda-intel model=alc295-hp-x360' | sudo tee --append /etc/modprobe.d/alsa-base.conf

this creates a file alsa-base.conf (file name can be anything, but must end in '.conf' in /etc/modprobe.d/ folder)
reboot to load laptop model configuration for audio driver
Comment: I saw this fix online and I tried it but it didn't work. Still no audio through headphones.
Comment: @etnguyen03: Look through `dmesg` after to boot to verify that your kernel is new enough to recognize the model option and apply the fix. If it doesn't, switch to a newer kernel.
Comment: @dirkt `dmesg | grep hda` doesn't mention anything about the `alc295-hp-x360` fix, all that I see is [here](https://pastebin.com/1fp4WnTS).
Comment: Then I'd assume it's not new enough.


I have my password with an accent and i can't put them

Question: I need to know how to put an accent in Elementary OS
I have a QWERTY keyboard in spanish, please help me!
Answer: You can try with unicode:
Pressing first Shift+Ctrl+U
Á
U+00C1
É
U+00C9
Í
U+00CD
Ó
U+00D3
Ú
U+00DA
á
U+00E1
é
U+00E9
í
U+00ED
ó
U+00F3
ú
U+00FA
More help:
http://www.ltool.net/characters_to_unicode_charts_in_spanish.php?unicode=1&nowpage=2
There os also another related question that can help you:
How to insert characters by pressing ALT + # (numpad)?
I hope it works but haven't tried myself in a password field.


Ftp server Perfomance

Question: i have a ftp server and asp.net application deployed (iis) on the same machine  the ftp server is on F drive and the application is on C drive hosted on iis . the application is used by 500 users daily through internet explorer. they are also going to upload and download the files from the application using the ftp server.
My question is there going to be any perfomance issue i.e is my server going to become slow. due to ftp server (used for upload and download from the application on the same mac
Answer: Every reads and writes from and to the disk is an operation that the disk must handle. And a physical disk can only handle so many operation. So, yes, having additional service in operation will cause additional slow down.

Ftp server Perfomance


Does the kinetic energy theorem imply that any body on wich is exerted the same space-dependent force is equally accelerated?

Question: So, we have a body $P_1$ of mass $m$ that travels from $A$ to $B$ along a straight line, on wich is exerted a constant force $F$ dependent only on the position of $P_1$. We know that the work done is $W_{P_1} = \frac{1}{2}m(v_{1A}-v_{1B})^2$, with the expression within the parenthesis being the difference in velocity from $A$ to $B$. Now, suppose that a second body $P_2$ with the same mass $m$ travels from $A$ to $B$. We know that the work depends only on the path and the force, so the work $W_B$ on $B$ satisfies $W_B = W_A$, hence $\frac{1}{2}m(v_{1A}-v_{1B})^2 = \frac{1}{2}m(v_{2A}-v_{2B})^2$ and $(v_{1A}-v_{1B})^2=(v_{2A}-v_{2B})^2$. Assuming a force opposite to the direction of motion, we conclude:$v_{1A}-v_{1B}=v_{2A}-v_{2B}$, in other words the change in velocity over the path $AB$ of both the bodies does not depend on their initial velocity. But I know this is false: is there a fallacy in my logic? In my math? Where am I doing a mistake?
Comment: $(x-y)^2 \neq x^2 - y^2$
Comment: Your equations are wrong. The work is equal to the change in kinetic energy. What you wrote is not the difference in kinetic energy. Fix this and then reformulate the question.
Answer: We know from Newton's second law that $\vec{F}=\frac{d\vec{p}}{dt}$. If the mass of the particle/object/body is constant, we can write $\vec{F}=m\frac{d\vec{v}}{dt}$. Rearranging the equation gives $d\vec{v}=\frac{\vec{F}dt}{m}$. This means that the difference in velocity only depends on the force applied on the body, the time it's applied for, and the body's mass. According to the work-energy theorem, the work done on or by a system is equal to the change in it's kinetic energy. If you apply a large(r) force, over some distance d, the change in velocity $d\vec{v}$ will be large(r), and hence, the difference of the squares of the final and initial velocities will be large(r). Similarly, applying a small force over the same distance d, the change in velocity will be small(er), and the difference between the squares of the final and initial velocities will be small(er). Also, note that you have made a mathematical error in your expression for the work done. Since the work done is the difference in kinetic energy, $W=\frac{m}{2}(v_f^2-v_i^2)$ and not $\frac{m}{2}(v_f-v_i)^2$ as you've written.
Answer: $$F= m_{0}a$$
In classical mechanics, if there is the same force, then at any speed the acceleration is going to be the same.
However, there is only the same change in momentum if $\int \vec{F} \cdot dt$ is the same.
For a body in the presence of a force field , moving through a distance x, regardless of speed, the body gains some kinetic energy KE.
$KE \propto v^2$

I have taken the libery to draw lines indicating the kinetic energy of a body of 1, 2 and the corresponding velocities.
Let's say a body is at at rest, and gains "1" of kinetic energy, because KE is proportional to v^2, the total change in velocity is 1m/s
Now, let's say the body is ALREADY moving at 1m/s, once it travels through a distance X under a force field it gains "1" KE such that it is now has 2 Ke,
The  change of kinetic energy is the same for both, however look at the graph. The increase of kinetic energy for the faster object, corresponds to  a LOWER change of velocity, than for a body at rest.
Another way to think about it,is that a faster object spends  LESS time in the field, moving through a distance x, so $\int \vec{F} \cdot dt$ is lower and thus a lower change of momentum.
This all changes when we consider relativistic speeds
$P = \frac{m_{0}v}{\sqrt{1-\frac{v^2}{c^2}}}$
Acceleration IS velocity dependant for a given net force.


Looking for a science fiction omnibus where one of the stories had mock combat games for political purposes

Question: I read this story over twelve years ago. It was published with a lot of other stories (by the same author IIRC). The main story that I remember had to do with some kind of war games using pilots and mechanized units (not sure if mecha specifically or just armored vehicles) meant to resolve political issues without military action. While I think it's name was a year in the 1990's (ex. 1999) it could have been the name of another story in the collection or another decade. Later stories were much stranger, I remember something about a witch created by a mistake made by an AI and genetically modified humans with animalistic traits. I'm pretty sure this exists somewhere but every time I've looked I have not been able to find it. I'm hoping someone can help me, because I've always wanted to at least confirm it exists.
Comment: The *witch created by accident* story sounds very like [The Dead Lady of Clown Town](http://www.isfdb.org/cgi-bin/title.cgi?41502) by Cordwainer Smith. However I don't know of a Cordwainer Smith story with mechanised units fighting a proxy war.
Comment: @JohnRennie I do - there were two versions of the story; the one I remember the title of was "War No. 81-Q" - they weren't "mecha" in the giant robot sense; they were remotely-operated dirigibles.
Comment: @JeffZeitlin: aha, thanks. On closer inspection of my bookshelf I have that story in [The Rediscovery of Man](https://en.wikipedia.org/wiki/The_Rediscovery_of_Man).
Answer: You should look for When the People Fell and We the Underpeople, both published by Baen Books around 2007. This is the complete Cordwainer Smith corpus, and will contain both stories that you've described - "War No. 81-Q"  and "The Dead Lady of Clown Town" (the latter also available at the Internet Archive) - as well as all of his other stories, including his first published one, "Scanners Live In Vain" (also available at the Internet Archive), and his novella, Norstrilia.
Unfortunately, the e-book editions are no longer available for purchase from Baen; you'll have to look for used hardcopy.
Answer: This could be a book by Cordwainer Smith. The Underpeople were modified animals created as servants. One of his short stories concerned a girl created as a healer when the machine asked  for information, and the (drunk) operator kept singing  "....heal the pain"


twenty seventeen theme: comments UI not visible

Question: I'm new to WP, so I may be missing something. But I've tried everything and cannot figure out how to display the comments UI on posts. When I switch to different themes, the problem is resolved and I can see the comments box. But no luck whatsoever in the twenty seventeen theme. Any advice? I've spent a good amount of time trying to set up my new blog on this theme and I'd like to use it. But there seems to be some type of glitch. Thanks.
Comment: did you do any update to the theme ? did check well the comment options ?
Answer: Had this problem and wasted SO many hours, until I read someone else's post explaining that in most themes the comment UI only shows up on the INDIVIDUAL blog post page, ie, the page that loads when you click on the title of the post, NOT on the landing page for the blog posts. Don't like it, but don't think it can be changed...


When Joe Blake travels to Berlin, do those jets really exist?

Question: Are those jets that can be seen in The Man in the High Castle when Joe Blake travels to Berlin for real? For a second I thought they were like Concordes but then I realised they were not. If no, then the VFX used is really great.
Comment: To make sure, you're not asking if those jets actually exist in reality, like those specific plane models existing, but if they used real jets for *filming*?
Comment: It would be nice if you could answer both
Answer: There were only two commercial SST, the Concorde and the Tupolev Tu-144.
This is neither of those, the tails and cockpit windows are different, and the Nazi aircraft has fewer exit doors than the real-life aircraft.
So, it's a Special Effect (CGI)
Here's a shot of the effect actually being filmed

There is a YouTube video from Zoic Studios who do the effects. This can be seen at 1.14

Concorde

The last Concorde airbody is currently at Aerospace Bristol, a museum dedicated to the region's involvement in air travel, in the UK.
Tu-144
Comment: Nice find & wow, they didn't even bother building the door - that had to make the CGI lighting guys work harder to get it right as people crossed the threshold. btw, I'd love to show you comparative photos from stuff I've worked on... but unfortunately it's a 'sackable' offence :/
Answer: No, it's not a real plane, it's CGI.
The design looks like a hybrid of the rather famous Concorde

& the less famous & rather more crash-prone Tupolev TU-144

Perhaps a case of 'parallel evolution' or even just 'spying'.
Both planes first flew in 1969.
Germany already had the jet engine in the mid-40s (in our timeline ;) as a parallel evolution to the Whittle engine developed by the Allies, before & during the war.
The Messerschmidt Me 262 saw service before the end of WWII.
Let's just assume the show's writers saw fit to bring that development forward a little - it helps shorten the wait between character moves very nicely.


convert pdf file into excel sheet

Question: Im new to .net,i have a pdf which contains three tables,(with the purchase details)my task is to extract all the 3 tables from the pdf and convert each into an excel sheet(three excel sheets)using c# code.,i google'd for 3days,all i could find was code to extract the text from pdf(but without any formatting),i cant purchase any third party tools,i need a way to atleast extract the text in proper table formats,then i will convert it to excel using interop,OR a code to directly convert to excel,whatever the solution is i need it urgently,pls help.
Answer: itextpdf has support for c# to extract information from pdf, however to answer whither we can extract table:

As described above: you can't get fields from a PDF that looks like a
  form, if the PDF isn't a form from a technical point of view; you
  can't get a table from a PDF that looks like a table, if the tabular
  structure (using tags) is missing inside the PDF.

Which i got from their support panel
Comment: is there any other way,to extract the table values alone correctly based on the column headers atleast?pls help.
Answer: I suggest you to look at xpdf.
It has a command line interface and you can obtain a text file from your pdf.
Most important, in case of columns, xpdf produces a well spaced text file so you can easily read your data using Substring() or, in the worst case, with regular expressions.
In the simplest case you can import directly the pdf output into Excel as text file with "fixed width fields".

convert pdf file into excel sheet


Do foreign nationals have the right to a speedy trial?

Question: A teenager who is not a citizen of the United States is charged with a criminal offense.
Does the teenager have the right to a speedy trial?  If yes, at what point in time is the trial late and no longer speedy?
Comment: **Comments have been [moved to chat](https://chat.stackexchange.com/rooms/150790/discussion-on-question-by-gatorback-do-foreign-nationals-have-the-right-to-a-spe); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed.
Answer: The right to a speedy trial is secured by the Sixth Amendment to the US Constitution:

In all criminal prosecutions, the accused shall enjoy the right to a speedy and public trial, by an impartial jury of the State and district wherein the crime shall have been committed, which district shall have been previously ascertained by law, and to be informed of the nature and cause of the accusation; to be confronted with the witnesses against him; to have compulsory process for obtaining witnesses in his favor, and to have the Assistance of Counsel for his defence.

All people within the jurisdiction of the United States may exercise this right. See e.g. Wong Wing v. United States, 163 U.S. 228 (1896) ("Applying this reasoning to the Fifth and Sixth Amendments, it must be concluded that all persons within the territory of the United States are entitled to the protection guaranteed by those amendments"); and U.S. v. Koch, Criminal No. 03-144 (W.D. Pa. Jan. 25, 2011):

Numerous courts have held that a foreign national may raise his or her Sixth Amendment right to a speedy trial and, if successful, is entitled to have the indictment dismissed.

(Koch was indicted in 2003, but was essentially a fugitive in Germany. In 2011, he asked that his case be dismissed because the government had made apparently no effort to secure his presence in the United States, thereby violating his Sixth Amendment right to a speedy trial. The judge found that Koch did not benefit from this right while afar in another country. If he wanted this to be over, he had to appear in the U.S. and demand that a court get on with his proceedings.)
Ohwilleke adds to this answer by explaining the substantive extent of this right.
Comment: It's worthwhile to note that the _Koch_ court denied Koch's sixth amendment claim because he was not in within the jurisdiction of the United States.
Comment: May not apply to foreign terrorists held in military custody abroad.
Answer: Jen has a solid answer to the first part of the question. I will answer the second part.

If yes, at what point in time is the trial late and no longer speedy?

The U.S. Constitution does not specify exactly what constitutes "speedy", which is up to each jurisdiction to define, and can be influenced by extraordinary events like COVID. The constitutional rule is analyzed on a case by case basis with deference given to any definition supplied by the jurisdiction in question.
But, in Colorado (which is typical), the default standard for a speedy trial is six months after the defendants is arrested, or if earlier, after criminal case is commenced. In contrast:

The Florida speedy trial rule provides that once a person has been
arrested, they must be brought to trial within 175 days of their
arrest if charged with a felony or within 90 days of their arrest if
charged with a misdemeanor.

It is commonplace, however, for defendants to waive their right to a speedy trial, especially if they are free on bail or are likely to be convicted if tried, since delay often favors the defendant.
Note that the right to a speedy trial should not be confused with a statute of limitations. A statute of limitations begins when the crime is committed and is met when a criminal case is commenced. The right to a speedy trial time period starts counting when a criminal case is commenced or someone is arrested, and is satisfied when there is a trial.
UPDATE
A Colorado Court Of Appeals case decided today, People in Interest of CMWR, 2024 COA 4 (January 11, 2024), holds, as a matter of first impression, that in Colorado, the statutory speedy trial protections applicable to adults in a criminal cases are equally applicable to juveniles who are charged with quasi-criminal juvenile delinquency offenses in the juvenile justice system.
As noted in Jen's answer, speedy trial protections in the United States, do not depend upon the nationality or citizenship of the defendant.