The equivalent of cmd "for" in bash?

Question: I only know little about bash (or any Linux shell - but I just use bash). I'm used to using for %c in (*.*) do {something} in cmd in Windows, and I really feel inconvenient without it. I tried wine cmd, but it wouldn't interpret Linux commands (which I need for the {something}) at all, which is not I want. Any help?
In Windows, for %c in (*.*) do {something} runs {something} once per file (ignoring directories). {something} can refer to %c for the current iteration's file name; other modifiers allow the file's path to be extracted, or the file's name without its path, the file's extension, attributes, modification date/time, size... for /d %c in (*.*) ... will process directories instead of files. In both cases *.* is equivalent to * in Unix-style systems, it matches all non-hidden files or directories, even those with no . in their name.
P.S. I know that the cmd "for" has many usages which may not be covered in one command in bash, but I just want to know the equivalent of the command mentioned above.
Answer: for file in *; do
  echo "$file"
done

This usually does not match "hidden" files (names beginning with a dot) though.
For matching the hidden files, too, you need this before:
shopt -s dotglob

If you want to skip directories (and probably anything "strange") then you have to detect them in the loop; pattern matching (the *) doesn't care about the type of object:
for file in *; do
  test -f "$file" || continue
  echo "$file"
done

Symbolic links are a special case. They are considered if they link to a file but the file may be in another directory. To ignore symlinks:
for file in *; do
  test -f "$file" || continue
  test -L "$file" && continue
  echo "$file"
done

Answer: The pattern matching behavior you describe is - according to this technet blog - a grandfathered bug:

...you'll also discover that *.* is the same as * by itself.
In addition ... if you typed DIR .TXT, the command prompt acted as if you had typed DIR *.TXT... This behavior was probably ... not intentional, but it was an accident that some people came to rely upon. When we fixed the bug in Windows 95, more than one person complained that their DIR .TXT command wasn't working.
The FCB matching algorithm was abandoned during the transition to Win32 since it didn't work with long file names. Long file names can contain multiple dots, and of course files can be longer than eleven characters, and there can be more than eight characters before the dot. But some quirks of the FCB matching algorithm persist into Win32 because they have become idiom.
For example, if your pattern ends in .*, the .* is ignored. Without this rule, the pattern *.* would match only files that contained a dot, which would break probably 90% of all the batch files on the planet, as well as everybody's muscle memory, since everybody running Windows NT 3.1 grew up in a world where *.* meant all files.
As another example, a pattern that ends in a dot doesn't actually match files which end in a dot; it matches files with no extension. And a question mark can match zero characters if it comes immediately before a dot.

This may not differ too terribly from the origin of the Unix precedent for dot files, as Rob Pike notes in his blog:

Long ago, as the design of the Unix file system was being worked out, the entries . and .. appeared, to make navigation easier. I'm not sure but I believe .. went in during the Version 2 rewrite, when the file system became hierarchical (it had a very different structure early on).  When one typed ls, however, these files appeared, so either Ken or Dennis added a simple test to the program. It was in assembler then, but the code in question was equivalent to something like this:
if (name[0] == '.') continue;

This statement was a little shorter than what it should have been, which is
if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue;

...but hey, it was easy...
I'm pretty sure the concept of a hidden file was an unintended consequence. It was certainly a mistake.
(For those who object that dot files serve a purpose, I don't dispute that but counter that it's the files that serve the purpose, not the convention for their names. They could just as easily be in $HOME/cfg or $HOME/lib, which is what we did in Plan 9, which had no dot files. Lessons can be learned.)

Since then, though, the . dot files came to be associated with the standard shell . utility, and from there just with user-specific plain-text configuration files.
You won't typically find dot files anywhere but a user's ~ because that is really the only place they would make sense - a user shouldn't be keeping any of their files anywhere else in the filesystem, anyway. When working on files in one's home directory it would be unfortunate if a user were to accidentally remove some or all of their configuration files - but it would be even more unfortunate if - when in ~ or any other directory - a loop were to unintentionally affect . - the current directory - or (worse still) .. - the parent directory. POSIX has this to say about .:

If a filename begins with a period ., the period shall be explicitly matched by using a period as the first character of the pattern or immediately following a /slash character. The leading period shall not be matched by:

The *asterisk or ?question-mark special characters

A [bracket] expression containing a non-matching list, such as [!a], a range expression, such as "[%-0]", or a character class expression, such as [[:punct:]]

It is unspecified whether an explicit period in a bracket expression matching list, such as [.abc], can match a leading period in a filename.

Still, though, it is possible to loop over all files in the current directory - dot files or not - in a single loop simply enough. For example:
set -- .* *
while until [ -f "$1" ] ||
            [ -z "$1" ] &&
            break "$((!$#+1))"
      do    shift;   done
do    printf %s\\n  "$1"
      shift
done

The above prints all regular files in the current directory in dash, bash, ksh, zsh, mksh, posh, and yash. It is even more akin to the Windows FOR loop than is the typical shell for in that this doesn't set any permanent shell variables - just like a cmd FOR it processes its arguments and when it is through with them their names no longer hold any value. In a typical shell for the last value in $var in for var in ... remains.
It doesn't have to be like that:
set -- .* * ''
while [ -n "$1" ]  || ! shift
do    [ -f "$1" ]  &&
      set -- "$@" "$1"
      shift
done
printf %s\\n "$@"

...accomplishes the same goal just as portably - printing all regular files in the current directory - but it loops over the arguments once first and prunes those which are not regular files. The advantage, though, is that afterward the shell's arg "$@" array still holds the whole list, and from that point on you can do:
for f do : something w/ "$f"; done

...as many times as you please on the same array. But you also get the count in "$#" and all args concatenated into a single string in "$*" and each addressable singly in sorted order in "$1" ... "${10}" and so on.
Those are typically not the kind of things you can do w/ Win32 cmd.
Answer: if you interesting in for loop learning
syntax -
for i in $(command with iterable elements); do command $i; done

like -
for i in $(echo 1 2 3 4 5); do echo $i; done

if you interesting in search command -
find . -name "*"

with depth level -
find . -maxdepth 1 -name "*"
find . -maxdepth 2 -name "*"

maybe it more useful for you
Comment: A couple of points: i) `for i in $()` is rarely a good idea (it breaks on whitespace), `command | while read` is generally safer ii) `find . -name "*"` is unnecessary, it is the same as `find` alone which expands to `find . -name "*"`.
Comment: @terdon - it doesn't break on whitespace - it breaks on `$IFS`. You can do it safely - and well - but you have to be very sure about *what* you're doing. I don't this answer demonstrates that at all.

The equivalent of cmd "for" in bash?


What are the activation functions that can be generated using op-amps and filters?

Question: There are varies activation functions in neural networks such as reLU, sigmoid and etc. I figured out that reLU function can be generated using simple diode circuit. What are the other activation functions that can be generated using basic electronic items such as op-ams, bjts, diodes, filters and etc? If there are any, how to do it?
These are some of the activation functions.
Comment: What is an activation function?
Comment: Please list the mathematical transfer function for these neural network functions.
Comment: "and etc" doesn't give us much to help you with. Need more details and clarity.
Comment: We are lacking a lot of information about what you are trying to do here, could you at least post a full schematic. I say full because the other day somebody posted a tiny section of the schematic without elaborating further.
Comment: I basically want to generate above function using a circuit which uses op-amps, diodes, bjts and fets. Is there any cretain circuit designs that can generate those functions?
Comment: @Hearth I believe this is in the context of neurons. The activation function is the relationship between the output potential of a neuron, and the weighted sum of its inputs.
Answer: The primary purpose of an activation function in an artificial neural network (ANN) is to create a non-linearity between layers. A purely linear combination of layers of weights and values can be mathematically reduced to a single layer (i.e. a single multiply-accumulate function -- the proof of this is simple enough and "left as an exercise for the reader") and thus without an intentional non-linear function it loses all the complexity that the multi-layer topology can provide. The activation function forces in a non-linearity, giving the neural network actual depth.
The only requirement for a usable activation function is that it be differentiable, so that back-propagation can be performed in training. This is partly why the "rectified linear unit" (ReLU) is so popular -- the slope is either 1 if x>0 or 0 otherwise (with the x=0 case arbitrarily assigned to zero) so it's really easy and fast to use in practice.
With that in mind, in theory any non-linear electrical device can compute an activation function. But none of them will be an exact match to the mathematical functions you've asked about. A transistor moving from linear to saturation region will look a lot like a tanh or sigmoid, but is not identical. A diode will not conduct at 0 V but rather at somewhere between 0.3 and 0.7 V, making it an imperfect ReLU. A comparator can be used to calculate which signal is the maximum, and that can be fed into a multiplexer to pass the actual signal through, making a maxout, but the multiplexer will drop some voltage and the comparator will only work in its input range. All real world devices have their limits. Even the humble resistor is non-linear if you push it out of its happy range. No electronic device you can design will ever produce a mathematically "pure" output.
Computing feed-forward in analog is the easy part, though. Training the ANN is the real challenge. To train your circuit, you will need to build circuitry which computes the derivative of each layer including its activation function, and which can update the multiplier weights on the fly. But if you can do that, then any non-linear electrical device will theoretically work as an activation function.
Comment: +1 The last paragraph is especially important. These nonlinearities are worthless without being able to tune them in the training process
Answer: I'm not sure how useful any of this will be, because all these suggestions only approximate those functions, to varying degrees, but here goes.
The simplest \$tanh\$ implementation I can think of, is a couple of anti-parallel diodes, that clamp the output close to 0V with an exponential "twist". Because the clamp voltage is 0.6V or so, optionally you can scale that output to ±1V or so with a simple non-inverting amplifier:

simulate this circuit – Schematic created using CircuitLab

For better control of the steepness of the central slope, you can move those diodes into the feedback loop of an inverting amplifier configuration, but use an additional resistor (R2 in the circuit below) to determine gain prior to the diodes taking over. The plots are with R2 set to 1kΩ (blue), 2kΩ (orange), and 5kΩ (tan):

simulate this circuit

Of course, you can invert and scale any signal with an inverting amplifier stage. Optionally, you can use that configuration as a summing amplifier, and offset the signal up or down. Here I take the output of the previous circuit (blue below), apply a gain of −0.9, and shift the whole thing upwards, to be centered around +0.5V (orange below), to obtain something approximating the sigmoid:

simulate this circuit

The ELU function is trivially simple to approximate. A diode clamp consisting of however many diodes you need for the negative limit. Each diode contributes −0.6V:

simulate this circuit

The ReLU function is exactly what you get from an active rectifier, but take care to take the output from the correct point:

simulate this circuit

The name "Leaky" ReLU is exactly what it say, all we need to do is add a leak (a current path from IN to OUT, via R1 below) to the active rectifier:

simulate this circuit

The "Maxout" function I am not sure about. I'll give it some thought.
Comment: Excellent answer!
Answer: Log / antilog type functions can be constructed from op-amps plus junction devices including transistors and diodes. They exploit the exponential I vs. V characteristics of their 'knee' area. (Search 'logarithmic amplifiers' for examples.)
More here: Sigmoid using op-amps
I think a sigmoid could also be approximated by using a FET pair, as suggested here:
https://www.reddit.com/r/AskElectronics/comments/217j2u/how_can_you_create_an_analog_sigmoid_voltage/
That said, making an arbitrary analog activation function seems to have a lot in common with gamma correction used for LCD panels. The LCD column drivers use an array of DACs to control a piecewise-linear mapping to implement a panel-optimized gamma transfer curve.
This same PWL approach could approximate the tanh, sigmoid or just about any other continuous curve function, not to mention ReLU and others.
More here: https://www.intechopen.com/chapters/11273
This paper is from 2009; the PWL + DAC driver technique is commonplace in panels now.
Comment: Great answer and great links. This also addresses the "easily computable derivative" problem that other activation functions face. A piecewise linear function's derivatives are just a lookup table; the true derivatives of the underlying functions are far slower to use in practice.


Does the GDPR's "right to be forgotten" extend to Google's search results?

Question: I have recently "googled" my own full name and found out that some comments I made during my teens have been indexed by Google. Back then I have used my full name as a user-name on that website. I have deleted those comments from the indexed website successfully and they have now disappeared from the website entirely. However, they still show up on google searches, although if one accesses that website, none of my entries are there anymore, so the way I see it, the website did its job and respected my right to be forgotten.
I wonder if the indexed entry will ever disappear from Google now. This is very concerning for me as I feel that my right to be forgotten is blatantly violated as that Google search entry is still there, even though that entry does not exist anymore.
Comment: Have you looked at [google's page on this with instructions](https://support.google.com/legal/answer/10769224)
Comment: I'm voting to close this question because it is not a legal question.
Comment: edited the headline question to make it explicitly a legal question
Comment: This is not a legal question. The question could be "Could I force Google to delete...?"
Answer: Yes. The GDPR's right to be forgotten is even modeled after case law that was developed around Google search results. Thus, you may have a right – depending on your individual circumstances – to order Google to stop showing search results in Europe, where those results relate to you.
Note that this only affects search results in Europe, not searches from other regions. (See CJEU case C-131/12)
In your particular case, there's nothing to do but to wait. Google regularly checks and updates the pages that it has crawled and indexed. This can easily take multiple weeks. But once Google sees that the page no longer contains the information in question, the information will no longer appear in search results. Any process you'd try to accelerate this will probably take longer than just waiting.
Other sites may be keeping archives of the old version of the page, e.g. the Wayback Machine (https://web.archive.org) or https://archive.is. These will not typically be deleted automatically, and due to the way how these sites operate they might not be subject to GDPR.

Details on the RTBF:

The GDPR enshrines a Right to Erasure / RTBF in Art 17.

This right only applies under certain circumstances, for example if the personal data was collected based on a "legitimate interest" and you successfully "objected" to further processing. Such an objection would have to override the legitimate interests, and depends on your particular situation – why you want this data to be gone. Sometimes, there might be very good reason to keep the information, for example politicians should not be able to use this mechanism to censor reports of past misconduct.

More relevant in this context is Art 17(3): when the website on which the information was published fulfilled your request to erasure, then,

taking account of available technology and the cost of implementation, [it] shall take reasonable steps, including technical measures, to inform [other] controllers which are processing the personal data that the data subject has requested the erasure by such controllers of any links to, or copy or replication of, those personal data.

This is legalese for: if someone removed personal data from their public website, they're supposed to tell Google that the information is gone and should be deleted from Google's indexes. This is possible e.g. by providing a sitemap.xml with accurate last-modified times, or by providing appropriate HTTP status codes like "410 Gone" when an entire URL is deleted.


Percentage of open access publication for a given researcher

Question: I am looking for a program, user script, API, or web tool that can indicate, for a given researcher, what percentage of their publication is open access.
Answer: A free option would be ImpactStory. Here is an example of a person with 100% OA articles.
Other than that, commercial databases such as Web of Science or Scopus contain such data.
This screenshot shows an example of an Author Profile search whereby in the left-handside menu you see the option to refine your search to 'Open Access' publications. One can also download these data as CSV files:
Comment: Franck. did that help you?


Modifying one end of a spiral/curve

Question: I have created a spiral using the "Add curve" function and want to taper just one end of it (kind of like extruding and narrowing). Is there a way to do this? If not, what would be the best way create a spiral that enables the modification of its ends. Thanks.
Answer: You may do it using a curve as a Taper Object's target to change the thickness along the spiral's axis. You can then change its width using the curve's specials menu.

After creating a curve add a Bezier Circle and set it as a target in the Bevel Object window (Curve Data header).

Add a Bezier Curve and edit it in Edit Mode so it's straight and placed vertical.

Select the spiral in Object Mode and set the newly added Bezier Curve as a Taper Object target.

Modify the newly added curve to change the thickness along the spiral's axis. Experiment with it for different results.

Finally select the spiral in Object Mode, press W-->Width Size and drag the cursor away to change its width.
Answer: Every curve point has a radius value that will adjust the bevel radius and can be found in the properties region.

You can use ⎇ AltS to adjust the radius value and combined with proportional editing you can get a gradual falloff from the active point.

Modifying one end of a spiral/curve


Who owns the patent on the statue of liberty?

Question: I am aware that A. BARTHOLDI is the original owner of the patent.  I heard a rumor that the current owner is Donald Trump.  I would like to know if this is true.
Comment: I can't tell if this is a clever joke. If it is, it is off topic. If it is serious, then no one owns a patent on the Statue of Liberty.
Comment: @EricShain I was skeptical at first too. But on some reflection, I think that if a person did not understand design patent expiry, it could actually be a legitimate question.
Comment: I have however removed "current" from the title, since I can't see how there could be any current patent on the statue of liberty: it is pretty public prior art.
Comment: I know this question is old. Normally after a patent owner dies, an estate comes into existance, that takes control of all property rights and responsibilities that was controlled by the person before their death. Bartholdi's wife was the estate, but since they had no children, after her death the town where he maintained his family's home became his estate, specially since they turned his family home into a museum, showcasing his preparatory models for his statues. Legally his home town doesn't have the right to sell any of his original patents on their own, and no French politician would all
Answer: This design patent is from 1879 and had a 14 year term (which is apparent from its description). It therefore expired in 1893. It therefore does not really have a current owner.
While it is possible to assign some rights associated with a patent after its expiry, that is quite limited. I think that assigning rights more than 100 years after a patent's expiry would go far beyond any credible limit.
I therefore feel reasonably confident in saying that Donald Trump does not own US D11023, nor does he hold any rights which might have once existed after its expiry.


Working with wavefront obj files

Question: Mathematica can easily import obj shape files. I wonder, is it possible to access individual faces? What I actually need is to calculate area of each face and its normal. This can be done from scratch (import the file as text, parse it and calculate what I need by using vector cross product). But, I would hope that because Mathematica supports this file format, it would already have some tools available. Even if just accessing vertices coordinates of each facet would be rather helpful (so that I do not at least need to parse the file) or automatically creating Polygons from the obj file.
Answer: When you import an "obj" file, these are the import elements you have access to:
Import["ExampleData/seashell.obj", "Elements"]
(* {"BoundaryMeshRegion", "CoordinateTransform", "Graphics3D",
"GraphicsComplex", "InvertNormals", "LineData", "LineObjects",
"MeshRegion", "PointData", "PointObjects", "PolygonColors",
"PolygonData", "PolygonObjects", "Region", "Summary", "VertexData",
"VertexNormals", "VerticalAxis"} *)

So you can get the faces via
Import["ExampleData/seashell.obj", "PolygonObjects"]

But they are all wrapped up in one polygon, so if you want properties of the individual polygons, then you need to split it up.  After that, getting the area and surface normal is straightforward
pgons = Import["ExampleData/seashell.obj", "PolygonObjects"] /.
   Polygon[a_] :> Polygon /@ a;
areas = Area /@ pgons;
normals = pgons /. Polygon[{a_, b_, ___, c_}] :> Normalize[Cross[b - a, c - a]];

Comment: If the obj file is not only triangular faces but rather polygonal, it is sufficient to modify the last line to `normals = pgons /. Polygon[{a_, b_, ___,c_}] :> Normalize[Cross[b - a, c - a]];`? I am not very good with patterns yet so this is just a guess - the idea is that it should be the cross product of the second vertex - first vertex with last vertex - first vertex.
Comment: @leosenko - That sounds right. I don't like it when these objects use polygons with more than three points though, because they aren't guaranteed to be coplanar to the degree of precision being used - I've often had MMA complain that the points aren't coplanar when making a `MeshRegion`.

Working with wavefront obj files


Why did they change the child actress portraying Lily twice?

Question: I am watching Modern family and I am currently on season 3. In Modern family, season 1 Lily is played by Jaden. In season 2 by Ella Hiller and from season 3 Aubrey Anderson-Emmons. What is the reason behind these frequent changes ? Did the creators want to show a much grown up Lily by season 3?
Comment: Typically child actors are changed because they want to age the character more rapidly, or the actor (or their parents) no longer wants the job, or the actor doesn't grow up into someone who can do the job well - for example an adorable baby may not become a 5 year old who can memorize lines or "hit their mark"
Comment: If the character has only been played by three actresses, then the casting has only been changed *twice*, not three times.
Comment: Makes me think (of course! to those around my age) of Becky Conner (Lecy Goranson), and Becky Conner (Sarah Chalke), and... Becky Conner (Lecy Goranson AND Sarah Chalke in the same season!).
Answer: Looking up the character on Wikipedia reveals that twin actors Jaden and Ella Hiller were replaced by Aubrey Anderson-Emmons. The reasons cited were the twin actresses' mother claimed they did not enjoy acting anymore, thus they "retired", and the role was recast with Aubrey Anderson-Emmons as Lily, who was old enough to provide speaking lines for Lily for the first time in the show.
Going further as a general film production question, the simple matter is that the actor or actress must be able to meet the demands of the character they've been selected to portray. Should the production team feel they're not able to do that at any point, they have the option to recast the role (barring contractual agreements to the contrary).
These rules apply to child actors just as much as adult actors.
Case in point for an adult role, Eric Stoltz was cast to play Marty McFly in Back to the Future. Initially Zemeckis wanted Michael J. Fox, but Fox was unable to get time off from filming the TV show Family Ties, so they cast Stoltz instead. 4 weeks into filming they realized it wasn't going to work and opted to recast with Fox when he was available, even though reshoots would cost $3 million.
Comment: Wait, you  mean that not all child stars have the innate acting talents of the Olson twins when they get older???
Comment: Another example -- Edward Furlong played John Conner in Terminator 2: Judgement Day at age 13 and won a couple of awards for his work.  He was expected to reprise the role in Terminator 3: Rise of the Machines twelve years later, but he was having substance abuse problems and the role went to Nick Stahl.
Answer: In most movies young children aren't good actors when they grow older and other actors suit the job better. Usually in shows each character is much older eventually reaching their real life age. So they usually switch the actors especially for young adolescent actors
Comment: While this may or may not be accurate, it doesn't address the OP's question
Comment: Please only use code text for code. Use quote text for quotes.
Answer: Actually, they changed to Aubrey because they felt the original "lily" was a little too dull and didnt have enough life, for lack of better word. I watched the documentary.
Comment: Which documentary? Link? Sources/Citation is required.


Using ElementType as field type for plugin in what way do I provide my own data to the modal?

Question: I have been looking at the BaseElementFieldType.php file to try and understand how to use it for my own field type. How do I provide that field type with my own array of data to use? I believe it has to do with the sources,criteria, or elements but it is unclear to me.
Comment: Can you elaborate about what modal exactly are you talking about?
Comment: When using a the BaseElementFieldType it uses the elementSelect form elements.  It is the input type assets uses or categories, or when selecting a relation. I am trying to incorporate that same input but using my own data to populate the modal window from which you can select content.
Answer: Ah, in that case you'll need to make your own ElementType. You should probably check out https://github.com/pixelandtonic/Events - that's meant to be a simple ElementType to serve as an entry point while we get some documentation together.
Also, there are some videos to watch over here: http://buildwithcraft.com/docs/plugins/working-with-elements#creating-new-element-types


Role of Capacitor when switch is open in Buck Converter?

Question: in a buck converter, initially, when switch is closed, then capacitor charges and stores energy. But when the switch is opened, then Inductor current flows through thr free wheeling diode, but what happens to the charge stored in the capacitor?
Comment: Charge isn't stored in a capacitor; energy is stored.
Answer: In a buck converter, the switch controls energy storage in the inductor. The average of the square wave applied to the filter will be the DC output level (12V @ 41.6% duty cycle = 5V average). The inductor acts as a current source to keep the output capacitor charged.
Depending on the load, switching frequency and inductor size, a fixed-frequency buck converter can operate in one of two modes. If the DC output current level is greater than half of the inductor current ramp, the converter is said to be in CCM (continuous conduction mode); if not, it's said to be in DCM (discontinuous conduction mode).
\$ I_o > \dfrac{1}{2} \cdot \dfrac{[V_i-V_o]\cdot T_{on}}{L} \$ or
\$ I_o > \dfrac{1}{2} \cdot \dfrac{-V_o\cdot T_{off}}{L} \$
In CCM, the inductor is sourcing current the entire time. The inductor current never goes to zero. The capacitor is always being charged by the inductor, so it never has to support the load by itself. The duty cycle will remain essentially fixed regardless of output current once in CCM.

In DCM, because the output current is less than half the inductor ramp current, the only way to regulate properly is to decrease duty cycle. This decrease in duty cycle leads to a third mode of operation, where the switch is off and the inductor has completely discharged.

(Some controllers will operate in what's called critical conduction mode, where instead of operating with fixed frequency and variable duty cycle, it operates with fixed duty cycle and adjusts the frequency to keep the converter exactly at the DCM/CCM threshold.)
Comment: Thanks, and looking at the explanation, CCM and DCM refers to the 2 states of opening of the switches right?
Comment: Not quite. See my edit.
Comment: @Madmanguruman: Can you please elaborate more details on CCM and DCM
Comment: CCM means "Continuous Conduction Mode" When the switch is turned on current builds up in the inductor then when its turned off it decays.  In CCM the current is not allowed to fall to zero before the switch is turned back on. in DCM (Discontinuous Conduction Mode) the current is is allowed to fall to zero. In CCM ignoring second order effects the output voltage is the the input voltage times the duty: this limits the minimum load. In DCM the duty is much more load dependant.


Why do bikes have their drivetrains on the right?

Question: Every bicycle I have seen in my life has its gears and chain on the right side? Why is this? The only thing I could find regarding this question is this forum topic, which speculates about things such as the prevalence of right-handed people, the idea that it is easier to produce right-handed threads since they are more common, and the traditions of mounting a horse, but I couldn't find anything definite. Does anyone here have any idea?
Comment: Thought of this question when I saw a BMX bike with its drivetrain on the left the other day. According to its rider that's so that when he puts the pegs on he can do grinds on the right side.
Comment: There are bikes with both sides, interestingly enough: http://sheldonbrown.com/bichain-fixed-free.html. Tandems are also in the same group.
Comment: Nice question, mikez!
Answer: Because (most) people are right handed.
Right side drivetrains are rooted in the fact that rotating clockwise causes bolts, etc. to tighten—this dates back to the first "safety bicycles" introduced in the 19th century. With the drivetrain on the right, more (standard threaded) parts will be rotating clockwise and thus tightening themselves as the rider pedals.
Drivetrains are on the right today because that's what bicycle builders decided to do in the late 1800s. As to why they originally decided to put drivetrains on the right, it's probably because rear cogs used to be screwed on (some still are). Standard threads dictate rear cogs be on the right, so that pedaling force tightens the cogs. (If they were on the left, pedaling force would likely loosen cogs.)
Today, left-hand drivetrains are possible, but more difficult to create because more reverse-threaded parts are needed. Generally, things like pedals and bottom brackets have threads that are reversed/asymmetric on one side. They're made specifically to work when the drivetrain is on the right—tightening themselves as the rider pedals. If these standard parts are placed on a bicycle with a drivetrain on the left, then those same parts will be loosening themselves as the rider rides.
But why do right-turning bolts tighten? Shortly before the safety bicycle was introduced in the 19th century, the right-turning convention was adopted because it's better to have all bolts work the same way and it's easier to turn them with your right hand. And most people are right handed.
Comment: Actually, the simpler pedals don't care, and the bottom bracket cartridge/axle can be switched around the other way with little effort.  The crank arms, however, are threaded for the pedals one way, and reversing would cause the pedals to precess out unless the cranks are rethreaded or a lock screw used.  Ignoring the issue of the freehub itself (where the ratchet mechanism would be backwards) a modern freehub wheel could be reversed and the cogs would still stay on.  All-in-all probably fairly easily doable for someone who wanted a "stupid" project to work on.
Comment: There are commercial parts available to run left side drive. It's mostly for BMX when the rider has a preference of grinding on the right to keep the geartrain out of the way. http://en.wikipedia.org/wiki/Crankset#Left-side-drive
Comment: Someone has taken issue with the sentence "Because people are right handed". This could be updated to say _most_ people, but even then I think that the answer reads nicely without that opening sentence at all. I would say it is better without it. The point is made later in the answer anyway.
Comment: Until relatively recently ( 50+ years) cotterless pedals / cranks were not that common.
Answer: It is a little known fact that the Wright Brothers invented the left-hand thread for the left-hand pedal in 1900. Therefore, up until then it is highly unlikely that bicycles used any left-hand threads on them at all. Therefore, as noted by @Eric Silva the chainset could have been on the right because that is the simplest way for the sprocket to have been bolted on.
Nowadays we take threaded nuts and bolts for granted, however, it has been a long journey of understanding to get threaded connectors standardised and working as well as they do now. Steel on steel threaded connectors of the past were far from reliable and far from standardised. Therefore for 'Safety Bicycle 1' there would have been no problem to have made a track-bike style locknut or a left-hand thread to secure the sprocket if it was felt that it was needed to place the chainset on the left.
As noted by @onestop the safety bicycle, like all the best inventions of that period, was a British design. It was designed for riding on the left with roads that did have pavements (sidewalks) and kerbs. Mounting and dismounting the bike from the kerb, pushing the bike and parking the bike with a pedal on the kerb works out a lot better with the chainset on the right (if you are in a country that 'drives' on the correct left-side of the road). Clothing gets to stay cleaner and that would have been a huge benefit in Victorian Britain when front-loading automatic washing machines weren't exactly commonplace.  These are lucky benefits and probably were not uppermost considerations in the design of 'Safety Bicycle 1'.
Placing the gears away from the kerb-side of the bike made a lot of sense in the days before cars took over when you could park your bike with it being supported by a pedal on the kerb. Doing so with the kerb on the left means that you are unlikely to damage the chainset or derailleur particularly if the bike falls over. Up until the 1980's this was the proper way to park a bicycle (if my memories of Cycling Proficiency Test serve me correctly).
As for pushing the bicycle and how that works out better if the bike is on the right hand side, this works out better in countries that drive on the left for all the reasons @onestop cited and more.
According to the Highway Code you are supposed to walk a bicycle on the right, facing on-coming traffic, not on the left with traffic coming from where you cannot see. With narrow pavements as found on country lanes you can push the bike with the bike on your right controlled by your (for 90% of the population) stronger right hand, the bike on the pavement with yourself on the road. When on-coming traffic comes along it is relatively easy to step up onto the pavement to clear the road for the on-coming car(s) and you don't have to drag the bike up and down the kerb.
Like @onestop I also do the turning around thing when leaning the bike against a left-side wall - glad I am not the only one with this quirk.
All considered, although the chainset on the right works out best for countries that drive on the left for a whole host of reasons, it was probably the lack of left-hand threads in bicycle design that was the deciding factor. And, your little gem of 'I did not know that' for today is that the Wright Brothers invented the left-hand thread left-pedal.
Comment: Of course, in the Wright Brothers' day frames were commonly made of wood.
Answer: Why did early manufacturers of safety bicycles put the drivetrain on the right? I have no evidence for this, but it's always struck me that a large part of the reason is surely that the safety bicycle originated in a country where you drive on the left.
When you're pushing your bicycle, or mounting or dismounting it, you're less likely to get chain oil on your clothing if you stand on the side away from the drivetrain. But it also seems sensible to walk or stand on the footway (sidewalk) and hold the bicycle in the road (note the same principle applies even when there's no footway - you want to stand away from passing traffic). Hence in a country where you drive on the left, it makes sense to stand on the left of the bicycle and therefore the drivetrain should be on the right.
I've found that one secret to avoiding getting oil on my trousers is always to stand to the left of my bicycle when pushing, mounting and dismounting, and always to park it with the right (drivetrain) side against the wall or stand. This even means that when I stop on the left side of the road and lean it against a wall to my left, I turn it around first. But it becomes difficult to keep to this rule when I cycle in countries where they drive on the right - i'd be standing in the road when mounting or dismounting.
Comment: Similarly being right-handed (like most people) it's easier to shoulder a bike on the right.  Luckily the time I had to shoulder my bike on the left (a very narrow bridge with a railing on the right) I was wearing mainly black.
Comment: @ChrisH is it? I'm left-handed, and find it easier to shoulder the bike on the right. I think it's just a matter of what you're used to, and you get used to whatever the drive-side dictates.
Comment: @leftaroundabout thinking about when I'm most likely to put it on my shoulder, I've often got something in the other hand, and my bikes are heavy and often loaded. Curling 20kg with my strong hand is easier. But I'm also likely to have the bike on my right to start with from pushing, and from there I can get it onto my right shoulder without slowing down.  These days (since that comment) the left shoulder isn't an easy option because I'm rather tender on top of where my collarbone is reinforced with titanium.  I have to position loads carefully on that shoulder
Answer: You need to look at single speed track threaded cog:

The right-handed thread was most common at that time.


Craft Pro 3.1.33 - Download PDF in admin user profile

Question: In Craft 3 Pro i need to download a PDF file that a template form submits to active user profile.
The PDF submits from the front and goes to the admin area under the user account profile.
The problem is that in the user account profile i can see the PDF but cannot download it or even preview it (shows a white thumbnail image with PDF written).
The only way i find to download the pdf is going to the assets section and find it among the other file assets. I do not want this.
Is there a way of adding a download button, or click in the pdf preview to download the pdf, in the user account profile in craft 3 admin backoffice?
Answer: Well, the only i way i found to solve this was to made my custom plugin for craft 3 CP.
I build my template scafold here:
https://pluginfactory.io/
Then installed it via composer and started coding to achieve what i want.
Job done.


How do you get music?

Question: I've looked at questions on how to get music and the only answers were with club LOL. I don't have club LOL. So how can you get music without club LOL?
Answer: There are two ways to get music:

Attend K.K. Slider's live performance on a Saturday night after 8:00 PM

Max: 1 per week
Price: Free
Option to select any one song (except K.K. Birthday, which can only be played on the Saturday on your birthday week)

or

Buy a copy from the Nookling store (T.I.Y. or higher)

Max: 1 per day (T.I.Y.) or 2 per day (T&T Emporium)
Price: 3200 bells
Random song(s) available each day

You'll need to get either Club LOL or several renovations to the Nookling store in order to get music for yourself, but if you have a friend who is willing you help you out, they are tradeable, and you can buy them from Nookling stores in other players' towns.
Answer: You can get KK Slider music at TIY/T&T Emporium for 3,200 Bells and at Club LOL for free(Saturday night). You can also get music by having a friend drop it in your town and you can pick it up, put it in your stereo and it will play music!
Answer: I've found that if you have someone you have met via spotpass then there is a chance that they have some music on display in their homes (from the HHA showcase). That is how I found my first music anyway.

How do you get music?


How do we measure mass?

Question: How do you measure mass? Weight is easy using a scale, but we can't measure mass that way, because then mass would be different on every planet. I know there was a Veritasium video (here) on defining what, exactly, one kilogram was, but they can only define that if they know some previous measurement (i.e., one cube of metal is 2kg)!
Answer: You measure mass by observing it's acceleration response to force (i.e by applying Newton's second law).
Now, because it is impractical to accurately measure straight-line accelerations over a wide range, we actually use periodic motions and measure frequency.

Mass-on-a-spring harmonic oscillator. $\omega = \sqrt{\frac{k}{m}}$ with known spring constant.
Measure the centripetal force on a centrifuge. $F = m \frac{v^2}{r} = m \omega^2 r$, is the naive approach, but on the surface of the planet you have to be a little more clever (adding the centripetal force to the existing weight). Here you would put a scale between the test mass and the centrifuge to get $F$.

An alternative is to measure both the weight and the local value of $g$, which can be done with a small-angle pendulum ($\omega = \sqrt{g/\ell}$).
Comment: I was thinking about this too, but you've just changed the problem to one of having a well-known force-measuring device. How does that work?
Comment: @Eoin That's called a scale. But the harmonic oscillator version doesn't need a scale for every weighing, just a good measurement of $k$.
Answer: I would maintain that we most often explicitly measure mass by comparing the pull of the local (unknown) gravity on the mass to be measured to the pull of the same gravity on a known, reference mass or masses.
If you look at the measuring devices in stores, you sometimes see the slogan, "Honest weight;  no springs!"  They are proudly claiming that they are not using a direct, force measuring device, but rather a force comparing system.
A traditional chemists scale:

uses an equal arm balance and a set of various masses to achieve balance between the object on one side, and the collection of calibrated masses on the other side.  A suspicious individual can reverse the position of object and masses to check the geometry (Is it really equal arm?). This device will give exactly the same result anywhere on earth, on the moon,or on an accelerating elevator. Keeping the reference masses uncontaminated is a requirement...
The mass measuring device you encounter in a clinical setting:

differs slightly in one detail.  It relies on a small number of reference masses, but uses the geometry of the bars on which the masses slide (and the notches on the bars) to create the different forces that balance the force of gravity on the subject.  Again, contamination of the masses would be a problem, as would be wear and tear on the notches on the bars...
In the absence of gravity, this method:
https://www.youtube.com/watch?v=8rt3udip7l4
can be used to compare a known mass(the saddle alone) to an unknown mass(saddle plus astronaut)  This compensates for the possible error caused by changes in the spring...
Comment: "This device will give exactly the same result anywhere on earth, on the moon,or on an accelerating elevator." Is there vacuum inside the device? Because otherwise, air buoyancy should be taken into account, right?
Answer: We almost always determine mass by measuring weight. Weight is the force on an object exterted by a gravitational field, and is proportional to the mass. On the Earth's surface W = m*g. We can convert weight to mass if our measuring scale is calibrated, usually with an object of known mass. This would work for any planet.
Even though the weight would change from planet to planet, the mass would not. But we would need to bring along a known mass to calibrate our scale on the new planet. At the moment, the kilogram, the unit of mass is defined in terms of an object stored in a vault in France. Every mass-measuring instrumenthas been at least indirectly compared to this standard kilogram.
The verisatium video talks about a new method proposed to define the kilogram, which depends on counting the number of atoms in an object. The mass of one atom is known, so simple multiplation will give you the mass of an object. This will really only give you a new way to define a standard kilogram (if for instance, the present kilogram was destroyed).
Comment: This is not really true. We *do* have ways to measure mass that are independent of the local gravitational field, though they are rarely used because they are hard and it is easier to simply measure weight.
Comment: That's why I said "almost always"

How do we measure mass?


Counter Mode Known plain text attacks

Question: Counter mode uses a counter that is incremented for each block. Doesnt predictability of this counter expose the scheme to attack? I mean if you are incrementing some nonce, then I have a good chance of guessing the next value
Comment: If you are really paranoid and have doubts about the block cipher to that effect, despite the design criteria of the cipher to resist those attacks, a dual-ctr stream with independent keys masks the ciphertexts so that key recovery should not be possible (under most conditions)
Answer: Modern ciphers are explicitly designed to be resistant to key recovery under known and chosen plaintext attacks. Assuming a successful cipher design, encrypting an incrementing counter does not offer an adversary any advantage in regards to obtaining the key, or predicting future ciphertext blocks.
This could be less true with a weak cipher and/or extremely large numbers of encrypted plaintexts.
Comment: why is it then that CBC mode strictly specifies a random IV (sort of a counter that cannot be guessed?). Also, does CTR mode send the initial counter in plain text? -- It seems like this would be the case if guessing the counter is not such a security problem.
Comment: If you use the same IV/key combination twice then security is broken. The IV is normally sent in clear.
Comment: @Minaj CBC and CTR modes work differently and use the IV/nonce for different purposes. [This answer](http://crypto.stackexchange.com/a/82/29554) touches upon the subject. Note that while an IV should be unpredictable, it is still known to the adversary because it is sent in the clear. The biggest reason why we dont randomly generate nonce is because collisions happen near the birthday bound, which is too probable for even an 128-bit nonce. If you use a 256 bit nonce you can generate it randomly. Nonce reuse in CTR mode reveals the plaintext, IV reuse in CBC leaks whether 2 blocks are the same.

Counter Mode Known plain text attacks


Asus Netbook restarts while loading windows files for installation

Question: I recently bought an Asus X200MA-KX141H X Series Netbook with DOS pre-installed. I made a bootable USB stick with windows 7 in it and after booting into the windows installation screen, loading windows files fast and displaying the 'Windows is Starting' message for a few seconds without even the glowing windows logo appearing, the netbook immediately restarts and repeats the whole booting process again. It doesn't proceed into the 'Install Windows' screen. It shows the blue screen of death if XHCI mode is disabled stating that the bios is not compatible with the AHCI. Please help! Thanks in Advance... :)
Answer: I also bought an Asus X200MA-KX143D-blue netbook (or notebook or ultrabook, whatever) and had the same problem. I found this solution topic on the net. You need to update your BIOS.

So you have to download the latest Bios version from this site: http://www.asus.com/Notebooks_Ultrabooks/X200MA/HelpDesk_Download
Then, upgrade the BIOS. You can follow the instructions found in the manual.
Finally just change to "Windows 7" at the "Advanced/OS Selection" tab of the Bios, as it's written in the solution topic.

Hope this will work ;)
Cheers!
Thank you very much, Radoo!
P.S: ah, and also: I bought a Transcend usb cd/dvd writer (I installed the win with that, I didn't try it with the USB stick solution, but it should work after you updated the BIOS) and it uses usb 2.0, so I had to disable the XHCI mode at the "Advanced/USB Configuration", since that is associated with USB 3.0, I don't know about that thing though =), my uncle helped me with that.


How to make a list comprehension in python with unequal sublists

Question: I have a list of unequal lists.
I would like to generate a new list with list comprehension from the sublists.
s = [['a','b','c','d'],['e','f','g'],['h','i'],['j','k','l','m']]

I am trying the following code but it keeps raising an indexError:
new_s = []
for i in range(len(s)):
    new_s.append((i,[t[i] for t in s if t[i]))

The expected output would be:
new_s = [(0,['a','e','h','j']),(1,['b','f','i','k']),(2,['c','g','l']),(3,['d','m'])]

Any ideas how to get this to work?
Answer: You can use itertools.zip_longest to iterate over each sublist elementwise, while using None as the fill value for the shorter sublists.
Then use filter to remove the None values that were used from padding.
So all together in a list comprehension:
>>> from itertools import zip_longest
>>> [(i, list(filter(None, j))) for i, j in enumerate(zip_longest(*s))]
[(0, ['a', 'e', 'h', 'j']), (1, ['b', 'f', 'i', 'k']), (2, ['c', 'g', 'l']), (3, ['d', 'm'])]

Answer: one without itertools but modifying the original list.
def until_depleted():
   while any(sl for sl in s):
    yield 1

list(enumerate(list(s_l.pop(0) for s_l in s if s_l) for _ in until_depleted()))

one without modifying the original but with a counter
idx = 0
max_idx = max(len(_) for _ in s)

def until_maxidx():
    global idx
    while idx < max_idx:
        yield 1
        idx += 1

list(enumerate(list(s_l[idx] for s_l in s if idx < len(s_l)) for _ in until_maxidx()))

A more explicit one without the inner comprehension nor calling generators:
ret = []
idx = 0
max_idx = max(len(_) for _ in s)
while idx < max_idx:
    ret.append(list(s_l[idx] for s_l in s if idx < len(s_l)))
    idx += 1

print(list(enumerate(ret)))

Answer: This is without itertools, but also without a comprehension, so I don't know if it does count as a solution.
s = [['a','b','c','d'],['e','f','g'],['h','i'],'j','k','l','m']]

new_s = []
for i in range(len(s)):
    tmp = []
    for item in s:
        tmp.extend(item[i:i+1])
    new_s.append((i, tmp))


How do I change an application icon on Ubuntu?

Question: Specifically, I want to swap out the Chrome icon for that of Chromium, as I find the former garish.
Answer: If the icon is newly created or downloaded, and does not already exist in the icons directory, its suite of images at different dimensions will need to be placed in the respective subdirectories, eg:
cp chromium-browser.png ~/.local/share/icons/hicolor/16x16/apps/

Then to make the application reference the new icon, copy the relevant .desktop configuration file into your user directory structure if it's not already there:
cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/

Edit the .desktop file Icon property to reference the new name (without any suffixes):
Icon=chromium-browser

All references to the application throughout the desktop should now appear with the new icon.
Comment: I'd certainly appreciate anyone improving my terminology here.
Answer: The magic, high priority, local location, if the icon is missing, is, ~/.local/share/icons/hicolor/scalable/apps/. Or theme-specific, ~/.local/share/icons/<THEME_NAME>/scalable/apps/
So, you look up the icons in /usr/share/icons/ with some thumbnail previewer, like Nautilus, or image manager, like Gwenview.
xdg-open /usr/share/icons

Then, copy the file and rename to ~/.local/share/icons/hicolor/scalable/apps/<ICON_NAME>.*. Note that the icon extension doesn't matter. It can be SVG or PNG.
You can look up the icon name in the *.desktop file.
# To find the location of the appropriate desktop file

find /usr/share/applications -iname '*chrome.desktop'
find ~/.local/share/applications -iname '*chrome.desktop'

I wouldn't edit *.desktop file, especially for non-local location, as it will overwritten by apt-get update.


Can I track a deactivated cell phone that is using a textnow app through wi-fi?

Question: My 16 year old daughter ran away 6 days ago with her 23 year old boyfriend who also happens to be a convicted child molester. She is using a textnow app on a deactivated cell phone she got from one of her friends. I'm desperate to find her.
Answer: It appears that TextNow can provide some potentially meaningful details to law enforcement.  It is however unlikely they would comply with a request directly from you.  Their info page is here: https://supportfree.textnow.com/hc/en-us/articles/204431979-Law-Enforcement-Subpoena-Requests
If you have not yet involved the police (and if you are in USA requested an Amber Alert to be issued) this would most definitely be the time to do so.  You'll need the authorities to request this information anyway, and they will have their own ways of trying to locate them which may be far faster than getting info from TextNow.


What happens to an ant colony when the queen dies?

Question: Does the colony collapse? Do workers keep following the last orders? Or can future queens replace the dead one? I'm guessing this might also depend on each specific sub-species.
Comment: Not ants unfortunately, but with bees if the queen dies the workers start rearing some larvae under queen-developing conditions. They're not normally as effective as 'proper' queens and you might end up with several at once, but you get something. Leaving this here in case someone feels like looking up whether similar processes occur in ants (although if I get time to I will try to do it myself at some point).
Comment: http://www.antweb.org/antblog/2010/12/can-ant-colonies-reproduce-and-sustain-with-no-queen-angela.html has an interesting answer (basically, they struggle but should survive by turning workers into temporary queens). That said, I'd like to have community experts confirm this, or detail whether it's species dependant before making it an official answer.
@arboviral: looks like it works just like bees if this is true.
Comment: Does your second question assume ant workers follow orders given by a qeen? I am not an ant specialist but how would that happen physically?
Comment: @BagiM: not sure if I've imagined this or read it somewhere, but I thought pheromones were used to spread general orders, influencing behavior throughout the colony.
Answer: Not really my field, but I can point to this review which discusses a couple of different ways in which ants organize their communities:
Heinze. 2008. The demise of the standard ant (Hymenoptera: Formicidae)
I know that in some species there can be several queens per colony (so more robust to queen deaths). In many species, workers can start laying eggs if the queen dies, but these will develop as males (since they are unfertilized). However, in some species (e.g. Platythyrea punctata) the workers can reproduce by parthenogenesis which can stabilize the colony to some extent after the queen dies.


HTML / Mail System / SMTP Not sending approval in html

Question: I have a current Drupal site that sends out all emails using the HTML template. Users requests, reset password, webform but does not send out approvals in HTML. Anyone have this issue or know a solution?
Comment: Have you found a solution? I have the same problem
Answer: I believe drupal will only send text emails by default. You will need a module to help you implement HTML emails. I have used Mime Mail in the past to do this.
https://www.drupal.org/project/mimemail
From drupal.org:

This is a Mime Mail component module (for use by other modules).

It permits users to receive HTML email and can be used by other
  modules. The mail functionality accepts an HTML message body,
  mime-endcodes it and sends it.
If the HTML has embedded graphics,
  these graphics are MIME-encoded and included as a message attachment.
Adopts your site's style by automatically including your theme's
  stylesheet files in a themeable HTML message format
If the
  recipient's preference is available and they prefer plaintext, the
  HTML will be converted to plain text and sent as-is. Otherwise, the
  email will be sent in themeable HTML with a plaintext alternative.
Allows you to theme messages with a specific mailkey. Converts CSS
  styles into inline style attributes.
Provides simple system actions
  and Rules actions to send HTML email with embedded images and
  attachments.
Comment: I do have those installed. But what is weird is everything sends out as html email but not the approval.


Can I do an MS in biotechnology after a bachelors degree in chemical engineering?

Question: I recently graduated from high school and now have to make a decision about my undergrad major. I am interested in biotechnology but my parents suggested that I should opt for a broad based degree and then specialize in my field of interest in grad school. So I read up about chemical engineering and I think it would be an interesting major, but my real interest probably lies in biotech.Is it possible to transition form chemical engineering to bio-related fields in grad school?
Answer: This will probably to a high degree depend on the (exact) curriculum and prerequisites of your chosen bachelor and master.
Also note that I'm not from the US and judging from the terms you are using, it seems that you are, so everything I say is also a bit speculative.
In general biochemistry and to some degrees also biotechnology will have a lot of overlap with many aspects of chemistry (or at least organic chemistry). Depending of the focus of each program this might, make it possible to switch over from one to the other. One thing you will definitely not learn in any chemical mayor is molecular biology, which may well be a requirement for studying in any biotech related field later on.
If both your majors focus more on the technological aspect and less on the biological or chemical you should probably be fine. The equipments used in (modern) biology and chemistry is in many cases similar, though biotech involves more equipment specialised for the handling and analysis of cells. The underlying principles are still the same though.
In your case I would recommend you to check the requirements of different MS or grad schools, that you'd be interested in first, and the see if you can meet these with a chemical engineering mayor (and maybe/probably some added courses like molecular biology).


Two baseboard thermostats wired to one baseboard heater in same room. One stays on while the other is cold

Question: We have 2 electric baseboard heaters in the same room  that are wired to a Cadet mechanical thermostat. One heater seems to stay on continuously even with the thermostat turned off, while the other is cold. I have felt the  thermontats several times and they are always the same. I tried different settings as well. They remain the same.
Comment: what is the question?
Comment: Well obviously both are NOT connected to the thermostat.  In fact it appears that neither one is.  Why don't you trace the wiring and figure out what is connected to what and update your question.
Answer: Lots of possibility's here, bad thermostat, bad heater . But more information is needed. Are these 120 or 240v heaters? Is the thermostat single pole or double pole (2 connections or 4) ? I have seen where a single double pole thermostat is controlling 2 heaters on both 120v and 240v , I have also seen 1 welded contact set and 1 burned open, so it could be the thermostat. Turning off the breaker before working on this and note if it is a single or a double (1 wide or 2 wide)  pull the thermostat out and let us know how many connections. I am guessing there will be 4 but it could be 2. Last we would need to know the nameplate rating of the thermostat, and the heaters.
Since this probably worked in the past Without any test equipment I would replace the thermostat, if you pull it out and find 4 wires connected this is the most likely cause of the problem.
If you only find 2 wires connected to the thermostat it may have welded the contacts and 1 heater failed , then we will need all the requested information and a photo of the wiring in the thermostat box to provide you with a safe path forward.
When changing thermostats keep track of the wires this is important a double pole thermostat can control 2 double pole heaters (240v) and you don't want to get the wires mixed up. The same is true with single pole heaters (120v). You want to keep the wires on the same circuit if fed from 2 breakers , they should be handle tied but some older homes 2 120v circuits going to a single thermostat predates handle ties as in a multi wire branch circuit.
Let us know the additional info or if changing the thermostat worked.


Script: How to check if the top item on the main stack is numeric or not?

Question: I'm looking for the clearest way to check whether the top element of the stack is numeric or not.
Thank you in advance
Answer: The best way that I know is quite involved because bitcoin-core standardness rules around Minimal representation of script ints. If you really need to do this, I can add detail in an updated answer.
Execution vs Satisfaction:
But in almost all cases, you should never really need to check such a thing. Recall that Bitcoin Script satisfaction requires Script executes successfully. At the end of the day, we are not interested in what is execution result, we are interested in whether the witness is valid or not. And the user redeeming the coins knows whether the pushed number is ScriptInt or not, they are let the interpreter know via additional boolean input.
Previous Code: where stack top is element `e`
OP_ISTOPNUMERIC # hypothetical that pushes 1 or 0 onto the stack top
OP_IF
    <process_num>
OP_ELSE
    <something_else>
OP_ENDIF

can be read written equivalently with two user input elements [e, e_is_num] where e_is_num is at stack top denoting whether e is numeric or not.
New code: with stack as `[e, e_is_num]`
OP_IF
    <process_num>
OP_ELSE
    <something_else>
OP_ENDIF


Does $2\to 2$ particle scattering occur in a plane?

Question: I am reading a physics textbook which implicitly uses this assumption in dealing with photon electron scattering. In general, I don't see why this is true. I can imagine the first two particle momenta spanning the x-y plane and the second two spanning the x-z plane, for instance, as long as the z-components of the final momenta are equal and opposite.
Comment: They are probably using the center of mass frame, in which the scattering does occur in a plane.
Comment: You can always perform a Lorentz transformation to a frame where the scattering is in a plane.
Comment: It holds in the COM frame because the initial velocities are parallel and hence don't define a plane, only a line, and the same happens for the final velocities. Therefore, initial+final velocities define a plane.
Comment: @Prahar I am looking specifically at Schwartz's QFT problem 9.1. where he considers $\gamma \phi \to \gamma \phi$ in scalar QED in the COM frame. Now it is clear to me that there exists _some_ frame where scattering is in a plane. But I don't see why it holds for the COM frame.
Comment: @Javier (I tried to tag you as well)
Comment: @Dwagg - Momentum conservation. In center of mass frame, the two incoming particles travel opposite to each other (so they lie along a single line). The net 3-momentum is zero. By momentum conservation, the net 3-momentum of the 2 outgoing particles must also be zero so that the outgoing particles must also travel opposite to each other on a single line. The two lines (ingoing and outgoing) intersect at the point of collision. Now convince yourself that this geometry (two intersecting lines) necessarily forms a plane. This is then the plane of collision.
Answer: No, it is not necessarily in a plane. The textbook has simplified it for analysis. Firstly, if it were always in a plane then that would be major news. Secondly, the cross section (which is perpendicular to particle movement) has to have two dimensions for there to be any chance of collision. So there is at least some amount of a third dimension in their paths.
Answer: You are right about there being no reason for 2-particle collisions to be restricted to a plane. However, if one of the particles has mass, then there is always a frame of reference where the action happens in a plane. For the electron-photon collision, if you go to the rest frame of the electron, then there are three momentum vectors: the photon's pre-collision momentum, the photon's post-collision momentum, and the electron's post-collision momentum. To conserve momentum, these three vectors have to lie in the same plane.
If you are studying Compton scattering, then the electrons in experiments are bound to atoms, making them effectively motionless in the lab frame compared to the incoming photon. This makes it valid to study the problem in two dimensions.


Is user consent needed to display a Google Map on a website?

Question: I would like to display a Google Map in a website project of mine.
This requires loading the JavaScript api from Google:
https://developers.google.com/maps/documentation/javascript/tutorial?hl=en#Loading_the_Maps_API
By loading this JavaScript api, every user which is opening my page is sending a request to Google, and thus "shares" their ip-address with Google.
According to my lawyer, the ip-address is personal data, since it might allow identifying the user (provided the user is not behind a proxy or connecting to the internet through a shared address, like e.g. from mobile networks)
Do I need to get consent from the user to force him/her into sending his/her ip-address to Google my accessing my site?
Comment: If your lawyer considers the IP addresses to be personal data, you should get his advice on a TOS and consent; we can't give legal advice here.
Answer: IANAL, but I"m assuming by "consent" you mean you feel you need to have users click through an agreement to acknowledge and clearly accept the fact that the site is sending their IP information to Google?
I'd say it's your choice to use a click through advisory for the data collection by Google. But at a minimum in your situation, I'd say it's a very good idea to have a terms of service and a privacy statement for users of your site to inform them that the Google API is being used and Google is collecting their IP address. Both statements can be linked in the footer, like everyone else seems to do. And a TOS is a contract: see Are terms of service legal contracts?
So even if users don't read it or you don't force a "click through," the TOS is in place, and users will consent to their IPs going to Google if you state in the TOS that users agree to the TOS by their use of the site. Which is pretty standard TOS wordage.
It's your choice to have a banner or a click through to point them out to users or even force a click through agreement. Realize that, in the EU, click through advisories are required to inform of cookie usage: http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm
I.e, Stack Exchanges own privacy policy on collecting IPs:

When you use the network, we also collect potentially personally
  identifying information in the form of Internet Protocol (IP)
  addresses. But we don't use that information to identify you, and we
  handle and disclose these addresses in the same way we handle other
  potentially personally identifying information as described below. https://stackexchange.com/legal/privacy-policy

Any site advertisements are collecting data, too. And be aware that your own webserver is logging user IP addresses, beyond Google and ads, and that should be covered in your TOS and privacy statement.
One of the many online TOS generators is probably sufficient for your site, if the only thing you are doing is dealing with user IPs and you're not a business or government entity: https://duckduckgo.com/?q=tos+generator . If in doubt, ask a lawyer.
Update:
If your lawyer considers the IP addresses to be personal data, you should get his advice 1) on a TOS for your site that covers the privacy concerns of users and protects you, and 2) if he feels the TOS should be click-though to force the user to clearly consent to and accept the TOS. This decision is up to you, as we on LE can't offer legal advice.


How Do I Make a Graphic Design Portfolio?

Question: I am a first year graphic design who is still relatively new to the field. I have no idea how to even start with a portfolio. Do I create a website? Is it something physical? Can it just be a Google Drive folder? I'm sorry if I sound dumb, I've tried Googling, but I don't really have a clear answer. What should I include in the portfolio, and what should I keep away from it? Thanks to all who read and answer.
Comment: That's a very broad question for this site, but in 2023 usually design portfolios are on the web as a website.
Comment: It might be helpful for you to Google the same question and read a few of the articles presented. If you are in school, this is typically a topic that's covered, at least minimally, at some point. (I don't know if "first year" refers to education.)
Answer: There's a reason you can't find a "clear answer"....
No one can tell you that A, B, C and D all should be part of your portfolio. Conversely, no one can tell you that A, B C, or D don't belong in your portfolio. No one here knows your work, your experience, your area of focus, etc. Every designer is different, with different skillsets and different career goals. Portfolios are just as unique as the designers themselves.
A graphic design portfolio is somewhat of a living, breathing, thing. It constantly changes as new, better, work is completed. The goal of a portfolio is to show how you solve visual problems. To show how well you understand color, the psychology of eye movement, balance, proximity, type usage, etc. All of these can be shown via any design project in most cases. The actual medium can be irrelevant to a degree.
Often it's wise to customize a portfolio as much as possible to reflect any proficiency in the area you want to work in. Meaning, if you are seeking a position related to print production, showing a bunch of web-related UI and content isn't exceptionally helpful to potential employers. Just as a bunch of print materials won't be helpful to an employer seeking a designer for web-based projects. Seeing how problems were solved is helpful, but seeing how problems were solved for relatable projects will be more helpful.
In addition, no one can tell you the "absolute best" format for a portfolio. The goal is to make the reader expend the smallest amount of effort to view anything. That can mean a well formatted PDF, or a web link. If you are seeking a portfolio for face-to-face job interviews, you will need a hard copy version of your portfolio (or an iPad/tablet you can leave with the employer for review). In today's era, a web-based portfolio is essentially a must have - whether that's your own domain and web site or something like Behance or Dribble is for you to determine.
Much of the logistics of a portfolio are in the hands of potential employers... if asked for a CV/Resumé and a link, then you need something web-based to provide the link. If asked for a PDF, you need the PDF. If asked to meet with you in person, you should be carrying something physical you can show and you may need to be willing to leave it with them for a week or two (It's returned to you later.) In some cases, it can be something like a thumb/flash drive that has been customized to show your work -- sort of a static, localized presentation on the drive. Many employers have no problem popping in a thumb drive to view things.
Admittedly, it's been a decade or more since I've sought direct employment, physical portfolios may entirely be a thing of the past. Most of what I see asks for a link or a PDF.

(Note: a Google Drive folder with a bunch of files to download is not a path I would take.)
Answer: Definitely a website of some sort.
Be aware that a large portion of jobs today are remote, the hiring is remote, the interviewing is remote, etc. Even if you do end up in that unlikely situation of a face-to-face, in-person interview, they will still probably want to see your portfolio website, before the interview.
So, I think the most basic, quickest way is to create a Behance or Dribble account. See what other members are posting in their portfolios, and figure out what you need to show from your existing work.
Otherwise the question is kind of broad, generally a portfolio is something you will constantly adjust over time. You will start with something, you will end up with something else, and then you'll get some other ideas, and so on.


Methods to train attention and obedience in a dog?

Question: We have a 2 year old male standard poodle, who is a wonderful dog by the way, and have done some training with him in the past - mainly centered on food and use of an e-collar.  He is completely responsive to both food and e-collar, but is fairly independent and hard to motivate otherwise.  What are some methods for enhancing our bond, and his obedience, without having a pocket full of food at all times?
Answer: 1) throw away the e-collar.  Poor timing on these (and most people's timing sucks) tends to result in poor behaviour, and the dog being frightened to try new behaviours.  They are an easy way to cause yourself unnecessary dog-related problems, and the science backs this up.
See also:
http://www.greenacreskennel.com/dog-behavior-and-training/the-unintended-consequences-of-shock-collars.html
http://www.companionanimalpsychology.com/2013/06/the-end-for-shock-collars.html
http://blog.smartanimaltraining.com/2013/05/23/e-collars-why-i-never-want-to-use-them-again/
(and many others)
2) carry food instead and reward for good behaviour. Poor timing here will have much less awkward consequences than punishment, and carrying food is not a hard thing to do.
3) give it time.  Your dog has a personality and he is currently at just the age when he's testing boundaries and likely to be more independent. You need to let your bond with him develop into friendship, and this takes time, just as it does with human friends.  (Consider also, that if you made your human friends behave the way you want by zapping them when they didn't want to do what you said, they too might become hard to motivate).
Answer: Could you provide some more information in regards to the behaviours you are trying to improve or strengthen


Has anyone ever been punished for Project MK-ULTRA?

Question: So I've been looking into what MK-ULTRA is, and recently a scary question has came to mind. That question being, has anyone been punished for the events of MK-ULTRA? By punished, I don't mean a slap on the wrist or the loss of a job. I mean more on the sense of legal ramifications. If not, was there any real reason they weren't?
Comment: What is the basis for assuming someone would have been punished? Did anyone do anything illegal?
Comment: What are legal ramifications? What was illegal? Which laws were broken?  In general "loss of a job" is illegal unless it is supported by legal process.
Comment: There is a difference between legal and power. At the top there is power, not law.
Comment: @DVK Apparently, very illegal, mostly breaches of the Nuremberg Code (i.e. illegal human experimentation without the subjects' knowledge or consent) and also probably at least one murder.
Answer: From Wiki with references there:

The program engaged in many illegal activities;[3][4][5] in particular
it used unwitting U.S. and Canadian citizens as its test subjects,
which led to controversy regarding its legitimacy.[3]

Some of the methods:

administration of drugs (especially LSD) and other chemicals,
hypnosis, sensory deprivation, isolation, verbal and sexual abuse, as
well as various forms of torture.

No one was charged.
Comment: This answer is long on conjecture and short on facts.
Comment: @ihtkwot Some more facts https://www.intelligence.senate.gov/sites/default/files/hearings/95mkultra.pdf.e.g. It's ok, but we want oversight and control.
Comment: Anyone have a source for "No one was charged"?
Answer: The closest thing I could find to any kind of restitution is mentioned in the Wikipedia article:

Although the government aggressively, and sometimes successfully,
sought to avoid legal liability, several plaintiffs did receive
compensation through court order, out-of-court settlement, or acts of
Congress. Frank Olson's family received $750,000 by a special act of
Congress, and both President Ford and CIA director William Colby met
with Olson's family to apologize publicly.

Not all such lawsuits were successful, and I can find no evidence so far of any criminal charges being pursued.


What exactly is a "bootleg sampler"?

Question: When I got my Sega Saturn video game console in 1996, it came with a "demo disc" similar to the PlayStation's iconic "Demo 1" disc with its fancy menu system and music and everything.
However, they used a very different "branding" for the selection screen and disc artwork for the Saturn. It says "bootleg sampler" and looks like this: https://youtu.be/NGEw0h6y_m8?t=3
What is a "bootleg sampler"? I know a "bootleg" is like an unauthorized recording of a live music performance for profit, or something. It appears to also have other, similar meanings.
But what is a "bootleg sampler"? Why do they call their own, very authorized playable and pre-recorded demos "bootlegs"? And what is a "sampler"? Bootleg sampler? My head spins from trying to understand this. I've been wondering about this since that day in 1996 when I finally got my Saturn after Sega heavily slashed its price.
Answer: Your understanding of "bootleg" is correct - unauthorised. Sega seems to have used the word "bootleg" as a marketing device - a word that will make the product seem "exciting, risky, mildly illegal".

What exactly is a "bootleg sampler"?


I added a line to the cmd.txt file to clear password. Now, i cannot set a password

Question: the file cmdline.txt got init=/bin/sh added to the end.
When I reboot, I do not need a password.
but It will not allow me to create one either.
do I need to now remove the added instruction? in order to create a new password? It goes through the new password create, but fails, and will not save it.
Comment: What are you hoping to do by adding this command? Are you trying to reset the Pi or another users password? Or is there something else you want to do?
Comment: Your headline is "*I added a line to the cmd.txt file* ...". Did you mean **cmdline.txt**? If so then you cannot add a line to it. It **must** have only one line otherwise it will break your bootup.
Answer: From the title of your question I'm guessing you are following some instructions form somewhere telling you to add init=/bin/sh to cmdline.txt in order to boot your Pi in "single user mode". What you are doing here is interrupting the normal boot process after the bare minimum required and running a shell as the root user -- the result being you are logged in without a password.
The instructions then probably tell you to use the passwd pi command to re-set the forgotten password for the user pi? However, because the Pi hasn't completed the usual boot process the filesystem hasn't been mounted fully yet and is still "read-only". The result being that the passwd pi command can't save the new password to the filesystem so has no effect when your reboot.
The solution is to (re-)mount the SD card "read-write" first, before you run your passwd pi command. Do this with the mount -n -o remount,rw / command followed by the passwd pi command. Finally, remove the init=/bin/sh from cmdline.txt and reboot.
Comment: Before reboot, you could also fix up `cmdline.txt`
Comment: Good point, I'll amend my answer.


How to run neogeo games

Question: I have some old neo geo games' backups which I play when I was a child. Is there any way of playing this on this ubuntu 13.04.
Answer: There are ancient Neo Geo emulators roaming around. Alongside GnGeo, there is NeoCD/SDL. I've no idea how well that works but it's just as old so it's just as likely to explode.
The reason NeoGeo gets no love is because people just use MAME. MAME handles a wide spectrum of consoles and arcade machines. And people tend to favour the original arcade ROMs that NeoGeo games are ports of. UpUbuntu.com has a fairly good tutorial on getting it all set up that I can't beat... But the basics revolve around the mame package.
We also have a question about various MAME front-ends:

Are there any UI for MAME?
Answer: GnGeo is a neo geo emulator for linux. You may try this one.
Comment: Doesn't work, it only throws this line: *** buffer overflow detected ***: gngeo terminated
Comment: How to use this?
Comment: check the FAQ - http://gngeo.berlios.de/?page=faq
Answer: I would give FinalBurn Alpha a try. You can install/use it directly in retroarch:
https://github.com/retropie/retropie-setup/wiki/FinalBurn-Alpha
It supports Neo-Geo specifically.
As noted in another answer most Neo Geo games are ports from arcade games, and you can play the original game i
Answer: It difficult to find Neo Geo Emulators for Ubuntu but you should try with RetroArch emulator it's usable for all platforms I think so not sure.
Comment: According to the official RetroArch website, *RetroArch can run on the usual platforms like Windows, Mac OS X and Linux*.
Answer: NeoRAGEx is what you are searching for. The emulator is available for both Windows and Linux.
Comment: You've provided the download link for Windows, not Ubuntu. Is there one? Perhaps adding that one would be of extra value over the current one.
Comment: Not sure if there is version for Ubuntu, but you can run it using Wine. The good thing is that with this emulator you have high emulation success rate, while the other emulators I tried can run only like 10% of the games.

How to run neogeo games


Evaluation of Graphics3D transforms

Question: I want to find the centroid of a graphics primitive after a series of rotation and translation transforms. But it seems that graphics transforms don't "evaluate". For example,
FullForm[Graphics3D[Translate[Sphere[{0, 0, 0}], {1, 0, 0}]]] returns unevaluated. So
DiscretizeGraphics[Graphics3D[Translate[Sphere[{0, 0, 0}], {1, 0, 0}]]] command does not work. I also tried DiscretizeGraphics[Graphics3D[GeometricTransformation[Sphere[{0, 0, 0}],TranslationTransform[{1, 0, 0}]]]], it also doesn't work. Is there a geometric transform function that explicitly transforms the coordinates of the graphics objects?
Comment: Possibly a duplicate of [Why doesn't Normal\[\] work on GeometricTransformation?](https://mathematica.stackexchange.com/questions/11430/why-doesnt-normal-work-on-geometrictransformation)
Answer: It is easy to miss, but in the documentation for GeometricTransformation it says

Normal[expr] if possible replaces all GeometricTransformation[Subscript[g, i],\[Ellipsis]] constructs by versions of the Subscript[g, i] in which the coordinates have explicitly been transformed.

so in this case you have
In[360]:= Normal@
 GeometricTransformation[Sphere[{0, 0, 0}],
  TranslationTransform[{1, 0, 0}]]

Out[360]= Sphere[{1, 0, 0}, 1]

Note it isn't too difficult to find GeometricTransformation expressions that do not convert via Normal, so I guess that "if possible" comes into play there.
Comment: @MikeR - use `RotationTransform` instead of `RotationMatrix`, but it still fails.  What seems to work in that case is `TransformedRegion[Cuboid[{0, 0, 0}, {1, 1, 1}],
 RotationTransform[Pi/4, {1, 0, 0}]]`
Comment: That works for translation, but already for rotation of a cube it doesn't seem to. `FullForm[Normal[
  Graphics3D[
   GeometricTransformation[Cuboid[{0, 0, 0}, {1, 1, 1}],
    RotationMatrix[Pi/4, {1, 0, 0}]]]]]`
Comment: Yes, that works! Also works for several sequential transforms, which is what I was looking for.
Comment: `TransformedRegion` is better for me than `GeometricTransformation`, but unfortunately the following code inexplicably doesn't do anything: `TransformedRegion[
 Parallelepiped[{1.0, 0.0, 0.0}, {{-1., 1., 0.}, {0., 0., 1.0}, {0., 0., 1.}}], RotationTransform[0, {1, 1, 1}]]`. Any idea why?
Comment: @LiamBaker your `Parallelepiped` has two identical vectors, is that valid?  It works in `Graphics3D` but all region functionality rejects it.
Comment: @JasonB. ah, that explains why it wasn't working. Thanks!
Answer: You could use my NormalizeGraphics function for this:
NormalizeGraphics @ Graphics3D[Translate[Sphere[{0,0,0}],{1,0,0}]] //InputForm

Graphics3D[Sphere[{1, 0, 0}, 1]]

Evaluation of Graphics3D transforms


dell e6400 lcd blanks out during boot

Question: lcd blanks out after initial "windows starting" screen comes on. External monitor works fine and laptop completes the boot normally and runs everything fine using external monitor. Running Windows 7 32 bit release. All drivers and bios are up to date. (Update) With the external monitor attached, if I repeatedly press F4 during the boot, the screen will come back on but in a reduced (narrower) size window. When I pull the external monitor plug the screen goes to full size. It may then work for days or screw up again the next day. This "work around" has worked each time I've tried it.
Answer: Are you sure its totally black? Does it appear to be slightly lit? If you hold a flashlight at it can you vaguely see anything being displayed on the screen?
Newer laptops have LEDs not LCDs, which do not have power inverters. If your laptop is older, say 5 years+ there is a chance your LCD inverter or LCD itself has gone bad.
Replacing either is very delicate work even for experienced techs. I would recommend you get a professional to take a lookie see.

dell e6400 lcd blanks out during boot


Is *raises the need for* a valid and meaningful phrase?

Question: I wanted to use the phrase "This raises the need for ...". A simple google search brought many results, most of which were either publications by non-native speakers or english pages of foreign websites. I was wondering if this is a common or correct phrase to use. I want to convey the meaning of "This gives rise to a need for...", but the juxtaposition of words seems weird to me.
Comment: I am not confident enough of my linguistic intuitions on this matter, so I am not posting this as an answer, but to my ear *raises the need for* is suited only to the cases where the causal connection is fairly direct, while *gives rise to the need for* can be used when the connection is indirect and works in combination with other causal factors. I would thus be inclined to say 'the current pandemic raises the need for face masks', but 'the current pandemic gives rise to the need for food delivery services'.
Comment: It helps if you give a whole sentence, otherwise it is easy to give irrelevant answers to what you are looking for. You could also provide a link where these phrases are used.
Answer: The problem is that "This raises the need for" is correct but it can be understood as "This increases the need for" or "This creates the need for". "This gives rise to a need for...", solves the ambiguity.
Answer: Blade,
I think you're fine here. "This raises the need for" seems perfectly natural to me. "This gives rise to a need for" is also grammatically correct, although I'll admit, it sounded strange to me as well.
Google's Ngram viewer is far better for checking these types of things than a straight Google search because, among other things, you can limit it to English books. Have a look here for the usage and here for examples in literature.
Hope this helps.
Answer: Google Ngrams show that raises the need for is at least comparable in idiomaticity with gives/gave/will give/have given rise to a need for (and the need for). We have to take into account that there are more variants hidden in the 'rise to a/the need for' data.

This is as I would have estimated; 'This gives rise to a/the need for...' sound fine to my ears. Looking at the the first 30 results in a Google search for "gives rise to a need for" yields no worrying examples, and mainly examples from businesses / institutions / legislatures in the US and UK.
And 'This raises the need for ...' is, although as you are picking up a slightly odd usage of 'raise' (while 'give rise to' is a familiar idiom), in fairly common use. Again, Google results for a search for the 5-word string are nearly (if not totally) entirely of well-written examples from institutions etc.
As Greybeard points out though, it introduces ambiguity. But, looking at examples on the internet, the 'gives rise to' rather than the 'increases' sense of 'raise' seems by far the more common.
Comment: Do I take it as a compliment that you haven't given this comment under the other answers to date? // I've done a reasonable sampling of the results of Google searches. OP seems to have very different search parameters.


Are Smoke Grenades cumulative?

Question: Does throwing a second smoke grenade make the smoke darker or is the effect not cumulative? Does it depend if it is thrown at the same point or is there an algorithm that calculates which parts of the smoke cloud should be darker?
Comment: @YUNOWORK True. But if you add water to a non-water liquid, it dilutes it. Add smoke particles to an area of non-saturated air, would cause it to be more and more opaque until the air is fully saturated. Heat and smoke particle density would affect the amount of saturation. So, your real world answer is incorrect, unless a smoke grenade puts out 100% saturation instantly--which it can't because it is explosive and therefore not a uniform distribution. But it doesn't matter anyway because Battlefront has almost nothing based in real life physics.
Comment: If you have a cup of water and you add water, the water won't become more liquid. If smoke grenade effects would stack, it would not only be weird, but also a slap into the face of every physical and chemical law
Answer: Disclaimer: I am not a developer of Battlefront and didn't write the engine, but this is what I believe is happening:
Graphically speaking, yes. Two grenades place two particle generators in the engine; the more particles in a space, it considers the area more dense with smoke, therefore more of the pixel will be altered from it's original color toward black.
So it makes it more dark; but since the particles are dense enough to reduce visibility through it anyway, if they are thrown at the same time, you're not going to reduce enemy aim significantly with a second grenade. You'll only affect the color of that already opaque pixel.
Gameplay speaking, overlapping grenades don't make it "worse," depending on the timing and spacing of the two grenades.
Once a grenade is out, it blocks homing completely if the cloud of smoke is between you and your target. Once the timer reaches a certain point it returns to 0% blocking (enabled again). So if there are two grenade effects between you and your target, it can't block homing (homing rockets, droid targeting, etc.) anymore than completely, as it is already with the first. However, if they aren't thrown at exactly the same time, then it will take until the second grenade reaches end of its timer before the homing feature is enabled again. So a second one lets you extend the time of visibility reduction, but not so much the actual visibility.
This assumes both grenades are dropped at the exact same place. If they are offset, and the first dissipates but the second has not, and the second is not between you and your target, then you can "see" through the first (for homing purposes), even though the second hasn't dissipated (since it may be near visually, but technically isn't in your way from a hitscan perspective).
In other words, it doesn't enable homing based on some analog "visibility level" but whether or not the cloud is between you and the target and if the cloud is still "actively blocking." Once the timer ends on the homing blocking, homing is enabled--even though the graphical particles haven't completely dissipated yet.
Needless to say, there is no wind in this virtual sand box, so the behavior is the same indoor as it is outdoor.

Are Smoke Grenades cumulative?


How to get angle between two lines in illustrator

Question: I am working on a logo in which I have to calculate what angle the cut is. Is there a tool in illustrator that lets us calculate the angle between 2 red lines?
Answer: You can enable Smart Guides U and use the Rotate tool R to measure an angle.

With the Direct Selection tool A, select a line segment.

Press R to engage the Rotate tool

Click on the corner anchor to set it as the rotation centre

Click and drag the line and rotate until it snaps to the other anchor. The Angle is displayed.

Finally, undo the changes using Ctrl+Z
Example
Comment: This is great. thank you, one mistake happened while I was rotating, it rotated by canvas and now I cannot set it back to way it was. I can use the trackpad to rotate it but it still have some difference.
Comment: @localhost I don't recommend using a trackpad with Illustrator - too inaccurate. Use a mouse. To reset canvas rotation, click View > Reset Rotate View.
Answer: One way to determine the angle between 2 lines is to select each line separately and note it's angle from the Transform Panel.
Simply calculate the difference between the 2 angles.
Comment: yes, that is pretty much it- it can be confirmed with @Billy Kerr's answer
Comment: so I did the maths one was 97.416 and other was 4.442. so is it correct to say 97.4-4.44 = 92.96 ?


Face embedding of unseen images

Question: I've read about FaceNet but the main problem is still unclear for me. Does embedding work on the trained images only? Or once trained on a big dataset it will readily cluster unknown faces without re-training? I need an approach to add new faces automatically.
Answer: Yes embedding works on unseen images. That is the point of the approach - instead of learning to classify each face in the training set directly, the model learns a vector that is intended to be:

far apart when the face itself is different
similar when the face is the same, but other items in the image - e.g. background, hair style etc - are different

In order to use embeddings to recognise someone, you need one or more sample images of that person, so that you can generate a target embedding. Then you can predict any new image that generates a new embedding close enough to the target embedding(s) to be an image of the same person.
This can still suffer usual problems of overfitting to training set. So it is important to understand what training data was used for the model. Embeddings generated from images that are very different from the training data will not be as reliable as embeddings of images that are similar to the training data.
Comment: @VladimirLenin: That is a different question - perhaps ask it separately. In brief, SVM adds a classifier layer that works on the embedding vector. It is not necessary, but may increase accuracy in a "closed" set of faces. If you have an open set of faces (e.g. where you could have a large number of unknown identities), you have to avoid the use of a classifier and work directly with some distance metric between the embedding vectors.
Comment: Then why they still use SVM on top of it sometimes? For me the most benefit of the approach is getting rid of SVM which requires re-training for new entities.

Face embedding of unseen images


Login Issue SDL Web 8.1.1

Question: We Installed SDL web 8.1.1 on one of the instance , when we login using chrome it's fine but when we access using IE we are getting error . please see attached screen shot , let me know if we need to  enable some settings on IE to fix the issue.
Answer: Please try this browser configurations

Login Issue SDL Web 8.1.1