Industrial electronics layout and design

Question: Why do industrial panels for oil and natural gas compressors or other industrial equipment use  terminal blocks for wire management? I have been doing some repairs for companies and was wondering why they chose that layout. I was thinking instead of all these wires going to different terminal blocks why not make a industrial PCB? Is this possible? Is it considered bad practice?
Comment: A picture of the inside of your panel, which is wired with screw terminal blocks, would make this question a lot better.
Comment: Personally, our hardware has terminal blocks because it needs to be easy to replace a defective unit with a new one.
Answer: Why of course, making industrial PCB is possible.
But also, there are good practical reasons for using wires and terminal blocks.
Control panels can be large
A typical limit on PCB size is about 0.5x0.5m.  The limit is set by the size of a PCB laminating press.  Control panels can be much larger than that.
High currents
Dealing with high currents (above 10A) on the PCB is possible, but it requires wide traces.  A medium sized 18AWG wire is rated for 15A.  High currents encourage to use wires.
Relatively low quantities
Makers of industrial control panels like to use ready-made blocks (thermostats, displays, alarms).  They come in standard sizes: 1/8, 1/16, 1/32, DIN rail.  They have screw terminals as a way of interfacing to the rest of the system, so you have to have wires to interface to them.
Maintenance
Long service life requires maintenance in place.  Ideally, maintenance should be possible without specialized tools.  Screw terminals need only a screwdriver.
Answer: Vibration is killer on connectors.  Screw terminal blocks are more resistant to it than pin connectors or card edge connectors.  Connectors are one of the most common causes of failure in electrical systems - reduce the risk of their failure with more secure connectors like screw terminal blocks or mil-spec connectors and you stop seeing as many failures.
Also loose connections that are about to break are serious danger in causing fires. The question mentioned oil and gas industry. One spark in wrong place there can be critical and cause loss of many lives. IEC Standards also stand for usage of proper installations and because of these standards there are several blocks created to make these secure installations easily.
Answer: I would agree with Nick Alexeev but wanted to add a couple more important reason and a note.
Reason 4:
Flexibility
Unlike consumer based industries and devices, Industrial process and manufacturing is constantly changing. Machines and systems commonly need to be changed to adapt for product variations, re-purposed for new products/task, constant improvement.
(In consumer industry like your HVAC or even electrical panel, circuits may not change for the life of panel. In commercial panels, like restaurants, they don't change that often. In consumer market when you want new improved, you take out the old and buy a complete new device/system.)
Reason 5:
Downtime
When you are doing that change or maintenance, it is critical you do it as quick as possible because the 'True Downtime Cost' can cost thousands, even millions. So the quicker you can add or change out bad device wired to it, the more money is saved in downtime cost.
Note: In the old days, hard wired circuits where used, they where called proprietary. Industrial customer had to rely on vendor of circuit, hope they where still in business, thousands in downtime. relays for switching higher currents had to be un-soldered, etc.. Later the industry evolved to relay sockets for faster replacement, then later to PLCs for even greater flexibility. Now days the PLC (just a dedicated microprocessor) to a PAC (Ind. computer emulating a PLC). Because the controller still interacts with real-world where flexibility and high currents still need to be dealt with, the Inputs and outputs go to terminal blocks.
Answer:
why not make a industrial PCB?

What could your industrial PCB look like?  We can design one and see how it develops.  It's the control panel for a mobile killer robot equipped with a laser death ray. It needs:-

Fieldbus controller with metal screened enclosures
pneumatic valves and actuators for the arms
100 KVA 3 phase power supply with a large fuse
power relays to control the laser water cooling system
power drivers for the electric wheel motors

So it might look like this:-

All of these components might find themselves inside a single control panel. This has similar components, including a large mechanical device (white thing).  Which bit would be the PCB with pneumatic, high and low analogue signals and digital /optical signals?
Virtually all serious control panels evolve as operations evolve.  By the end of their lifetimes, I'd bet that most control panels are unique as a result even if there were duplicates originally.  How would you evolve such a PCB to add another death ray, or upgrade the power of the original one?  Adding another 200A capacity to a circuit board isn't practical.
This one is a good example of a mixed discipline panel where there's half digital logic and half pneumatic controls.  You effectively have wires connected to pipes:-

Discrete parts allow that.  You can easily replace the PLC with a newer more powerful model, especially if the panel is well designed with ample space.  Crowded panels don't help anyone in the long term and might be considered dangerous.  If you've invested £100K in a large panel, you need to protect that capital for a few years by incorporating a great deal of flexibility.  A PCB would need to be completely re manufactured if you decided to use fibre optics rather than RS232.  By connecting standardised parts together, you avail yourself of the division of labour and economies of scale.  These are the tenets of an industrialised society.
Comment: Incidentally, anyone know what the white boxed "mechanical device" at 8 o'clock is?  Transformer?


SO(n) as a manifold

Question: I cannot find some basic information on $SO(n)$ ($n$ general, not just 3) as a manifold: what is the geodesic distance between two matrices, what are the eigenfunctions and eigenvalues of the Laplace-Beltrami operator. It would be good to get a recursive definition starting from $SO(2)$, where the answers are trivial.
Answer: The article On strain measures and the geodesic distance to $SO_n$ in the general linear group has an introductory section on the geodesic distance, which might be helpful. In general I would look into Differential Geometry, Lie Groups, and Symmetric Spaces by Sigurdur Helgason.
Comment: Thank you for the references. I am interested in SO(n) just in order to use them. I am looking for a ready reference so that I can make statements like: the geodesic distance on SO(n) is given by this formula, and these are the eigenfunctions and eigenvalues for the Laplacian on SO(n), see []. Neither the article nor the book nor its sequel mention such formulas. There are formulas in a book by Vilenkin, but they are stated in terms of matrix elements of a group representation. It is a lot of effort to figure out what exactly are these and how they are connected with laplican eigenfunctions.

SO(n) as a manifold


breath technique during jogging

Question: I'm jogging for everyday. i use to get stopped by myself due to high breathing though i jogging in good pace.
How to improve and keep it steady my jog and is that good to drink water after / before jogging?
Answer: A good breathing exercise to slow down your breathing is to time your breathing with your steps. Inhale for three steps then exhale for two. "Steps" in this case would be for one foot. If you chose your left foot, the pattern would be:
Inhale:

Left
Right
Left
Right
Left

Exhale:

Left
Right
Left

This would mean that the faster you run, the faster you breath, and the slower you run the slower you breath.  If you focus on this for enough time, you should eventually just start doing it automatically.
You can drink water any time. Although drinking a lot of water before a jog may cause minor stomach pain. I've personally never had a problem with it, but I know people who have. I would say it's an absolute requirement to drink water before and during a jog on hot days.
Answer: A good breathing exercise you should consider during jogging is to close your mouth during the process. Though there has been studies to suggest that it doesn't matter if you breath through your nose or mouth, i am a strong advocate for nasal breathing during run/jogging. The reason is that, when you breath through your nose, it forces you to breath from your stomach and causes you to be more calm as it slows your breathing down. I always run this way and i can run forever and not feel like i'm running out of breath but the minute i open my mouth, i feel like my chest gets hit with too much air. My suggestion for you is to close your mouth while running and perform  the left right breathing exercise suggested in Answer1 by @DeeV and see how it works for you. Try to hydrate hours before you run. It's always better to be hydrated hours before the run than to try to hydrate during run. Lesson: stay hydrated all the time so that when ever you feel like running, you will be good to go.

breath technique during jogging


Are Chow groups invariant under universal homeomorphisms?

Question: Let $f:X\to Y$ be a universal homeomorphism of schemes, $R$ a coefficient ring. Which assumptions on $f$ and $R$ are suffient to ensure that the pullback map $f^*$ of  $R$-linear Chow groups is bijective (clearly, it suffices to verify injectivity)? Actually, I am mostly interested in the case where $Y$ is a smooth variety over a field $k$ and $X=Y\times_{Spec\,k}Spec\,k^{perf}$; yet I would be deeply grateful for any references on this subject!
Comment: I am afraid this will happen only in trivial cases. For instance if $Y$ is a smooth projective curve over $\mathbb{Q}$, with Jacobian variety $J$, $CH^1(Y)=\operatorname{Pic}(Y) $ is finitely generated, while $\operatorname{Pic}(X) =\mathbb{Z}\oplus J(\bar{\mathbb{Q}})$ is not.
Comment: Well, in characteristic $0$ only "trivial" universal homeomorphisms exist, yes.:)
Comment: @MikhailBondarko how about the resolution of a cusp? (Tag [0BRC](https://stacks.math.columbia.edu/tag/0BRC))
Answer: If you work in equal characteristic, you have a chance of survival. In characteristic zero, this amounts to check that Chow groups do see nilpotent extensions. In characteristic $p>0$, if $p$ is invertible in your coeffcient Ring $R$, what you want is true as well (in fact this is true for higher Chow groups). I do not know any explicit reference though (but this does not mean such thing does not exist). However, this is an easy consequence of combinations of results which are documented.
To see it first observe that higher Chow groups are representable in $DM^{eff}(k,R)$ at least for equidimensional affine schemes: this is Theorem 4.2 in Bivariant cycle cohomology, by Friedlander and Voevodsky (in the book "Triangulated categories of motives"). This extends to non affine schemes as follows: using Suslin's beautiful paper Motivic complexes over nonperfect fields, we may replace $k$ by its perfection without changing $DM^{eff}$ with $R$ coefficients, and then apply the main result from Kelly's book which allows to replace arguments of resolution singularities as in the paper of Friedlander and Voevodsky above by resolution by $\ell$-alterations with $\ell\neq p$, which exist by a well known result of Gabber.
Finally, note that all motivic invariants tend to be invariant under universal homeomorphisms after you invert the exponential characteristic: this may be seen a  joint paper of mine with Déglise for $DM$ (a way to summarize what I wrote above is that, using Suslin's paper, alle the representability results in section 8 of my joint paper with Déglise are true over arbitrary fields), and, more generally, in a paper of Khan and Elmanto for $SH$.
If you are happy to tensor with $\mathbf{Q}$, then all this extend to arbitrary schemes, since $DM$ satisfies $h$-descent with rational coefficients.
Comment: Thank you! Yet does there exist an easier proof? Is it really necessary to invert p? Since $X$ is universally homeomorphic to $Y$, any cycle in it is a pullback of a cycle in $Y$, and any cycle in $\mathbb{A}^1\times X$ is a pullback of a cycle in $\mathbb{A}^1\times Y$; doesn't this help?
Comment: I am pretty sure that the Frobenius is not invertible with integral coefficients: this would contradict the $p$-adic version of Bloch-Kato (obtained by replacing $\ell$-adic cohomology with synthomic cohomology). As for the existence of an elementary proof away from $p$-torsion, I do not see why not (not that you may use Suslin's paper as a basis to reach such a thing, since most of it is about cycles themselves).
Answer: This is easy to answer in equicharacteristic under the additional assumption that $f$ is finite flat and $X$ and $Y$ are irreducible and generically reduced, using $\mathbf Z[\tfrac{1}{p}]$-coefficients, where $p$ is the exponential characteristic (i.e. $1$ if we're in characteristic $0$).
Indeed, in this case push and pull shows that the composition
$$\operatorname{CH}_*(Y) \stackrel{f^*}\to \operatorname{CH}_*(X) \stackrel{f_*}\to \operatorname{CH}_*(Y)$$
equals the degree of $f$ (see e.g. Fulton, Example 1.7.4). Since $f$ is radicial, the extension $K(Y) \to K(X)$ has degree $p^n$ for some $n \in \mathbf N$, hence the same goes for $f$. Thus $f^*$ is injective with $\mathbf Z[\tfrac{1}{p}]$-coefficients.
Similarly, if $V \subseteq Y$ is an integral subscheme with image $W$, then $f_*[V] = p^r[W]$ for some $r \in \mathbf N$, and $f^*[W] = m[V]$ for some $m \in \mathbf Z_{>0}$. Pushing forward gives
$$p^n[W] = f_*f^*[W] = mp^r[W],$$
so $m$ is a power of $p$ as well (these equalities hold in $Z_*(Y)$, so there is no torsion), showing surjectivity with $\mathbf Z[\tfrac{1}{p}]$-coefficients. $\square$
This is enough to go from $k$ to $k^{\operatorname{perf}}$ with $\mathbf Z[\tfrac{1}{p}]$-coefficients by a limit argument (see e.g. Tag 0FH6).
Example. Injectivity is not true integrally, even for divisors on smooth projective $\bar{\mathbf F}_p$-varieties. For example, consider a $\pmb\mu_p$-quotient $X \to Y$ of smooth projective varieties with $X$ a complete intersection of dimension $\geq 2$. Then $\mathbf{Pic}^\tau_X = 0$ but $\mathbf{Pic}^\tau_Y = (\pmb\mu_p)^\vee = \mathbf Z/p$. See for example Cor. 1.2 of this preprint of mine for a modern account (but the result is much older).
I'm not sure if the same phenomenon occurs for a base change along a purely inseparable field extension.
For surjectivity with $\mathbf Z$-coefficients, by the argument above, it suffices to move a subscheme to a linearly equivalent one for which $[K(V):K(W)] = [K(X):K(Y)]$. This seems plausible at least in the quasi-projective case.
Remark. If you don't assume $f$ is flat or l.c.i. or $Y$ is regular, I'm not sure what the definition of $f^*$ is. (At least Fulton does not define this, nor does the Stacks project as far as I can tell.)


How do I backup just a single user account with OS 10.10 Yosemite?

Question: I have a MacBook Pro that will be securely wiped and reverted back to factory state, but I want to save just one personal user account and restore it after the wipe.  I don't think I want to use Time Machine to do the backup unless it can selectively back up a single account.  Is there a way to copy just that user account folder and have my settings, etc., preserved?  How would I restore it afterward?
Answer:
Open Disk Utility application.
From the Menu Bar select "File→New→Disk Image from Folder"
Select home folder of the user account. Click "Image" button.
In "New Image from Folder" window enter:
Save As: Name for .dmg file that will be created.
Tags: Leave blank.
Where: Where to place .dmg file.
Image Format: compressed
Encryption: none
Click "Save" button.
In the "Disk Utility" window, highlight the new .dmg file. From the
Menu Bar select "Images→Scan Image for Restore".

You now can mount the new .dmg file and access the saved files. You may have to use the chown command to reassign ownership of any files copied from the mounted .dmg file.

Update 1:
Personally, I would preform a backup of a users files while booted to a recovery partition or another partition containing OS X. Using internet recovery would also be preferable.
If you choose to preform a backup while logged into an administrator account, then choose to save the .dmg file to location where the user would normally have permission to save such a file.
For example, say I (davidanderson) open the disk utility and try to backup ronjanzen's files to the default folder /Users, as shown below.

I would expect the following error message, because I do not have permission to create the file ronjanzen.dmg in the folder /Users.

Now, if I choose to save to my Documents folder, then I will succeed.

The other alternative would be to give read/write permission to the /Users folder. If you do a "Get Info" from the Finder on folder /Users, you get the following.

If you modify "Sharing & Permission" as shown below, you will not get the above error message.
Comment: @Kent, if you are already an administrator then a pop window will ask for your login password. If entered correctly, then you will be given permission to read the other users files. I did test this before posting it.
Comment: I tried this but after step 5, it said "permission denied" and failed. Any suggestions? I tried from two different admin user accounts.
Comment: @rob: I updated my answer to address your concerns. Let me know if you have any other problems.
Comment: That won't work unless you've given the administrator permission to read the other user's files.
Comment: Apologies!! I've had trouble with that in the past (on OSX Server) and have since resorted to the command line hdiutil or starting Disk Utility as root. Great to know that there's an easier way.
Answer: You can use time machine, then when you set up, use migration assistant. It will allow you to copy specific files (your user account).
Comment: Can I configure Time Machine to exclude other user accounts?
Comment: Yes. You can go to sys prefs > time machine > options, then exclude the user folders.
Answer: All your settings are being kept in /Users/[username] folder.
You can make disk image of that folder, or you can create archive from command line:
$ tar cvpjf [where you want to save archive]/[archivename].tar.gz /Users/[username]

this command will create [archivename].tar.gz file (compressed archive) in [where you want to save archive]/ directory. It will contain all of the files found in /Users/[username].
Now, when you reinstall, get this archive, run
$ tar xvpjf [archivename].tar.gz

You will get your old home directory back. Now, just make sure all the rights are ok (run it even if username is the same as on old system - numerical user id or group id might differ):
$ chown -R [your new username]: [unpacked directory]

(might need admin password for that; don't forget ':' after the username - it makes sure that owner group is correct).
Comment: BTW, `tar -j` creates a bzip2 archive but you gave it a .gz extension. Gzip is the `-z` switch. If you want a bzip2, you should use a .bz2 extension.


Explained variance in linear mixed effect model

Question: Do anyone know a R function (or another way) to get the proportion of explained variance by each one of the fixed effect factors in a linear mixed-effects model?
Answer: This is actually a very complex question. Defining what the proportion of explained variance means in these models is a non-trivial exercise. I would start with chapter 7 of Tom Snijders & Roel Bosker (1999) "Multilevel Analysis: An introduction to basic and advanced multilevel modeling" Thousand Oaks: Sage.
Comment: Thank you very much for you answer.The only issue is that I do not have access to this chapter of this book.
Comment: Even if the book is not in your local library, many libraries offer the option to borrow from other libraries through your own local library at no or nominal cost.
Answer: Nakagawa and Schielzeth (2013) has become the standard approach to this problem (currently cited almost 2000 times).  See R2 for mixed models with multiple fixed and random effects.
Note, however, that the encyclopedic GLMM FAQ highlights that this is a complex issue and does not outright endorse the Nakagawa and Schielzeth approach, instead highlighting it among various other approaches and emphasizing that

'you have to think carefully about what information you want to get out of the coefficient of determination', because no recipe will have all of the properties of R2 in the simple linear model case.


Can we obtain interference pattern with single electron/photon in Young's double slit experiment?

Question: Can we obtain interference pattern by using single electron/photon in Young's Double slit experiment? If yes, then how ...and if no, then why?
Comment: See also: [Single photon and double-slit experiment](http://physics.stackexchange.com/questions/35833/single-photon-and-double-slit-experiment). We encourage new members to do [a basic search of the site](http://physics.stackexchange.com/search?q=single+photon) before posting to see if their questions has already been asked.
Comment: Do you mean observe an interference pattern after launching just one photon?  No.    Do you mean interference after launching many photons, one at a time, one after another?  Yes.
Comment: with a single electron/photon u not going to get a pattern but you will get interference effects.i.e,if u let photons/electrons incident one by one and wait for sometime you 'll see interference pattern on the screen
Answer: G.I. Taylor did the first such experiment in 1909; see https://en.wikipedia.org/wiki/G._I._Taylor
And yes, the statistical pattern of many repetitions shows interference.
The same result holds for similar experimental setups; I've done it with electrons where the slits were provided by ultrathin gold films.
How does this happen?  It is just a fundamental property of quantum physics - Richard Feynman didn't explain it in his lectures, volume III; it simply is.
Answer: Interference pattern will emerge statistically. Single electron experiment will result in a single electron appearing on the screen, but the probability for this electron to appear at a certain point on the screen will be governed by interference of probabilities of a single-slit experiment. As a result, sending more electrons through a double-slit , one after another, will gradually build up exactly an interference pattern.
Answer: Yes we can , that is called single photon double slit experiment
But its general question that how single particle can can interfere with itself so physicst tryies to cheque that by observing the phenomenon but an intresting think happen , pattern get vanish as it observed so its mistery as i think....
but in recen i read a article of prof. Stinberg who has obsebed the path of photon with no loss of interference pattern which again a big question for physics
Comment: "The path" or more exactly the track of "a photon" can only be observed if "the photon" (a misnomer) has a very high energy compared to the weak position measurements that map it out, in which case "the photon" acts like a classical object and there is no interference. There is no mystery here, just endless amounts of philosophical non-sense that centers around profound misunderstandings of the measurement process.


Why is weak topology considered weak while others are strong.

Question: I know for a banach space $\mathbf{X}$ that the norm $||\cdot||$ produces a topology for the space. I also know this is considered "strong". I also understand that the dual, $\mathbf{X}^\ast$, is the set of all continuous linear functionals. I also understand that the set of functions in $\mathbf{X}^\ast$ can be used to create a topology on $\mathbf{X}$ such that they are all continuous. This one being called "Weak topology", I don't understand this, why is it called weak? Why is it viewed as being "weaker" than the norm based one? What is the motivation behind this?
Answer: One motivation of "weak" is, that "strong" convergence implies "weak" convergence. Hence, the "weak" convergence is a weaker convergence than "strong" convergence.
Comment: To my surprise I discovered that there exists older literature about *general topology* seeing the concept of "weak" in exactly the opposite way. Have a look at my answer to https://math.stackexchange.com/q/3234052. This point of view "survived" in the notion of CW-complexes where "W" stands for "weak".
Answer: We speak of weak/strong topologies and also of coarse/fine topologies. Either metaphor relates to the same relationship.
A topology on a set $X$ is a subset $\tau$ of $\mathfrak{P}X$ - the power set of $X$. To qualify as a topology the collection $\tau$ must satisfy the usual axioms.
If $\sigma$ is another topology on $X$ then to say $\sigma$ is weaker than $\tau$ means exactly that, as sets
$$
\sigma \subseteq \tau.
$$
You may find it a useful exercise to explore how this relation induces a partially-ordered set structure on the topologies on $X$, and whether you can find suitable definitions of $\sigma \land \tau$ and  $\sigma \lor \tau$ which make this poset into a lattice.
Comment: so strong vs weak is identical to course vs fine?
Comment: yes, with a slight clash of semantics, since coarse corresponds to weak, and strong to fine. however "strong/weak" has taken on a rather more specific  family of meanings in the context of topological vector spaces, whereas the "coarse/fine" dimension is of more general application
Comment: I see, thank you :)


What do you call a situation when the traffic is stopped on the part of the road which is being maintained?

Question: It is not a gridlock or deadlock and vehicles do not wait in queues, but it is a situation when you know traffic is ..... because of the road rehabilitation.
Comment: If you start a question with "how do you call" it is a sure indication that you are not a native speaker. You should consider whether your question is appropriate to English Language Learners.
Comment: Traffic has been diverted because  of the work in process. http://dictionary.cambridge.org/dictionary/english/divert
Comment: Traffic is at a standstill. (USA)
Answer: The usual phrase, at least in the NYC metro area, is backed up: "Traffic on the FDR Drive is backed up from the RFK/Triboro Bridge to 14th Street due to road construction at 130th Street."
If the condition obtains in a non-continuous fashion at several locations on the same road, you may also hear the term congested or congestion: "There is an accident at Exit 12 on the Hutchinson Parkway, backing traffic up down to Boston Road, but you'll also see congestion right back to the Whitestone Bridge."
If by "traffic is stopped", you mean that no vehicles are permitted on a section of roadway (the segment is closed), then diverted is appropriate: "Traffic is being diverted from the West Side Highway at 96th Street due to sinkhole repair at 91st Street."
Answer: I think you are thinking of a 'traffic bottleneck'.
A traffic bottleneck occurs when you have a physical object blocking part of the road, causing disruption. Unlike a traffic jam, where there is no obstruction, and driving is just slow.
A bottleneck can refer to construction, or a car wreck, or some other physical thing blocking a lane and causing cars to merge, and slow.
Sources (Don't hate me because its a wiki o3o )
https://en.wikipedia.org/wiki/Traffic_bottleneck


Workflow for un-publishing component or pages

Question: Can we create a workflow which gets triggered when an item is unpublished?
Answer: Yes... and no. It depends on how much you need this requirement.
I've commonly seen workflows being designed for unpublishing. Items that are due to be unpublished are added to a bundle, and then the workflow has the logic to unpublish the items after approval (possibly unpublishing them first from staging, then from your live site).
If you really need it to be when unpublishing, then you could write some event system code that would add the items to a bundle instead of unpublishing them, and start a workflow for approval then.
I frankly prefer the first approach, possibly coupled with some UI magic to hide the unpublish button.
Comment: Regarding approach 2 where i catch the un-publish event in event system and start a new workflow, how can i stop the initial un-publishing event which has actually triggered the event
Answer: Since Tridion 2013 you can define an Workflow Process that will Unpublish/Expire content in the CMS. Basically in the new Workflow 2013 you can define a Workflow Process that is started On Demand for Bundles and perform different kind of operations like Unpublishing.
For instance a typical implementation will have two Workflow Process (Publish and Expiration) that can be attached to two different Bundle Schemas (Publish and Expiration) so if you want to unpublish content create a Bundle using the Expiration Schema then start the Unpublish Workflow On Demand.


Where can I find logs on recent USB insertion in the Event Viewer?

Question: I am using Windows 10 and would like to find logs of recent USB insertions on my desktop. Using the built in Event Viewer, where can I find these logs?
Comment: To find list of inserted USB devices: https://superuser.com/a/1695767/249349
Answer: Per scottschlaefli's answer, Windows does not log this event by default.  However, you can do this with a third-party utility.  One I've found useful to log USB activity:  http://www.nirsoft.net/utils/usb_log_view.html

USBLogView is a small utility that runs in the background and records the details of any USB device that is plugged or unplugged into your system. For every log line created by USBLogView, the following information is displayed: Event Type (Plug/Unplug), Event Time, Device Name, Description, Device Type, Drive Letter (For storage devices), Serial Number (Only for some types of devices), Vendor ID, Product ID, Vendor Name, Product Name, and more.
Answer: Try logman.exe trace.
USB insertion is not a logged event in windows event viewer by default. You can create event traces for USB devices using logman by following these steps located in this Technet article:
In an administrative command prompt enter the following
logman create trace -n usbtrace -o %SystemRoot%\Tracing\usbtrace.etl -nb 128 640 -bs 128
logman update trace -n usbtrace -p Microsoft-Windows-USB-USBXHCI (Default,PartialDataBusTrace)
logman update trace -n usbtrace -p Microsoft-Windows-USB-UCX (Default,PartialDataBusTrace)
logman update trace -n usbtrace -p Microsoft-Windows-USB-USBHUB3 (Default,PartialDataBusTrace)
logman update trace -n usbtrace -p Microsoft-Windows-USB-USBPORT
logman update trace -n usbtrace -p Microsoft-Windows-USB-USBHUB
logman update trace -n usbtrace -p Microsoft-Windows-Kernel-IoTrace 0 2
logman start -n usbtrace

This will create a trace at  %SystemRoot%\Tracing\usbtrace.etl
This log can become excessively large and logging all activity for the USB stacks is not going to be a good idea between multiple sessions, this is more for troubleshooting USB activity.
USB disks will cause event ID 4688 to be logged to Windows>Security when inserted and mounted by the OS, maybe that's enough but there isn't a log entry anytime a USB device is connected. If the concern is removable storage devices you can enforce auditing through Group Policy as described here:
Enforce a GPO with the following:
Computer Configuration>Security Settings>Advanced Audit Policy Configuration>Object Access>Audit Removable Storage>Success (and Failure if desired) audit event boxes checked.
Comment: Undead link: https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/how-to-capture-a-usb-event-trace
Answer: I'm not a aware of a full list, so run a tool called EventGhost. When a device is attached or removed you see an event on the left side.

It includes a string with the hardware id. Look for the ID of your mouse
Answer: On a device running Windows 7 or 10 there several events recorded in the Event logs when you plug in a USB device into a system that requires a driver.
You can see USB devices being connected, as well as see when they are disconnected by using the Event Viewer to parse the: "Microsoft/Windows/DriverFrameworks-UserMode/Operational" event log. (By default, this event log is not enabled, so if you're interested in an event that's occurred before you enable this log, you're out of luck.)
Comment: This is not a full answer, so I would love to see it turned into one.  I ran eventvwr and found the log you refer to, and opened "Operational" under it and enabled it.  But it doesn't log anything when I plug/unplug my keyboard.
Comment: "I" am interested ...
Comment: Works for me when inserting a USB device (I tried an USB SD card reader). It creates a bunch of events for each plug/unplug step.
Comment: Interesting, thanks. I didn't know that. I just tried and it works. But it's too low level for me. It logs TOO MUCH. I tried with a USB licensing stick and that generated 44 events for plugging and another 44 for unplugging.


What is the best argument for maximum parsimony method in phylogenetic tree construction?

Question: Beside the fact that maximum parsimony is computationally cheap, what other good arguments are there for it? Is there any model behind this principle? Why would one expect this principle to provide right phylogeny in any situation at all ?
Comment: I've programmed a phylogeny tree data parsing program which uses standard tree of life OTT files. I had never heard of maximum parsimony and the topic on Wiki exceedingly complex. They just say it's popular because it's simple. computationally speaking the data in pylogeny tree file can't actually be wrong if the tree does not contain errors unless you skip some nodes, a tree can easily be checked by counting the branches up and down from a species and into their shared nodes, and a check can't present an error. that said I don't know if the OTT even has taxon and information of that kind.
Answer: The idea of parsimony is that when constructing phylogenetic trees a simple hypothesis (e.g., four evolutionary changes are necessary to connect two taxa) is more likely to be true than a more complex hypothesis (e.g., 15 evolutionary changes) (source: Berkeley University).
The reason is that for a certain taxon to evolve, there must be a certain number of evolutionary changes. In the end, this happens by more or less stochastic processes (Dingli & Pacheco, 2011) that randomly generate genetic changes (mutations). The characteristics of better fit individuals survive, while those of the least fit are terminated from the gene pool. Hence, every additional change that must be adopted to create a new taxon from another means that the chance that that happens decreases exponentially; it's all a matter of statistics. The less the number of changes needed, the higher the chance that that might have actually happened.
Reference
- Dingli & Pacheco, BMC Biology (2011);9:41
Answer: Generally speaking, parsimony consists in not making unnecessary ad hoc hypotheses.
In the case of phylogeny, parsimony can be used at two stages: when inferring the number of character changes for a given topology and then when choosing among topologies.
One does not expect parsimony to provide the right phylogeny in any situation. It is just the most sensible we can do when no further information about evolutionary processes is available. This is why parsimony is a popular choice when it comes to deal with morphological data: models of character evolution are not as easy to devise for morphological data as for molecular data.
In the case of phylogeny based on molecular data such as protein or DNA sequences, models of evolutionary changes exist, which are not based on ad hoc hypotheses, but on reasonably good knowledge gathered from disciplines such as molecular biology, biochemistry, etc.
Under these models, "hidden" multiple character changes are expected along long enough branches. This may lead to differences with respect to the most simple parsimony criterion, when inferring the number of character changes in a topology.
In such a case, simple parsimony may not be the most sensible approach to phylogeny resconstruction.


Difference between "click" and "press"

Question: I want to know the difference between click and press. As we click the mouse and press a button. Where do we use press and where do we use click?
Comment: If, when you do the action, you hear a "click" sound, then it's a click.  Up until the "click" occurs it's a press.
Comment: how did a dictionary explain the difference?
Comment: @HotLicks Exactly. I was in the process of rustling up some definitions for an answer - would you like to do the honours?
Comment: @Lawrence - No, have at it!  It's time for me to get breakfast.  (Wouldn't want to miss that!)
Comment: @HotLicks Oh, very well then :P . *Bon Appétit*!
Comment: Please provide an example sentence in which you think the two verbs are interchangeable. Failing that, this question does not really make much sense, as the two verbs mean very different things and are not generally interchangeable at all. Plus you've actually explained the difference yourself. You cannot click an elevator button IRL because there's no mouse involved. You can click it in a computer game, though.
Answer: Typically, we use "click" for mice and buttons on the computer screen, and "press" for buttons which we physically push. Googling shows that some people do use "press the mouse" for the mouse button. However, I don't think anybody would say "click floor 5" for a button in an elevator. Similarly, unless it was designed for a touch screen, I think it would be quite rare to use "press the start button" for the image of a button which you have to activate by positioning the cursor over it and clicking the mouse.
Speculative etymology follows; TL;DR
Why? When mice were first invented in California, the inventors had to come up with a verb for "clicking" a mouse button. The verb they came up with was the one that stuck.
From this Ngram, it appears that click was first applied to mice, and then applied to buttons on the computer screen.
While it seems that the usual term in the U.K. is press the button, many Americans don't press buttons, they push buttons. See Ngram.  I suspect this variation is regional, but I have no real evidence for this, and I don't know what the regional distribution of press the button and push the button is in the U.S.
Suppose the inventors of mice typically used "push the button". It would have been clear to them that you couldn't say "push the mouse", as that would be ambiguous: "push the mouse" might be interpreted as "move the mouse".
So they might have started using "click" as the verb.
It seems to me that "press the mouse" is completely unambiguous, and would have been a better choice than "click". But maybe that word choice didn't even occur to the inventors of the mouse, because in their dialect, one didn't press buttons, one pushed them instead.
Comment: While *"left click the mouse"* is pretty clear, *"left push the mouse"* ***might*** be interpreted as move the mouse leftwards along the surface of your desk.
Comment: we use left click of mouse button but not use the left  push button ?
Comment: i want to ask Is we say press the button but when use mouse then say click the mouse.
Comment: I ***don't*** say "press the button"; I say "push the button". And you don't want to use "push the mouse", because that's ambiguous.
Comment: I think someone's pushing someone's buttons.  "Push" is rarely used (in the US) with regard to actions on a GUI device.
Comment: @Hot Licks: I'm talking about when mice were first invented. I've edited my answer to make this clear.
Comment: Thanks for the answer and the historical context that went with it. Made a lot of sense.
Answer: Click is more of a software thing, while press is more of a hardware.
What it means is when there is physical touch involved in an action without any medium then its press. For example you press the button on the wall, or press the cross button on your mobile phone.
Click involves a medium. So when you use a mouse or a pointer to do the pressing for an action; you are clicking.
So you click the cross button on a desktop, while you press it on a touch screen mobile phone.
Comment: I'm confused ... pressing a button seems physical, like clicking a mouse.
Comment: Actually the name came into being because of the click on a mouse has a sound **click**. Is it clearer?
Comment: So my keyboard is unplugged it doesn't **click**??  What's that sound I hear, then?
Comment: @hot-licks You are right actually. The sound was called [clickety clack](http://www.aamboli.com/translate/clickety-clack).
Comment: @AamBoli - No, "clickety-clack" is the sound of a train rolling over a **real** railroad track, one before they installed those stupid welded rails and made it all quiet-like.
Answer: First, some definitions:

Click
noun 1 A short, sharp sound as of a switch being operated or of two hard objects coming smartly into contact
noun 1.2 Computing An act of pressing a button on a mouse or similar device:
verb 1.1 Computing Select an item in a graphical user interface by pressing a button on a mouse
- ODO
Press verb
Move or cause to move into a position of contact with something by exerting continuous physical force
- ODO

Press is more generic. A click is a press, but a press may not be a click.
Of the click definitions, verb 1.1 is the closest to your question. It is related to noun 1.2, which in turn is related to the more general noun 1. Click is an onomatopoeia that is related to the sound that the mouse button button makes when pressing it activates the mechanical switch underneath.
In answer to your question: the difference between click and press is that click evokes the audible (and perhaps even tangible) feedback from the mouse, whereas press simply refers to the generic action of pushing the button.

Difference between "click" and "press"


How do I use TextMate as my command line subversion message editor?

Question: Simply setting the SVN_EDITOR variable to "mate" does not get the job done.  It opens TextMate when appropriate, but then when I save the message and exit, I'm prompted to continue, abort or try again.  It seems like the buffer isn't returned to the svn command for use.
Answer: You need to include a command line option in your SVN_EDITOR (or EDITOR) variable
export SVN_EDITOR='mate -w'
This makes the svn command wait for the editor to close/release the file before continuing, which is where the process is getting mucked up now.
See here.
Answer: I found this thread googling for textmate as svn editor. While trying I found out that you can also set the editor-cmd in ~/.subversion/config file and more important you should set the value to mate -wl1 because in this way the caret will be placed on the first line of the file, the place where to put comments for commit message.
Just my contribute to this thread.


Definition of distribution

Question: I'm trying to solve this question with the following given information;
I have $\Omega \in \mathbb{R}$ open set, $C^\infty_o(\Omega)$ is a vector space with usual addition and multiplication, and the space $\mathbb{D}(\Omega)$ equipped with the following convergence is the space of test functions.
define the Convergence $\phi_j \rightarrow \phi$ in $\mathbb{D}(\Omega)$  if:

There exist $K \subset \Omega$ compact such that support$(\phi_j)\subset K,\forall j$.
$\forall \alpha$ multi-index; $\partial^\alpha \phi_j \rightarrow \partial^\alpha \phi$ uniformly on $\Omega$.

$\mathbb{D}^\prime(\Omega)$ is the set of distributions on $\mathbb{D}(\Omega)$
The question is; if $\Omega = (0,2)$ & $u:\mathbb{D}(\Omega) \rightarrow \mathbb{R} , u(\phi) := \sum_{j=1}^\infty \phi^{(j)}(\frac{1}{j})$ where $(j)$ is the $j^{th}$ derivative of $\phi$.

(a)Show that $u \in \mathbb{D}^\prime(0,2)$.
(b)Does u have finite order?

Solution: (a) apparently $u$ is linear and let K$\subset$ (0,2) compact then there exist $N\in \mathbb{Z}^+$, $i.e \frac{1}{N} \in K$, but $\frac{1}{j} \notin K$ for $j>N$ If support$(\phi) \subset K$ then $|u(\phi)| = |\sum_{j=1}^N \phi^{(j)}(\frac{1}{j})| \leq \sum_{j=1}^N max|\phi^{(j)}|$ then I can conclude it is sequentially continuous then it is a distribution and $u \in \mathbb{D}^\prime(0,2)$
My problem with (b) part, I can see from answer in (a) that I can't assume the finite order because of dependence of $N$ on the set $K$ but also I don't know how to prove it is not finite?
Can anyone help?Thank you.
Answer: Suppose it was finite order, say order $N$. Let $\phi$ be supported on $U\subset (0,2)$ where $$U\cap \{1,\frac12,\frac13,\dots\} = \{\frac1{N+1}\}$$
Then $u(\phi) = \phi^{(N+1)}(\frac1{N+1})$...

Definition of distribution


Godox X1T-C & TT350C & Canon M3

Question: I have a Canon M3 with Godox X1T-C and TT350-C. It seems the two Godox units are working with each other but my Canon M3 isn't. When I press the test button on the X1T, the TT350C flashes. It even flashes when I mount the trigger on camera. I checked online and the trigger is listed as compatible with my camera.
Comment: Please add firmware versions of the 2 devices and clarify what exactly does not work. I guess that the flash fires when attaching the transmitter, but not on taking a photo.
Comment: When you say "It even flashes when I mount trigger on camera" do you mean it fires when you slide the trigger onto the hot shoe? (Hint: always turn flash/transmitter off when sliding on/off hot shoe. Failing to turn the flash/transmitter off can damage it.) Or do you mean the test button on the transmitter works even when the flash is attached to a powered up camera?
Answer: If the transmitter already works with the flash, then the usual stuff seems to be ok. The flash may accidentally fire when putting the transmitter on, as the pin for firing my be shorted when sliding it into the socket.
Note that the X1T-C transmitter needs firmware V22 to work with the M3. Current version is V27 from 2019-06-18.
Also the TT350C needs v1.5 for M3/M5/M6 compatibility.
Please make sure both devices are patched up to current firmware levels. Some more details on that: How do I tell if my Godox trigger or flash needs a firmware update?

Godox X1T-C & TT350C & Canon M3


BitNami LAMP stack on ubuntu

Question: I just installed BitNami LAMP stack on ubuntu. When I visit localhost/127.0.0.1 Apache returns "403 Forbidden. You don't have permission to access / on this server." I try repointing Apache's home directory to another folder (same hard drive, same partition) that's set to 777 recursively. Still getting 403. And then I change the ownership of the directory to under my username and daemon group from root/root. Same error. Am I missing something here?
Comment: Anything set recursively to 777 is wrong. Full stop. Period. The end.
Answer: Use the following command:
<code>sudo ./ctl.sh start apache
</code>
You will be asked to enter the password - it will then start.

BitNami LAMP stack on ubuntu


'pow' Was Not Declared In This Scope

Question: #include <iostream>
#include <string.h>

using namespace std;

int main()
{
    int e=0;
    int b=0;
    cout<<"Enter Exponent";
    cin>>e;
    cout<<"Enter Base";
    cin>>b;
    pow(e, b);
    cout<<"Power:"<<e;
    return 0;
}

void pow(int e, int b)
{
  int t=1;
  while(b==t)
  {
    e=e*b;
    t++;
  }
}

Here is the error I received:
ulaga.cpp|29|error: 'pow' was not declared in this scope

Can any one explain why this error occurred?
Comment: Move the definition of `pow()` above the `main()` or declare the function before `main()` so that `main()` knows what `pow()` is.
Comment: How is this problem an "argument passing error"?
Comment: your function `pow` has no return or output arguments and appears to have no side effects, so any decent compiler should optimize it away anyway ... perhaps you wanted to have `e` an output argument, then declare `pow(int&e, int b)` ... and you shouldn't call it "pow", which suggests it's computing a power, which it doesn't ...
Answer: You need to forward declare the pow function. Like -
....
void pow(int e, int b);

int main()
....

There are few things wrong here. For example e is passed by value. So, e in main is different from that of pow.
pow(e, b);
cout<<"Power:"<<e;  // This just prints the value taken from console
                    // And not the calculated power.

Either make pow function to return a value (or) pass e by reference.
Answer: The C++ compiler parses through your code file sequentially in order. i.e. line 1 then line 2 then line 3... and so on. So by the time the compiler comes to the function call statement pow(e, b); in your main() function, it hasn't yet reached the definition of the function void pow(int e, int b) below the main() function and therefore gives you the error. There are two ways to solve this.
1) Move the definition of void pow(int e, int b) (and any other function that you plan to call from main()) above the main() function itself. This way the compiler has already parsed and is aware of your function before it reaches the pow(e, b); line in your main().
2) The other way is to use a forward declaration. This means adding the line void pow(int e, int b); before the main() function. This tells the compiler that the function given by the forward declaration (in this case void pow(int e, int b)) is defined in this code file but may be called before the definition code of the function in the file. This is a better method as you may have multiple functions in your file calling one another in different order and it may not be easy to rearrange their definitions to appear before they are called in a file. Here's a good read on Forward Declaration
You may also want to pass parameters by reference to your function to get the correct result. i.e. use void pow(int& e, int& b). This will cause the values modified in your pow() function to actually be applied to integers e and b and not just to their copies which will be thrown away after pow() is done executing. This link about passing arguments by reference in functions is pretty good at explaining this.
Comment: @Mahesh - I remembered how the links in my comment and the examples in those links clarified things for me back when I was new to C++ and simple things like this OP post would hold me up. I thought these may be helpful to OP. :)
Answer: This can easily be fixed by just importing #include <cmath> in the beginning of your code.
Answer: You need to use forward declaration of your function pow. Or just move it's definition above the main function.
Answer: I was getting a similar error but I just added it.
#include<cmath>

and the "pow" not declared error got resolved.

'pow' Was Not Declared In This Scope


What can I use as a concrete release agent for aluminum forms?

Question: If I need to use aluminum sheeting as form for pouring concrete or another cement product, such as mortar/stucco, is there something (chemical) I can coat the sheet metal with so the cement doesn't stick to it?
Answer: I know this is late, but I'm pretty sure you could get away with PAM or grease for releasing aluminum from concrete. Commercial release products are an assortment of commonly used items like mineral oil, or silicon lube, or graphite; less common are metal stearates (like zinc stearate in a can). I have played around with zinc stearate. I still have some that I should proably throw away, since I don't really have a serious need for it.
Comment: I've heard of using used motor oil...
Answer: Check with one of your local building supply stores that cater to concrete contractors and see if they have release agents. They do sell release agents that you can spray on any type of concrete form to help the concrete release from the form. I've heard of using powdery substances on your form before pouring the concrete can help the concrete to release as well.


What physically limits qubit connectivity in superconducting chips?

Question: All the superconducting based quantum computers I'm familiar with have a maximum of 4 nearest neighbors per qubit. Trapped ion architectures seem to be able to drive entangling gates between all pairs of qubits in devices containing up to something like 50 qubits. What is it that is limiting building superconducting chips where each qubit is connected to say, 10 others? Is it a control limitation, geometric, frequency crowding, perhaps something we can do but the hit in fidelity or coherence times makes it infeasible?
Answer: From my understanding, there is no fundamental reason why a given superconducting qubit cannot be connected to many others.
In practice, however, you are facing the following limitations that are clearly technology-dependent (they depend on how you perform your two-qubit gates). Those limitations are typically either related to a frequency issue (there is a limitation in the total number of frequencies you can allocate to your qubits: it will give a limitation to how much qubits one given qubit can communicate to), to very "practical" issues (roughly speaking you would need a much more complex architecture if you want a high connectivity), or noise issues (the less interactions can be turned on, the less noise can enter in the system).
Method 1 to perform two-qubit gates: intermediate coupler scheme
One way of performing two qubit gates is based on a coupler scheme. Basically between qubit Q1 and qubit Q2, you use a coupler "C" (that is usually a resonator, sometimes also a qubit, but which does not contain any information from the algorithm). By tuning the frequency of this coupler you can make $Q1$ and $Q2$ interact in some "effective frame" (and hence perform a two qubit gate). One ref for this.
The issue with this scheme is that you would need a coupler per pair of qubit that need to interact. It can quickly be a lot (if you have $N$ qubits in your computer and you want to perform an arbitrary two qubit gate between each pair of qubits, you would need $\binom{N}{2}$ couplers). I let you imagine the nightmare in wiring and overall scalability.
Method 2: you couple different qubits with a bus
In this method, you put many qubits in contact with a bus. This bus will mediate the interactions and can allow "in principle" to make any pair of qubits connected to this bus to interact to make a two qubit gate. This is much easier to scale up with that.
One example is the cross-resonance scheme. The principle is to send a microwave pulse on $Q1$ at the frequency of $Q2$. Doing so you can perform two-qubit gates between $Q1$ and $Q2$. In this scheme, one natural limitation is the number of qubits that can be connected to the bus. You need to be sure to have enough frequencies to avoid "accidentally" performing a three body interaction. For instance, if you only have two frequencies available but that you put three qubits on the same bus, you will not have enough space in frequency to make the thing work.
This question leads to another one: how do I know that I lack frequencies? An easy criteria for that is to consider that transmons qubits are typically at frequencies in the range $6 GHz \pm 1 GHz$. Then the total bandwith you can have is $\Delta f \approx 2 GHz$. The spectral width $\Delta s$ of a signal is typically given by the inverse of its duration (shorter signals are more spread in frequencies). Then, knowing the duration of your gates you can deduce how much frequencies you can reasonably put. Typically, you can have $\Delta f / \Delta s$ different frequencies for your qubits. What limits to make $\Delta s$ as small possible is because you want to manipulate your qubit in a "fast enough" manner (otherwise they will decohere).
As a last comment: there might exist other methods than the one I have put here. But they are the two main ways of performing two-qubit gates I am thinking of. The first method has been used in the Sycamore processor from Google. I know that the second method (in particular cross-resonance) is used in IBM quantum processors.
Comment: @MartinVesely My guess would be that it would help, yes. But there are also other issues by connecting one qubit to many others which is that if you do that you also open new potential noise channels for your qubits. This is true for the two methods.
Comment: Concerning the method one, it sounds like *tyranny of numbers* known from classical mainframe computers before integrated circuits mass deployment is back. So 3D structures can help. Right?
Answer: If you increase the number of transmon qubits (for example) connected to one transmon qubit, the charging energy will increase. If this happens, qubit frequency and anhamornicity will change and you will be out of the transmon regime you need to operate the qubit.
Answer: I would add that there are also physical limitations. Transmon qubits are realized in planar semiconductor structures, so you are limited to only two dimensions. Of course, you can make multilayer chips like in classical semiconductor instruments, however, there is a issue with "induction" from lines in one layer to another etc. Moreover, you have to plug qubits to reading lines and input lines which makes the multilayer design even more difficult.
Notwithstanding that even single layer chips have currently issues with connecting many lines. This could be solved with multi-chips design, i.e. more quantum processors connected each other.
Still you will face issues mentioned by Manuel García.


Is there a way to set a fixed Local Peer ID in a Substrate blockchain?

Question: I am currently working with a Substrate blockchain and I was wondering if there is a way to set a fixed Local Peer ID, instead of it being generated dynamically every time the node starts up. I have been unable to find any information on this in the documentation and would greatly appreciate any help or guidance on this matter. Thank you.
Answer: You can use Subkey to generate a node key, that you can then supply to the node using the <code>--node-key</code> option.


How can I enable usb debugging on a broken phone?

Question: My android mobile is accidentally broken. And the usb debugging is set to off. If I can enable it I could use it through visor in PC. But can't do it now. :( I don't have OTG supported too. My android version is 7.0 Nougat. The manufacturer is Symphony LiteTel. Model: Symphony LiteTel - LT4502 Is there any way? :(
Comment: The Android version is important, therefore thanks for including this info. However every Android device can be seen as unique, therefore you should additionally name the manufacturer and the exact model name of your device. Otherwise the answer is just "may be".
Comment: @Robert, I've added those information. Could you please check?
Comment: I thought may be your device has an MTP chip which allows to flash a custom firmware with pre-enabled adb. But your phone seems to be very special not even find some detailed tech specs. Hence this won't work - sorry.
Comment: :sob: @Robert thank you.
Comment: Related: [Can I enable USB debugging using adb?](/q/120394/16575) // [Broken screen while debug mode was disabled. How can I re-enable adb?](/q/12834/16575) // [Enable ADB and/or change USB connection mode on Galaxy S7 w/ broken screen](/q/159551/16575) and probably more in the resp. "related" sections, as this is a question coming up frequently.
Answer: you can't do much because device has locked bootloader
well. so spoken, you can't do much wrong and can try something stupid ;) basically adb can be enabled by modifying boot or system partition. but locked bootloader means no modifications allowed.
some older devices have no protection for flashing modified partitions, only avb/dm-verity will deny boot in such case.
however, Magisk is able to by-pass dm-verity in some cases. most likely you will brick your device with this method, but give it a try (you can repair it by restoring official partitions)

download latest platform-tools

get a flash tool for your device. for Spreadtrum/Unisoc chipset it's SPD Upgrade Tool (make sure you download latest version)

install Spreadtrum USB drivers

download stock ROM according to your current android version / build number (you can check from fastboot)
fastboot devices
fastboot getvar all

in UpgradeDownload.ini (SPD_Upgrade_Tool) change the following flags
Repartition = 0
ShowOtherPage = 1
CanEdit = 1
CanSelect = 1

extract the stock ROM and find the boot.img (you will patch) and the userdata.img (you must delete) in SPD ImageFiles/_DownloadFiles

1. Magisk root + enable usb-debugging + by-pass dm-verity

unpack the boot.img with any ramdisk tool
(i recommend AIK unpackimg.bat)

modify default.prop to enable adb
(use Notepad++ for correct line ending LF)
ro.secure=0
ro.adb.secure=0
ro.debuggable=1
persist.sys.usb.config=mtp,adb

repack ramdisk/kernel and copy image-new.img to any android device (android 7.0 recommended)

install Magisk Manager and patch the image file with settings "keep AVB/dm-verity" and "keep force encryption"

goto settings - about device - tap build number 7x (seven) times and enable usb-debugging in developer options

open cmd.exe, navigate to platform-tools folder and copy magisk_patched.img back to PC
adb devices
adb pull /sdcard/Download/magisk_patched.img

2. now comes the tricky part. you must flash that file to your broken device (boot partition). that is untested and may fail

open SPD Upgrade Tool - Settings - Main Page. uncheck all entries that do not apply to boot partition

especially make sure all entries related to "Erase" or "UserData" are removed. you only want to flash boot (not to confuse with uboot)

select magisk_patched.img from platform-tools folder and replace the original boot.img in the proper entry

Power off your device. connect your device. start the flashing process

finally, reboot your device and check adb connection
adb devices
scrcpy

if no adb connection that means the bootloader does not allow modified partitions and your device is bricked now
unbrick by flashing the original boot.img (see step 2)
make sure never flash userdata you will lose all data
Comment: thank you so much for your contribution. I don't know if I could do this or not. But I'll try.
Comment: https://www.xda-developers.com/scrcpy-control-android-on-pc
Comment: can confirm this method works 100% for Lenovo Tab 7 Essential (TB-7304F) and Cubot King Kong B-1 (X511) both with MTK SP Flash Tool


If $f$ and $f\circ h$ are nonconstant and real-analytic, with $h\in C^\infty$, does it follow that $h$ is also real-analytic?

Question: Let $f,g:I\to\mathbb{R}$ be two real, non-constant, analytic functions on an open interval $I\subset\mathbb{R}$. If there is a smooth function $h:I\to\mathbb{R}$ (i.e. $h\in C^{\infty}(I)$) such that: $(f\circ h)(t)=g(t),\ \forall\ t\in I$, is it true that $h$ is also analytic on $I$?
Comment: Take $f = g$ as constant functions.
Comment: I've edited my post. Yes, it would be obvious indeed...
Answer: If we add that $f'$ does not vanish nowhere, then the answer is yes.
It can be checked locally. As $f$ is real-analytic, it extends analytically in an neighbourhood of $h(I)$ in $\mathbb C$ - We assume that $f$ is real analytic on an interval $J$, with $h(I)\subset J$.
Let now $h(t_0)=w_0\in h(I)$.
As $f'(w_0)\ne 0$, then $f$ possesses an analytic inverse $F$ in a neighbourhood $D(w_0,r)\subset \mathbb C$ of $t_0$,  and hence $h=F\circ g$, for $t\in I$, such that $h(t)\in (w_0-r,w_0+r)$, and therefore $h$ is analytic in a neighboorhood of $t_0$.
However, if $f'$ vanishes, then it DOES NOT hold. For example $h(x)=\lvert x\rvert$ and $f(x)=x^2$.
Comment: Thanks for your answer! I put that question trying to solve this:http://math.stackexchange.com/questions/978462/function-in-polar-coordinates/978485#978485. There $f=\cos$. Do you think that maybe it's not true what is asked at that topic?
Comment: @Bogdan There you have two functions, $\cos$ and $\sin$, and their derivatives don't vanish at the same points, so everywhere one of the two is locally invertible.


Smash bros GameCube controller on Wii

Question: Is the Super smash bros for Wii u controller itself (not the adapter as I know it's not compatible) adapter compatible with an original Wii or GameCube? I don't want to purchase used ones from Ebay because I heard about lots of Ebay scams.
Comment: If you mean [this controller](http://www.amazon.com/gp/product/B00O9GW8VK), then yes.
Comment: Are you asking of you can run super smash bro for wii U can run on wii/gamecube via some adapter? Or if the adapter is compatible?
Comment: @KevinvanderVelden No, I meant the controller. (Although that would be AWESOME)
Answer: As @Powerlord pointed out, the GameCube Super Smash Bros. Edition Controller is compatible with the original GameCube and Wii.  This is confirmed on Nintendo's website (in the same link provided, very last question)

Can the GameCube Super Smash Bros. Edition Controller be used with a GameCube or a compatible Wii model?
Yes, it can be used with these systems.

Sidebar: Always make sure to check the box before confirming your purchase! 3rd-party companies like Hori and PDP make their own "Fight pads" as well, but they're Classic Wii controllers without the analog triggers. (They have squishy triggers, but there's no analog signal, and that means tossing your shield or grab is delayed significantly.
Answer: It should work with both the Wii and the Gamecube.
Answer: If you are asking if the gamepad is compatible with the Wii, and the GameCube system itself, the answer is no. Both of these systems don't have the right technology to work with the gamepad controller. If this was not your question I apologize.

Smash bros GameCube controller on Wii


iPhone contacts

Question: When adding a contact, I cannot save their phone number under the catogory of iphone.  Only the "mobile" option shows up, where as before I had a "iphone" option.  I want the iphone option so I can imessage long distance without a charge.
Comment: Are you using standard Apple contacts?  For example I don't. My contacts are exchange based and the iPhone option does not appear because of that.
Answer: The label you assign to a number in the Contacts app doesn't have any effect on the amount you are charged. I believe the way it works is when you add a phone number, Apple checks it against their own records and if they find that number there (and you can contact Apple's servers at the time you try to send) then it will send text messages through the iMessage service rather than through the regular phone network.
That aside, I'm not sure why the iPhone label wouldn't appear unless it is already in use for another number for that Contact. Each label can only be assigned to one number per contact.
Answer: When you add or edit a contact on an IOS device there is an option to select or add a custom label.
When you tap the green "+" to add a contact (for example) the label is underlined. It's a hyperlink/button, tap it. the "Label" screen will slide up. You can then select from a list of labels and if you scroll past the preexisting labels there is an option to "Add Custom Label."
"iPhone" is a preexisting label on my iPhone (IOS 8.4) but if it is missing you should be able to add it as a custom label.

iPhone contacts


Why "Location" but not "Theme"?

Question: When I was reading "Semantics: A Coursebook" (2nd ed), I came across this semantic roles identifying exercise "Detroit is a big city. The answer key is that "Detroit" is Location and "a big city" is Theme. I was confused as to why "Detroit" is assigned the role Location because it is stated in "The Study of Language" by George that Theme also designates an entity being described. Here, Detroit is described as a big city. And if Detroit was the Theme then what is "a big city"?
Answer: "...is a big city" is a copula construction. The NP in it does not refer to an entity, it is used as a predicate. There is no event participant behind this NP. Therefore, I would not expect it to have a thematic role at all. Sometimes, people use "theme" as the thematic role label for "anything else", so maybe that is why it appears here. But I don't think it's a good analysis.
"Detroit" is definitely not used as a location. Detroit is a "place", but that is a kind of entity, while "location" is the location of something: a relation in space. Note that thematic roles have to be relations, not absolute sorts of entities. A location would be the "y" part of a statement "x is in/at y". But there is nothing that is being localised in Detroit in the example. -- The case is perhaps clearer for temporal than for local relations: when you say "Yesterday was a beautiful day", "yesterday" is not a temporal adverbial, it functions more like a noun and denotes the whole day as such. The temporal localisation (as it were) as in "I made a cake yesterday" refers to some time in the interval "yesterday", not to the whole day. So that's clearly different. (Cf. Wolfgang Klein: Time in language. Routledge, London 1994, p. 143).
"Detroit" as a "theme" seems correct to me, also because it is standard to call "theme" the entity that is in a state (or has a property, as you said).
Comment: That was very helpful. Thank you so much!

Why "Location" but not "Theme"?


When I boot up my notebook PC from USB it shows me this: BOOTMGR is missing

Question: When I boot up my notebook PC from USB it shows me this: BOOTMGR is missing
What could this mean? Please answer me.. I want to have Ubuntu! Thanks anyway..
Answer: The USB disk is not bootable.  Please use proper method to prepare usb disk.
From Windows you can use following programs,

Lili
Universal USB Installer

From ubuntu, you can use

Start up disk creator

Unetbootin is an utiliy that runs both Windows and Linux.
Answer: You can find a guide to properly install ubuntu on a flashdrive here
https://help.ubuntu.com/community/Installation/FromUSBStick/


What is the basic concept behind WaitHandle?

Question: What is the basic concept behind WaitHandle in C# .net threading?
Whats is its use?
When to use it?
What is the use of WaitAll and WaitAny methods inside it?
Answer: Whenever you would want to control the execution of multiple threads in your app. Though this does not only mean that only one thread increments the counter; but let the threads start/stop or pause upon an event.
See WaitHandles - Auto/ManualResetEvent and Mutex
--EDIT--
WaitHandles are the mechanism that you "use" to control the threads' execution. Its not about handles not being accessible within a thread; its about using them within the thread.
This may be a fat example, but please bear with me; think about, a lady gives five different toned whistles to five girls, and tells them to blow the whistle whenever something would happen; the process is for each girl to blow a whistle, and the lady would know who blew the whistle.
Now, its not about sharing-the-whistles with each other, its about, probably for the lady, to use them to "control" the execution or the process how girls would blow the whistle.
Therefore, technically the process would be to:

Create a wait event(ManualResetEvent object)
Register the events, WaitHandle.WaitAny(events);
After you are done performing operation in your thread, the .Set(), which would tell the WaitHandle that 'I am done!'.

For instance, consider the example from the link provided. I have added the steps for you to understand the logic. These aren't the hardcoded steps, but just so you may understand.
class Test
{
    static void Main()
    {
    //STEP 1: Create a wait handle
        ManualResetEvent[] events = new ManualResetEvent[10];//Create a wait handle
        for (int i=0; i < events.Length; i++)
        {
            events[i] = new ManualResetEvent(false);
            Runner r = new Runner(events[i], i);
            new Thread(new ThreadStart(r.Run)).Start();
        }

    //STEP 2: Register for the events to wait for
        int index = WaitHandle.WaitAny(events); //wait here for any event and print following line.

        Console.WriteLine ("***** The winner is {0} *****",
                           index);

        WaitHandle.WaitAll(events); //Wait for all of the threads to finish, that is, to call their cooresponding `.Set()` method.

        Console.WriteLine ("All finished!");
    }
}

class Runner
{
    static readonly object rngLock = new object();
    static Random rng = new Random();

    ManualResetEvent ev;
    int id;

    internal Runner (ManualResetEvent ev, int id)
    {
        this.ev = ev;//Wait handle associated to each object, thread in this case.
        this.id = id;
    }

    internal void Run()
    {
    //STEP 3: Do some work
        for (int i=0; i < 10; i++)
        {
            int sleepTime;
            // Not sure about the thread safety of Random...
            lock (rngLock)
            {
                sleepTime = rng.Next(2000);
            }
            Thread.Sleep(sleepTime);
            Console.WriteLine ("Runner {0} at stage {1}",
                               id, i);
        }

    //STEP 4: Im done!
        ev.Set();
    }
}

Comment: ruffin: Because it had to be something. Kangaroos and wallabies aren't any better, especially since they're not commonly known to blow whistles.
Comment: @DotNetBeginner: `Does it mean that Handles will not be accessible to other threads`; please see my updated post, an example added just to respond to this question.
Comment: WaitAll() - used to wait for all of the handles in a set to be free/signalled... Does it mean that Handles will not be accessible to other threads untill and unless they are not released(other threads should wait for these handles in the set) ?
Comment: it is worth saying that `ev.Set()` better to be put in the `finally` block
Comment: Why's it gotta be a lady "controlling" girls when we're talking whistles? Maybe kangaroos given whistles by a wallaby or something?
Answer: WaitHandle is an abstract base class for the two commonly used event handles: AutoResetEvent and ManualResetEvent.
Both of these classes allow one thread to "signal" one or more other threads. They're used to synchronize (or serialize activity) between threads. This is accomplished using the Set and WaitOne (or WaitAll) methods. For example:
Thread 1:
// do setup work

myWaitHandle.Set();

Thread 2:
// do setup work

myWaitHandle.WaitOne();

// this code will not continue until after the call to `Set`
// in thread 1 completes.

This is a very rudimentary example, and there are loads of them available on the web. The basic idea is that WaitOne is used to wait for a signal from another thread that indicates that something has happened. In the case of AsyncWaitHandle (which is returned from invoking a delegate asynchronously), WaitOne allows you to cause the current thread to wait until the async operation has completed.
When an AutoResetEvent or ManualResetEvent are not set, calls to WaitOne will block the calling thread until Set is called. These two classes differ only in that AutoResetEvent "unsets" the event once a successful call to WaitOne completes, making subsequent calls block again until Set is called. ManualResetEvent must be "unset" explicitly by calling Reset.
WaitAll and WaitAny are static methods on the WaitHandle class that allow you to specify an array of WaitHandles to wait on. WaitAll will block until all of the supplied handles are Set, whereas WaitAny will only block until one of them gets Set.
Answer: It is an abstract class, you don't use it directly.  Concrete derived classes are ManualResetEvent, AutoResetEvent, Mutex and Semaphore.  Important classes in your toolbox to implement thread synchronization.  They inherit the WaitOne, WaitAll and WaitAny methods, you use them to detect that one or more threads signaled the wait condition.
Typical usage scenario for Manual/AutoResetEvent is to tell a thread to exit or to let a thread signal that it has progressed to an important sequence point.  Semaphore helps you to limit the number of threads that perform an action.  Or to implement threading synchronization that should not have affinity to a particular thread.  Mutex is there to assign ownership to a section of code to one thread, the lock statement is often applicable there as well.
Books have been written about it.  Joe Duffy's Concurrent Programming in Windows is the latest and greatest.  Strongly recommended if you contemplate writing threaded code.
Answer: Imagine you have an array with 1000 items in it. You need to do some processing on every one of those items. This work will take some time, but is not I/O bound.
For example, maybe you need to use each item to make a low-bandwidth web request. You have plenty of throughput to request many items at the same time, and the latency in each web request means doing one at a time could take longer than you want.
Enter the world of parallel programming. Today there are a number of ways you can handle this task, and WaitHandle is a fundamental part of it. Even if you don't use a WaitHandle directly, whatever option you choose is likely relying on a WaitHandle such as WaitAll or WaitAny behind the scenes.
Continuing the example, let's say you have a typical four-core CPU. In this situation, it doesn't make a lot of sense to have more than 4 threads going at once.* So 4 threads, but 1000 items;  what do you do?
One option uses WaitAny. You kick off 4 threads, and every time the WaitAny method returns you kick off another, until all 1000 items are queued. Note this is a poor example for WaitAny, because we know how many items there in total and can access any of the items at the same rate. WaitAny is best when you only have sequential access. There are other, similar situations where WaitAny can make a lot of sense.
Another option uses WaitAll. Instead of queuing one item at a time, you set up one thread for each of the four cores assign it a different 250 item segment of the array.  With this option, you can use WaitAll to wait for all the processing to finish.

 * Actually, it does. There's usually a certain amount of I/O time where the CPU would be idle, such that you can do better by having more than one thread going per core. But that's a story for another time.
Answer: There are some very long answers here. For anyone looking for the short answer:
Wait handle are a mechanism for making one thread wait until another thread reaches a certain point.
You can also have several threads waiting and/or several threads that are being waited for, hence the WaitOne, WaitAll and WaitAny methods. There are also several options for semantics available by choosing one of these classes: Mutex, Semaphore, ManualResetEvent, AutoResetEvent which are well documented.


Can I overdraw my cashapp card?

Question: Can I overdraw my cashapp card if it starts with a positive balance to buy diapers and food and Walmart? I have $1.09 on my card and laid off right now. I have no 211 resources anywhere near my area.
Comment: Likely the transaction won't go through if it exceeds the available balance, but I'm not familiar with cashapp cards. Your best bet for immediate needs might be local food banks/churches.
Answer: [EDIT] Removing the link [/EDIT]
There are cards that allow overdrafts in some form but CashApp is not one of them. Their Terms Of Service say that either the money has to be in their account or the user has to be connected to another account to fund the purchase.
Comment: Links to Google search queries aren't very helpful in answers, as results will change over time. Perhaps you can quote from a specific relevant source based on your search results?

Can I overdraw my cashapp card?


Could the pictured plant be buckwheat?

Question: The plant is as seen below, in the photographs, and is similar to cyclamen / sow bread in all respects, but I am absolutely certain that the flower belongs to neither, and the only other plant that comes to mind is a buckflower. Am I right?
Answer: It looks like it wants to belong to the Saxifrages, a rosette of palm shaped leaves with a long spike/raceme of flowers. However this one is on steroids, perhaps sitting in the garden of a scientist who brought one from a remote region and gave it a favourable environment.
If by buckflower you mean Eriogonum thymoides, these have flowers in a head, but the picture shows a raceme, a spike with flowers on short stalks so maybe the answer to your specific question would be no.
Comment: My apologies, - I meant Buckwheat, not Buckflower. Heuchera is one of the Saxifragaceae family, if I am not mistaken, so, like Bamboo, and Kevinsky, I think you have got the general identification of the plant ...and, yes, things in my garden have a habit of being a bit wild; but this is North Wales, where plants are plants and weeds are nervous...
Answer: It is one of the Heuchera/Heucherella varieties, of which there are many,  probably hundreds. Heucherella is a cross between Heuchera and Tiarella - Tiarella tends to produce longer flower stems. As to which exact variety you have, given the range of plants in this category, it's hard to be precise, but it might be something like Heuchera 'Paris'  - information and some images here https://www.plantdelights.com/blogs/articles/coral-bells-heuchera-plant-varieties
The flowers on these varieties are usually fairly insignificant - they are grown for their decorative leaves more than anything else, and their ability to tolerate a fair bit of shade. So far, the only Heuchera which produces noticeable and attractive, bright red flowers is Heuchera sanguinum, like the variety 'Firefly'; this is one of the original Heucheras prior to breeding and crossing, and it has plain green leaves. The common name 'coral bells' refers to the bright red flowers on the original plant.
Comment: Alright, - I accept that it is, and that mine has mutated a little or has gone a little wild (plus, as you say, the flowers tend to be somewhat insignificant). It probably does not like the garden much, either, seeing as the garden appears to have been used as a local tip up until recently and has very poor (probably acid) soil.
Comment: I;m not sure its 'mutated' - its probably as its meant to be, by and large.
Comment: Fair enough, - I will try not to hold you to that if I go outside one morning and get eaten by it...
Comment: So long as you don't eat IT, you'll be fine!

Could the pictured plant be buckwheat?


Why can't I store the Attrazione in Saints Row the Third?

Question: Both the fiance and I have had trouble storing the Attrazione car in our garages in Saints Row the Third. We've been able to find them, drive them, and take them into our garages; but once they're in there, even if we press "Y" (Xbox 360, standard control setup) to store it, it doesn't store--it will remain in the same location in which it was parked rather than disappearing, and no message displays saying that it has been stored. When looking at the stored car list, its name does not show. Additionally, after looking at the stored car list, the Attrazione disappears (and is still not stored in the garage). We have had this problem on each of our profiles, and we play on the same Xbox 360 console. This has occurred on different days after various turnings-on and -off of the console. Does anyone know why we are unable to store the Attrazione in our garages?
Comment: That must be a glitch. I always have one in my storage in that game. Try modifying it in a garage maybe, add some kneecappers and things and try it again? I've never had this issue.
Answer: If you customize it in a garage it will automatically be stored in your garage, it might also be that you have 50 vehicles and cannot store anymore
Answer: I'd be interested in knowing where you're trying to store the car. I'm playing the Steam version of the game and whenever I try to store a car in the Burns Reactor crib (North-East of Kinzie's crib) it won't let me. It doesn't matter which car, and it doesn't matter which save I'm trying from. For me, it's just a glitch I know about so if I want the car, I go somewhere else to store it. I have had several Attraziones in my garage over time without difficulty although I have to say that I prefer the Neuron as it has far better handling. :)
There is a limit to the number of cars you can store as has been mentioned, but before deleting cars, just try saving it in other cribs, at a Rim Jobs, etc. Also, if you DO delete cars, remember that reward cars don't count to your total so you have to delete cars you've captured yourself to clear a slot.
Good luck with it.


How do I use proton torpedoes?

Question: I just bought proton torpedoes since I got to level 50, but I don't know how to use them. They're not in the hotkey-bar in space combat and I can't find anything in the keybindings section of the options.
How do I use them?
Answer: From http://www.swtor.com/community/showthread.php?p=1200623:

To fire a proton torpedo, position your cursor over the target and hold down the right mouse button until it establishes a lock. Your cursor must remain over the target the entire time. Once it's locked on, release the right mouse button to fire the proton torpedo.

This is different from regular missiles where you can just single click or drag over top without remaining over the target.
Edit: After obtaining and using them, I can verify that Killer's answer is also somewhat correct.  They are only usable on "heavily shielded" targets: those that would normally take 4+ missiles (in the harder missions), such as the target on the bottom of space stations and all 5 shielded targets on Super Star Destroyers (or whatever the larger frigates are called).  The shields on the smaller ships can't be targeted with the torpedoes.
Note that I said 5 above — Killer's assertion that there are never more than 4 targets you can use the torpedoes on is incorrect, especially since there is more than one ultra-ship in some missions.  The (now deleted) answer he quotes was actually also correct — you can't use regular missiles on a heavily-shielded target unless (a) you are out of proton torpedoes or (b) you have fired a torpedo and it has not yet hit its target.
Answer:

Just Right Click.
Torpedos replace your standard missiles until exhausted. Because of the long lock-on >>delay, you may want to unequip the torpedoes entirely prior to some missions - they >>aren't great against fast-disappearing capital ships.

Absolutely wrong. Proton Torpedoes do NOT replace your standard missiles until they are done they are used in place of your regular missiles when attacking shielded targets and the mod does NOT have to be removed from mission to mission.
Correct, right click the shielded target (capital ship shield generators) until lock then release right click to fire HOWEVER you (currently as of patch 1.1) cannot fire regular missiles against these targets if you have Protons. However you have a max of 4 Protons and ALL MISSIONS that have the possibility of firing these Proton missiles have no more than the max of 4 targets to fire at.
Point in case is that having Proton missiles allows you to one shot shielded targets saving the time of wearing down these targets with lasers and missiles. Always useful.
TL;DR: Equip your proton missiles and use them 1 per target that allows it. Do not unequipt them for any reason (not necessary)

How do I use proton torpedoes?


Resonance and mesomeric effect

Question:
Can you please explain to me why are A and E not relevant resonance structures of the molecule F?
And is B aromatic?
Answer: For A: The pyridine ring would be very strained. The lone pair on the nitrogen is also in the plane of the ring and would hardly be able to form a double bond this way.
For E: Putting a positive charge on an sp hybridized atom is never good. The more 's' character you have, the closer the charge is to the nucleus (since s orbitals are closer to the nucleus). This is higher in energy. On top of that, putting a negative charge on a 'sp3' carbon is not particularly favored either.
Answer: The relevant resonance structures of the given molecule are as follows.

Structure A is shown below. NItrogen with 2 sigma bonds is linear as shown below. However , nitrogen in the ring is strained with an angle of $\ce{120^o}$ (figure 1).

In figure 2 ,an unstrained Nitrogen with $\ce{120^o}$ bond angle is shown for your reference. Therefore , this structure $\ce{A}$ is irrelevant resonance structure .

Structure $\ce{E}$ is not a resonance structure of $\ce{F}$ or $\ce{1}$ in my structure. The carbanion in $\ce{2}$ is in conjugation with imine bond ($\ce{ C=N }$). This gives $\ce{3}$.

Structure $\ce{B}$ in not aromatic .

Resonance and mesomeric effect


operator norm of a matrix and trace of a matrix

Question: Suppose $A=(a_{ij})$ is an $n\times n$ complex matrix, $\operatorname{tr}(A)=\displaystyle \frac{1}{n}\sum_{i}a_{ii}$. I wonder whether there exists a relationship between $\|A\|$ (the operator norm) and $\operatorname{tr}(A^k)$, where $k=1,\cdots,n$?
Comment: in general the trace is not divided by $n$, this is a especial trace operator or it is a typo?
Comment: @Masacroso: normalizing the trace so that it becomes a state is a very standard thing.
Answer: In general no, as nilpotent operators exist. For instance consider $$A=\begin{bmatrix}0&1\\0&0\end{bmatrix}. $$ Then $\|A\|=1$ and $\operatorname{tr}(A^k)=0$ for all $k$.
When $A$ is normal, it is easy to check that
$$\tag1
\|A\|=\lim_{k\to\infty}|n\operatorname{tr}(A^k)|^{1/k}.
$$
Indeed, you have that $\|A\|=\max\{|\lambda_j|:\ j=1,\ldots,n\}$, where $\{\lambda_j\}$ are the eigenvalues of $A$ counting multiplicities. If we take $\lambda_1$ to be the one with $|\lambda_1|=\|A\|$,
\begin{align}
|\operatorname{tr}(A^k)|^{1/k}&=\exp\left({\tfrac1k\,\log|\sum_{j=1}^n\lambda_j^k|}\right)
=\exp\left({\tfrac1k\,\log|\lambda_1^k|\,|1+\sum_{j=1}^n(\lambda_j/\lambda_1)^k|}\right)\\ \ \\
&=|\lambda_1|\,\exp\left({\tfrac1k\,\log |1+\sum_{j=1}^n(\lambda_j/\lambda_1)^k|}\right)\xrightarrow[k\to\infty]{}|\lambda_1|,\\ \ \\
\end{align}
as the expression inside brackets is bounded above by $\tfrac1k\,\log(1+n)$.
Comment: why the second equality has no the term $1/n$?
Comment: I forgot an $n$ in $(1)$.
Comment: So in your proof,$tr$ denotes the sum of diagonal elements of a matrix?
Comment: No. $ \ \ \ \ $
Comment: $|tr(A^k)|=1/n|\sum \lamda j k$?
Comment: Yes. $\ \ \ \ $


Mipmapping on CPU

Question: I'm trying to load a big terrain texture and only want to load a certain mipmap level to the GPU with Vulkan. When the whole terrain is in sight, the camera is far enough away from it so that only a mipmap of the whole terrain texture would be enough for renderering. So for that I don't want to load the whole texture on the GPU just for mipmap generation. So is it possible to generate the mipmap on CPU first? If so, what techniques are being used for mipmapping or (maybe better) is there already a implementation (library) for generating a mipmap on CPU?
Comment: It's possible that this approach is going to work out slower than just loading the full texture to the GPU.  Mipmapping on the CPU will always be slower anyway, and you'll need to constantly refresh the texture as the player moves around.
Answer: Its most likely better to pregenerate and store the lower precision mipmaps along side the original texture in your assets. Then only when you need the higher resolution image do you actually load it from disk.

Mipmapping on CPU


Extracting words from .txt and creating one master .txt

Question: I have multiple files .txt which contain names of people sorted alphabetically so for example in main directory I have directory a which contains one a.txt full with names which start with "a" like "Anna" "Andrew" etc. The same thing repeats in main directory I have directory b containing b.txt full with names etc. up until x,y,z. How can I extract the names and create a master.txt containing all people's names?
Answer: You can accomplish this by using the cat command and filename expansion. If all of these files are in the source directory /path/to/directory, and there are no other files in this directory, then the most succinct command would be the following:
cat /path/to/directory/*/*.txt > master.txt

This will create a file called master.txt in your current directory which contains the concatenated contents of all of the files in the source directory. NOTE: This will include any files in any of the subdirectories of the source directory.
If there are other files in the directory (or if you just want to be a little bit more precise) then you can use this command instead:
cat /path/to/directory/[a-z]/[a-z].txt > master.txt

This will only match the following files in the source directory:
a/a.txt
a/b.txt
a/c.txt
.
.
.
z/x.txt
z/y.txt
z/z.txt

If there are other files in the source directory, or if you have files of the similar to a/z.txt where the subdirectory name doesn't match the base-name of the file, and if you want to exclude those files, then you would have to use a more precise command to narrow down the list of matched files. In that case you could use brace-expansion and a for-loop:
for letter in {a..z}; do \
    cat "/path/to/directory/${letter}/${letter}.txt"; \
done >> master.txt

This will match exactly the files you've specified in your question and no other files.
Answer: Replace main_dir with the path to your main directory, save this in a script and run from the terminal as sh ./script-name.sh
#!/bin/bash
for i in $( cd main_dir && ls ); do
    cat "main_dir/$i/$i.txt" >> "master.txt"
done

Comment: There's no reason to parse the output of `ls` in this situation, since globbing/filename-expansion will work just as well. Also, parsing the output of `ls` is considered bad practice in general. See [Why you shouldn't parse the output of ls](http://mywiki.wooledge.org/ParsingLs) for more on that topic.


Can we ask for an intuitive explanation of models, algorithms and topics?

Question: Can we ask for an intuitive explanation of models, algorithms, and topics related to Artificial Intelligence and Deep Learning?
Comment: Some of us definitely learn and understand better if we have a non-rigorous intuitive view of a concept.  I remember when we studied Green's Theorem in calculus.  I could follow the mathematical proof, and accepted the result, but never felt that I actually understood it.  Later, when they introduced Green's Theorem in physics, it was immediately obvious *why* it had to be true (e.g. with a light-bulb in a room, the same total amount of light reaches the surface of the room, regardless of the size or shape of the room.)
Answer: Yes, you can ask for an intuitive explanation of a model, algorithm or, in general, topic. Just make sure that you clarify in your post what exactly you are looking for.
For example, if you're looking for an intuitive explanation of how a u-net works, you should ask

Intuitively, how does u-net work? What are the main ideas behind this model?

If you just ask

How does u-net work?

a person could think that you are looking for a detailed explanation (and that could even considered a too broad post). Alternatively, if you are (also) looking for a detailed explanation, you may (also) ask for a reference that explains the topic in detail.
Moreover, before asking a question, you should probably do a little bit of research on your own, then explain WHAT you haven't understood in the sources that you have researched/read so far (maybe you should also cite the sources that you have read).


Desktop doesn't show up as an option when I try to change directories

Question: I am trying to change my Ubuntu directory into "Desktop". I have tried running "cd ~/Desktop" however it responds with "-bash: cd: /home/mcosentino/Desktop: No such file or directory".
When I am in my home directory and I run "dir" the only 3 directories it shows are "lammps  lammps-stable_3Mar2020  stable_3Mar2020.tar.gz".
Why can't I connect to my Desktop and/or Documents when I use cd?
Comment: Are you actually running a desktop (GUI) version of Ubuntu? or is it a server (CLI only) version?
Comment: I'm using Ubuntu 20.04 LTS- not sure which version this is.
Comment: Hello. a few things. you can edit your posted question with your answers above. First of all, you aren't root are you? If not, as a regular user type cd and press return, then pwd. what does it say? Then cd ~ press return, and pwd again. what does that say? And also echo $HOME , what does that say? these should be redundant, but just checking. Also if you can tell or post the output of cat ~/.config/user-dirs.dirs. AND to make steeldriver's question a little more clear to you. Do you (normally) have an actual visual "desktop" you are working on, or do you have the black console screen?
Answer: If you are Italian the Desktop is called "Scrivania". Anyway if you open your terminal you have to type:
<code>$ ls -al
</code>
The command ls means "list"
-a means show the hidden files and directories
-l it show also the permissions
In this way you can see all the file and directories in your home directory. The "dir" command come from Dos.
Comment: When I run that line it returns a larger list: ., .., .bash_history, .bash_logout, .bashrc, .landscape, motd_shown, .profile, .sudo_as_admin_successful, .wget-hsts, lammps, lammps-stable_3Mar2020, stable_3Mar2020.tar.gz. But Desktop is still not an option? (my computer is not italian)
Comment: If you dont have file or directory like Desktop, Public, .Xdefaults, .Xresources, .Xauthority, means that your ubuntu is installed without Xorg (withhout the windows manager). Then you have access to your system only by shell or cli (character user interface). Also I see the file ".landscape" that means your installation is a server. Usually the servers are installed without Graphical User Interface (aka Xorg or windows manager). Then you haven't your Desktop folder because you haven't a desktop.