error in including Cesium in webpack enabled project

Question: I have a create-react-app nodejs app using:
npx create-react-app client

Added the Cesium library
cd client
npm install --save cesium

ejected the app:
npm run eject

and modified webpack config by following the instructions described in Cesium and Webpack
And I am getting the following error:
./src/index.js
Module not found: Can't resolve 'cesium/Cesium' in '/home/client/src'

the import statement in index.js is:
import Cesium from 'cesium/Cesium';

Any pointers to what I should do?
I commented out the ModuleScopePlugin statement in the plugins section.
As suggested in the cesium page, I added an alias like so:
const cesiumSource = 'node_modules/cesium/Source';
...
'cesium': path.resolve(__dirname, cesiumSource)

but apparently it is trying to import it from src.
I have pasted the whole webpack.config.prod.js file here:
'use strict';

const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
const CopywebpackPlugin = require('copy-webpack-plugin');

// Webpack uses `publicPath` to determine where the app is being served from.
// In development, we always serve from the root. This makes config easier.
const publicPath = '/';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.
const publicUrl = '';
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);

// The path to the Cesium source code
const cesiumSource = 'node_modules/cesium/Source';
const cesiumWorkers = '../Build/Cesium/Workers';

// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
// The production configuration is different and lives in a separate file.
module.exports = {
  // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
  // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.
  devtool: 'cheap-module-source-map',
  // These are the "entry points" to our application.
  // This means they will be the "root" imports that are included in JS bundle.
  // The first two entry points enable "hot" CSS and auto-refreshes for JS.
  entry: [
    // We ship a few polyfills by default:
    require.resolve('./polyfills'),
    // Include an alternative client for WebpackDevServer. A client's job is to
    // connect to WebpackDevServer by a socket and get notified about changes.
    // When you save a file, the client will either apply hot updates (in case
    // of CSS changes), or refresh the page (in case of JS changes). When you
    // make a syntax error, this client will display a syntax error overlay.
    // Note: instead of the default WebpackDevServer client, we use a custom one
    // to bring better experience for Create React App users. You can replace
    // the line below with these two lines if you prefer the stock client:
    // require.resolve('webpack-dev-server/client') + '?/',
    // require.resolve('webpack/hot/dev-server'),
    require.resolve('react-dev-utils/webpackHotDevClient'),
    // Finally, this is your app's code:
    paths.appIndexJs,
    // We include the app code last so that if there is a runtime error during
    // initialization, it doesn't blow up the WebpackDevServer client, and
    // changing JS code would still trigger a refresh.
  ],
  output: {
    // Add /* filename */ comments to generated require()s in the output.
    pathinfo: true,
    // This does not produce a real file. It's just the virtual path that is
    // served by WebpackDevServer in development. This is the JS bundle
    // containing code from all our entry points, and the Webpack runtime.
    filename: 'static/js/bundle.js',
    // There are also additional JS chunk files if you use code splitting.
    chunkFilename: 'static/js/[name].chunk.js',
    // This is the URL that app is served from. We use "/" in development.
    publicPath: publicPath,
    // Point sourcemap entries to original disk location (format as URL on Windows)
    devtoolModuleFilenameTemplate: info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
    // Needed to compile multiline strings in Cesium
    sourcePrefix: ''
  },
  amd: {
    // Enable webpack-friendly use of require in Cesium
    toUrlUndefined: true
  },
  resolve: {
    // This allows you to set a fallback for where Webpack should look for modules.
    // We placed these paths second because we want `node_modules` to "win"
    // if there are any conflicts. This matches Node resolution mechanism.
    // https://github.com/facebookincubator/create-react-app/issues/253
    modules: ['node_modules', paths.appNodeModules].concat(
      // It is guaranteed to exist because we tweak it in `env.js`
      process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
    ),
    // These are the reasonable defaults supported by the Node ecosystem.
    // We also include JSX as a common component filename extension to support
    // some tools, although we do not recommend using it, see:
    // https://github.com/facebookincubator/create-react-app/issues/290
    // `web` extension prefixes have been added for better support
    // for React Native Web.
    extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
    alias: {

      // Support React Native Web
      // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
      'react-native': 'react-native-web',
      // Cesium module name
            cesium: path.join(__dirname, cesiumSource)
    },
    plugins: [
      // Prevents users from importing files from outside of src/ (or node_modules/).
      // This often causes confusion because we only process files within src/ with babel.
      // To fix this, we prevent you from importing files out of src/ -- if you'd like to,
      // please link the files into your node_modules/ and let module-resolution kick in.
      // Make sure your source files are compiled, as they will not be processed in any way.
      //new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
    ],
  },
  module: {
    strictExportPresence: true,
    rules: [
      // TODO: Disable require.ensure as it's not a standard language feature.
      // We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
      // { parser: { requireEnsure: false } },

      // First, run the linter.
      // It's important to do this before Babel processes the JS.
      {
        test: /\.(js|jsx|mjs)$/,
        enforce: 'pre',
        use: [
          {
            options: {
              formatter: eslintFormatter,
              eslintPath: require.resolve('eslint'),

            },
            loader: require.resolve('eslint-loader'),
          },
        ],
        include: paths.appSrc,
      },
      {
        // "oneOf" will traverse all following loaders until one will
        // match the requirements. When no loader matches it will fall
        // back to the "file" loader at the end of the loader list.
        oneOf: [
          // "url" loader works like "file" loader except that it embeds assets
          // smaller than specified limit in bytes as data URLs to avoid requests.
          // A missing `test` is equivalent to a match.
          {
            test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/, /\.xml$/],
            loader: require.resolve('url-loader'),
            options: {
              limit: 10000,
              name: 'static/media/[name].[hash:8].[ext]',
            },
          },
          // Process JS with Babel.
          {
            test: /\.(js|jsx|mjs)$/,
            include: paths.appSrc,
            loader: require.resolve('babel-loader'),
            options: {

              // This is a feature of `babel-loader` for webpack (not Babel itself).
              // It enables caching results in ./node_modules/.cache/babel-loader/
              // directory for faster rebuilds.
              cacheDirectory: true,
            },
          },
          // "postcss" loader applies autoprefixer to our CSS.
          // "css" loader resolves paths in CSS and adds assets as dependencies.
          // "style" loader turns CSS into JS modules that inject


Can I transplant new sprouts from a Royal Empress Tree stump?

Question:  My neighbor cut down a beautiful Royal Empress Tree and now there are about 5 areas of new sprouts!   A huge cluster coming off the stump and additional sprouts surrounding that area (coming up from the roots).  Can I cut one of them from underground and replant it?
Comment: Not to nag, but the offer to help choose a native replacement tree is very real!  What do you like about the Royal Empress?  The flowers?  Fast growing?  Straight, handsome limbs?  Broad leaves?
Answer: Word to the wise, these trees are considered invasive in North America and Europe and are notoriously difficult to remove after they are established.  We would be happy to help you select a native replacement tree if you ask a second question on this site.  Please plant responsibly :-)
I have never propagated one of these, but I believe the idea should be the same as other trees.  You want to gently dig around the root suckers and see if they have developed roots or are still feeding off of the parent plant's roots.  In this picture, the sucker on the right has no roots of its own, and the one on the left has a few.

Image taken from https://www.southernagrarian.com/
Hopefully you will find something like this.

Image taken from a random Quora question
If you find developed roots appropriate for the above-ground portion of the sucker, you can carefully dig the roots and sucker up and transplant it.  Water it while the roots re-establish themselves.
If you find that the sucker is coming up from roots that are too deep or impractical to dig up, you can encourage roots to develop.  One method is to scrape away the bark from an underground section of the sucker and rebury it.  Check back monthly for root development, and transplant when it is ready.
If these do not work, you may be able to root the sucker in water or with rooting hormone before transplanting it, but I don't have enough experience with that to suggest it.
Another method that I believe would propagate your Royal Empress is to simply cut a small piece of root and plant it.  Pam Pierce describes this method here, while also discouraging propagating this plant in North America.


Does putting a thin metal plate beneath a heavy object reduce the pressure it would have applied without it

Question: My dad bought an earthen pot and he kept it on our glass table. Worried that the glass could break on filling the pot with water. I kept a metal plate beneath it. At first, it seemed like a good idea , but on further thinking I was unsure if it would actually help in bringing down the pressure on the glass. what if I put three coins beneath the pressure points instead of the plate, would it be any different
 than placing the plate (assuming the coins to be nearly as thick as the plate).
and if it won't be any different, am I right to think that I could further keep reducing the area of the coins until they start looking extensions of the stand on which the earthen pot rests.
Comment: FYI: That glass plate probably is _plenty_ strong enough to withstand the stress of supporting that pot, even without the metal pan, and even if the pot was completely filled with water. I bet you could even file those metal legs down to sharp points, and the glass still would be plenty strong enough.
Answer: Here's how to think about this case.
imagine a very small glass table, just wide enough so that the three legs of the pot fit inside the circumference of that small table.
For such a small table the force exerted by each of the three legs would not be a problem at all.
For comparison, imagine a table where the top is made of very soft wood. Then you do want to put coasters underneath each of the legs, otherwise you might get indentations in the wood.
Well, glass is in no danger at all of getting indented. I would not be surprised to see coasters that are made out of glass.
The relevant failure mode is the glass plate breaking as a whole. An instantaneous full length crack. For that failure mode the metal plate shown in the photo will not make much difference, if any.
To assess how much load the glass is subjected to I suggest looking at reflection in the glass as the earthen pot is filled with water. Whithout load the glass will be straight/flat, and the reflection will be like a mirror image. When the glass bends the view reflected in the glass is distorted accordingly. If you put some load on the table, and you see no distortion (or very little) then there is very little bending, and the table is presumably strong enough. If you do see bending of the glass as the pot is filled then that table is just not a good location for that pot.
Answer: I don't think a metal plate is necessary for a thick glass like that, supported by an wood table.
Being transparent, glass looks like more fragile than it actually is.
I have a ceramic floor for example. Each ceramic plate has 60 x 60 cm, and much thinner than the glass of the picture. Moreover, the contact with the concrete behind it is far from perfect. But there are heavy sofas over it anyway. And ceramic is also a brittle material. It must be properly protected during transportation from the store to house, otherwise breaks easily.
Comment: Usually ceramic tiles are set in grout, which improves the area of contact a lot. And also prevents bending.
Comment: Yes, of course. But after solidification there are voids from behind. I guess that the contact wood-glass of the picture is better.
Answer: The arguments given here for pressure = force/area ignore one very important point, as follows: An earthenware pot in contact with a glass tabletop does not apply a uniform load to the glass because the bottom of the pot is not perfectly flat and smooth. It makes contact with the glass in only a few points corresponding to the tallest bumps on its bottom surface.
In a pot containing some sand in the clay, these asperities on the pot surface are likely to consist of sand particles: SiO2, which is harder than most glass and has extremely sharp edges on it.
For the case of a pot with sharp sand grains stuck to its bottom surface, the pressure multiplication will be huge, because the weight of the pot is applied to the glass over a small number of microscopic contact areas, and the glass will easily be scratched.
Once scratched, the glass's strength is significantly reduced because the scratch enables brittle fracture of the glass.
Putting a stiff piece of metal under the pot only works as a load distributor if the metal is ductile enough to conform to the glass surface- and if there is only a single sand grain between the metal and the glass, then for a flat piece of stiff metal the load concentration effect is made much worse.
For these reasons, wooden legs with flat surfaces on their bottoms are much preferred because they are far softer than the glass, and any sand grains that get into the interface will become embedded into the wood and not pushed into the glass with great pressure.
The best load distributor by far consists of a stiff metal plate with a layer of soft rubber on the side facing the glass tabletop. The metal plate distributes the load and the rubber eliminates stress concentrators by conforming to both the glass and the metal.
Answer: Yes, definitely by putting a plate you are reducing the pressure the pot exerts on the table because $$p= f/a$$ where p is pressure, f is force and area is a . That basically is not a description but a definition of the word pressure itself. Though I'm not sure about this, I think the plate is better than the three coins. Think about it. Gravity is not like arrows from he pot shooting straight down (technically it is straight lines towards center of earth but I meant that it also has an impact on other objects on its way - how?- because gravity pulls the pot down which presses onto the plate and the electrostatic forces between them means that the plate is experiencing a force.)
Simply put: The pot exerts a downward force on the plate OR presses down onto the plate and the plate in turn presses onto the table but now with a larger area and hence with lesser pressure, so your table is much safer.
The coins idea is not good as it does not change the surface area and simply acts as a mediator of the force of the pot above.
Answer: It will reduce the pressure. It may help prevent breakage.
$pressure = weight/area$, where area is the area in contact with the surface below it.
Without the plate, the area is just the blue feet. The blue rubber helps. It is soft and deforms to be flat on the bottom. Without it, area would be whatever points of contact were resting on the table.
Glass is pretty incompressable. A softer material like wood might be dented by metal feet.
Assuming the plate is somewhat rigid and smooth, the area of contact is likely larger than the rubber feet. You could improve it with a rubber sheet or maybe a towel under the plate.
A coin does not have a flat surface. High points on the coin would rest on the surface.

But this may not have as much effect on breakage as you might think. The way glass breaks is different than what you might think.
Glass can bend. It is easier to see in large thin sheets. But smaller thicker sheets bend a little. When it does, the inside surface compresses and the outside surface stretches. Breakage occurs when the outside surface is stretched so hard that neighboring atoms are pulled apart.
In a perfect sheet of glass, it is hard to do. Sometimes you intentionally break glass. For example, to cut a sheet to the right size for a window. To do so, you scratch the surface, and bend it to pull apart the scratch. Once a scratch is started, it is a lot easier to pull it apart a little and make it deeper. It is like tearing open a plastic bag. It is much easier once the tear is started.
Also, water is a polar molecule. The O has a negative charge, and the H's have a positive charge. These charges can exert large forces on nearby molecules. This is why water dissolves more substances than any other liquid. Water normally has little effect on glass. But in the tip of a crack, the environment is such that water pulls apart molecules and makes the crack a little deeper. And then it does it again at the new tip. So often glass cutters scratch, and then wet the scratch.
So here are some ways to avoid breaking the table top.

Get a thick piece of glass that is harder to bend. Twice the thickness means 1/4 the bending. From the photo, it looks like the glass is 1/2" or thicker.
Don't scratch the bottom surface.
support the glass so it doesn't bend. There is a lip around the edge of the table that supports the glass. This is good.
Put the pot near the edge of the table, where it is supported. Not the middle, where bending will be greatest.


Inserting Account and custom object record at the same time?

Question: Hi i need to create a record in both Account and custom object"customlead" at the same. I tried this DataLoader but at a time we can select only one object. I need to select both how this could de resloved either by Dataloader or Excel Connector. Can anyone help to solve this issue and tell me the steps.
Thanks,
Regards,
Lavanya.
Answer: You cannot insert records into more than one sObject at a time. All tools (data loader , workbench, excel connector) will only let you insert records into one sObject at a time.
Depending on the use case, you can create an after trigger on Account to create a record in your custom sObject when Account records are inserted.


get sharepoint list with pnp

Question: I want to get a sharepoint list and assign it to my list 'items' which of type is IExampleItem, but I don't really know how to do it; I tried the following code but it gives me an error, my list 'items' is not compatible with what my
Answer: Khadi,
While there is nothing technically wrong with loading the items in the FaqWebPart, I prefer to load it in the component for performance reasons. That way, it appears that the web part is faster (even if it isn't, really) by first rendering an empty list, and rendering a filled list once the items are loaded. You can even be fancy and add a 'loading' message, a spinner, or a shimmer to your list.
The trick to solve the error you get is to map the returned list items (which are of type any when they get returned) to a IFAQItem (or IExampleItem in your original code). In this example, assigned the returned items to a const variable to make it easier to read the code.
Here is how I would change the code to do this:

Full disclaimer: I did not build or run this code. There may be errors, but I should demonstrate the concept.

I hope this helps?
Answer: Check the type of 'items' in the FAQ component.
It must match with the return type of _getFacItems().
Comment: the problem i don't know which type return

`sp.web.lists.getByTitle("FAQ_List").items
.select("Question", "Reponse","Categorie", "Langue")
.orderBy("Created", true)
.get()`
Comment: i change my code for this, but it doesn't work

 `public _getFacItems() : IExampleItem[] {
  var ListFaq :  IExampleItem[] ;
  debugger;
  sp.web.lists.getByTitle("FAQ_List").items
    .select("Question", "Reponse","Categorie/Title", "Langue")
    .expand("Categorie")
    .get()
    .then( response => {
      response.forEach( item   => {
        ListFaq.push(item)
      })
    });
    ListFaq.forEach(item  => {
      alert("khkjhkjhkhkhkjhkhj"+item.Question)
    })
      debugger;
    return ListFaq;
   }`
Answer: _getFacItems return Promise《T》 so it not same as IExampleItem[].
I did sample test demo in my github project below, I bind data in component not in webpart directly, while it might be helpful for you.
https://github.com/OS-Lee/ReactSPFx/blob/master/src/webparts/reactSpFx/components/ReactSpFx.tsx

get sharepoint list with pnp


How do I get the Tsavo highway skull on halo 3?

Question: I was reading my halo 3 tip guide and it said the way to get the "tough luck" skull was to go to this platform by crouch jumping there. Well I did so but did not find it. What has happened what did I do wrong? If you could post a very helpful video that would help a lot 'cause I do better with visuals. Thank you!
Answer: The skull is called Tough Luck.  Like most of the skull locations in Halo 3, it is hard to describe well without a video.  The best written description I can give is this:

On Tsavo Highway you'll fight some Wraiths, and then take the highway path left typically in a Warthog.
Listen for a guy on the radio to say "Commander, this is Oni Recon One-Eleven..."
Right about this time, there will be a big pipe on your left, with a ladder.  Climb the ladder and walk right along the top of the pipe.
There is a steep cliff wall on your left as you proceed, that come to a sudden drop off.  As soon as you reach the drop off turn left and drop down.  It's a long drop and your shields will take damage but you won't die.
Walk several steps forward and look to your left.  You'll see the Tough Luck skull on a nearby cliff edge that you can jump to.

A video paint 1000 words at 60 fps, so I can't compete with that - check this out for a video walkthrough:


How was dark matter formed?

Question: I am a homeschooled student in year 7. I am interested in dark matter. Specifically its formation. I am curious about when and how dark matter was first formed. Also what part it played in the formation of the first galaxies. I am aware it has something to do with haloes?
Answer: The simple answer is that we don't know because we don't know what dark matter is.
We distinguish between the different kinds of stuff in the universe by their equation of state. This sound complicated, but it just describes the way the stuff behaves as the universe expands, and by dark matter we mean some kind of stuff that has the same equation of state as visible matter. Since it has the same equation of state as visible matter an obvious assumption is that dark matter is just weakly interacting matter. This is the assumption behind suggestions that dark matter might be WIMPs or axions.
If that's true it means dark matter formed at the same time as the visible matter, but actually that doesn't help much because there's no clear point at which matter formed. Most of the particles that eventually evolved into the matter we see today probably formed at the end of the inflationary era about $10^{-32}$ seconds after the Big Bang, but it's important to emphasise that we have no firm theories to describe the universe so any suggestions about exactly what happened at this time are highly speculative.
If dark matter is supersymmetric particles then dark matter became distinct from visible matter at the time of supersymmetry breaking, but again we don't know when (or even if) this happened, though to be consistent with observations it would have had to happen something like $10^{-14}$ to $10^{-12}$ seconds after the Big Bang. If dark matter is axions then they would have formed at the time of the QCD phase transition.
If you're interested in pursuing this further I recommend Phase transitions in the early and the present Universe by Boyanovsky, de Vega and Schwarz.
As to the second part of your question, we have a good idea what the universe looked like 378,000 years after the Big Bang from observations of the cosmic microwave background. The problem is that at that time the universe was remarkably homogeneous. The first galaxies formed no later than $400$ million years after the emission of the CMB, and that time simply isn't long enough for the initially homogeneous matter to have clumped into galaxies based on the observed density of matter. The suggested solution is that there is a lot more matter we can't see (the dark matter) and when we include the gravitational field of this extra matter it is sufficient to form the first galaxies so quickly.
Finally, you ask:

I am aware it has something to do with haloes?

A natural question is where all the dark matter ended up as the universe expanded and cooled. Dark matter can't form stars and planets as visible matter can because it is too weakly interacting and cannot shed its kinetic energy by radiating heat and light. So we expect that today the dark matter exists as clouds centred on galaxies, where the size of these clouds is several times bigger than the size of the galaxies. This is what is meant by the dark matter forming a halo round the galaxy. The presence of this dark matter halo is consistent with the observed rotation curves of galaxies.
A footnote: the existence of dark matter is somewhat controversial and you will find mainstream scientists who doubt that it exists. Until experiment settles the issue we just have to admit we don't know for sure. However dark matter neatly solves several unrelated issues e.g. it explains the fast formation of the first galaxies and also explains galaxy cluster dynamics and the observed rotation curves of current galaxies. While this doesn't constitute proof that dark matter exists it is certainly circumstantial evidence.
Answer: I will try to keep this as simple as possible and stick to the basics so you can follow along and leave anything complex to the bottom of this post. Unfortunately there are not really any simple answers.
There is actually a Total matter to Ordinary matter 'circular' symmetry, or a 'halo' type appearance of Dark matter, contained in the published results obtained from WMAP and PLANCK data but it is commonly regarded as 'numerology' by the physics community.
Considering that 'halo's and Dark matter lensing has a similar 'circular' symmetry with the objects being lensed, further analysis of one potential explanation for this 'circular' symmetry follows.
Nina Byers describes how Emmy Noether, a German Mathematician, proved Hilbert's conjecture to Klein, that Improper energy theorems not Proper energy theorems (as in Classical physics) were a characteristic feature of the general theory of relativity, in her paper "E. Noether's Discovery of the Deep Connection Between Symmetries and Conservation Laws" in 1998.
https://arxiv.org/abs/physics/9807044v2
"Though the general theory of relativity was completed in 1915, there remained unresolved problems. In particular, the principle of local energy conservation was a vexing issue. In the general theory, energy is not conserved locally as it is in classical field theories - Newtonian gravity, electromagnetism, hydrodynamics, etc.. Energy conservation in the general theory
has been perplexing many people for decades. In the early days, Hilbert wrote about this problem as 'the failure of the energy theorem'. In a correspondence with Klein [3], he asserted that this 'failure' is a characteristic feature of the general theory, and that instead of 'proper energy theorems' one had 'improper energy theorems' in such a theory. This conjecture was clarified, quantified and proved correct by Emmy Noether."
https://en.wikipedia.org/wiki/Emmy_Noether
Arthur Compton provided the final part of the puzzle on particle wave duality in his work on the particle nature of electromagnetic radiation.
https://en.wikipedia.org/wiki/Arthur_Compton
"Arthur Holly Compton (September 10, 1892 – March 15, 1962) was an American physicist who won the Nobel Prize in Physics in 1927 for his 1923 discovery of the Compton effect, which demonstrated the particle nature of electromagnetic radiation. It was a sensational discovery at the time: the wave nature of light had been well-demonstrated, but the idea that light had both wave and particle properties was not easily accepted."
The reduced Compton wavelength (a natural representation for mass on the quantum scale) and the standard Compton wavelength (conversion of mass into energy, or to the wavelengths of photons interacting with mass) are both named after him as a result.
https://en.wikipedia.org/wiki/Compton_wavelength#Relationship_between_the_reduced_and_non-reduced_Compton_wavelength
Finally the ratio of the Total matter percentages i.e. (Dark matter + Ordinary matter) divided by the (Ordinary matter percentages multiplied by 2), in both the published WMAP and PLANCK data percentages, equals Pi +/- 1.1%. As 2 is a constant the Total calculated matter/Ordinary matter ratio can equal 2 * Pi or the difference between the reduced Compton wavelength and the standard Compton wavelength as identified by Arthur Compton.
Could you expect this 'circular' symmetry between the masses if you modelled classical Newtonian physics (Proper energy theorems) and Quantum physics (Improper energy theorems) together in the same homogeneous and isotropic universe model as used by LambdaCDM or is this just coincident 'numerology'?
The maths night be a bit advanced for you so I will provide a description of the Calculus of Improper Integrals and Proper definite integrals by change of variables with references below, should you be interested.
At a conceptual structural level improper integrals in physics can be piecewise continuous integrals, with limits from +infinity to -infinity, that converge. Refer H.J. Keisler, p367, Definition to p369, examples 7, 8, and 9. If they are continuous and don't converge then they are indefinite integrals which are entirely different. Refer H.J. Keisler, p370, example 10, diagram 6.7.10 "It is tempting to argue that the positive area to the right of the origin and the negative area to the left exactly cancel each other out so that the improper integral is zero. But this leads to a paradox... So we do not give the integral ... the value 0, instead leave it undefined."
That doesn't mean that indefinite integrals don't play a part in our physics as an indefinite integral that cycles between +infinity and -infinity at its limits, as a sub function of a higher level function, is a valid proper use of indefinite integrals as definite integrals by change of variables. Refer H.J. Keisler, p224-5, Definition and example 8, diagram 4.4.6 second equation with u and substitute infinite limits. "We do not know how to find the indefinite integrals in this example. Nevertheless the answer is 0 because on changing variables both limits of integration become the same."
A valid proper integral of any form is not equivalent to a valid improper integral because that is the underlying conceptual difference between classical and modern physics as discussed by Hilbert and Klein above.
Reference H.J.Keisler "Elementary Calculus an Infinitessimal Approach" PDF link: https://www.math.wisc.edu/~keisler/keislercalc-03-07-17.pdf
Note: The pages referred to above are the PDF pages not the page numbers in the Contents.

How was dark matter formed?


Can we perform an experiment which can show wave and particle nature at the same time?

Question: can we perform an experiment which can show wave and particle nature at the same time? I think the answer is no. If that is the case, is that not what heisenberg uncertainty principle saying then.? or heisenberg uncertainty principle has some other meaning. Looks like uncertainty principle is direct consequence of dual nature but a limitation that you cant observe both the nature in a single experiment
Comment: things don't behave like waves or particles, they behave in quantum-mechanical way.
Comment: Things don't really behave as "particles or waves", they propagate as things called "wave packets" and the localisation of these wavepackets is responsible for their wave-iness or particle-ness. The localisation is down to the experiment, as the apparatus will interact with / measure different things.
Comment: Then how do we see an interference pattern which follows a wave equãation.?
Comment: The slit's size acts as a sort of measurement on the [talking about say, an electron] and Heisenberg's uncertainty relation results in the probability distribution for momentum and thus a diffraction pattern.
Comment: @aaaaaa please elucidate "quantum-mechanical way"
Answer: Here is the result of the double-slit experiment, performed with a very low-intensity source of electrons (source: https://en.wikipedia.org/wiki/File:Elektronenbeugung_Doppelspalt_gerendert.png):

This result clearly shows both the wave and particle nature of the electron. The particle nature is apparent because we see from the image that individual electrons have a well-defined position when they interact with the detector (that is because the detector measures the position, collapsing the wavefunction). The wave nature is apparent because there is a diffraction pattern in the density of electrons.
Answer: The whole concept of wave-particle duality is a very outdated one. The reality is that everything is fundamentally wavelike. However, sometimes the waves can take the form of a 'wave packet' in a what's known as a coherent state.  These coherent states behave as if they were a classical particle, but really it's just a complex interaction between a superposition of waves that looks like it's behaving classically.
Answer: Doing a Young's Double Slit experiment and photoelectric effect with the same light beam is an excellent way to experience both particle and wave nature of light. You could also do the same with electron beam to find the wave nature for these as well.
Answer: Heisenberg's uncertainty principle refers to simultaneous measurements of different physical properties (as has been pointed out here, experiments may very well show particle and wave behaviour of the same entity), and is a consequence of quantum logic: non-commuting observables are incompatible physical properties, meaning they cannot exist in conjunction, so they cannot be measured simultaneously.


Choosing cases for assisted supervised learning

Question: I have a bag of words binary text classification task. The SGD algorithm performed well for a certain target where number of labeled cases for training reached tens of thousands. For another target only about a thousand of labeled cases is available.
Colleagues can help me to manually label any additional case to the new target. Thus the "assisted" learning comes to mind. Number of unlabeled cases we have is virtually unlimited. The limitation is that colleagues can only label a few hundreds of cases at most so we have to choose them wisely.
How to chose cases to label with most impact to the precision of the classifier?
I recall reading a text online about choosing the cases with the highest uncertainty of classification or something but can't find it now.
Could you point me to any algorithm or a just some starting point to implement the above approach?
Comment: Please edit your question to describe the context of this problem. For example, what is the goal of this project, what sorts of text are you trying to classify, and what performance have you been able to achieve with the training data you already have?
Answer: Here is an example implementation in sklearn. It's name "Label Propagation digits active learning" did not sound like what I am trying to do so I have missed it at first. Another name for my task found in the literature is "active adaptive learning".


CEF 3 offscreen rendering and page source

Question: today i'm working with Chromium Embedded Framework 3.
I have everything set up, compiled and executed. Everything works fine.
Now I want to read the page source after everything is rendered and JavaScript is executed.
I would also like to get the buffer from the offscreen rendering.
My basic application structure is:
App implements CefApp, CefBrowserProcessHandler and CefRenderProcessHandler
Handler implements CefClient, CefDisplayHandler, CefLifeSpanHandler, CefLoadHandler and CefRenderHandler
Visitor implements CefStringVisitor
In App::OnContextInitialized() i'm executing

CreateBrowser(window_info, handler.get(), "http://www.google.com/",
  browser_settings, NULL);

while

window_info.SetAsWindowless(NULL, true);

Now is App::OnContextCreated() only called if i run CEF3 in single-mode with

main_settings.single_process = true;

otherwise it's never called. In App::OnContextCreated() im doing

browser->GetMainFrame()->GetSource(new Visitor());

to get the page source and it works, but the method is called multiple times and seems not to executing JavaScript at this point.
My question is now what's the best point to read the page source AFTER everything is rendered and JavaScript is executed ?
Also Handler::OnPaint() is never called while Handler::GetViewRect() is.
regards
Norwido
Answer: OnContextCreated runs in the Renderer process, that's probably why it works only in single process mode. You should call GetSource in CefLoadHandler::OnLoadEnd or OnLoadingStateChange that run in the Browser process.
Not implementing all the necessary callbacks in CefRenderHandler may be the cause of the OnPaint callback not being called. Read the doc comments in the header files.
Comment: I used CefLoadHandler::OnLoadEnd before but it's fired at every frame, seems OnLoadingStateChange is the way to go. Big Thanks :)
Comment: @Norwido OnLoadEnd may also work if you add a condition: `if (browser->GetMainFrame()->GetIdentifier() == frame->GetIdentifier())`. Don't forget to +1 / accept the answer if that helped you.


Which daily exercise are helpful to maintain health for long?

Question: Which daily exercise are helpful to maintain health for long? And in what amount we need to do that? How much Yoga is helpful for physical and mental health?
Comment: Welcome to Health SE. I'm afraid that this question is too broad in its current state. You ask three separate question, and they are all pretty broad by themselves. If you can narrow this question down, please flag for reopening.
Answer: For Yoga, modern science says do 54 sets = 108 reps of Surya Namaskar. Of course you need to gradually build your stamina to increase reps.
My great-grandfather did 2 hours of yoga in morning, and lived to nearly 100 years. Also ate nuts, fruits, teas, water. This is according to my dad. Not modern science, just things about family members that get passed down from generation to generation :-)
According to American Health Association

AHA Recommendation
For Overall Cardiovascular Health:
At least 30 minutes of moderate-intensity aerobic activity at least 5
  days per week for a total of 150
OR At least 25 minutes of vigorous aerobic activity at least 3 days
  per week for a total of 75 minutes; or a combination of moderate- and
  vigorous-intensity aerobic activity
AND Moderate- to high-intensity muscle-strengthening activity at least
  2 days per week for additional health benefits.
For Lowering Blood Pressure and Cholesterol An average 40 minutes of
  moderate- to vigorous-intensity aerobic activity 3 or 4 times per week
Comment: Welcome to Health SE. I like the second source that you give, but the first two cannot really be backed up by science, which we [strongly encourage](http://meta.health.stackexchange.com/q/1) on this site. Could you possibly add in sources to back up the yoga information you give?
Comment: @michaelpri Ok give me a few moments


Why did Sherlock change clothes before seeing Irene Adler?

Question: Why did Sherlock change clothes before seeing Irene Adler in the episode "A Scandal in Belgravia" (S02E01)? Same with the punch he asked John to do. Was that his attempt at impressing a girl because he doesn't understand them?
Answer: It was a disguise, a ruse, to get into Irene's house to obtain the phone.
In several iterations of Sherlock, he is known for taking on disguises to get into different locations to gather different information.  For example, in one episode he dresses up as a security guard to get into a museum.
In this instance Sherlock made himself up to be a preacher that had been attacked in order to gain access to Irene's house.  If he had just shown up as himself he more than likely (at least in most normal circumstances) would have been turned away.  Instead, it was a fabricated "emergency" situation, intended to generate sympathy to allow him access.
John punching him was to add some authenticity to the story that he was mugged.
The disguise had nothing to do with Irene's gender, at the time Sherlock only knew about her either what he was told or what was on her website.  For him that's a decent amount, but not enough for him to want to impress her at this point.
Comment: To add to this, both disguises and fake injuries appear in the original short story by Arthur Conan Doyle, *A Scandal in Bohemia*.
Answer: In the original story, A Scandal in Bohemia by Arthur Conan Doyle, Sherlock changed his clothes to keep Irene from recognizing him. In the story, Irene doesn't recognize him until after Sherlock's visit, but in the show, somehow she knows the identity of her visitor. It's all about a manner of hiding in plain sight, which worked well for the literary Sherlock Holmes, but not so well for the BBC's Sherlock.


Mapping AD "member of" user property in sharepoint 2010 user profile properties

Question: I need to map AD's "Member Of" property in sharepoint 2010 user profile properties. I found a guide on how to do that, How to map a user's Active Directory group membership to their SharePoint profile but unfortunately it refers to sharepoint 2007, and to be honest I was hoping that meanwhile there was some faster/easier way to do that.
Answer: If you don't like the idea of running the scheduled powershell, you can resort to a WebPart in the profile (person.aspx) page.
But beware that doing direct queries to AD can bite you back for it was not built to be queried extensively (there is a good reason SharePoint synchronizes and makes a local copy of the domain), but your use case may fit in it.
That said, your web part just needs to run this DirectoryServices query:
public List<string> GetMemberships(string username)
{
   var empty = new List<string>();
   var domain = new PrincipalContext(ContextType.Domain);
   var user = UserPrincipal.FindByIdentity(domain, username);

   if(user == null)
       return empty; //empty result or throw ex

   return user.GetAuthorizationGroups().OfType<GroupPrincipal>().Select(g => g.DistinguisedName).ToList();
}

Answer: I'm not sure about that, I did this in 2007 last week, and it was easy in the corresponding User Profile Synchronization Service in the dialogue for mapping AD properties to SharePoint...
I guess it hasn't changed much in 2010, but if there's a simpler way, I'm happy to know too :)
Comment: In the end I decided it would be *easier and faster* to just retrieve the group members through an LDAP query to the AD. Of course doing it, being the first time I try, is a whole different matter but still better then wasting time trying something of which I have even less info and examples to look to.
Comment: How did you do that? I also want to add new Userprofile property, which sync with the field "Memeber Of" in AD.


Gardening. Potted cucumber plants

Question: My potted cucumber plants appear to have mosaic virus.  How is an insect barrier created?
Answer: Mosaic virus?  Cucumber Mosaic Virus
I had this this year as well:  Planted them as starts, then gave them a balanced fertilizer and have lots of ventilation, blowing fans. They started having normal colored leaves and are doing very well.  This was also a RESISTANT variety! Excelsior!  Great cucumber!
If you've got your cucumbers potted I hope that you used sterilized potting soil.  Yes?  Otherwise, you have to pay attention to rotation practices.  No Curcubits can be planted in the same soil for another 2 years.  Pots with potting soil are super for expanding one's garden real estate.
Rotation is critical for curcubits, solanaceae (tomatoes, peppers, potatoes) and brassicas (broccoli, cauliflower, kale)...Make a map of your garden every year so that you can remember what was planted where!

Gardening. Potted cucumber plants


Arquebus muzzle velocity, and how to balance it with bows and crossbows

Question: What would be the projectile velocity of a 16th, 15th or even 14th (basically a rustic) arquebus, and if that velocity exceeds that of an arrow or bolt by much, how would it be possible to make it slower?
PS - Sorry for poor English, not native language
Edit - As it has been asked, the reason for wanting these arquebuses to be slower, is that, in a world where society are "stagnated" (not really stagnated, they just don't progress technologically as we did, this was made so no electricity, computers, advanced guns, among other stuff, would be invented) in the 12th to 17th centuries, and I wanted to have some great warriors (which are in some way superhuman, for they have peak-most reaction time, though they aren't inhumanly fast, just as much as your everyday elite warrior would) fight on the battlefields, and be able to dodge, or at least block, bullets and shots at close ranges.
I don't know if this helps, but the setting is a high-fantasy, with many races, magic and deities) with a grain of steampunk.
Edit 2 - This is not part of the question, but I've got to say that I must take my hat off to the community of this site. I expected to get no answer at all, considering it's such an obscure topic, however I got many great and helpful answers. I can't thank you people enough.
Comment: Projectile velocity is an *utterly useless number*. What counts is projectile *energy*, because that's what hits the target. A primitive arquebus would throw a projectile with 3 to 6 times more energy than the best crossbow available in pre-modern times (which itself would throw a projectile with about twice the energy of the best bow). And any unemployed loafer can learn how to fire an aquebus (or a crossbow) in about two weeks, whereas an archer needs *years* of strenuous training.
Comment: I'd go with turtling down the Arquebuses for thousands of years, the idea is that some characters (In some way superhuman, for they have peak-most reaction time, though they aren't "faster" than your average well trained warrior, just very reflexive) would be able to, with some difficulty, dodge shots at a close distance, or at least block them with shields. The story would be set in a 16th or even 17th century society stagnated in such times for many reasons, involving both magic and economy, so I wanted to have some warriors which could face guns toe-to-toe on the battlefield
Comment: What do you mean by balancing? Story wise or gameplay wise? Do you need a temporary solution for a couple decades for your story or do you want to turtle down Arquebuses for a thousand years for a setting?
Answer: Looking at the answer a bit differently, the reason firearms replaced bows has to do with the ability to rapidly train people to use them and effectively do battle with highly skilled knights or other fighting men.
Lets look at this in two separate parts:
1.Rapidly training people.
Knights, Samurai, Ottoman Janissaries and so on were incredibly dangerous on the battlefield not because they were fully armoured, carried razor sharp Katanas or recurve bows, but because they had spent a lifetime training to fight. Looking at surviving medieval texts, men at arms were proficient in grappling and wrestling, mounted and dismounted fighting, and the use of a wide range of cutting, hacking, stabbing and crushing/smashing weapons. Samurai spent so much time practicing the arts of "budo" that they were forbidden to farm or deal in commerce. Janissaries were slaves, so their time was equally constrained.
The "Infantry Revolution" of the 1400's was a result of the development of weapons and tactics which were simple to use and simple to perform. Getting 100 townsmen to stand in a square with pikes was much easier, and since the men could do their day to day work between drill sessions (often just once a week), they could be quite productive. Rulers who understood this could rapidly raise large numbers of fighting men when and where they were needed, rather than having a dedicated fighting class which was a drain on the economy, rather than an asset.

Pike formations were relatively simple to learn

Effective on the battlefield

Having simplified tactics would be really pointless if the weapons were not effective against knights, men at arms and other fighting forces. Knights could simply wade in and hack their way through the enemy formation with little fear of harm.
Long pikes deterred cavalry attacks, and kept the knights out of weapons range. Crossbows were much easier to use than long or recurve bows, and fired a quarrel with enough force to kill or injure even a fully armoured knight, or his horse. Combinations of pike squares and crossbows could not only keep knights away, but even be used to press the attack against the enemy.

Pikemen were useful for protecting crossbowmen first ,and then gunners
Firearms took this to the next level. The flash, noise and smoke was an excellent deterrent to mounted troops, and as computercarguy pointed out in his answer, a firearm provided an order of magnitude more energy than any bow. The sort of armour which was "proof" against that was generally too heavy and too expensive to purchase and use.
If we have the situation given in the OP, then suddenly the use of firearms becomes non viable. A firearm with a very low muzzle velocity will not have the range to deter attacks, will be difficult to aim because of the very high trajectory and will not be effective against mounted or dismounted men at arms in full armour. A formation of pike and crossbows will be equally effective, and much cheaper as well. Under those conditions, a wise ruler would not spend any time or money on firearms,
Comment: All right then, guess bullets can't be slowed down without losing tactical effectiveness. Thanks for the answer and the historical info too!
Answer: Speed of the arquebus is discussed (briefly) here (less than 1000 fps):
https://www.thefirearmsforum.com/threads/arquebus-velocity.82830/
This page seems to have a high number (1351 fps):
http://deadliestwarrior.wikia.com/wiki/Arquebus
But this section of a book says it's getting info from actual testing and comparison to crossbows and longbows:
https://books.google.com/books?id=GpVbnsqAzxIC&pg=PA922&lpg=PA922&dq=arquebus+muzzle+velocity&source=bl&ots=EJJ57S0i1D&sig=dTNcmkuWwhVQLD9PIefnSUaxUfM&hl=en&sa=X&ved=0ahUKEwiOkuuB5q3XAhXpxYMKHa7cDGsQ6AEIPjAD#v=onepage&q=arquebus%20muzzle%20velocity&f=false
1300 Joules for the arquebus, 200 Joules for the crossbow and 100 Joules for the longbow.
This last one is done in Joules, rather than fps or mps, so you'll have to figure that one out still.
You'll have to compare ball sizes (from the Dealiest Warrior page) to the weight of an arrow and determine things from there, I think.
The problem with a "slow" ball from a gun is that there's not really any mass to keep it moving, nor is there very good aerodynamics to let it glide.  This means that a ball really does need to be fired fast to work over any real distance.
Good luck figuring all this out!
Comment: Did googling on Arquebus and Muskets this very september and found a source that stated 180-200m/s for a 80g bullet for Arquebus and 300-400m/s for Muskets but with a lighter bullet but sadly can't find it anymore. Anyways 180*180*0.08/2=1296 Joules.
Comment: Oh, that's great, if you do come across the source again please post it here. Sadly for me it seems i'll have to make the Arquebus bullet about 3 times slower.
Comment: Since we're talking about power however, I've come across a guy who's been able to identify ranged weapon's power across the ages. It's in ft-lbs.
http://historum.com/war-military-history/37754-kinetic-energy-ancient-modern-weapons.html
Comment: Might be worth noting that most handguns not in the "Magnum" category have muzzle velocity well below 1000 ft/s, including the .38 Special (carried for decades by tens of thousands of police officers and security guards), the .45 ACP (US military choice for two world wars) and the .45 Colt (cartridge of "the gun that won the West").
Answer: Ignore muzzle velocity.
A projectile object is one that is given an initial velocity, and then left to fly on its own. For all the reasons others have talked about, arquebus muzzle velocities must be high to be worth having.
You want a rocket, not an arquebus. These existed in China long before the arquebus existed.
The difference is, the rocket has the gunpowder in the ammunition, not in the gun. The explosion is controlled so that it continues throughout the flight of the object, overcoming the effects of drag, and even accelerating.
These can have significantly lower muzzle and average velocities than an arquebus, whilst maintaining good range and firepower.
Answer: Problem is Arquebus outmatches regular bows and crossbows by a lot in terms of muzzle velocity and therefore kinetic energy of the projectile. The formula for KE is (m*v^2)/2 which means that velocity counts more than mass by a lot. Arquebus muzzle velocities are in range between 180-300 meters per second depending on the design of the Arquebus, the powder load and its composition, bullet caliber and mass.
But even if we assume the lowest values of a 20g bullet and 180m/s velocity it still gives us (0.02*180^2)/2 = 324 Joules which is more than any bow or crossbow and while it's still not several magnitudes more powerful than them it's not long before someone in your setting tries to improve such Arquebus: elongating the barrel, increasing the payload, making a bullet heavier - are all evolutionary changes that are bound to happen.
There's however a thing to consider: Arquebus is a long barreled type of gun, arguably the first in its' category. This is what gives it its' high muzzle velocities. However it's not the first firearm to be ever used: Arquebus were predated by Hand Canons - awkward looking, short barreled mini-cannons on sticks that didn't even have a stock.
If you want to incorporate early firearms but still make them "balanced"
compared to conventional ranged weapons consider stopping the evolution of firearms before they go "long-barrel" and invent issues that would prophibit their later development into Arquebuses and Muskets.

You can also try limiting firearms in general through economic reasons - make one of the ingridients for the powder to be extremely rare making mass deployment of such weapons impossible. The fireamrs will be able to run their course of evolution from primitive hand-cannons to exquisite muskets, but their tactics will not repeat our history: such weapons will be reserved for the rich and powerful serving as antics for sport and hunting or weapons of personal defense - even a fat and clumsy old man can kill someone with a pistol.

When there's 20 thousand people on either side a 300 man elite regiment of royal musketeers is still a fearsome force to be reckoned with but whether they are the deciding factor of the battle's outcome is up to debate.
Comment: Thanks for the answer, but do you think that changing the existing black powder's (I believe that's the predecessor of gunpowder) properties could help in slowing down the shot?
Comment: Sorry, but I'm not a chemistry major to answer that. Maybe if you made a quantity of powder required to propel the projectile to the desired speeds much higher it would lead to a situation where achivieng certain KE's is impossible with the given gunpowder. What you'd need are: lower than historcally effecieny of the powder and slower burn speed. That way big cannons are still viable but smaller firearms become either unwieldy or not as powerfull.
Comment: Well, that's actually helps a lot. You don't need a chemistry major to be smart. Thanks for the help! I'll still have to find a way to lower the powder's effectiveness though.
Answer: Wrong approach. If you have an arquebus whose bullets can be dodged, the best tactic is not to dodge them at all. A bullet (or a ball from an arquebus) is much lighter than an arrow or a bolt, and it doesn't have a pointy end, so at the same speed they carry an order of magnitude less energy, and two orders of magnitude less penetration power.
A bullet shot at you at dodgeable speed carries a fraction of the strength of a (much heavier) stone throw at you by hand. You can just let it hit you without problems.
Now, if you want your superhumans to be able to dodge firearms, what you really need is half a second from the trigger pulling to the actual explosion which propels the bullet. Primitive firearms had a matchlock trigger which ignited the priming charge, which ignited the main charge. There was a tiny fraction of a second between the soldier pulling the trigger and the actual shot. You can make it a little longer in your story, and your superhumans could move out of the way.
Comment: That's a great suggestion, but there's a small problem that when the trigger is pulled, the warrior in question likely won't hear it, especially in a large distance, and also these fellows aren't actual superhuman, their capabilities are just at the peak of human potential. Also, is it feasible that maybe shields and armor could block the shots? During the first centuries of firearms they could indeed be blocked by armor, and maybe with padding and shields a man could withstand shots at point blank?
Comment: Arquebuses and early muskets were so imprecise that one of the most succesful generals of the time, Fernando Álvarez de Toledo, the duke of Alba, said that its optimal fire range was pressing the mouth of the cannon against the chest of the enemy. And he was only half-joking. If your heroes are so far away they can't see the enemy pulling the trigger, they're totally safe. In fact, if they are away enough not to smell the shooter's breath, they are perfectly safe.
Comment: That's actually... A great answer. I guess they'd be more worried about bows on long distances.


Can electrical energy be changed into potential energy?

Question: If I boil some water on an electric stove, will the heat energy imparted change into potential energy (state changes: water to steam).
Comment: When you boil water, the electrical energy converts to thermal energy, which is used to change the phase of water. You could use the expansion of steam from this thermal energy to raise a weight, thus also storing potential energy.
Answer: If I boil some water on an electric stove, will the heat energy imparted change into potential energy (state changes: water to steam).
YES. It does as a result of a sequence of changes to the kinetic and/or potential energy of the heating element, pot, and the water. The following is an admittedly simplified explanation, but it should make the point.
You turn on the stove. The following conversions occur:

Electrical energy elevates the internal energy of the heating element raising its temperature (primarily kinetic energy) and the temperature of the metal sheathing in contact with the bottom of the pot.
The bottom of the metal pot is initially at room temperature (same temperature as the water in it).  Since there is a temperature difference between the sheath and the bottom of the pot, heat transfers from the sheathed heating element to the bottom of the pot.
The heat transfer to the bottom of the pot raises its internal energy (increases its internal kinetic energy) and thus its temperature. It now transfers heat to the water.
The internal energy of the water initially consists of a combination of kinetic energy (the random translational motion of the water molecules) as reflected by its initial temperature and internal potential energy due to the intermolecular forces between them.
As the water temperature increases, the motion of the molecules (kinetic energy) increases. Initially there is little change in the distance between water molecules. But eventually the water reaches its boiling point and starts to convert to steam (causes a phase change)
The conversion of water to steam is a phase change at constant temperature and increases the separation between water molecules. So now the heat being delivered causes an increase in the potential energy of the water molecules.

So the answer to your question is yes. By way of the sequence of energy conversions  the original electrical energy has been, in part, converted into the potential energy of the water.
Hope this helps
Comment: I did not expect such an elaborated answer. Thank you, Bob.
Comment: @user9836598 Hope it wasn't too elaborate, but happy it was acceptable to you.


'booklover' in latin

Question: How would you say booklover or bookworm in latin. It is for a tattoo. The person who wants it is a real booklover and wants the world to know. He is not a collector of books but a reader. I find different translations but it must be correct Latin and we're not able to judge that. Thank you, Enya
Comment: Thank you all. I think Libricola at the moment is my favorite. I also found litteratus. But to call yourself learned, erudite.. I don't know. Any thoughts on that? Much appreciated!
Enya
Comment: @Enya I'm glad to hear the answers have been of use! The best way to reward those you help you on this site is to vote their answers up and to accept one of the answers. You'll be able to do those if you register your account. (I agree on *litteratus*: it is more "better than others because of books" than "lover of books". Also, that one needs to switched to *litterata* if you want a feminine form.)
Answer: A booklover is librorum amans or librorum studiosus. If you want, you can also use the superlatives: librorum amantissimus or librorum studiosissimus.
Another term (that has gained some currency in learned English) is helluo librorum, which is a rather drastic expression, meaning something like "book glutton"! (This is sometimes attributed to Cicero (e.g. by Erasmus), although it seems Cicero only wrote (De Finibus 3, 7): quasi helluari libris, si hoc verbo in tam clara re utendum est = "being a glutton, so to speak, for books, if it is appropriate to use this word for such an honourable thing.")
Comment: I wonder if one could add Maximus to the above? What would the greatest book lover of all be called?
Comment: I follow @Sebastian on *librorum studiosus*. Cicero, Verr., 4, 13: *qui studiosi sunt harum rerum* "those who are fond of those objects".
Comment: @user1095108 in the case of *helluo librorum*, you absolutely can add *maximus*, as Erasmus did when he wrote: *Lucernula conueniet Chrysoglotto, anagnostae insatiabili, et, ut M. Tullius inquit, librorum helluoni maximo* = "The little lamp will be welcomed by Chrysoglottus, the insatiable reader and, as M. Tullius [Cicero] puts it, greatest glutton for books." But in the case of *amans* and *studiosus*, the superlatives I mentioned would be used instead.
Answer: Libris deditus for a man, libris dedita for a woman, literally "devoted to books", but metaphorically a true book aficionado.
Found in Cicero, De Oratore 3.82.10.
Answer: I suggest using a compound with -cola, indicating where someone lives or what someone worships or works on.
Examples include agricola, caelicola, monticola, Iunonicola, Christicola, silvicola, ruricola, nocticola, viticola.
The Perseus Digital Library makes it easy to compile a list of Latin words ending in -cola.
Given this range of examples, I think libricola would make a sound translation for "a cultivator of books" or a "bookdweller".
This word is not attested in classical Latin, but the suffix -cola seems to have been quite productive and searching online suggests that the word has been in (infrequent) use since the medieval times for a bibliophile.
Comment: Your answer is nice, I voted up. Just, if we are to nitpick, *to cultivate books* is not exactly *to love books*. But it has the advantage of suggesting a synthetic compound, contrary to *librorum studiosus* and similar glosses.
Answer: If he's open to borrowing from Greek, as Roman lovers of books did frequently, you could take the attested Greek term φιλόβιβλος (philobiblos) -- ``a lover of books'' -- and Latinize it to philobiblus. Or he could get a tattoo of the Greek word itself.
This term also has the advantage of alluding to Richard de Bury's Philobiblon, a medieval work on learning from books and building a library.
The order should not be reversed because it would change the meaning. βιβλόφιλος is not attested, but it would mean something like "a friend of books" or "loved by books." Compare φιλόλογος "lover of words" and λογόφιλος "friend of words," or φιλόθεος "pious, lover of the divine" and θεόφιλος "loved by the gods, a friend of the gods." The attested compounds seem to indicate that "lover of X" should be φιλο-X rather than X-φιλος.
Comment: In Greek, reversing the order would change the meaning. βιβλόφιλος is not attested, but it would mean something like "a friend of books" or "loved by books." Compare φιλόλογος "lover of words" and λογόφιλος "friend of words," or φιλόθεος "pious, lover of the divine" and θεόφιλος "loved by the gods, a friend of the gods." The attested compounds seem to indicate that "lover of X" should be φιλο-X rather than X-φιλος.
Comment: Does this exist also in the reversed order? Some modern languages seem to have words like the English 'bibliophile'.
Comment: Thanks! That clarifies it a lot. Can you edit that into the answer itself, too?
Comment: Okay, I've done that.

'booklover' in latin


How to know spid which is filling tempdb from temp table name in sybase

Question: I received alert that tempdb is going to be full and temp table name aslo provided.
Now I want to know how to check which spid is filling tempdb from temp tablename.
Comment: Sybase uses a different system table structure than SQLServer, so I don't think it's a duplicate.
Answer: The best is to use the montables. Make sure you have mon tables activated. Once verified you can issue the following select statement:
select SPID, DBName, ObjectName, PartitionSize
from master..monProcessObject
where DBID = tempdb_id(SPID)
order by SPID

for more information please see the official Sybase docs: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00967.1550/html/MigrationGuide/MigrationGuide14.htm
Answer: Note that the above query against monProcessObject doesn't detect 'implicit' tempdb usage.  Ie., usage from an 'order by', 'group by' or other internal/hidden tempdb based worktables used by the query optimizer operations.
To monitor tempdb usage for a for implicit and explicit usage, try:
select spid,tempdb_pages=pssinfo(spid,"tempdb_pages")
from master..sysprocesses

This pssinfo function is available at least in version 15.5 and higher.  Not sure about 12.5.4


Timestamp each line in GNU Screen

Question: When using GNU Screen as a serial port terminal, is there a way to show a timestamp on each line as it is sent/received?
Comment: screen can add a timestamp to a logfile when the tty is idle, and again when active. are you not running any application that does i/o to the port? what is writing to the port, for example?
Comment: Yes, there is I/O to the port. A custom program is writing to the serial port, but in this case I was unable to modify the code received on the serial port to include a timestamp, so I'm wanting to add the timestamp using GNU Screen.
Answer: I added the following lines to the configuration file:
<code>logtstamp after 5
logtstamp on
</code>
Then I started Screen using:
<code>$ screen -L -c muxscreenrc /dev/tty.usbserial-A5027V8X 115200
</code>
The timestamp doesn't appear in the Screen session, but the saved log file did include timestamps.
This isn't exactly what I want, but it's close enough for my use case.
Answer: Install or download the "multitail" program. Set GNU screen to log to a disk file.
Tail the screen log file with multitail, as it reads the screen log file it adds timestamps to individual lines in its own window.

Timestamp each line in GNU Screen


Should I explain a single bad grade in my personal statement?

Question: Overall, I have always maintained a good standing in all of my undergrad classes. Most of my grades are either As or Bs. With only one Junior level course with a D. Is it worthwhile to explain this one bad grade? I am afraid that since all my other grades are good, I will only be highlighting that one bad grade by talking about it.
Comment: If the course is particularly relevant to the program you're applying to, then it might make sense to explain it. If not, then not.
Comment: If you decide to explain the grade, make the explanation as brief as you can.  Don't tell a long story that will divert attention from the rest of your statement.
Answer: There are really two parallel circumstances to consider here:

The grade is highly relevant to the program in question. In that case, you might need to address it, as someone will be focusing on that coursework in particular - partially because they will be relying on you knowing the content of that coursework, and with that grade it's hard to argue you do. Though in this case, it's also probably a good idea to strongly consider retaking the course. In this case, you might touch on the reasons, but that should be 1) Short and 2) Be a legitimate reason why this might not accurately reflect your abilities. "I didn't like the professor" is not that reason.
It's just a random class. 'Women in Medieval Art and Literature' and you're applying to a Microbiology program. 'Calculus 1' and you're applying to a Comparative Literature program. 'German 4' and you're applying for a Computer Science program. In this case, I wouldn't draw attention to it.
Comment: Probably a fair point - I've changed it to be even more far afield.
Comment: Excellent response. But a minor quibble [PREVIOUS REVISION]: Poli sci isn't my field, but I would imagine some of the more political economy-oriented ones would expect you to either take grad level microeconomics, or at least be able to more-or-less follow econ papers. Either could involve calculus.


How to find volunteering works in Testing?

Question: How to find volunteering works in Testing?
I am looking for volunteering works in either Manual or Automation Testing. I am a Salesforce Certified Administrator, ISTQB certified Tester. Could anyone please provide any information on the volunteering?
Comment: Why do you want to volunteer ? this will help us direct you
Answer: GitHub is perhaps your biggest playground. Pick a project you are interested in and try to find some bugs in it, apart from testing, you can learn how to build or deploy a piece of software. People involved in these opensource projects will usually be more than happy that someone is actually using their product and cares enough to find some time to report bugs and possible new features to their Issue page.
Apart from GitHub, there're several sites for Testers where you can sing up and wait for testing tasks. I've tried a few, but it never worked for me, so I don't even remember the names of these sites now. But this very idea does exist and you can give it a try.
My personal experience is that apart from the above-mentioned GitHub projects, no testing volunteering worked for me, which actually proves nothing much :D But I still think, it's much easier to get a job as a Tester than find volunteering as a Tester.
Comment: Those are called crowd testing or Crowdsourced testing.
I wouldn't refer to "GitHub projects" as such, open source projects is a more appropriate name since they can be hosted anywhere. Many OS projects have or requires serious testing, for example [sqlite](https://www.sqlite.org/testing.html) is not hosted on git and have "the SQLite library consists of approximately 143.4 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or, in other words, lines of code excluding blank lines and comments.) By comparison, the project has 640 times as much test code and test scripts "
Answer: The easiest way is to look at which software do you use.
Most of them have some instructions on how you can help with testing.
E.g., LibreOffice has a great community of testers. If you like games, 0 A.D. has a good community too.
Also, if you are looking to work with a particular technology, search for "[Techology] open source project" will open many options.
For instance, if you want to work with Ember, doing such search may show you that Discord and


Embed PDF on a webpage and prevent download

Question: Is there a way to embed a PDF document on a webpage and at the same time disabling download? If possible I would prefer an html5/css3 solution. If no other way is possible I'd go with something else.
Answer: just add #toolbar=0 to the url of the pdf
Comment: Very usefull and simple answer, i just tried it and worked! Thank you.
Comment: You still see the URL to the pdf in the sourcecode.
Comment: But... what if I want to allow printing? Is there an option that doesn't hide the whole toolbar?
Answer: Yes. Yes there is:

    <object width="100%" height="650" type="application/pdf" data="[ImageURLHere]#zoom=85&scrollbar=0&toolbar=0&navpanes=0" id="pdf_content" style="pointer-events: none;">

Insert your error message here, if the PDF cannot be displayed.

    </object>

The pointer-events: none styling will also prevent users from right-clicking the PDF and downloading.
Comment: This is not going to work. Also, adding the pointer-events: none; to the style will also disable scrolling for the pdf.
Comment: I tried it on my Angular 4 app and it just shows the base index.html page. I tried digging into the console tabs and couldn't find the asset anywhere.
Comment: What if a user uses "view page source"? Than he can still get the URL right?
Comment: In 2023, using Chrome, scrolling works and the printing and downloading buttons were removed.
Answer: Actually, it is possible, you can adjust in your Google Drive option "Prevent viewers from downloading"
Then set PDF file public, so everyone can view PDF in Viewer, but none can download it.
I hope, that this will help for some.
Answer: Short answer is, it can't be done.  The only way to view a PDF document without any kind of conversion is via the adobe PDF plugin, and that invariably allows the document to be saved.  On top of that, it's trivial to use various tools to get the url of the PDF and download it from there.
If you want to avoid sending the actual PDF document, you could create a server-side script that converts the PDF document to a series of PNG or JPG images behind the scenes.  You can do this with ghostscript for example.
But then, the actual content of the document still reaches the user, only in a different format.  If this is not satisfactory for you, there are various techniques you can use to prevent most users from saving the images, but these are easily circumvented by a sufficiently technically savvy user.
Comment: Can i at least remove control bar of a PDF plugin??? Soo at least ordinary users wont know how to download it. Oh and i would probbably had to prevent the right click also.
Comment: You can use any of available PDF rasterizer's available,
Answer: You can use SlideShare, you can set a read password, prevent users from downloading in the settings, and even create a secret link so only users with it can open it. I am sure there are ways to circumvent this, but at least it's not immediate.
Answer: You can download the PDF.js and modify these 2 files: viewer.html and viewer.js, remove/modify the corresponding buttons/actions in order to disable downloading/printing, and you can furtherly disable right click menu items.
Answer: 2017 Note: this feature has moved locations and the implementation has changed since it was originally answered.

Google Viewer offers a solution.
Use the iframe it generates for you.
Comment: @Luke Google removed the page in 2015. The viewer app is still available using `https://docs.google.com/viewer?embedded=true&url=`, but now there's a popup button to launch the full-feature viewer, including download and print, so not really a solution anymore.
Comment: It really isnt possible to save the document using iframe, but in the top right corner of the frame there is a full-screen mode button and in full-screen mode it is possible to print to PDF.
Comment: The link provided in this answer doesn't work. Will remove down-vote if this is fixed.
Comment: Above Method does NOT disable download functionality.
Comment: You can alter the code of that generated iframe using PHP (change the reference urls of js files from relative paths to absolute) and disable the print button.


How to configure multiple subnets

Question: I have a scenario in which one computer needs to be a member of two subnets on the same physical network - 192.168.2.0/24 and 192.168.3.0/24. I have achieved this using ifconfig eth0:1 192.168.3.123/24 up etc. The problem arises when I am trying to start a telnet session with another host, which is also a member of those two subnets. That host is accessible via telnet on both IP addresses, but when I try to connect to it, telnet hangs. This problem disappears when I remove either one of the two interfaces. I think it is also worth mentioning that there is no problem in Windows, with the same multiple IP setup. Since the host I am trying to connect to cannot be configured or modified, is it possible to solve this problem, say, by restricting 192.168.3.0 traffic only to eth0:1, or, perhaps having a different MAC address on that pseudo interface?
Comment: Does telnet hang no matter which IP address you try to connect on?
Comment: What distribution and version are you using?
Answer: It sounds to me like a problem with the source IP address.  I imagine there are multiple ways to fix this.  Possibly the easiest would be to disable reverse path filtering.
An alternative option may be to rewrite packets to ensure the leaving address always matches the subnet with a couple of snat rules - possibly something like
iptables -t nat -A POSTROUTING -s 192.168.2.x -o 192.168.3.123 --sport 25
-j SNAT --to 192.168.3.x

Answer: If your aliased address is used only for telnetting into this server, then there is a very simple solution: tell telnet to bind to the specific address you want to use, as in:
  telnet -b 192.168.3.123   192.168.3.201
  telnet -b 192.168.2.123   192.168.2.201

having assumed that your pc has addresses 192.168.3.123/192.168.2.123 and the remote server has IP addresses 192.168.3.201/192.168.2.201. Notice that it is necessary for the source and destination addresses to belong to the same subnet, since you did not specify the existence of a network gateway.
If instead your use of the aliased address is more general (for instance, if you receive telnet calls, in which case you cannot specify the -b option as above), then you will need to learn about policy routing. But I guess we will cross that bridge when we get there.

How to configure multiple subnets


MInecraft Java infinity enchant not working

Question: Whenever I put an infinity enchant on my bow it still takes up my arrows. My friend is also experiencing this issue. Is there any way to fix this? Thanks!
Comment: Normal or some kind of special - spectral, tipped etc? Infinity still uses up these.
Answer: I know this might come across as obvious, but try to make sure you have arrows in your inventory. It could also help to upgrade or downgrade your version of Minecraft if possible. This may stop you from playing on servers, but I believe it would fix the problem on singleplayer. if you can't change the version maybe try this article on it.
Comment: I have definitely had the situation where I had spectral arrows, and a stack of regular arrows, and my infinity bow started using the spectral arrows first. Another somewhat obvious thing is, if you have multiple enchanted bows in your inventory, ensure that your infinity bow is the one that you are actually using. Also if you have a crossbow, and are shooting that, it will use up your arrows as well...that's all I can think of


how can I attach screws perpendicularly to an aluminum sheet

Question: I do not own a drill press nor a welding machine; I do own a simple drill however it is not poweful enough to penetrate through the aluminum. are there any special glue types for aluminum that can help me with that?
Comment: How thick is the aluminum you're trying to get thru? And please reword your question as it's not very clear as to what you're trying to do.
Comment: What do you mean by "attach perpendicularly"?  It also isn't clear why you can't drill aluminum; it's very soft.  But if you can't drill a hole, what's the purpose of the screw?  Which end of the screw do you need to attach to the aluminum?  What kinds of forces and in what direction does the attachment need to withstand?  How big are the screw and aluminum?  Can the whole process be done in a shop or does this need to be done somewhere on-site?  Are there any constraints, like limits on heat?
Answer: When you say "simple drill" is this an electric drill or hand-powered? If it's electric you should be able to drill into it with a decent drill bit. You can *generally use woodworking tools (saws, drills, files, etc) on aluminum, unless you have some sort of exotic hardened aluminum.
You can use epoxy to join aluminum. Make sure both surfaces are clean and dry. A little scuffing with sandpaper would help it get a better grip.
This is dependent on the use for the item, also. If it is not highly stressed,  you should be fine.
*generally, as in not EVERY single wood working tool.


Expectation of multiple variables

Question: I'm not really sure what's going on in the bit underneath; Question: What does this mean? Should you buy lightbulbs?
Comment: Is this your answer, and a grader's response?
Comment: No, it's all lecture notes. The lecturer has filled in the answer to the question but I do not understand what he has written in blue as the answer to the "Question."
Comment: That's why when I was a boy you could test light bulbs before buying them.
Answer: Should I buy light bulbs?   No. I'd rather buy ice cream.
So I'd say the question makes no sense. What should have been asked is: should I buy bulbs of type A or of type B. Both are 100 watts and the same lumens (brightness) but they differ in unit cost and in lifetime distribution. We will assume exponential lifetimes, but a different mean value. So we want to come up with a good decision rule to choose type (brand) of bulb. (There are an infinite number of decision rules.) The fact that $1$/Lifetime has infinite expectation is interesting but is not the main issue.
Let's look at the problem informally and later show the mathematics.
Suppose I observe a sample of 3 bulb lifetimes $u,w,z$ hours for the same bulb type at a cost $c$ each. We need to come up with a way to compare different types of bulbs. There are two obvious ways to measure cost per hour.
We could compute $3c/(u+w+z)$ which is the cost of 3 bulbs divided by their total lifetime. Makes sense. This is $c/\bar{x}$ where $\bar{x}$ is the average. Another possible method: we compute the cost per hour for each bulb and then take the average:
$$\frac13\left [ \frac{c}{u}+\frac{c}{w}+\frac{c}{z}  \right]$$
The Harmonic Mean is defined as
$\left[\frac13 (1/u+1/w+1/z )\right]^{-1}$
  so
$$\frac13\left[ \frac{c}{u}+\frac{c}{w}+\frac{c}{z } \right]=c/{HM}$$
Should we use $c/\bar{x}$ or $c/HM$ ? They both have the correct units of cost per hour so we cannot use that to decide between them. For exponential lifetimes $c/\bar{x}$ has a finite expectation if we have at least 2 lifetimes. (That fact surprised me.) However, $c/HM$ has an infinite expectation. That's not good. It is well-known that $HM\le \bar{x}$ with equality if $u=w=z$ . Suppose $u,w,z = 4,10,1000.$ Then $\bar{x}=338$ and $HM=1000/117=8.6$ This is quite a difference. The reason is that $\bar{x}$ treats each lifetime equally in the average while $HM$ treats each cost ratio equally:  $$c/HM=\frac13\frac{c}4+\frac13\frac{c}{10}+\frac13\frac{c}{1000}.$$  The time interval of length 1000 was by far the most important interval of the 3 in determining the overall cost performance (since it was the longest) but it contributed only $c/{1000}$ to the total. In fact, in this method the shortest lifetime of 4 was the greatest determinant of overall cost per hour. It's exactly the reverse of what makes sense. Let's try to "correct" this approach by using a weighted $HM$. Let's weight the cost ratios in proportion to their importance – proportional to the length of the lifetime. So we replace (1/3,1/3,1/3)  with $p_1=4/1014, p_2=10/1014,p_3=1000/1014$. Then our new ratio is
$$ \frac{c}4p_1+\frac{c}{10}p_2+\frac{c}{1000}p_3 .$$ This simplifies to $c/\bar{x}$.  So it looks like minimizing $c/\bar{x}$ is the only sensible decision rule we can come up with. Now we will see how this can be justified.
But first we need to clarify another issue: There is a tacit assumption that you will replace the bulb after it burns out and keep replacing bulbs with the same type. Otherwise, I choose the cheaper bulb even if it lasts only a second before burning out. I will save money if it is only a one-shot decision. (I am assuming you get no value from the light from the remaining bulb. If you do, then tell me what the value is.) To avoid this crazy conclusion, we must think long-term:
We install a new bulb at time $0$.  We immediately replace with a new bulb and repeat indefinitely. The cost of the bulb is paid when it is installed.
Assumptions: Bulbs cost $c$ each and they last $Y$ which is exponential with mean $\beta$. Lifetimes are independent. Since the lifetimes of the bulbs are exponential, the occurrence of bulb burnouts forms a Poisson process. Let $N(t)$ be the number of bulbs installed in the time interval $[0,t]$. Notice we have made a subtle change from the intuitive approach. We now select a given $t$ and look at the (random) number of bulbs used. Previously we looked at the first 3 lifetimes (which ended at a random time.)
Now $cN(t)/t$ is the cost per hour over $[0,t]$. From the expectation of the Poisson distribution, we get
$$E[N(t)]=1+t/\beta$$
where the extra 1 is for the initial bulb at $0.$ Then we have
$$E[cN(t)/t]=c(1/t+1/\beta)$$
where $t$ is our decision horizon. In the long-run, as $t\to \infty$ , we will try to minimize
$$c/\beta $$
That is, the cost of one bulb per its hours of expected life.
This is consistent with our hunch of using $c/\bar{x}$ for a finite decision horizon.
If the lifetime distribution is not exponential the conclusion is still valid but then we need Renewal Theory.
Answer: $E(1/T)$ is the calculation shown.  We can't find the explicit antiderivative, but we can show that the asymptote at $0$ causes the integral to be infinite.  Since $1/T$ is the cost of a bulb per hour of use, this seems to mean that a lightbulb has an infinite expected cost per hour of use, which would make buying them not a good idea.
But if I buy three bulbs, their average lifetime is $(T_1+T_2+T_3)/3$, so that the (average cost) per hour of use is $3/(T_1+T_2+T_3)$.  This has finite expectation: again, we can't find the antiderivative, but this is because $1/\|x\|$ is integrable in $\mathbb{R}^3$.
On the other hand, the average (cost per hour of use) is $(1/T_1+1/T_2+1/T_3)/3$, which has infinite expectation: it's simply an average of three infinite values.
I'm not sure what "Scale matters!!" means.  I think the lecturer is trying to say why it actually does make sense to buy lightbulbs: if you buy a bunch of them (large scale purchase), then you get a finite expectation, but not if you buy just 1 (or 2).  My answer for why it makes sense to buy lightbulbs would be that if a company's quality control can guarantee that a lightbulb lasts at least $\epsilon$ time, then $f_T(t)=0$ on $[0,\epsilon]$, we don't have the asymptote, and the expectation is finite (and we only need a slight adjustment to the rest of $f_T(t)$).
Answer: If I buy $n$ bulbs, then the cost per hour will be
  \[
  Y_n = \frac n{T_1 + \cdots + T_n}.
  \]
As I buy more bulbs, the cost per hour gets closer to
  \[
  \lim_{n\to\infty} Y_n = \lim_{n\to\infty}\frac n{T_1 + \cdots + T_n}
    = \frac1{\displaystyle{
    \lim_{n\to\infty}\left(\frac{T_1 + \cdots + T_n}{n}\right)}.
    }
  \]
According to the law of large numbers, this limit is $\displaystyle{\frac1{E[T]}}$. So we see, then, that $E[Y]$ is not what matters to us. It is $E[T]$ that we care about. The bigger it is, the smaller our cost per hour will be in the long run.

Expectation of multiple variables


Does keyboard-interactive authentication support two sequential passwords?

Question: Keyboard-interactive authentication(RFC 4256), which is implemented as ChallengeResponseAuthentication in OpenSSH configuration file, allows one to chain multiple authentication methods. For example password and TOTP. Is it also possible to chain multiple passwords, i.e. when user connects to a server, then he is asked for password1 and then for password2? Or does this depend solely on PAM modules and PAM configuration? The reason I ask is that such setup would break most if not all automatic SSH brute-force tools while still does not require user to have anything.
Answer: Answer is yes. You are pointing to the correct target, but you miss few pieces:
Using ChallengeResponseAuthentication, you can define more authentication methods, but to make sure they are requested from user, you need to specify the list of them in AuthenticationMethods, for example like this in sshd_config (doing pam two times is just example to try how does it work):
ChallengeResponseAuthentication yes
AuthenticationMethods keyboard-interactive:pam,keyboard-interactive:pam

But to note, you can do the same only in PAM by adding additional method into /etc/pam.d/sshd.
As a footnote, yes. It would probably make most of the normal ssh scans fail. But brute-force attacks, if they are targeted, can guess one or two passwords. It doesn't matter. But all of them will still waste your computer time. And you still need strong passwords, if you don't want to disable them (which should be preferred).
Answer: Theoretically it is possible, but using something like a Radius server for one of the two authentications. Otherwise it should draw a second database for password2.
But if the intention is to avoid the automated brute force tools I believe that the best approach is that of security through obscurity, or quite simply, to change the standard port for ssh from 22 to, for example, 2233. To me this solution worked and the "attacks" brute force are completely gone ...
Comment: Readers should note that "security through obscurity" usually means "ignoring [Kerckhoffs's principle](https://en.wikipedia.org/wiki/Kerckhoffs%27s_principle)" and is almost always a bad idea. An idea like this one might better be described as "avoiding the low-level attackers". It's useful, but beware a false sense of security: it won't fool a skilled attacker for long.


Highlight programmed cells in WPF listview on clicking

Question: I am trying to re-implement a form in WPF which was fairly easy to program in winforms and cannot see how to progress. The form consists of three panes. The right hand pane contains the detailed data - columns of flags which either contain the value Y or are blank, while the two left hand panes contain matrices which summarise the matches and discrepancies between the columns.
The number of columns (n) in the right hand pane is variable, and the two left-hand panes are n X n -so their size is dynamic too. When the user clicks a cell in one of the left hand panes, it is highlighted and used to highlight the appropriate columns in the right hand pane.
For example, consider the case of cell 1,2 of the Matches. Let us assume that it contains the value 2,and that the 1,2 cell of the Discrepancies contains 3. When the cell 1,2 is clicked, it is highlighted green,the corresponding cell on the differences panel is highlighted red, and the columns 1 and 2 are marked up with the matches, resulting in 2 corresponding entries highlighted green and 3 single entries highlighted red:
<code>                                 Column1 Column 2
                        green         Y      Y
                        red           Y
                        green         Y      Y
                        red                  Y
                        red                  Y
</code>
I decided to use a listview to implement this in WPF. Since the arrays have variable sizes, I decided to set up the grid view programmatically. Here is part of the code (in VB.net):
<code>Private Sub DefineColumns(ByRef _GridView As GridView, MaxIndex As Integer)
    With _GridView
        For i = 0 To MaxIndex
            Dim _ColumnTitle = "P" & (i + 1)

            Dim _TextBlock = New FrameworkElementFactory(GetType(TextBlock))
            Dim _Binding = New Binding(_ColumnTitle)
            _TextBlock.SetBinding(TextBlock.TextProperty, _Binding)
            _TextBlock.SetValue(HorizontalAlignmentProperty, Windows.HorizontalAlignment.Right)
            Dim _DataTemplate = New DataTemplate()
            _DataTemplate.VisualTree = _TextBlock

            Dim _Column = New GridViewColumn()
            With _Column
                .CellTemplate = _DataTemplate
                .Header = (i + 1)
                .Width = 39
            End With
            .Columns.Add(_Column)
        Next
    End With
End Sub
</code>
The WPF form works - but how can I achieve the highlighting I need? I really need to program it somehow and it does not seem to me that triggers are any use as I really want to mark things permanently so that I can scroll the right hand pane. All I need to do is mark the two selected cells in the left hand panes, and then loop down the selected columns on the right hand pane, marking matches in green and discrepancies in red. Can anyone help? It seems so simple in principle, but with WPF simple things can sometimes be very complicated to implement.
Answer: I did not get any answers here so I decided to cut down the scope of my question and ask on MSDN. I then managed to program round the problem. My answer can be found here:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d68c606-d71e-4f89-a016-1e344d784467/#978f068f-a956-411b-b3d1-df8ac4a92cd8


How to calculate a new raster based on nodata values from original raster, in QGIS?

Question: I'm using the raster calculator from core in QGIS and I need to generate a new tif raster file (mask) from the nodata values of another tif raster file. I tried isnull(), but no luck. Any one can help?
Comment: Seems like raster calc just passes NA to the new raster the moment it encounters NA - though [this post](http://indicatrix.wordpress.com/2012/03/31/conditionals-in-the-qgis-raster-calculator/) seems to indicate that someone did do calcs on NA values. I can't get it to work though, trying `rast@1 = -9999` where -9999 is my NoData value. gdal_translate is supposed to allow removing nodata values (`-a_nodata none`) but I can't get that to work either.
Answer:
"... I need to generate a new tif raster file (mask) from the nodata values of another tif raster file."

You can use gdalwarp, via the command line, to convert a nodata value to an alpha mask:
gdalwarp -dstalpha -srcnodata "0 0 0" -co "ALPHA=YES" "raster_w-nodata.tif" "raster_w-alpha.tif"

You will want to read up on the creation options for GeoTIFF, or whatever gdal-supported output raster format you need.
I do not see a simple way to do this in QGIS, yet. Most of the GDAL (Raster menu) tools work with the utilities and extra Python script bundled with GDAL. Since the underlying utilities of GDAL have a myriad of choices to suit many different scenarios, you may run into limitations of what is generally available via the GUI tools in QGIS.
In those instances, try directly using GDAL's command line utilities or load GDAL's Python binding into a Python script and leverage GDAL from there.
Answer: dakcarto's answer worked for me, with the following modification:
gdalwarp -dstalpha -srcnodata "-9999" -co "ALPHA=YES" "rast.tif" "rast_w-alpha.tif"

Assuming your raster only has one band, like mine did. The second band in your new GeoTIFF is now the mask for data (value 0) and nodata (value 255).
I hope someone can put this into a simple plugin for QGIS 2.0, because it took me two hours to find this, and I expected to be able to just use the nodata value in the QGIS raster calculator...
Comment: There is also an option, in QGIS 2 at least, under Raster menu | Analysis | Fill 'nodata'