How to get a record's updated value using lightning-record-edit-form in LWC?

Question: I use the lightning-record-edit-form for my custom lead conversion and override the save button. However I cannot find a good documentation to get the updated values of the lead. The lead needs to be updated before conversion. I'am calling an apex method to convert the lead. TIA.
Answer: I don't believe the lightning-record-edit-form component has any ways built-in to do this. On a submit event its fields property contains all of the fields available on the form, so that will include both changed and unchanged values:
handleOnSubmit(event) {
    event.preventDefault();

    // Get the fields from the submit event
    let fields = event.detail.fields;

    // check, compare, modify field values
    console.log(fields.Country);
    fields.Name = fields.Name + fields.Phone;

    // custom logic in here before submission

    // pass the fields on
    this.template.querySelector('lightning-record-edit-form').submit(fields);
}

If you want to identify the changes you have three options as far as I can see.

Let the submit request hit the server and use an Apex method to compare the new values with the old and only commit the updated values. This ensures the comparison happens on the server, but it would require querying for the current state of the Lead in the Apex class and unless you have a good need for doing a field by field comparison, the DML operation will handle updating only the changed values for you anyways.
Keep a copy of the original state of the Lead in your LWC. So when you fetch the Lead, make a clone of it that you can compare the changes to.
Keep track of the fields that were accessed and modified in the component. This is my least favored option as it would likely involve the most code and maintenance going forward and could slow your component down as you check for each change.


Infinite item source for creative mode?

Question: Is there any mod which adds infinite item source? What I mean is - I want to have a block like chest, barrel from Factorization, storage unit from Minefactory Reloaded or items monitor from Applied Energistics but with ability to store infinite amount of items (for example by right clicking with this item in hand on storage block). I want to be able (in creative mode) to pump items from that storage block without any amount limitations by BuildCraft pipes, Thermal Expansion conduits or Computer Craft turtles (especially Computer Craft turtles). Is it possible some how?
Comment: By limitations by the various pipes do you mean speed limitations
Comment: @Flaunting, I meant amount limitation
Comment: The trouble with this is that the more items you have, the more ram it'll take up, so it will eventually end up causing severe lag issues
Comment: @Ben, I understand that and that's the risk i'm willing to take.
Answer: Your best option is the Deep Storage Unit - Minefactory Reloaded - This can store 2 billion of a single item. This is the biggest form of storage you can get. To fill it quickly the best way is.

This will only work in SP if you don't have access to the server.
Clear your inventory (optional, but makes it easier)
Get one of the item you want a lot of
Edit your player file with an NBT editor
Change the amount of the item to like 2000000000
Log back in, don't die or there will be a ton of lag.

then place the rather large stack into the DSU.
If you wanted to pump this out quickly your best option is applied energistics. but any pipe system will work. It completely depends on how quickly.
The only infinite source is using the Jabba creative upgrade but this has been buggy in my experience when connected to pipe networks and has crashed my server several times when too many items get taken out.

Infinite item source for creative mode?


Combining Pictures of Letters

Question: I am trying to put 3 letters next to each other. These Letters are saved as Images, unfortunately I don't know yet how to make the pictures just the the outline of the letter and not a box containing the letter, so that I could push them so close together in order for them to touch each other
Many thanks for your help!
Answer: If they are raster images which have black on a white background you can give to them in the Objects panel Blending mode =Multiply. Then they can overlap. White causes nothing and black in one image makes that point black.
You can also goto GIMP and turn in your bitmaps all white to transparency. You must add an alpha channel to your image to make transparency possible and apply Color to Alpha so that white is converted to transparency. Save as  PNG and import to Inkscape.
I must admit your case is a puzzle. If you can write texts with a font in your computer you should also be able to have the texts as vectors. I have met the same problem as you when I copied a piece of text as screenshot (no other way available then) I tried also to do Trace Bitmap to get a vector, but quite low resolution and antialiasing made it useless. The text looked best as a bitmap.
If the letter images already happen to be vectors the blend mode = multiply -trick  still works, but as well you should be able to kill the white area by disassembling the image and deleting all white. Impossible to give exact steps without seeing the vector structure.
Answer: I'm not quite sure what you've tried, but the steps are pretty straight forward.
Each image should be traced, using Path, Trace Bitmap.
If necessary, use Path, Break Apart which will separate the individual objects. You can then select the groups of objects you wish to cluster and Group them.
You'll then be able to move each group to the desired locations.
Note that after you trace each image, you'll still have the image floating about behind the newly created vectors.

Combining Pictures of Letters


Relation between classical implication and intuitionistic implication

Question: Recently, I have read an article on combining classical and intuitionistic implications. On page 9, in their Proposition 6, the authors say that
$$A\Rightarrow((A\Rightarrow B)\rightarrow (A\rightarrow B))$$
is an axiom in the combined logic. Note that the authors use $\Rightarrow$ for classical implication and use $\rightarrow$ for intuitionistic implication. The proof they give for this proposition is couched in terms of Kripke semantics. I am wondering if it is possible to provide a proof in terms of Natural Deduction or Sequent Calculus for this proposition? Thanks!
Answer: To prove this in terms of "Natural Deduction or Sequent Calculus", you would need a natural deduction or sequent calculus proof system provided for this logic. Just as this logic has a novel semantics, it would need a novel proof system. At the point Proposition 6 is proven, they have only presented a semantics. Definition 3 in the next section presents a Hilbert-style proof system. You can prove that formula using this proof system by starting from axiom X3 which states $A\to((A\Rightarrow B)\to(A\to B))$, then deriving $(A\Rightarrow B)\to(A\to B)$ using IMP with an assumed $A$. Finally, use (meta-)Theorem 4, the classical deduction theorem CDED, to turns this proof of $(A\Rightarrow B)\to(A\to B)$ conditional on $A$ into an unconditional proof of $A\Rightarrow((A\Rightarrow B)\to(A\to B))$. You can unfold the proof of Theorem 4 to get an explicit proof if you like, or you can try to derive it directly.
Comment: There's no avoiding this. They're *defining* their logic via the given semantics. Even if this logic could be understood via a translation into intuitionistic logic (which seems very plausible), you would need to use the semantics to prove this (likely indirectly by using the proof system in Definition 3, though you could do it directly if you wanted).
Comment: Hi Derek, thanks for the answer. The problem for me is that the axiom that you refer to in their Definition 3 is based on their Proposition 6. So, I don't really want to use this to prove Proposition 6. I am wondering if we could use, for example, propositional truncation, or Godel's negative translation to do that. But I have not found a way to do that. Any idea?


What type of bearings are used to support the shafts in jet engines?

Question: I would like to know which types of bearings are commonly used to support the shafts in jet engines and why. I also read something about hydrodynamic bearings, how common are they?
Comment: I edited the title because it was incredibly broad and didn't jive with the question body. The question body is much more focused, though the hydrodynamic part would probably best be served as a stand alone question.
Answer: Rolling bearings

I would like to know which types of bearings are commonly used to support the shafts in jet engines and why

Rolling bearings are mostly of two types, depending on what's rolling: Cylinders or spheres:

Roller bearings to counter friction. They are used mainly for centering shafts within another component (e.g. a frame).

(Source)
We want to center the shaft but we don't want the shaft or the other part to heat, nor the rotation to be slowed down by friction. So we replace as much friction/sliding as we can by a part rolling between journals. It's like replacing sleigh skates by wheels between the ground and the sleigh, when the ground is not snowy.

Ball bearings. In addition of acting against friction like a roller bearing, an angular contact ball bearing also prevents any longitudinal movement between the shaft and the other part. Thrust for example pushes longitudinally on shafts which would slide out of the engine if not blocked. The roller bearings act as blocking elements, shafts remain at their position withing the engine, and thrust is transmitted to the wing via the bearings, the frame and the pylon.

(Source)

You can see roller (magenta squares) and ball (circles) bearings in this engine schematics taken from In a turbofan what holds the spinning axis:

Frames, shafts, bearings. Adapted from CFM56-7B Familiarization Manual
What we see on this design:

Two ball bearings are used to give N1 and N2 shafts their longitudinal position relatively to the fan frame.

These ball bearings also center the shafts within the frames, allowing rotors to be centered in the engine walls.

Three roller bearings are used to center the shaft at other selected locations, due to the shaft length and loads.

Other bearings are used for the gearboxes which connect the N2 shaft to the accessory gearbox, visible here:

Source: Where is the generator in a large turbofan of a commercial airliner?
(There are many other types of rolling bearings with needles, tapered rollers, double row, ... each having some advantages in a particular use.)
Hydrodynamic bearings

I also read something about hydrodynamic bearings, how common are they?

Hydrodynamic bearings reduce friction, not by rolling parts like balls or a rollers, but by injecting oil between the rotating elements, friction is decreased, only oil viscosity tends to slow down the rotation.

(Source)
It's the traditional bearing, with a lubricant, like waxed skates.
The "dynamic" part is because this is the motion of the rotating part which creates the oil film, using the same principle than for accelerating air over a wing: Shaft velocity creates a boundary layer in oil. After the film is created, the motion is no more between metal and metal, but between metal, oil and metal.
Their main advantage is they can bear large loads and still be accurate in positioning. You can read more this technology here. They are commonly found in rocket turbo-pumps. Here's one which is able to bear a load along the longitudinal axis, borne by the flat pads.

(Source)
Actually roller and ball bearings also use oil to minimize rolling resistance. The difference is rolling versus sliding. Rolling is usually more efficient to decrease friction effects than sliding since the area at the interface (metal-metal or metal-oil-metal) is reduced.
Comment: And what is the purpose of the final figure of a thrust bearing ( tilting pad ?) ?
Comment: I agree with @blacksmith37, the tilting pad thrust bearing seems out of place here. They are rarely used in jet engines (partly because there is not _that_ much thrust on the shaft: most of it is [cancelled out between the turbine and compressor](https://aviation.stackexchange.com/questions/79467/is-a-jet-engines-shaft-neutral-in-the-direction-of-thrust)). It's just an opportunity to repeat common misconceptions: for example, these bearings can be _more_ efficient than roller bearings, particularly under high load.
Comment: @blacksmith37: The OP asked about what is a hydrodynamic bearing. This answers this point, even if they are not used in the engine shown.
Comment: It's much better now, although the last sentence is still misleading: the area has almost nothing to do with it. And in the explanation of hydrodynamic bearings, I would add one perhaps most important clue: they don't just form a "boundary" of fluid between the surfaces; it is _hydrostatic_ bearings that rely on a plain boundary. Hydrodynamic bearings form a _wedge_ of fluid; this is why the shaft is shown off-centre on the picture and why you need _tilting_ pads on the thrust bearing shown. They indeed behave a bit like a wing. It is none other than Osborne Reynolds who created this theory.
Comment: @Zeus: You would save time by writing your own answer, free of misconceptions.
Comment: @mins, why? You've got a good and complete one; I just feel it could be improved and made excellent.
Comment: @Zeus: I thank you for that, but I don't feel you're correct in "*they don't just form a 'boundary' of fluid between the surfaces*", I didn't say this is *boundary lubrication*, a specific wording in ME. I told about a 'boundary layer', that is a gradual velocity change in the oil wedge, which indeed exists by viscosity effect, one side of the wedge moving with the shaft, the other being stationary, resulting in the pressure increase in the converging nozzle, peculiar to hydrodynamic lubrication.
Answer: You don't see hydrodynamic bearings in aviation very much. Jet engines are generally ball and/or roller, and piston engines with machined one-piece crankshafts use plain babbit type bearings that depend on pumped oil pressure to separate the metal of the bearing and journal (piston engines with multi-element cranks may use ball and roller bearings).
Another bearing you see in components like Air Cycle Machines (used in air conditioning packs) are "air bearings", where a gas is injected into the journal to create sufficient pressure to separate the metal parts; more or less a plain bearing but with air instead of oil.  Air bearings require a conventional low friction bearing that supports the shaft during startup until the gas pressure becomes sufficient.  Once the pressure is sufficient to lift the shaft clear, these bearings are near frictionless.
The CRJ700 and 900 Air Conditioning packs use Liebherr Aerospace air bearing ACMs that pressurize their bearings using main engine or APU bleed.
Comment: Why wouldn't a Babbitt bearing on a connecting rod, main, or cam bearing not be a hydrodynamic bearing?
Comment: A hydrodynamic bearing works passively, using the motion between the surfaces and the ramp effect to build up a pressure wave of oil.  Babbit bearings are helped by ramp effect, but under high stress they are dependent on oil pressure forced in from the pump, and a larger inlet than exit area, to keep the surfaces apart.   A plain babbit bearing once pressurized has an infinite life in theory, as long as oil pressure is adequate. So oil pressure below the green arc on takeoff on a piston engine means your bearings are being destroyed by metal contact, but at or near idle, not such a big deal.
Comment: oil is injected between the bearing and shaft. The oil wedge created (the oil between the bearing and shaft
Comment: From https://www.sciencedirect.com/topics/materials-science/hydrodynamic-bearing
Comment: oil is injected between the bearing and shaft. The oil wedge created (the oil between the bearing and shaft at the load point) is only about 20–25 μm tick, about the thickness of a human hair.


How to transfer my photos from my Android to my MacBook Pro?

Question: Where to find the MTP mode in my Galaxy 5 phone and then how to transfer my photos from my phone to my MacBook Pro? Or at least have them automatically transfer from my phone to my drive in Google.
Answer: macOS by default does not support the MTP protocol. You'll need to download a utility provided by Google called Android File Transfer on your MacBook to transfer files from your phone to your laptop.
As for the second part, you can set up your photos to automatically be backed up to your Google Drive by going to Google Photos and selecting all the folders which you'd like to be backed up.


The space of varieties between two given varieties

Question: Let $\mathbf{P} = \mathbf{P}^n(k)$ be the $n$-dimensional projective space over a field $k$, let  $A, B$ be projective varieties in $\mathbf{P}$ such that $A \subset B$. Now define
$V(A,B)$ to be the set of all projective varieties $C$ such that $A \subseteq C \subseteq B$.
What can be said about the structure of $V(A,B)$ ?
 What about the same question where we allow "quasi-projective'' instead of ''projective" ?
 Can one see $V(A,B)$ as a variety (and what is its dimension) ?
Answer: This is more reasonable if you insist that $C$ have a given Hilbert polynomial. Otherwise, consider the case $A = \emptyset$, $B = \bf P = \bf P^2$. Then you have curves of every degree, so your $V(A,B)$ will be of infinite type.
With $C$'s Hilbert polynomial fixed, the natural thing to look at is the subschemes $C$ between $A$ and $B$. This defines a closed subscheme $X$ of the Hilbert scheme of $\bf P$ with this chosen Hilbert polynomial, so in particular is projective. (I get the impression from your question that you need to learn about Hilbert schemes, from e.g. Eisenbud and Harris.)
If you only want varieties, then you're thinking about an open subscheme $V(A,B)$ of that $X$.  Given how badly behaved Hilbert schemes are, I doubt it $V(A,B)$ will be irreducible, and I suspect figuring out the dimensions of its components will be quite intractable in general.
Comment: Hey - thanks for the nice answer ! Supposing that one considers quasi-projective varieties $A, B, C$ (so that, as you state, it is possible to obtain a thing of infinite type), is there a formal statement somewhere that $V(A,B)$ iself is always a variety, or a scheme ?


View.onDraw() --- when does it get called?

Question: I put a Log.d() call into the onDraw() of my extended View, so I could see how often and when it's getting called.  It gets called upon instantiation of the view, which is not surprising.  But then I notice, it gets called on every tap that is handled by onTouchEvent(), even though my code there isn't doing anything remotely related to graphics.  However, in the documentation for Views, I can't seem to find anything about when onDraw() is actually called.  I'm not really concerned about my particular project here (this doesn't cause a problem for me), I would just like to know if there is a list somewhere or something that shows the order of operations for a View, particularly what causes onDraw() to get called.
Comment: *"It gets called upon instantiation of the view*" - A `View` is either constructed during it's inflation (from an xml layout) or directly "from code". None of the measurements are yet known when `onFinishInflate` completes, it is only when the `View` is actually "rendered" they calculated (i.e. when `onAttachedToWindow`, `onMeasure`, `onLayout`, and `onDraw` are called).
Answer: AFAIK, a View's onDraw() is called when:

The view is initially drawn
Whenever invalidate() is called on the view

Invalidate can be called by you or the system whenever needed. For example, a lot of Views change how they look onTouch, like an EditText getting an outline and cursor, or a button being in the pressed state. Due to this, Views are redrawn on touch.
I agree that it would be nice to have a document that detailed the working of Views, and if one exists and somebody knows where to find it, please let us know.
Comment: This is not the case for `ViewGroup`s. See my answer http://stackoverflow.com/a/34367199/1642079
Comment: One aspect to pay attention to is that View's `onDraw()` is not guaranteed to be called immediately after `invalidate()`. Like the doc says, after `invaldiate()`, **_if the view is visible, `onDraw(android.graphics.Canvas)` will be called at some point in the future._**
Comment: @Raghav: I tried your suggested approach (in a View and not in a ViewGroup). The invalidate() call does not trigger the onDraw() method in my example (see https://stackoverflow.com/questions/70038233/how-to-update-a-view-element-with-a-canvas-in-android)
Answer: onDraw() is called when invalidate() is called.
But you should know for ViewGroups: onDraw() will not be called like you expect. Rather, onDispatchDraw().
However, in a ViewGroup you can call setWillNotDraw(false) in the constructor to make onDraw() to be called on invalidate().
Take a look at this answer
Answer:

If you set a background drawable for a View, then the View will draw
  it for you before calling back to its onDraw() method.
onAttachedToWindow () is called when the view is attached to a window.
  At this point it has a Surface and will start drawing. Note that this
  function is guaranteed to be called before
  onDraw(android.graphics.Canvas), however it may be called any time
  before the first onDraw -- including before or after onMeasure(int,
  int).
invalidate() mark the area defined by dirty as needing to be drawn. If
  the view is visible, onDraw(android.graphics.Canvas) will be called at
  some point in the future.
Comment: Is a way we can intercept before calling back onDraw(), would you like to check my question http://stackoverflow.com/questions/19052952/bitmap-change-will-make-view-auto-refresh-before-ondraw-and-regardless-invalid
Answer: One important thing to keep in mind is that try to minimize calling of invalidate() function with no arguments.
Instead try to maximize the invalidate() function with four arguments.As drawing whole view is very expensive.The second variant refreshes only the part of view.
Comment: This answer is outdated, the API is updated so that it calculates the "dirty rectangle" by itself, and thus this function is deprecated.
Answer: When is onDraw called (check this for more details)

The onDraw method is called whenever android thinks that your view
should be redrawn. This can be tha case when your view is animated, in
which case onDraw is called for every frame in the animation. It is
also called when the layout changes and your view is re-positioned on
the screen.
But what if some data inside your view has changed and you want to
make sure that the view is redrawn. You can't call onDraw directly.
Instead you should call invalidate to tell the view that it needs to
redraw itself.
Answer: Additional to the above: The soft keyboard causes a View.invalidate()-->View.onDraw() sequence after resizing the Window to sensibly accommodate the 'keyboard'. A custom View.onDraw() must leave itself in a state that anticipates this possibility.
Such phenomenum explains why the app you developed and tested on a tablet with a bluetooth keyboard went to the dogs once it reached the real world (-:


Spring-block system, simple harmonic motion, time period

Question: In the case of simple harmonic motion of spring block system, why time period of the simple harmonic motion of the block is independent of acceleration of the system (spring-block system)?
Answer: A spring applies a force $F = kx$, where $k$ is the spring constant and $x$ is the distance from the rest position. If you have a mass $m$ on the spring, it will oscillate around $x = 0$ with period $t = 2\pi\sqrt{m\over{k}}$. If you then apply an acceleration $a$, the rest position of the spring will shift by $d_a = {a\over{k}}$. If you keep this acceleration constant, and displace the spring away from its new rest position $d_a$, then the net spring force will be $F_n = k(x - d_a)$. This is the same equation as you had before for the spring, just shifted by $d_a$. So, you will again get oscillation with period $t = 2\pi\sqrt{m\over{k}}$, except centered on $x = d_a$.
Comment: Why this shift causes no change in time period? Please explain. Thanks in advance
Comment: The oscillation period is a function of two things: the restoring force as a function of displacement from the spring's rest position, and the mass. Neither changes if you add an acceleration; you just shift the spring's rest position.


Please help me to choose a proper Automatic Transmission Fluid

Question: My car has a Aisin 81-40LE(Toyota U440e) 4-Speed Automatic Transmission.
I want to change ATF, can i use multi-Vehicle ATF's like "Aisin ATF Plus"?
Also can i mix new fluid with old?
Can we use Multi-Vehicle Automatic Transmission Fluid (ATF) for a transmission that Manufacturer specified to use Toyota-IV?
Answer: This manual specifies "T-IV ATF" and is noted in the table on the right, source
Comment: Tnx for your answer,  can i use multi-vehicle ATF's Like "Aisin ATF Plus"? or i must use a Fluid that has only T-IV support?
Answer: One of of the tricky things with this question is that googling "Aisin ATF Plus" does not return any hits for me.  I suspect that it is a packaging for a local market or a counterfeit product.
Automatic transmission fluids are made to different specifications and many car manufactures use the same fluid.  They just give them their own part number or marketing name.  For instance my wife's BMW uses GM Dexron fluid, that makes it easy to find.  In your case you are looking for T-IV fluid, you need to look on the multi-vehicle fluid container and see if it is compatible with T-IV.  If not, DO NOT USE IT, because there are different incompatible fluids out there and you want to use something you know is good.  There really are no multi-purpose fluids, it is just that most car manufactures use the same OEM transmissions under the covers.
As far as mixing new and old fluid, unless you are using a fancy flushing system you will not be able to get all the old fluid out.  For instance the torque converter will hold onto alot of fluid.  Again on my wife's BMW the recommendation was to change the fluid and then change it again after a few thousand miles.  That way you end up with a good mix of mostly new fluid.
Comment: @saidh does the multi-vehicle fluid explicitly say it is T-IV compatible?  The Multi-vehicle fluid should say what types of fluid it replaces or the fluid specifications it meets, you need to work form those to figure out if they cover T-IV.  There is no-such thing as a universal fluid that will work for all cars.
Comment: can we mix t-iv fluid in multi-vehicle fluid? because my old fluid is T-iv...


Energy needed to create a black hole vs energy needed to run the Large Hadron Collider?

Question: I was disappointed to hear Brian Cox's flippant reply to whether or not the LHC could create a black hole big enough to swallow the earth in this video:
https://www.youtube.com/watch?v=QFy87tFTZwY
I'm guessing that the power used by the LHC is nothing like that used when gravity crushes a star to a singularity, but ...
... how big is "nothing like"?
Comment: I think the question is not how much energy is needed to create a star sized black hole. It should be how much energy is needed to create a tiny black hole that could be stable and start growing by itself from surrounding matter. That is probably very larger than LHC output, but smaller than the former.
Comment: It will be fun to take a wild guess at this.  The LHC affects things *the size of an electron or maybe a proton*.  In contrast, you are talking about something *the size of a star*.  ("!!!!!")  After a quick google on "how big are stars", I'm going to take a wild guess and say the LHC would need to be 10^58 ("!!!!!!!!!!!!!!!") times more powerful, to, as you say, "crush a star to a singularity".  I encourage anyone else to take w wild guess before someone calculates it :)  So my guess is, the LHC would need to be 10^58 times more powerful.
Comment: 1) A star 3 or 5 times the size of our sun will gradually burn up its hydrogen and collapse to form a black hole big enough to swallow the earth;

2) The force of gravity needed to crush the star to a singularity is 10^x joules;

3) This process is not instant. It actually takes 10^y seconds;

4) The power needed to create such a black hole is 10^(x+y) watts;

5) At full pelt, the LHC uses 120 megawatts, or 1.2*10^8 watts.

"Bollocks", "a lot" and "probably very larger" are answers I could have come up with myself, but I can't do the science to find x and y. Can you? Please?
Comment: @Boodysaspie because stars lose a lot of their matter, the initial mass has to be quite a bit bigger than 3 to 5 times the mass of our sun.      As for the other questions, you might want to edit your question rather than ask in comments.
Comment: Related:    http://astronomy.stackexchange.com/questions/11202/how-small-would-you-have-to-crush-an-object-for-it-to-become-a-black-hole
Answer: Your question touches on a few points.
First, yes, he was flippant, but the risk was super-low.   The simplest way to explain this is that nothing happens in CERN that doesn't happen all over the universe and in the upper atmosphere of the Earth or on the surface of all the moons, planets and stars every day.  For example, the Oh My God particle was traveling with several million times the energy of the particle collisions inside CERN.   At those speeds, accelerating the particle further doesn't add much velocity, what they're basically doing is adding energy or mass to the particle and only slightly increasing it's velocity as it's speed gradually moves closer to the speed of light.
What makes CERN useful, isn't that the high speed collisions don't happen anywhere else (they happen all the time all over the Universe).  What makes it useful is the million dollar equipment that zooms in on those collisions, recording what happens with the best cameras in the world.   We can't predict when and where a very fast moving cosmic particle will hit the Earth, but they know when and where the CERN particles are going to collide, because that's planned to happen in a specific place and time.
So, if those kinds of collisions happen all the time and no planet or star has ever been observed being eaten by a particle collision created black hole, then such events are, at the very least, extremely rare.
Add to that, Hawking radiation dictates that black holes that small should evaporate before they can eat anything.   So, when Brian Cox laughs at that question, he has good reason to laugh, because it was never a real risk and it's more of a joke question than a genuine risk.

Now, when you say "pressure" to create black holes.   The pressure inside a black hole, or, I should say, pressure inside a Neutron Star about to turn into a black hole, or the pressure inside a collapsing core of a very large star about to create a black hole - those pressures are crazy high, but if we could re-create that pressure on earth (We can't), but if we could, it wouldn't be enough to make a black hole.   Pressure alone doesn't do it, you need mass (at last about 3 solar masses) to fit within a certain size and the less mass you have, the greater the required density (and greater pressure) is needed to achieve the necessary mass to schwarzchild radius ratio.  The pressure required inside the forming black hole actually decreases as the mass of the black hole increases.  (based on simple pressure equations and schwarzchild radii).   Equal pressure in a lab on Earth wouldn't accomplish it.
What makes black holes theoretically possible is the small quantum size and possibility of extra dimensions and quantum rules that only apply to the very small, so it's a very different set of circumstances.
Collisions in CERN are measured in Electron-volts.   It was theorized that if there were extra dimensions on the quantum level, then micro-black holes might form at the energy of CERN's collisions (this would imply that black holes of this type form in Earth's upper atmosphere all the time, implying they're not dangerous).
But so far, no luck.  No micro-black-holes have been observed.  They should dissipate very rapidly but their decay streams should be recognizable so they should get noticed, but so far, none have been spotted and as a result, there's no evidence of extra dimensions.  That doesn't mean they're not there, and that micro-black-holes can't be created, but so far there's no evidence that they've been created up to about 13 trillion electron volts, the current peak of CERN's collision energy.   See here
Hope that makes sense.  Corrections welcome.
Answer: According to our current understanding, there is no lower bound for the energy needed to make a black hole. Any object, no matter how small, if compressed enough, could in theory form a black hole. Make it small enough, and it would not require much energy at all.
But here's the main issue. Black holes have this thing called Hawking radiation: they constantly lose energy (and therefore mass) via radiation, and the smaller the BH is, the faster it loses energy. Super-tiny BHs basically pop out of existence the very moment they are created, that's how quick the process is.
For a BH to be a threat, it would have to be big enough to be stable long enough to actually start eating surrounding matter, to compensate for loss via radiation. I believe calculations have shown that the BH would then have to be as massive as a big mountain. That's A LOT of energy. The LHC is nowhere near that level.
Comment: Say Florin, *"Any object, no matter how small, if compressed enough, could in theory form a black hole."*  OK - but the smallest possibility there is "pushing two electrons together".  (Is that correct?)  So then, *"there is no lower bound for the energy needed to make a black hole"* .. au contraire, i guess, thus, the lower bound would in fact be: **"enough energy to push two electrons together"**.  And that's a great deal of energy right?  (And/or, it's physically impossible / completely mysterious due to quantum considerations right?)
Comment: Just to emphasise (and I have modded the question to save anyone the trouble of viewing the video) that the black hole should be big enough to swallow the earth.
Answer: While it's not recommended, your comments cover enough ground that rather than make a long answer, I'll address them here.   If my answer is unsatisfactory, you might want to create a new question, clarifying the specifics.

A star 3 or 5 times the size of our sun will gradually burn up its
  hydrogen and collapse to form a black hole big enough to swallow the
  earth

Stars don't operate that way.  During the final stages, (red giant, helium flash, etc), stars lose a significant percentage of their matter into space.   Our sun is expected to lose about half it's mass by the time it becomes a white dwarf.   larger stars lose an even higher percentage so you need a much more massive star to end up with a black hole. About 8 solar masses to end up a neutron star and about 25 solar masses (same link) for a black hole, though a neutron star can accrue mass and become a black hole that way too if it's in a binary system.
I realize that's not precisely what you asked, but one of the problems with compression on this scale is you have to ask what you are compressing.   Compressing fissionable materials can lead to explosive events that would resist the compression.
If you use iron, which won't create any new energy upon being very tightly compacted, then you have a relatively straightforward mass to size problem where you can estimate the pressure. 3 solar masses of iron should be sufficient to form a black hole by its own mass and gravity. It might even be a bit less than that, as it's never been observed and would vary some with speed of rotation and temperature. But 3.0 solar masses is close enough.

The force of gravity needed to crush the star to a singularity is $10^x$ joules

This isn't straightforward because it would vary with the initial mass you wanted to force into a black hole and the math gets very complex, involving equations based on the Pauli exclusion principle and neutron degeneracy pressure.
But, in general, with enough mass, no force is needed, because the gravity does all the work itself. There is no energy expenditure with 3 solar masses of iron. There's a huge (enormous) gravitational force, but no energy.
With less mass, the force increases because a smaller Schwarzschild radius requires the Neutrons and quarks to get even closer, and the energy of such compression is enormous and hard to calculate.
Fortunately, there is a way to cheat and get a very simplified answer. The degenerate pressure that keeps the neutron star from becoming a black hole is in balance with the gravitational binding energy and gravitational binding energy can be estimated, assuming uniform density,
$$U=\frac{3GM^2}{5R}$$
(Source).
So, let's take a millionth of a gram of stuff, something heavy, like a piece of iron dust to avoid any fission energy that would work against black hole formation, and use our handy Hawking radiation calculator.
A one millionth of a gram black hole would have a radius of about $1.5 \times 10^{-36}$ meters (calculator above), so the gravitational binding energy, roughly equivalent to the neutron degeneracy pressure at Schwarzchild radius:
$$\frac{3 \times 6.67 \times 10^{-11} \times 10^{-9}}{5 \times 1.5 \times 10^{-36}} = 2.67 \times 10^{15}$$
or 26.7 million billion joules, crammed into a space smaller than an atom, just to make a 1 millionth of a gram black hole that should evaporate in a fraction of a fraction of a second.    Now, there's probably a thousand reasons why my estimate is wrong, but it's ballpark (a very big, Texas-sized ballpark), but still in the ballpark.
Your estimate for CERN is that it uses 800 million watts. Now, remember, CERN accelerates beams of protons, thousands if not millions, and at current peak energy, each individual proton carries a maximum of about 13 trillion electron volts, and there are about $6.24 \times 10^{18}$ electron volts in a joule, so each individual CERN collision, proton onto proton has about 1/48,000 joules, at maximum power.
Now, even with my Texas-sized ballpark estimate, 1/48,000 is a much smaller number than 26.7 million billion. When the numbers are that far off, "bollocks" kinda covers it.
And a millionth of a gram black hole would evaporate anyway. It would be much smaller than an atom and would have a hard time absorbing much of anything. Not to mention the creation of such an object would probably have an initial velocity well above escape velocity and it would simply fly away from the earth (or right through it and away - like a heavy neutrino).
There's no estimate that creates a dangerous scenario using CERN's 1/48,000 joules per collision energy, and for an individual collision, that's enormous, but it's nowhere close to dangerous, unless you make the mistake of standing in the beam (that happened to somebody once, but...I digress). He lived by the way.
CERN can't put anywhere close to all 800 megawatts of energy into the acceleration of one proton. If they could, we might discover some very interesting things, but they can't even come close. All that energy powers the magnets and the vacuum and keeps everything cool, but the individual proton energy is a tiny fraction of that.
So, depending on what size black hole you want to create, CERN would need to be, oh, maybe a billion billion billion times more powerful than it currently is, and even so, the black hole created would probably evaporate before it ate anything, or, if Hawking radiation is wrong and it doesn't evaporate it would most likely fly harmlessly through the Earth, or, mostly harmlessly as it might do some harm if it flew through a person.
To create a black hole of low enough temperature to actually be stable, (and theoretically eat the Earth), you'd need, by the Hawking radiation calculator, millions of tons. And clearly we're deep into the impossible if you think CERN can crush millions of tons of iron into a speck the size of an atom. The orders of magnitude of improbability are higher than I can calculate.

Now, as to the flip side of this question and why it was thought that CERN might be able to create a black hole (so far they haven't), is because quantum black holes (theoretically) obey different rules over very short distances. They wouldn't last long and they wouldn't be dangerous. If quantum black holes can be created in CERN, then they are being created all the time by cosmic rays, on the surface of the moon, in the upper atmosphere of Earth. CERN does nothing that doesn't happen in the upper atmosphere all the time.
But to actually turn a speck of matter like a grain of sand into a black hole, the energy required would be billions and billions of times over what CERN is capable of. I can't give you an exact answer because I don't have the training in quantum calculations, and I'm not sure anyone can, or if they can, it will be very complicated.
In my opinion, "bollocks", covers it.  But he could have said "yes, that could happen, if CERN were a billion billion billion billion times more powerful.
There's much easier ways to kill everyone on Earth than making a black hole that eats the Earth. In fact, that might be the hardest way to kill everyone ever thought up.
Hope you don't mind my narrative, but I think the gravitational binding energy approach isn't a bad way to answer your specific questions on energy required.


Excel not updating pasted as value formula

Question: Try these steps:
1. Open excel
2. Enter 3 value in cell A1
3. Enter A in cell B1
4. Enter 1 in cell C1
5. Enter ="="&B1&C1 in cell B5
6. Copy cell B5
7. Select cell B6 and right-click Paste Special then select Values and click OK
8. Cell B6 shows =A1 formula now.... but why is it not calculating this formula?
Answer: The quickest way to do this is to paste your formula into required cells then highlight them by selecting the column and then click the "Calculate Now" button:

This will update the results of the formulae.
If this used to work then it could be that the calculation options have been set to manual. Click on the menu and select "Automatic":
Answer: Excel doesn't run the cell through its interpreter after a paste, so your cell value is still a string of text.
Press F2 then Enter to force Excel the reinterpret the cell.
However, if you using cells B1 and C1 to build a cell reference then you should probably use the INDIRECT() function.
Comment: I got that turn around too. Thanks. but that wont help much because i have about a thousand cells that contains the same data.
Comment: I have this problem often enough that I made a macro to do it for me as assigned it to a button on the ribbon. It works for any size selection of cells.
Private Sub recalcCells(): Selection = Selection.Value: End Sub
Answer: Thanks for the help. I find a solution:
Copy paste the cells into a new workbook.
Saveas the workbook into a tab delimited text file.
Open the text file in notepad
Copy the whole contents
and paste it back into the excel.
Now it works!
Answer:
Select the "Pasted as Value" Cells
Copy (CTRL +C)
Paste (CTRL +V) replacing those cells themselves; (Don't "Paste Special")
Excel will update those Cells


How do I change the color of particles with a color ramp?

Question: I watched this tutorial https://youtu.be/eshOzshjt90 and at 2:18 he somehow magically managed to get a different color on his second particle via the color ramp. But the color ramp doesn't do anything at all? I'm really confused. How do I change or invert the color of my second particle?
Answer: If your particle system is instancing an object then you can customise the particles to sample random colours by using this node setup on your instancing object:

Here, all I've done is use the random output of an object info node with a colour ramp :)
Comment: mhh, thats not really what I'm searching for :/ my plane has two hair particles, the second one is a duplicate of the first one. The first particle should have color a and the second one color b... i tried with creating a texture and enable color ramp, but color ramp doesn't do anything...


Can't access all profiles

Question:
App Version: 1.4.5
Device: iPad 4 (Wi-Fi)
OS Version: Version 9.3.1 (Build 13E238)
Wanted to find a question I had asked on Apple.SE without scrolling down hunting for it.  Clicked the avatar but got only the "Travel" profile—only things in Travel.SE.  Selected Apple again and repeated.  Still got Travel.
Comment: How many rep you see for your Travel profile using the iOS app? Maybe you registered a different account in the app by mistake, when signing in.
Comment: No, it's the same. I have only ever used one e-mail address on any SE site.  Rep is the same, and the list of questions is the same.
Answer: This will be fixed in 18.104.22.168.
Right now the menu icon always takes you to your highest rep site.  It's a vestige of the fact that on the iPhone it takes you to a network profile rather than a site profile.
There are currently two ways to get to your profile on Apple.SE.

Go to your profile from the menu.  In the bottom right, you'll see a list of your other sites.  You can tap "Ask Different" to get to your Apple.SE profile.
While Apple.SE is open, tap the last menu item for the site, the one with three dots.  In the resulting screen, you'll see an item for your site profile.

In the next release, tapping on your menu icon while in a site will open up the profile for that site.
You can try this change when it's built by becoming a beta tester.

Can't access all profiles


Queries about distro switching and dual booting

Question: This is my compilation of my questions regarding distro switching. To begin with, where are all my programs stored in linux?(like the c:/ drive in windows) If I switch distros (I know my files will be intact but..)will my programs be removed? Do I have to install them once again? As of dual booting: How much space would you recommend allocating for linux?(My use case: I will use linux for everything except ms office and games.) I know the file system of windows is NTFS and linux uses ext4. So will I be able to access my windows files in linux and linux files in windows? Will there be a performance degradation in doing so? If so, how much? How much swap area would you recommend? How do I install Windows alongside Linux? Will windows take over linux or will the vice versa happen? If so, how to prevent it? All in all I love linux but occasionally I want to use windows as well.
Comment: Only Ubuntu and official flavors of Ubuntu (https://ubuntu.com/download/flavours) are on-topic here, refer to https://askubuntu.com/help/on-topic. Your question doesn't even mention Ubuntu, but refers to distro's (not *flavors* as used in Ubuntu terminology) so I see no connection with this site.  Ubuntu doesn't require you to re-install programs (if you install without *format*) however it'll depend on a lot of options, and this does **not** apply to non-Ubuntu systems in most cases.
Comment: A number of your questions as written are unanswerable (correct swap size is dependent on your hardware, your applications & *end-use* of your system, none of which have been provided). Yes you can use shared *file-systems*, and yes there are costs (better usually to have a shared area used by both rather than each use the other's, as NTFS is foreign to windows, the same applies to your unstated chosen *fs* used by unstated Ubuntu which has many options!)  Your question is *too broad*  (see https://askubuntu.com/help/dont-ask as well as the *on-topic* link in prior comment)
Comment: "will my programs be removed?" windows software is not compatible with linux. We have alternatives for about any sofwtare used in windows though
Answer: In the future, it is advised to stick to a single question and your question may get closed for asking multiple questions but I will go ahead and answer.
Personally, I would recommend using at least half your drive for Ubuntu but that depends on how much you plan on using Windows in the future and how much you plan on using Ubuntu. If you plan on primarily using Ubuntu, you may want more. If you plan on primarily using Windows, you might want to use less. If you plan on using them both equally, you might just want to use half and half.
Applications are not stored in executable .exe style packages the way they are in Windows. Applications are initially stored in compressed .deb files but they are expanded and the contents are distributed to different directories during installation. The bin files typically run the application and they are typically stored in /bin or /usr/bin or /sbin or /usr/sbin or other bin and sbin directories that may exist.
However, you don't have to worry about this stuff because installation and removal of applications are handled through a package manager. Similar to how we use the "play store" on Android operating systems, there is an application package that you will use to search for and install applications.
Alternatively, you can use the command line to install applications using the apt command. For example, to install gimp, you would run the command: sudo apt install gimp
Next, you will often hear that "everything in linux is a file." Also, what you call "folders" are typically referred to as "directories." Typically, your main drive is mounted at / instead of C:\. However, when you have an extra drive, it can be mounted anywhere in the filesystem that another drive is not mounted to.
For example, your main drive is mounted to /. You can create a new directory to mount a new drive such as /mount/ and external drives are often automatically mounted to a directory under /media/. However, you cannot mount a new drive to / because you already have a drive mounted to this directory. In other words, unlike windows which has an individual filesystem for each drive, there is one single file system and extra drives are mounted to directories under your main filesystem. So it functions more like a tree with branches and extra drive is like an extra tree that can grow from one of the branches.
As you probably know, partitions function like individual drives. However in windows, if you have two partitions they will be labeled as C: and D: etc. and the same applies to partitions of any additional drives which may be E: and F: etc.
On linux type systems, individual drives are labeled /dev/sda and /dev/sdb etc. and individual partitions are labeled /dev/sda1 and /dev/sda2. These labels are not referred to when referring to your filesystem the way the labels are in Windows but we do use these labels for mounting purposes. So we may say that /dev/sda1 is mounted to / and that /dev/sda2 is mounted to /media/username/drivename/.
Swap space is typically added automatically on newer versions of Ubuntu and it is not recommended to mess with swap.
You can access NTFS from Ubuntu but you most likely cannot access ext4 from Windows. Here are some performance benchmarks provided by Phoronix.
Finally, just to let you know, your "home" directory is located at /home/username/
Comment: What do you say about windows accessing ext4 using drivers? Like ext2fsd, etc !??
Comment: you say swap will be added automatically, right? What if I choose the "something  else" option during installation?
Comment: @Sujay.R Yes. Newer versions of Ubuntu use a swap file instead of a swap partition so it will add the file automatically unless you actually create a separate swap partition.
Comment: @Sujay.R As far as Windows accessing ext4, I've heard that ext2fsd is not reliable and can sometimes lead to memory corruption so use at your own risk.
Comment: @Sujay.R Also, as for accessing NTFS from Ubuntu, you will need to make sure to disable any fastboot option in Windows and make sure that Windows is not in any type of hibernated or fastboot state or you will have problems accessing NTFS. You will also need to make sure Windows is in no hibernated state or fastboot state during Ubuntu installation and this is important.


Instrumenting Web Service Performance in ASP.NET

Question: I need to measure the length of time requests are taking to be processed on an ASMX ASP.NET web service.  What is the best approach for this?  Is there an support in ASP.NET that "natively" supports this without me having to write code?  Thanks.
Answer: Performance monitor is chock full of counters for monitoring ASP.NET.
Answer: You can use a profiler for this. ANTS Performance Profiler (http://www.red-gate.com/products/ants_performance_profiler/index.htm) and dotTrace (http://www.jetbrains.com/profiler/) are good. Also the native Perfmon is also good.
Another similar query is here: https://stackoverflow.com/questions/7867/best-tool-for-performance-testing-asp-net
Answer: What do you want to measure? Time in execution between methods, return time to/from the client?
Perfmon is fine for aggregated performance counting, but not really beneficial for single-request reviews.  ANTS profiler is fine for monitoring performance in the programmatic realm, if that's what you're after.
If you're looking for round-trip client-to-server measurement, try the TimeTaken field in the IIS log. It measures from the time the web server accepts the request, to the time to first bytes delivered in reply to the request.


Cant access BIOS or Windows after Ubuntu install

Question: I have 2 drives in my laptop (Samsung NP530U4C), a 120GB SSD and a 25GB mSATA SSD. I have Windows 7 on the 120GB drive and after installing Ubuntu 12.04 on the mSATA I cant access Windows or get into the BIOS anymore.
When I select Windows 7 in grub it says "invalid EFI file path" and Windows/Linux USBs/CDs dont show up in grub.
The BIOS boot menu only shows 'ubuntu' (no drives or CDROM) and I cant get into the full BIOS and no I'm not pressing the wrong buttons.
I tried Boot-Repair but had no luck. Anybody have any suggestions?
Comment: If you see ubuntu in "BIOS", it seems more like UEFI? Can you post link to BootINfo report from Boot-Repair? Is Windows installed in BIOS mode and Ubuntu in UEFI? That would also give boot from grub issues.
Answer: Ubuntu does not write anything to your motherboard where the bios is located.
First you will need to restore your Win 7 boot.
Do this first>> Disconnect the SSD with ubuntu on it.
Fixing the Master Boot Record (MBR)
Note: I strongly advise running all 3 commands  fixmbr fixboot rebuildbcd
Step one: Turn your computer on, booting from either your Windows 7 Installation DVD or Windows 7 System Recovery Disc.  Remember, you may need to change the boot order inside your BIOS to have the your DVD drive boot first.
Step two: After the installation or recovery disc loads, if prompted, select your language settings and then continue.  If you are using the installation DVD, when prompted by the following screen select Repair your computer.
Step three: The computer will take a moment now to scan itself for any Windows installations, after which you will likely be given a choice to select which installation you wish to repair.  Select the appropriate Windows installation from the list and then continue. If by chance a problem is detected in one of your Windows installations at this initial stage, the system may also ask you if it can try to repair the problem automatically. It is up to you if you wish to let the system try to repair itself, but otherwise just select No.
Step four: Once you have reached the System Recovery Options screen, as shown below, you will be faced with a list of choices that can aid you in repairing a damaged Windows 7 operating system.  If you wish to try the Startup Repair option first, it is often successful in automatically fixing many different start up issues, but in this article we will be using the Command Prompt option to resolve our problems manually. So, click Command Prompt to continue.
Step five: Now sitting at the command prompt, enter the following command and then press enter:
<code>     bootrec.exe /FixMbr
</code>
If successful, you should be greeted with the message The operation completed successfully.  That's it!  Your Master Boot Record has been repaired.
While the above command does fix the MBR, and sometimes that is enough, there still might be an error with the system partition's boot sector and Boot Configuration Data (BCD). This might occur if you have tried to install another operating system alongside Windows 7, such as Windows XP.  To write a new boot sector, try the following command:
<code>    bootrec.exe /FixBoot
</code>
If you are still faced with your Windows 7 installation not being detected during start up, or if you wish to include more than one operating system choice to your system's boot list, you can try the following command to rebuild your BCD:
<code>    bootrec.exe /RebuildBcd
</code>
The above command will scan all your disks for other operating systems compatible with Windows 7 and allow you to add them to your system's boot list.
After you have done this you can reboot your computer and let windows start to make sure it is working.
If it is then shut down your computer and reconnect your Ubuntu SSD.
Start your computer and press whatever key is needed for you to select the drive you want to boot to which is going to be ubuntu.
When ubuntu starts open up Synaptic and install a program called BOOT-REPAIR
You can easily use that to fix any boot problems in ubuntu


How does linear SVMs function in multi dimensional feature space?

Question: How does linear SVMs function in multi dimensional feature space? I'm not able to picture how a linear SVM can perform classification in more than 2 dimensions. Also, when to chose linear SVMs and kernel based SVMs? For example, my dataset has over 5000 instances with 4000 features.
Answer: Linear SVM always works in the exact same way, even if you can't mentally wrap your head around the geometrics. Humans are generally bad at reasoning in more than three dimensions, so don't let that worry you.
Imagine linear SVM in one dimension. This would look something like this:
<code>+ + + + + | - - - -</code>
where | is your decision boundary. A hyperplane in one dimension is a cutoff value. In two dimensions, you get a line. In three dimensions, you get a plane, ...
With 4000 features in input space, you probably don't benefit enough by mapping to a higher dimensional feature space (= use a kernel) to make it worth the extra computational expense. Hence, use a linear kernel.
In fact, always use the linear kernel first and see if you get satisfactory results. Generally, you can try a nonlinear kernel if and only if you don't get good results with a linear kernel.
Comment: It would be a hyperplane, which is the generalization of a plane to more dimensions. Suppose you fix 3997 out of your 4000 dimensions and look at the decision boundary in the remaining 3 free dimensions, you'd get a plane, regardless of which 3 you pick. Don't try to visualize the geometry in your mind, because our imagination is generally limited to what we can interpret *spatially* (i.e., in three dimensions or less).
Comment: Thanks for your reply. I can imagine in three dimensions it would be a plane. What I don't understand is how would a linear SVM look in 4000 dimensional space. Sorry if the question is really naive.
Answer: I was even stuck at same question for sometime, then I reffered some of the websites through which I was able yo get the intution.
If you are not able to visualise in mind consider this..
For 1 dimensional dataset a point will be suitable to discriminate between different classes.
Increase a dimension up for a 2 dimensional plane of data a single line may discriminate it  with/without applying kernel.
Another increase will be analogous to having data in three dimensions but hyperplane or seperating plane in 2 dimension as we know a plane is 2d.
According to following Wikipedia article's starting lines you may develop the intution.
https://en.m.wikipedia.org/wiki/Hyperplane
The hyperplane is just one dimension less than data in order to separate the data points into multiple classes.
Then for 4000 feature space it will be nothing other than 3999 dimensional plane (plane in order to seperate) or simply collection of the points with 3999 dimensions in order to seperate the data points.


Photos & Reducing Clutter on macOS High Sierra

Question: I'm using macOS High Sierra. Recently I started to shoot movies and use FCPX to edit etcetera. My question is when going to About this Mac > Storage > Manage > Reduce Clutter> Review Files > Large Files… Much to my frustration I find oodles of QuickTime movie files. I'd like to delete them and regain the almost 300 GB of storage that's being used up. But I'm worried they would no longer be stored in my Photos application (where I imported or dragged and dropped everything I've filmed). Why do they end up saved in that documents file and is it safe to delete them. A related question, when I delete downloads, if I've saved them in photos or in pages, will those be gone from those places or will they remain?
Answer: This largely depends on how you have photos imported to the Photos app. Photos > Preferences has an Importing checkbox. If this checkbox was ever disabled when you imported photos, you may not have all photos in the library itself and may exist in other places on your computer.

If you are not using iCloud Photo Library, consider selecting the image or movie in Photos, and using File > Show Referenced File in Finder. This will allow you to see exactly where the file lives.
You could export all your movie files from Photos and move them to a different hard drive or cloud storage solution, or delete the movies in Photos and replace them all with the Importing checkbox selected. You should export originals via File > Export > Export Unmodified Original for x Videos.
I also recommend making sure you have good backups via Time Machine or another service. If you make a mistake when deleting files, you can recover files.


Exposed cord on bike tire - replace?

Question:
The gash is about 3 inches long. Should I toss the tire or should I keep it?
Comment: You say in a comment that it is less than a 1000 miles but do you have a more accurate count?  Care to share the make/model of the tire as well?  It may be a common lifetime of it or a tire we need to avoid.
Comment: That seems to be your back wheel. Are you using your brakes properly? (i.e. braking with the front brake), or are you locking the rear wheel? Beyond keeping your components in good state, it can also save your life... http://sheldonbrown.com/brakturn.html
Comment: I've only locked up my rear wheel while braking twice. Neither lockup was extended. Both lasted maybe a second or so. What's odd is that the tire was fine a week ago when I was changing tubes. I didn't notice any wear like this when swapping tubes.
Comment: @BPugh its a kenda kaliente l3r pro
Comment: Should have been tossed about 2000 miles ago.
Comment: Those tires aren't really low quality (judging by how they are priced) and I'm surprised to see this kind of wear after such short mileage. I almost wonder if you rode through something that ate away at the rubber.  I had really cheap Kenda tires that came with a hybrid bike that lasted for years and probably at least 5000 km.
Comment: @Kibbee - the bike was unused for 10 years. Could the rubber have deteriorated? And I agree - these tires were top of the line Kendas 10 years ago and still basically are. I'm actually really willing to give Kenda a second shot.
Answer: Definitely replace it.
At this stage, with the rubber delaminating from the case, it could come apart at any time. It's dangerous to use.
Near the bottom of the picture there are some bare threads. It is at that point the tire should have been replaced and perhaps only used in an emergency.
PS I see from the picture that the rim is quite worn. It's not far off needing replacement also.
Comment: Yes, the concave area where the pads rub. If you ride in wet or dirty conditions the brakes need to be cleaned frequently, else dirt caught on the pads just rips into the rim.
Comment: thanks for the comments. This is odd. Both the tire and rim have seen less than 1000 miles. I've only had the bike for 6 months, and I've only been seriously riding for the last 2 months. Could it just be a case of cheap rim and cheap tire? I'll do some research on rim wear in the mean time and perhaps open another question. How can you tell the rim is worn? Is it that the brake track looks concave in the picture?
Comment: now that I think of it I was using some old stock Tektro brake pads on my rims ... and these were about 10 years old and VERY hard. Could that have been the cause of the wear? I regularly take my bike on commutes and there's this one down hill section I *have* to ride with the brakes on because not only does it involve going downhill but it also involves fitting between two very narrow posts with only a few inches of clearance for my bike ...
Answer: You must replace it. This tire is shot.
I'm curious as to the brand/model of rims as well as the bike itself.
Also, what surfaces are you riding on/
Comment: I used Kenda before too and they indeed deteriorated fast. Actually even less than 1000 kilometres. This is a known "feature" of cheap Kenda tires. When the rubber starts to delaminate some sort of chain reaction seem to happen and other parts of the tire delaminate too.  Just replace them with something better and forget for a while.
Comment: These are Kenda Kaliente L3R Pro tires on Easton Vista rims. I ride on roads. Asphalt roads. Pretty well-maintained. Occasionally I ride through gravel and gritty road shoulders. I'm surprised because this wear literally appeared overnight.

Exposed cord on bike tire - replace?


wipers will only run on one speed

Question: Where is the wiper relay located on 1997 f150? My wipers only work on one speed. The windshield washer works well. I already replaced the switch, old switch handle was broke. The wipers still don't work. I can not locate the relay. I believe that would be the next step
Answer: Its located in the Power Distribution Box in the engine compartment, Relay position 3 in the image below
.
Comment: Is it possible to visually inspect a relay and see whether it is good or bad? like fuses? or we need to take them to an electronic shop?
Comment: Just replace it, they are fairly inexpensive.

wipers will only run on one speed


saving number of kerbals in ship

Question: Is there any way to save the number of kerbals along with a ship? I always forget that these get reset and launch with less kerbals than expected only to realize my mistake midlanding somewhere.
Comment: I haven't found a way to do this.  You just have to remember to do this before launch.
Comment: bummer. maybe someday this gets implemented.
Answer: There is no stock way, as of 0.23 to save which or how many Kerbals are assigned to each mission.

saving number of kerbals in ship


Intra-Schengen travel in April 2021

Question: Can I, as a citizen of Russia with a tourist Schengen visa, get to Paris (planning to travel further to Italy and Iceland) for a few days with a tourist purpose? I am in Greece on a legal basis, passed the prescribed 7-day quarantine.
Answer: Right now, the whole of mainland France is under lockdown. Crossing provincial borders (département) is only allowed for limited purposes and nobody is supposed to travel anywhere for leisure (that's irrespective of citizenship or status). Restaurants, museums, and many shops are also closed.
Since you are already in the Schengen area, most of the formal restrictions on travel from outside the EU do not apply to you and crossing the border is technically not forbidden in itself (after a PCR test) but after that you are supposed to stay put and tourism is not a valid reason to go out of your chosen place of residence.
France is also one of the worse affected countries in the EU so you would run the risk of additional restrictions on entry to Italy or Iceland being imposed while you are there.
Answer: In terms of visa, it shouldn't be an issue as long as the visa is valid (and ideally that the "main purpose" of your travel remains in the country which issued the visa), though expect passport/visa checks while travelling between Greece and France, contrary to normal Schengen rules.
However, in terms of the ever-changing Covid restrictions:

France is currently under lockdown. All bars, restaurants, museums, malls, non-essential shops, etc. are closed.

You are not allowed to travel within France.

You need to have a PCR test less than 72 hours old

You need to present a signed declaration

I believe Iceland is no longer under lockdown, but they do have a quarantine regime in place. Italy is in lockdown.
Basically, definitely not the right time to do sightseeing...

Intra-Schengen travel in April 2021


Auto-update security

Question: I've found this comment: Any reason not to allow automatic updating for an app? - is that safety feature documented anywhere ? I'm about to turn on automatic updates but I don't feel comfortable doing that without a firm proof that it won't compromise security.
Comment: I always turn it off, because I don't want all newer versions of all softwares be installed. And I don't want my data and power get consumed just for some none-sense-for-me updates (updates which fix bugs for another phone models than mine). Also I prefer to review list of updates available and decide by myself which one to update.
Comment: Plus there were reports that auto-updates also happen when on mobile data -- which may harm your data plan. I also prefer to run updates when *I* decide -- and then I'm either connected by Wifi, or run a single (urgent) update manually. BTW: The "manual update" in the screenshot you refer to *is* a security feature: That app had added new permission requirements. In such a case, no automatic update will take place.
Comment: @Izzy You can tell the play store to do auto updates only when connected to WiFi.
Comment: @Flow I know -- but as I wrote: "there were reports..." that this seems to have not always been honored. Maybe just rumors ;)
Comment: @Izzy - I think some of the Google apps may update even if you're on data, but I haven't experienced that sort of thing with any other apps. That may be what you've been hearing.
Comment: OK, let's drop that argument -- enough others remain valid ;)
Comment: Wow, I've been downvoted right away! :)
Answer: It's not documented somewhere. But only updates that don't change the permissions are done automatically. If there is a change, the update will have to be done manually.
But of course there is no gurantee that this will always work this way, because of bugs or design changes. If you are paranoid, turn the feature off. (But then, how could you trust Android that the permissions that are shown to you are enforced?)
Comment: Yeah, if you're going to start mistrusting Android, where do you stop? To be completely secure, throw away your phone and wrap yourself in tinfoil ;)
Comment: Those are good points, I tried it and I can see that permission escalation requires manual approval and yeah, either I trust Android or I can throw it away :)

Auto-update security


Average Nearest Neighbor for X points instead of 1 point

Question: Is there a tool similar to the Average Nearest Neighbor tool where instead of calculating the average for the closest point it calculates the average for the closest X points?
Answer: Yes, you should use the Generate Near Table tool.
Your in_feature is the points feature you want to analyze.
Your near_feature is the points feature close/surrounding the point to analyze.
You must specify how far you want to limit the near table.
As a result you will have a table with the distance values from the point you want to evaluate to the n  points that you are interested.
You can use any pivot table (excel works fine), or if you want more automated results you can use cursors to calculate the average distance.
Hope this helps.
Uncheck the box Find only closest feature (optional) then enter the number of features to find in Maximum number of closest matches (optional).

This will generate a table that has a NEAR_RANK attribute you can query to get the values you need.
Comment: Yes it did. Thank you! I added a few images to your answer of what I did.
Comment: Does this tool work for the same feature class? It looks like it only works for two different feature classes.
Comment: Never tryied for the same feature class. However, you can duplicate your fc and make one the in feature and the other one the 'near' one. Wil work great.
Comment: @TuckerChapman... did it work?
Answer: Sorry, but you are profoundly misunderstanding the tool/statistic. The nearest neighbor index (NNI) is a statistic for evaluating the spatial distribution of point observations, as to whether they are random or clustered.
This is one of the simplest indices in a family of statistics called Point Patten Analysis (PPA). The NNI tests the observed average neighbor distance against the expected and is not limited to a single neighbor, as you intimate.  In fact, the average neighbor distance is calculated from a matrix of all pair-wise distances.
The Nearest Neighbor Index is calculated as:
Nearest Neighbor Distance (observed) D(nn) = sum(min(Dij)/N)
Mean Random Distance (expected) D(e) = 0.5 SQRT(A/N)
Nearest Neighbor Index NNI = D(nn)/D(e)
Where; D=matrix of neighbor distances, A=Area, N=number of observations`

Comment: I understand that but what I was wondering is if there is a tool that can calculate the "group-wise" distance for every point finding the minimal distance required for X points from a point and averaging that instead of 1 point and its closest neighbor (for each point).
Comment: To what end? In this instance, the expected would be incorrect and yield an erroneous result. It sounds like you are describing the Ripley's-K statistic that calculates clustering a specified spatial (distance) lags. I believe that this statistic is available in ArcGIS under the spatial statistics toolbox "Multi-Distance Spatial Cluster Analysis " tool. Unfortunately, the commonly applied statistic, Besag's-L (standardizes the expected of K to zero, making it considerably more interpretable), is not available in ArcGIS and there is no simulation envelope to indicate statistical significance.
Comment: I would also add that if your spatial process is inhomogeneous, as many are, then statistics based on kNN can be very misleading, particularly if spatial lags are introduced. Please delve into the primary literature, which is quite voluminous, on point pattern analysis and quantifying spatial process. There has been considerable progress, in spatial statistics, using intensity to normalize inhomogeneity and nonstationarity in spatial random fields.
Comment: I am trying to calculate values for the search radius in the Empirical Bayesian Kriging tool.  According to [this post](https://geonet.esri.com/thread/160052) the Geostatistical Wizard sets it to search for at least 32 neighbors.  I want to try different values and was wondering if there was a tool to calculate those distances for N neighbors instead of 1.


When and how to use 来る 【きたる】

Question: Of course 来る is most often read as くる.  However, it can also be read as きたる.  Is きたる mostly an archaic reading?  Does it carry a different, or any additional meanings??  When are "appropriate" (socially, grammatically, etc.) times to use it?
Comment: Etymologically, it's くる plus the past/perfect auxiliary 〜たる. As for its use, it is indeed literary, but its precise meaning is unclear to me, so I'll let someone else answer.
Comment: Archaic? I don't remember the sentence, but it was used a couple of weeks ago on a huge banner in front of Tohoku University…  Something like "明日が来る" with the furiganas.
Comment: @Axioplase - was it「あすがきたる」or 「みょうにちがきたる」?
Comment: I don't remember, it might even have been 将来… I'll try to find the original banner.
Answer: Basically, it is literary (and archaic), but there are some situations when it is still appropriate to use it in a modern context.

In the sense of "the coming [time or event]" e.g. 来【きた】る土曜日 = "the coming Saturday"
Related to the above, in the form 来【きた】るべき, meaning "the coming [thing]", "the [thing] that is sure to come", e.g. the title of Tezuka Osamu's manga "来【きた】るべき世界", translated as "Next World" in English I believe
In the imperative form, as an invitation. For example, junior high and high school clubs often promote themselves at the start of the year with signs saying things like "来【き】たれ!野球部" or whatever. This is not an order but an attempt to entice people to come and check the club out.
In set phrases like "来【きた】る者拒まず", which means that anyone who comes will be accepted (often paired with "去る者追わず", "... and anyone who leaves will not be pursued")

Outside of these usages, it has a literary flavor, sort of like "is come" or "cometh" (rather than "has come") in modern English.
Incidentally, I learned that although it looks like 来る + past/perfect aux. たる, it is actually a separate word derived from 来る + 至る; I just checked the 広辞苑 and 日本国語大辞典, and they agree with this (although obviously, sometimes the word きたる will in fact be 来る + たる). Special bonus trivia: the 来る + 至る /kitaru/ got its big break in the world of kanbun 漢文, as a pinch hitter for 来(る). (And it is true that the character 来 is generally rendered /kitaru/ in kanbun.) I can't find a reliable source for why kanbun kundoku doesn't just use /ku(ru)/, but some (e.g. fontomanie at Chiebukuro) suggest that it was because /ku(ru)/ didn't have enough syllables for convenient okurigana affixation (cf /nasu/ instead of /su(ru)/ for 為).
So, the specific literary flavor is that of kanbun or heavily Chinese-influenced Japanese, not "pure" classical Japanese.
Comment: Gah, I should have checked the dictionary first. Interesting. I was also going to remark that, as far as I know, くべき does not occur, くるべき sounds a bit off, and it's usually きたるべき.
Comment: Yeah, it totally seems like it should be that other /taru/... I'm pretty sure I made that exact same mistake once, although apparently not online. About combining /kuru/ with /beki/, probably the terms of reference need a-narrowing. くるべき is apparently OK in modern colloquial Japanese (no doubt only sounds off to us frustrated classicists); does some formal authority proscribe it? Also, you can find くべき in the Kokinshu (e.g. こゑたえずなけやうぐひすひととせにふたたびとだにくべき春かは) + Genji (e.g. ここに来べきよし、忍びて言へ), which actually makes sense if きたる, being 漢文ish, was generally avoided in waka/monogatari-type stuff.
Comment: Haha, I'm no classicist. Just an amateur linguist. To clarify my comments: While くるべき does sound a bit off, it's not as unnatural-sounding to me as くべき (in modern Japanese). すべき is fine though, and するべき is not all too disagreeable either.

When and how to use 来る 【きたる】


QGIS Line Subdivide by distance

Question: I know in QGIS you can subdivide a line, but is there a way you can type in a distance and the line will split according to this, with the last segment being smaller in length? If not I will try to script this in Python.
Answer: If you write split in the Processing toolbox you will find a tool under GRASS named v.split.length:

Which will give you the option to define the desired distance to split the line:
Comment: Thanks. I didn't have the latest version so I installed and now I see it. Works great.
Comment: You are welcome. I am glad it worked :)

QGIS Line Subdivide by distance


Leaflet: Different custom information popups for each GeoJSON polygon

Question: I'm really new to this and I'm trying to create popups for 2 polygons which will each contain a paragraph of written information.
The function I have so far differentiates between the 2 polygons by the property 'NUMBER' (numbered 1 and 2)is:
<code>    function onPolygonClick(e) {

            if (feature.properties.NUMBER = 1) {
                    geojson.bindPopup("<this is some writing>");

            } else if (feature.properties.NUMBER = 2) {
                    geojson.bindPopup("<this is some more writing>");
            }
        }
</code>
I have this function tied to a click in a separate function:
<code>        function setEvents(feature, layer) {
            layer.on({
                mouseover: highlightFeature,
                mouseout: resetHighlight,
                click: onPolygonClick
            });
        }
</code>
Which is then put into the GeoJSON:
<code>            // load the geojson data, style it, set events and add to map
            geojson = L.geoJson(data, {
                        style: style,
                        onEachFeature: setEvents,
                    }).addTo(map);
</code>
However the popup is not working. What should I do differently?
Comment: Most likely from conditional inside onPolygonClick. Try to find our what inside e / console.log(e) and adjust your if clause accordingly. Feature.properties must be somewhere in your data
Answer: You need to bind the popup to each feature, setting the text then.  You are trying to bind it to the geojson object, rather than the individual feature that you clicked.  Move the bind function into the eachFeature function and reference only the curent feature instead of the entire geojson object:
<code>function setEvents(feature, layer) {

    if (feature.properties.NUMBER = 1) {
        var blurb = "<this is some writing>";

    } else if (feature.properties.NUMBER = 2) {
        var blurb = "<this is some more writing>";
    }

    layer.bindPopup(blurb)

    layer.on({
        mouseover: highlightFeature,
        mouseout: resetHighlight,
        click: openPopup()
    });
}
</code>


How to fix the connection error for cameras in Valve Index?

Question: I'm trying to turn on the cameras in the Valve Index headset but the camera test says there's a communication error. All the options in the SteamVR indicate that it should be on and working. Device Manager shows a camera device and it does not look like it's missing drivers or has any issues. What else can I do?
Answer: Aside from turning it on inside SteamVR menus, you may have to enable access to your camera through Windows 10 system settings menu:

To find this setting page just type "camera" after opening the Start menu and you should get a link to it. Flip the toggle button to On in the "Allow apps to access your camera" section. This should be enough. Because SteamVR is not a Microsoft Store app, it doesn't look like it will be listed in a list of per-app permission toggles below. Flipping just the one switch on top helped me turn on the cameras.


Shelf-Stable Milk is it still good

Question: Our shelf-stable milk was left in a hot car of over 100 degrees for many days.  it has not been opened.  Would it still be good for use ?  I have not opened any of the cartons and I will just throw them away if it may not be good to still drink.
Comment: Have you thought about opening a carton and do a sniff test?
Comment: One way to tell is by bloating. If there is (or was when you took them out) any expansion to the cartons *at all* then it is definitely off.
Answer: As I understand it, as long as your milk is in the sealed, original packaging, it is still safe.   In fact, the flavor might be ok, depending on the length of time at that storage temperature. These authors studied the effect of storage temperature on the quality of UHT milk.
They state:

For UHT milk stored at 30 and 37 °C a deviating taste was generally detected from storage weeks 24–32. For all storage temperatures, the deviating taste was described as sweet, cardboard, creamy or watery. Additionally, for UHT milk stored at 30 and 37 °C, the deviating taste was described as acidic or caramel.

Their highest test temperature ws 37C (just about 100F). From the paper, I would assume that higher temps speed the flavor change.  However, they were also storing for a year, not "many days."  In fact, they didn't notice a flavor change until week 24!
If it were me, I would chill one down, and give it a taste to see if I liked it.
Answer: I would throw it out. While UHT (Ultra-High-Temperature) Pasteurization is a great way to extend the shelf-life of milk and is packaged in a sterile environment in sterile packaging, it doesn't guarantee sterility, so it is not safe to consume the milk.
In addition, the high temperatures will most likely have altered the flavour and texture of the product, which might well make it unpalatable even if it were safe.

Shelf-Stable Milk is it still good


How to use Fingerprint reader in Ubuntu 19.10

Question: I am using Ubuntu 19.10 in Asus X510UN. Using the lsusb command I can't find Fingerprint Device, and it's even showing no device found in fprintd-enroll.
I have built-in fingerprint reader in my touchpad.
Answer: Is your device on this list? https://fprint.freedesktop.org/supported-devices.html
I see a lot of elantech devices on the list that are fprintd-enroll supported.
Other options instead of fprint look like fingerprint-gui https://launchpad.net/~fingerprint/+archive/ubuntu/fingerprint-gui
Which supports these devices:
https://fprint.freedesktop.org/supported-devices.html
Or thinkfinger which is only think pads:
http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader#Software_support
I have a Lenovo L380 and am still looking for a package that supports my Synaptics fingerprint reader. I'm kind of a newbie myself so I'm still learning things but that is where I would start looking.
Comment: If you can get lsusb to list your fingerprint you may be able to add a driver request to  fdprint here: https://gitlab.freedesktop.org/libfprint/libfprint/issues?label_name=Driver+Request
Comment: My Ubuntu not Even Showing that there is fingerprint reader in my Laptop... When i use lsusb in terminal it only shows about USB and other devices but Not Fingerprint.
Comment: Broadcom fingerprint readers (e.g. used in some Dell laptops, such as Latitude 7300) don't seem to be well supported yet by fprint. I filed another request there: https://gitlab.freedesktop.org/libfprint/libfprint/issues/221
Answer: My Ubuntu not Even Showing that there is fingerprint reader in my Laptop... When i use lsusb in terminal it only shows about USB and other devices but Not Fingerprint.
Answer: As Lucas suggests, check if your device is supported.
If not, it might be under development at the fprintd project.
You kernel might not show a fingerprint device, you could try a newer kernel to see if there is a difference.
To identify your device, check for any device ID in the lsusb output that has no name behind it.
Mine shows:
Bus 001 Device 003: ID 27c6:538c Shenzhen Goodix Technology Co.,Ltd. Fingerprint Reader
It's showing the device but it does't work in fprintd-enroll either because no driver is loaded.
If your device starts with 27c6 it's likely a Goodix too.
Check with that at the project page if a driver might be under development:
https://gitlab.freedesktop.org/libfprint/libfprint/issues?scope=all&utf8=%E2%9C%93&state=opened&search=27c6
and if possible try to help out in any way.
With a bit of luck a driver may be coming from Dell, but that's not certain.
A Goodix device is apparently in the Dell Precision 5530 and they support Linux on it, but it might be the model without that ( like in previous versions).
This suggests:
https://certification.ubuntu.com/catalog/component/27c6:538c
for example for this one:
https://certification.ubuntu.com/hardware/201807-26295
that the mentioned fingerprint reader is supported by the 4.15 oem kernel.
You could try to build it from:
https://code.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/bionic/+ref/oem
or add the Dell repo to find the Dell shipped oem kernel.
I hope that helps!
Answer: Update 2020
If you need an official package, Upgrade to ubuntu 20.10, Fingerprint is now supported in the latest version
Here


Implications of Brexit Political Declaration

Question: There is some debate as to whether or not the UK has a mandatory obligation to apply EU rules in Domestic activites beyond 2020, irrespective of what Brexit (Trade) Deal is negotiated. The Political Declaration is non-binding, but the (binding) Withdrawl Agreement says that the former must be respected using the 'best endeavours'. But there is another qualifier saying that 'the negotiating positions may evolve', and therefore surely this does not at all constrain things in any manner? Or does 'evolve' have a one-sided interpretation, i.e. evolve towards (but not away from) alignment with EU frameworks?
Comment: I think the debate to which you're referring is to whether this obligation should be part of the trade deal being negotiated, not whether it's an obligation under the withdrawal agreement (as the answerer below has said, it isn't).
Answer: The UK is under no obligation to apply EU rules beyond the end of the transition period. If no deal is agreed, none of the EU treaties and laws must be upheld.
Parliament incorporated most EU law into UK law, so a change in the law would require Parliamentary approval.
The Political declaration states the intent to produce "a ambitious, wide-ranging and balanced
economic partnership. This partnership will be comprehensive, encompassing a Free Trade
Agreement".  But the declaration is a list of hopes and desires. It expresses intent, but doesn't bind the UK or EU to any particular set of rules after the end of the Transition period.  If no deal is in place, and no extension to the transition period is agreed, then the EU and UK will trade on WTO rules, and many will judge the negotiations to have failed.
There is nothing in the Political Declaration or the Withdrawl agreement that requires the UK to apply EU rules after the end of the transition period.
Comment: "...we will judge the negotiations to have failed", I think a more accurate statement here would be that '**many** we will judge the negotiations to have failed'. There are good number of people who judge the negotiations as a farce to begin with and/or completely missing the point, or the result, of the referendum. Some regard the negotiations as a conspiracy or even a complete betrayal. For these vocal types, leaving on No Deal cannot be judged as a 'failure'. In some ways, depending on their perspective, quite the opposite.
Comment: I think "many" is a better than what I wrote.


Update from my Windows side?

Question: I wanted to know if it is possible to update Ubuntu from my the Windows side of my computer (I dual boot). The Ubuntu side is a WUBI install. The reason is I accidentally deleted the wireless driver for my Broadcom wireless card thinking I was replacing it. As I had no ethernet driver installed, I currently have no access to the internet from my Ubuntu side. I am relatively new to Linux so please don't be too hard on me haha. I just really want to upgrade to 12.10 so, hopefully, this problem can be resolved in the update. Thank you for your help in advance.
Comment: How exactly did you delete the driver? The driver itself is a kernel module - I can't think of a way to delete it rather than physically removing the file from `/etc/modules/(version)/kernel/drivers/net/ethernet/broadcom` or maybe from `/etc/modules/(version)/kernel/drivers/net/wireless/b43`. In this case you'll need to obtain the file and put it where it was before.
Answer: If you deleted the driver by uninstalling a package, and you know the name of the package, you can download and install the .deb file manually. Just go to  http://packages.ubuntu.com/, enter the name of the package and the distribution ("precise" in your case). The actual .deb file can be downloaded after you click on the name of the package in the search results, the scroll to the bottom and select architecture, and then select a mirror to download from - the interface is a bit confusing but its doable.
Then move the .deb file to your Ubuntu and install it using
sudo dpkg -i package_name.deb

if you deleted the driver by physically deleting some files, and you remember the names of the files, you can find which packages contain those files using "Search the contents of packages" form on that page.
Additionally, the package you need may already be in the /var/cache/apt/archives so you don't even need to download it.
Answer: YES and NO.
There is no really simple way to find the right driver, download it (using windows), and then install it on your WUBI install.
It can be done, but someone would need to step you through each step ..

A simpler solution would be for you to use Windows to download the 12.10 ISO file, copy it to your WUBI install, and then create a boot USB (or DVD) using WUBI.
Then install 12.10 alongside Windows. This would still leave your WUBI install, which could be removed later.
Answer: I think it would be better if you install 12.10 from scratch. To backup your current files you can access your wubi installation from an Ubuntu Live CD.

Boot into the OS press Ctrl + Alt + T to open a terminal.
Your windows drive should be mounted already, you can find it in /media. This command will mount the wubi virtual disk into /mnt. Change win with the name of your Windows drive.
sudo mount -o loop /media/win/ubuntu/disks/root.disk /mnt
Open Nautilus, press Ctrl + L to show the path bar and type "/mnt" to see your files.
Now you can start copy/pasting into your Windows drive so you can restore it later. Most of your stuff would probably be under home.
Uninstall old wubi from Windows and install new one.

Update from my Windows side?


A lot of pipelines on Vulkan for each render pass, what could go wrong?

Question: I would like to represent creation for each 2D shape or bitmap effect as a pipeline. The only purpose of this to modularize algorithms because extendibility is a big deal for current project. However, is there any drawback for using that kind of strategy? If it's too risky (in term of performance and stability), then any other alternatives?
Answer: Binding a Graphics Pipeline in Vulkan is considered to be an expensive operation. So performance can be an issue if a program wants to bind many pipelines for each frame. Binding hundreds or even a few thousand pipelines per a frame is reasonable, a high end system could support up into the tens of thousands (good luck getting anything else done though).
Alternatives:
Vulkan allows some parts of the pipeline to be dynamic, the list of what can be dynamic was recently extended as well. Using dynamic pipelines is less efficient then using a "non" dynamic pipes, but much more efficient then constantly binding many different pipelines.
Even if there are only a few pipelines per a frame, a program can still get into trouble by constantly switching between pipelines. So, combine draw calls on a per pipe basis, meaning bind a pipe, do all the draws for that pipe, bind the next pipe, etc.
Finding ways to merge shaders is probably the best way to reduce the number of pipelines. The extreme on this is the so called uber shader where virtually all the shaders are merged into a single shader. Just merging groups of similar shaders can greatly reduce the number of pipelines though and is usually fairly easy to do.
There is a little hand waving for this next one, but I have seen some programs with hardcoded descriptor values inside shaders which causes pipeline count to explode, just switching to multiple descriptor sets helps resolve this. This creates a system where a pipeline is bound, then each draw for that pipeline binds a descriptor set. (often there is a single descriptor set that has all the generic info in it, and a per draw set that has per draw specific info) This has its own drawbacks but is better then many graphics pipelines.
Comment: Isn't there a Vulkan equivalent of Nvidia bindless stuff? https://www.nvidia.com/en-us/drivers/bindless-graphics/ ; https://www.khronos.org/opengl/wiki/Bindless_Texture
Comment: Apparently there is https://wickedengine.net/2021/04/06/bindless-descriptors/ but I haven't used it myself, so can't comment in any depth.
Comment: Bindless has good support in Vulkan, combined with Vulkans memory management, compute shaders, and draw indirect a massive number of objects can be pushed through a pipeline.


Separating videos from photos in Lightroom

Question: I've got about 700 videos in lightroom, and I want them to be separate so I can work on them with a totally separate workflow. I was thinking about removing all the videos from my photo folders and just dealing with them in premiere but when I took the video I also took photos and so the videos are kind of 'in context' in the photo library. Any suggestions about workflow for dealing with this situation? Is there a reason why videos are able to be imported into Lightroom, when my perception of it is that it is photography software?
Comment: I don't know the answer to the question, but I think you've answered exactly the part about why they're able to be imported when you say _"he videos are kind of 'in context' in the photo library"_. It sounds like you don't want to lose that — is the question really how to _keep_ that but keep it useful in your workflow?
Answer: If you just want to filter down to your video files in Lightroom, create a smart collection and specify the collection is for files with Media Type = Video. [Or in Lightroom Classic: File Type = Video].
Lightroom 4 added some basic video processing features, so Lightroom can process video files, not just still images.
Comment: **2022 Update:** In Lightroom Classic, it's File Type = Video.
Comment: @cb4. Thanks edited it in.
Answer: I can suggest a solution for moving videos to another folder.
I used exiftool. It's free and cross-platform (including Linux). However it's command line and can take some mental work to figure out.
Something like this below would import video files (based on the file extension) from F:\MyMess and move them into a directory structure à la Lightroom (YYYY\MM\DD), under F:\MyVideos
cd F:\MyVideos
exiftool.exe -CreateDate -DateTimeOriginal -r -m -d %Y/%m/%d "-Directory<DateTimeOriginal" "-Directory<CreateDate"  -ext MP4 -ext AVI -ext MOV -ext MPEG "F:\MyMess"

Source (and more tricks).
Answer: 2022 Lightroom Classic

Create a smart collection of all your video files with File Type = Video.
Right-click the smart collection and export it as a catalog to another folder (or drive) with enough space.
LrC copies all of the video files to the destination in the exact same folder hierarchy as they exist in your current catalog.
Use the new catalog when you want to work on your videos.

One (good) caveat: My catalog was not 100% in sync with the file system. This being the first time I tried this procedure, I wanted to make sure it was accurate. Checked the file system against my catalog and found different counts. Turns out I had duplicate videos in the file system!