What is better, adjacency lists or adjacency matrices for graph problems in C++?

Question: What is better, adjacency lists or adjacency matrix, for graph problems in C++?
What are the advantages and disadvantages of each?
Comment: The structure you use does not depend on the language but on the problem you're trying to solve.
Comment: @avakar: or `std::deque` or `std::set`. It depends on the way the graph will change with time and what algorithms you intend to run on them.
Comment: I meant for general use like djikstra algorithm , i asked this question cause i don't know is linked list implementation worth trying cause it's harder to code than adjacency matrix .
Comment: Read details from [khan academy](https://www.khanacademy.org/computing/computer-science/algorithms/graph-representation/a/representing-graphs)
Comment: Lists in C++ are as easy as typing `std::list` (or better yet, `std::vector`).
Comment: I find this [answer](https://stackoverflow.com/a/62614483/6306190) useful as well.
Answer: It depends on the problem.
Adjacency Matrix

Uses O(n^2) memory
It is fast to lookup and check for presence or absence of a specific edge
between any two nodes O(1)
It is slow to iterate over all edges
It is slow to add/delete a node; a complex operation O(n^2)
It is fast to add a new edge O(1)

Adjacency List

Memory usage depends more on the number of edges (and less on the number of nodes),
which might save a lot of memory if the adjacency matrix is sparse
Finding the presence or absence of specific edge between any two nodes
is slightly slower than with the matrix O(k); where k is the number of neighbors nodes
It is fast to iterate over all edges because you can access any node neighbors directly
It is fast to add/delete a node; easier than the matrix representation
It fast to add a new edge O(1)
Comment: @magiix: Yes I think you should understand how to code linked lists if needed, but it's also important to not reinvent the wheel: http://www.cplusplus.com/reference/stl/list/
Comment: linked lists are harder to code , do you think they the implementation is worth spending some time learning it?
Comment: can anyone provide a link with a clean code for say Breadth first search in linked lists format ??
Comment: Using std::list
http://www.geeksforgeeks.org/breadth-first-traversal-for-a-graph/
Comment: The adjacency list can have the same upsides (and none of the downsides) of the adjacency matrix by storing node neighbours in a HashSet. Why use an adjacency matrix at all?
Answer: This answer is not just for C++ since everything mentioned is about the data structures themselves, regardless of language. And, my answer is assuming that you know the basic structure of adjacency lists and matrices.
Memory
If memory is your primary concern you can follow this formula for a simple graph that allows loops:
An adjacency matrix occupies n2/8 byte space (one bit per entry).
An adjacency list occupies 8e space, where e is the number of edges (32bit computer).
If we define the density of the graph as d = e/n2   (number of edges divided by the maximum number of edges), we can find the "breakpoint" where a list takes up more memory than a matrix:
8e > n2/8   when  d > 1/64
So with these numbers (still 32-bit specific) the breakpoint lands at 1/64.
 If the density (e/n2) is bigger than 1/64, then a matrix is preferable if you want to save memory.
You can read about this at wikipedia (article on adjacency matrices) and a lot of other sites.
Side note: One can improve the space-efficiency of the adjacency matrix by using a hash table where the keys are pairs of vertices (undirected only).
Iteration and lookup
Adjacency lists are a compact way of representing only existing edges. However, this comes at the cost of possibly slow lookup of specific edges. Since each list is as long as the degree of a vertex the worst case lookup time of checking for a specific edge can become O(n), if the list is unordered.
However, looking up the neighbours of a vertex becomes trivial, and for a sparse or small graph the cost of iterating through the adjacency lists might be negligible.
Adjacency matrices on the other hand use more space in order to provide constant lookup time. Since every possible entry exists you can check for the existence of an edge in constant time using indexes. However, neighbour lookup takes O(n) since you need to check all possible neighbours.
The obvious space drawback is that for sparse graphs a lot of padding is added. See the memory discussion above for more information on this.
If you're still unsure what to use: Most real-world problems produce sparse and/or large graphs, which are better suited for adjacency list representations. They might seem harder to implement but I assure you they aren't, and when you write a BFS or DFS and want to fetch all neighbours of a node they're just one line of code away. However, note that I'm not promoting adjacency lists in general.
Comment: +1 for insight, but this has to be corrected by the actual data structure used to store the adjacency lists. You may want to store for each vertex its adjacency list as a map or a vector, in which case the actual numbers in your formulas have to be updated. Also, similar computations can be used to assess break-even points for time complexity of particular algorithms.
Comment: Yeah, this formula is for a specific scenario. If you want a rough answer, go ahead and use this formula, or modify it according to your specifications as needed (for example, most people have a 64 bit computer nowadays :))
Comment: For those interested, the formula for the breaking point (maximum number of average edges in a graph of n nodes) is `e = n / s`, where `s` is the pointer size.
Answer: Okay, I've compiled the Time and Space complexities of basic operations on graphs.
The image below should be self-explanatory.
Notice how Adjacency Matrix is preferable when we expect the graph to be dense, and how Adjacency List is preferable when we expect the graph to be sparse.
I've made some assumptions. Ask me if a complexity (Time or Space) needs clarification. (For example, For a sparse graph, I've taken En to be a small constant, as I've assumed that addition of a new vertex will add only a few edges, because we expect the graph to remain sparse even after adding that vertex.)
Please tell me if there are any mistakes.
Comment: How is adding a vertex to AL O(V) ? We have to create a new matrix, copy the previous values into it. It should be O(v^2).
Comment: @Alex_ban Generally yes, but practically, it depends on the language and on the way it is implemented (you can do a lot of optimizations, and use dynamic arrays for example).
Comment: In case it is not known if the graph is a dense one or a sparse one, would it be right to say that space complexity for an adjacency list would be O(v+e) ?
Comment: For most practical algorithms, one of the most important operations is iterating through all the edges going out of a given vertex. You might want to add it to your list - it's O(degree) for AL and O(V) for AM.
Comment: @johnred isn't it better to say that Adding a vertex (time) for AL is O(1) because instead of O(en) because we don't really add edges on adding a vertex. Adding an edge can be dealt with as a separate operation. For AM it make sense to account but even there we just need to initialize relevant rows and column of new vertex to zero. Addition of edges even for AM can be accounted for separately.
Answer: It depends on what you're looking for.
With adjacency matrices you can answer fast to questions regarding if a specific edge between two vertices belongs to the graph, and you can also have quick insertions and deletions of edges. The downside is that you have to use excessive space, especially for graphs with many vertices, which is very inefficient especially if your graph is sparse.
On the other hand, with adjacency lists it is harder to check whether a given edge is in a graph, because you have to search through the appropriate list to find the edge, but they are more space efficient.
Generally though, adjacency lists are the right data structure for most applications of graphs.
Comment: what if you use dictionaries to store the adjacency list, that will give you the presence of an edge in O(1) amortized time.
Answer: Lets assume we have a graph which has n number of nodes and m number of edges,
Example graph

Adjacency Matrix:
We are creating a matrix that has n number of rows and columns so in memory it will take space that is proportional to n2. Checking if two nodes named as u and v has an edge between them will take Θ(1) time. For example checking for (1, 2) is an edge will look like as follows in the code:
if(matrix[1][2] == 1)

If you want to identify all edges, you have to iterate over matrix at this will require two nested loops and it will take Θ(n2). (You may just use the upper triangular part of the matrix to determine all edges but it will be again Θ(n2))
Adjacency List:
We are creating a list that each node also points to another list. Your list will have n elements and each element will point to a list that has number of items that is equal to number of neighbors of this node (look image for better visualization). So it will take space in memory that is proportional to n+m. Checking if (u, v) is an edge will take O(deg(u)) time in which deg(u) equals number of neighbors of u. Because at most, you have to iterate over the list that is pointed by the u. Identifying all edges will take Θ(n+m).
Adjacency list of example graph

You should make your choice according to your needs.
Because of my reputation I couldn't put image of matrix, sorry for that
Comment: Edge represented as red blocks in the second graph. Second graph represents relation between 2 and 4, 2 has (1, 3, 4, 5) in its list and 4 has (2, 5) in its list. Second graph represents linked list of nodes that the node is connected to.
Comment: What is the orange edge between 2 and 4 in your graph? And why is there no `2 -> 4` or `4 -> 2` in your image?
Comment: Thanks so much! Came here from SQL and didn't get the linked list thing.
Answer: If you are looking at graph analysis in C++ probably the first place to start would be the boost graph library, which implements a number of algorithms including BFS.

Boost Graph Library Docs

EDIT
This previous question on SO will probably help:
how-to-create-a-c-boost-undirected-graph-and-traverse-it-in-depth-first-search
Comment: Thanks you i ll check this library
Comment: +1 for boost graph. This is the way to go (excepted of course if it's for educational purposes)
Answer: This is best answered with examples.
Think of Floyd-Warshall for example. We have to use an adjacency matrix, or the algorithm will be asymptotically slower.
Or what if it's a dense graph on 30,000 vertices? Then an adjacency matrix might make sense, as you'll be storing 1 bit per pair of vertices, rather than the 16 bits per edge (the minimum that you would need for an adjacency list): that's 107 MB, rather than 1.7 GB.
But for algorithms like DFS, BFS (and those that use it, like Edmonds-Karp), Priority-first search (Dijkstra, Prim, A*), etc., an adjacency list is as good as a matrix. Well, a matrix might have a slight edge when the graph is dense, but only by an unremarkable constant factor. (How much? It's a matter of experimenting.)
Comment: For algorithms like DFS and BFS, if you use a matrix then you need to check the whole row each time you want to find adjacent nodes, whereas you already have adjacent nodes in an adjacent list. Why do you think `an adjacency list is as good as a matrix` in those cases?
Comment: @realUser404 Exactly, scanning a whole matrix row is an O(n) operation. Adjacency lists are better for sparse graphs when you need to traverse all outgoing edges, they can do that in O(d) (d: degree of the node). Matrices have better cache performance than adjacency lists though, because of sequential access, so for a somewhat dense graphs, scanning a matrices can make more sense.
Answer: To add to keyser5053's answer about memory usage.
For any directed graph, an adjacency matrix (at 1 bit per edge) consumes n^2 * (1) bits of memory.
For a complete graph, an adjacency list (with 64 bit pointers) consumes n * (n * 64) bits of memory, excluding list overhead.
For an incomplete graph, an adjacency list consumes 0 bits of memory, excluding list overhead.

For an adjacency list, you can use the follow formula to determine the maximum number of edges (e) before an adjacency matrix is optimal for memory.
edges = n^2 / s to determine the maximum number of edges, where s is the pointer size of the platform.
If you're graph is dynamically updating,  you can maintain this efficiency with an average edge count (per node) of n / s.

Some examples with 64 bit pointers and dynamic graph (A dynamic graph updates the solution of a problem efficiently after changes, rather than recomputing it from scratch each time after a change has been made.)
For a directed graph, where n is 300, the optimal number of edges per node using an adjacency list is:
= 300 / 64
= 4

If we plug this into keyser5053's formula, d = e / n^2 (where e is the total edge count), we can see we are below the break point (1 / s):
d = (4 * 300) / (300 * 300)
d < 1/64
aka 0.0133 < 0.0156

However, 64 bits for a pointer can be overkill.
If you instead use 16bit integers as pointer offsets, we can fit up to 18 edges before breaking point.
= 300 / 16
= 18

d = ((18 * 300) / (300^2))
d < 1/16
aka 0.06 < 0.0625

Each of these examples ignore the overhead of the adjacency lists themselves (64*2 for a vector and 64 bit pointers).
Comment: I dont't understand the part `d = (4 * 300) / (300 * 300)`, should it not be `d = 4 / (300 * 300)` ? Since the formula is `d = e / n^2` .
Comment: where is the answer of the question?
Answer: Depending on the Adjacency Matrix implementation the 'n' of the graph should be known earlier for an efficient implementation. If the graph is too dynamic and requires expansion of the matrix every now and then that can also be counted as a downside?
Answer: If you use a hash table instead of either adjacency matrix or list, you'll get better or same big-O run-time and space for all operations (checking for an edge is O(1), getting all adjacent edges is O(degree), etc.).
There's some constant factor overhead though for both run-time and space (hash table isn't as fast as linked list or array lookup, and takes a decent amount extra space to reduce collisions).
Answer: I am just going to touch on overcoming the trade-off of regular adjacency list representation, since other answers have covered those aspects.
It is possible to represent a graph in adjacency list with EdgeExists query in amortized constant time, by taking advantage of Dictionary and HashSet data structures. The idea is to keep vertices in a dictionary, and for each vertex, we keep a hash set referencing to other vertices it has edges with.
One minor trade-off in this implementation is that it will have space complexity O(V + 2E) instead of O(V + E) as in regular adjacency list, since edges are represented twice here (because each vertex have its own hash set of edges). But operations such as AddVertex, AddEdge, RemoveEdge can be done in amortized time O(1) with this implementation, except for RemoveVertex, which would be O(V) amortized like in adjacency matrix with an array index lookup dictionary. This would mean that other than implementation simplicity, adjacency matrix don't have any specific advantage. We can save space on sparse graph with almost the same performance in this adjacency list implementation.
Take a look at implementations below in Github C# repository for details. Note that for weighted graph it uses a nested dictionary instead of dictionary-hash set combination so as to accommodate weight value. Similarly for directed graph there is separate hash sets for in & out edges.
Advanced-Algorithms
Note: I believe using lazy deletion we can further optimize RemoveVertex operation to O(1) amortized, even though I haven't tested that idea. For example, upon deletion just mark the vertex as deleted in dictionary, and then lazily clear orphaned edges during other operations.
Comment: For adjacency matrix, remove vertex takes O(V^2) not O(V)
Comment: Yes. But if you use a dictionary to track the array indices, then it will go down to O(V). Take a look at this [RemoveVertex](https://github.com/justcoding121/Advanced-Algorithms/blob/master/src/Advanced.Algorithms/DataStructures/Graph/AdjacencyMatrix/Graph.cs#L92) implementation.


How to install corner bead on an uneven corner

Question: How do I install this corner bead without it buckling when I screw it down. Do I just fill the recessed spot with mud first? If it matters it's the ceiling in my shower.
Comment: Thar corner actually looks pretty even to me!
Comment: Filling with mud, pressing the bead in, screwing up from the bottom, then holding the top down with tape while waiting for the mud to dry sounds like a VeryGoodIdea™. Follow up with a _gentle_ application of screws through the freshly set mud. But I'd wait for someone with more experience/knowledge than me before diving into that plan.
Answer: I'm not sure I understand the problem. That corner is beautiful compared to most. Corner bead isn't normally screwed, though, for the reason you've encountered--screws pull way to hard and cause deformation. Use drywall nails (gently) or narrow-crown staples (like for underlayment).
Be sure to keep the bead above the plane of the wall. In the photo, the top side has a slight recess where the edge of the other sheet terminates. Don't pull the bead down tight to that. I like to stand a carpenter's square on the wall surface and lap onto the bead. If the square doesn't have a slim gap under it, shift the bead flange on the adjacent wall face to make it so. Imagine pulling your taping knife down that wall later... you don't want it to scrape the flange.
Comment: I've always used screws for corner bead with out any issues, for this one though nails were a good suggestion.
Answer: Get some cardboard drywall shims. They are sold at the big box stores and can be trimmed in either direction to fit your application. You could also try trimming off 1/4" from the whole length of the corner bead.
Comment: Neither of those things are necessary (or even remotely standard).
Comment: If he screws it in as is, the entire edge of that corner bead is going to pop out and almost certainly be proud of the actual corner itself making it impossible to get a good finish. Stapling will probably have the same result. Nails would work better, but I'd still pop a shim under there and avoid the hassle.
Answer: Prefill or coat the corner with Quick setting mud like EZ Sand 20. Get the corner straight as possible. When dry sand it then nail the bead on. Or get some of the paper-backed bead and mud it on. Make sure you have plenty of mud under the bead and position it straight
and wipe it down pushing the excess mud out but leave enough mud to hold the paper and bead to the wall.


sending an email with example personalization string, stop Ampscript from interpreting the percent signs

Question: I want to send an email to our email users who create emails. I want to describe something about personalization strings. When I put the example in the content block (such as %%First Name%%) the Ampscript interpreter reads it (as expected). How can I include the example and have the interpreter not interpret it?
Thanks.
Michael
Answer: Use the HTML entity for percent sign and it will display as you wish and not be recognized as a personalization string or ampscript.
% as HTML entity: %
so for your example, you would do:
%%First Name%% and the email would show %%First Name%% and not show the actual person's first name.
Reference


What is the 1k that shows up where LTE would be?

Question: It shows up sometimes and I lose my 4g and go straight to that and have no connection, how do I get rid of it?
Answer: It's "1x" not "1k".
This is the core fallback 2G cellular connection of a CMDA (Verizon in the US) network. It's not showing up to replace your 4G LTE connection, it's your LTE that is failing and 1x is the only signal that can reach your phone.
The same thing happens with any carrier and it is by design. If you are in an area that is at the edge of their premium 4G service, you fallback to 3G then 2G.
See Wikipedia page on CDMA for more details.
Answer: This is regarding your connection strength.
For example, if you are on a GSM network and are in a low coverage area, you could have 4G (HSPA+) or E (EDGE) network connectivity.
There is not a way to get rid of it other than changing your provider for service, which is probably Sprint, or by constantly turning airplane mode on for a moment and turning it back off to refresh the connection to your cellular service.


After effects: Adding visual callouts of currently playing audio files with a source text script

Question: I'm working on a short film, and I've got AE CS 6 as my editor. I have a friend who is an audio engineer, who will perform the Protools final audio mixing and editing. I've got some sound effects in my AE file that I like, and I'd love a good way to add visual text callouts about which audio file is currently playing. That way, he can save time by not having to search thru my big shared audio library to find the exact sound (.wav) that's currently playing.
  It seems like it would be a text layer with an expression on the Source text, and a for loop, but I can't imagine how to write the expression.
  I hope this makes sense.
Thanks in advance!
Geoff
Answer: You are making your and your friend's job much harder than it would have to be. Try exporting an xml (if it's possible to read audio-xlms in protools) or, which would be much easier, your friend switches over to audition. That way you can simply load your audio-timeline into audition and it's all there. Trying to recreate your mix is a terrible idea as you will risk damaging the synced audio of dialogue etc.
Alternatively, if none of that works, assign each audio channel a role (such as vox, ambient, wind, punches, etc.) and export each track on its own. He could then import every track which will be in sync just the way you had it and slice the individual tracks up if he wants to.


Is it a good idea to write jQuery plugins just for the sake of neat code?

Question: For example if you write a plugin you could do this $('#myDiv').doAction() instead of doAction($('#myDiv')). and you have to admit, the first one looks more intuitive. Are there any clear drawbacks of this like performance hits?
Answer: You won't see any noticeable performance hit from this, but there is one potential drawback: namespacing your code is very valuable, and makes it easier to maintain (as you probably know). Throwing everything into jQuery.fn may not be the best way to do this.
Personally, I shy away from extending jQuery with very specific things (like app-specific logic or something) but whole-heartedly recommend it for general, DOM-level things (.hasAttr() and .scrollHeight() are two I use a lot). The reason is that there are better places to put app-specific logic (in the module in charge of that area of the app, for example).
A simple heuristic: would it be useful to other people if I made this a public extension? Or is this only relevant to this particular project?
That said, there is no concrete problem with doing this in your code. It's more a semantic issue: is that the best place for it?
Answer: Write a jQuery plugin so that you do not need to repeat this over and over again.
There are literally minimal performance issue with this, and mindful that this is at client side, it does not attribute to your server resources.
Comment: Lets say this is a huge project and if i write plugins like this, i ll end up with hundreds of them. also, obviously, Performance issues arent relevant only on server side.
Answer: There aren't any performance hits choosing one approach over the other. It's more of a question of, do you need it as a jquery plugin? I create regular functions if it's a utility function and doesn't need to act upon a jquery object. If it does, then it should be a plugin (no need to pass in the jquery object as a parameter, and you can chain)
Answer: You seem to be using jQuery as a framework. It is not one.
Please use a client-side MVC style library like backbone/knockout/sammy/eyeballs for seperations of concerns and structure
Please use an AMD loader like curl/requirejs for modularisation of your code.


In the Hunger Games, what happens to the arena after the games are over?

Question: In the Hunger Games, there have been 75 different arenas. After the tributes are done killing each other, what happens to them? And after the revolution, do they get destroyed?
Comment: The first dozen or so were actually in the _same_ arena. Namely a dilapidated sports stadium.
Answer: It's stated that the arenas were preserved by Panem;

Everything is brand-new, I will be the first and only tribute to use this Launch Room. The arenas are historic sites, preserved after the Games. Popular destinations for Capitol residents to visit, to vacation. Go for a month, rewatch the Games, tour the catacombs, visit the sites where the deaths took place. You can even take part in reenactments.
They say the food is excellent.
The Hunger Games

But destroyed after the Revolution

The questions are just beginning. The arenas have been completely
destroyed, the memorials built, there are no more Hunger Games. But
they teach about them at school, and the girl knows we played a role
in them. The boy will know in a few years. How can I tell them about
that world without frightening them to death?
Mockingjay


How to modify Chrome newtab.css from within a Chrome theme?

Question: I want to modify the CSS for new tab page. NOT make new tab page. I already made a new tab page, but many users installing my themes won't also install the new tab page extension. So I want to modify the CSS on the new tab page for those who ONLY want my theme.
It is my understanding that chrome://theme/css/newtab.css is the stylesheet I need to change.
Feel free to tell other ways to add CSS to the ORIGINAL new tab page in Chrome.
Answer: The default chrome theme is not designed to be editable by the end users. The resource files, including CSS, for Chrome's default theme used to be stored in theme.dll, and within chrome.dll itself for newer versions.
You can follow the instructions here if you are adventurous to hack DLL files.
The best source of guide for editing Chrome themes is still the official Chrome Developer Themes documentation.
Answer:
How to modify Chrome newtab.css from within a Chrome theme?

You can't, for two reasons:

Chrome themes are extremely restricted in scope -- the only thing they can do is provide colors and/or background images for the user interface (e.g, toolbar and tab bar) and new-tab page. They cannot make other changes to the appearance of the browser or override CSS for any web content (including the new-tab page).
Even if you meant a Chrome extension, extensions can only replace the new-tab page. They cannot alter or interact with the default new-tab page in any way.


Why is TopGrp the category of topological groups and continous homomorphisms protomodular?

Question: Why is TopGrp the category of topological groups and continous homomorphisms protomodular? I know it is, and I have several indirect proofs, but am not able to prove this directly by showing that the split short five lemma holds. Please help!!! Thank you!
Comment: When you say you have indirect proofs: is this example mentioned in the book of Borceux and Bourn?
Comment: Unfortunately I don't have time to get into it now, but possibly you would find https://estudogeral.sib.uc.pt/bitstream/10316/4633/1/file32ca005f79714a1796ebdc0e2cc2655f.pdf#lbib8 useful, especially sections 13 and 14 (and references therein).
Answer: Given the fact that Borceux and Clementino (et al. from references) are reasonably explicit and constructive in their proofs, a "direct proof" should be obtainable in any case just by systematically unpacking all the lemmas they use. This is an instance of a general metamathematical method called "beta-reducing" a proof or computation, akin to cut elimination in proof theory. Let's take a look.
The proof of theorem 50 in Borceux-Clementino (specialized to the theory of groups) explains that the short split five lemma is a statement expressible in the language of finite limits, so that by a Yoneda argument, it should hold in $\mathbf{Grp}(\mathrm{Top})$, given that the short split five lemma holds in $\mathbf{Grp}$. We can unpack this Yoneda lemma argument to give a direct proof.
Thus, suppose given a commutative diagram in the category of topological groups

\begin{array}{ccccc}
 \ker(q) & \xrightarrow{i'} & F & \xrightarrow{q} & B \\
 \wr \downarrow & & \downarrow \pi & & \downarrow 1_B\\
 \ker(p) &\xrightarrow{i}&E&\xrightarrow{p}& B &
\end{array}

where $p$ and $q$ are assumed to be split epic. We want to show $\pi$ is an isomorphism of topological groups. Let $U(E)$ be the underlying topological space of $E$. Then $\hom(U(E), -)$ sends this diagram of topological groups to a diagram of ordinary groups. Since this representable preserves kernels, split epics, etc., we infer from the split five lemma in $\mathbf{Grp}$ that $\hom(U(E), \pi)$ is a group isomorphism. In particular, there is a continuous map $s: E \to F$ which is sent to $1_E$ by $\hom(U(E), \pi)$; in other words, such that $\pi \circ s = 1_E$. We argue similarly that $\hom(U(F), \pi)$ is a group isomorphism, so that there exists a unique continuous map in $\hom_{\mathrm{Top}}(F, F)$ which maps to $\pi$ under $\hom(U(F), \pi)$. Since both $1_F$ and $s \circ \pi$ are such maps, we also have $s \circ \pi = 1_F$. Finally, since the forgetful functor $\mathbf{Grp}(\mathrm{Top}) \to \mathrm{Top}$ reflects isomorphisms, we have that $\pi$ is an isomorphism in $\mathbf{Grp}(\mathrm{Top})$.
But we might as well go whole hog and make it even more direct, by following the diagram chase implicit in the preceding paragraph and constructing the inverse of $\pi$ explicitly. (I'll use additive notation here, even though we're in the context of groups and not abelian groups.) Thus, let $j$ be a section of the split epi $q$. We have $p \pi (j p) = q j p = 1_B p = p$, so $p(1_E - \pi j p) = 0$. It follows that $1_E - \pi j p$ factors through the kernel $i: \ker(p) \to E$; write $1_E - \pi p j = i g$ for some (unique) $g: E \to \ker(p)$. Let $\phi: \ker(q) \to \ker(p)$ be the isomorphism on display above. I claim that the continuous map
$$s = i'\phi^{-1} g + j p: E \to F$$
is inverse to $\pi: F \to E$. Indeed, in one direction, we have
$$\pi(i'\phi^{-1} g + j p) = \pi i' \phi^{-1} g + \pi j p = i \phi \phi^{-1} g + \pi j p = i g + \pi j p = (1_E - \pi j p) + \pi j p = 1_E.$$
In the other direction, to prove $s \pi = 1_F$, we first note that
$$\pi (1_F - s \pi) = \pi - \pi s \pi = \pi - 1_E \pi = 0$$
so that in particular, $0 = p \pi (1_F - s \pi) = q (1_F - s \pi)$. Therefore $1_F - s\pi$ factors through the kernel of $q$: we have $1_F - s\pi = i'h$ for some unique $h: F \to \ker(q)$. From the equation displayed above, we thus have $0 = \pi i' h = i \phi h$. Since $i \phi$ is monic, this implies $h = 0$. Therefore $1_F - s\pi = i' h = 0$, and this completes the proof.
Comment: Made a note on that here: http://ncatlab.org/nlab/show/topological+group#Protomodularity
Comment: +1 for the "pedestrian version" (not that there's anything inherently wrong with the more abstract version, but it is good to see both for Brains of Little Bear like myself)
Comment: Thanks, Yemon. I have to admit that I slipped at first and wrote the above as if in the context of abelian groups, but as long as one is careful, it goes through for groups as well. Of course, Borceux and Clementino do things much more generally; their paper is a nice instructive application of categorical universal algebra.
Answer: That's a good example of an indirect proof for it. It would be sooo nice if it could be shown directly that the split short five lemma (http://ncatlab.org/nlab/show/five+lemma#short_split_five_lemma_28) holds in TopGrp. All I need to show is that w (in the diagram in the link) is an open map. Not working for me, not sure why...
Comment: Feel free to comment here again if you are unsatisfied with the argument presented in my answer (I realize you don't have the points yet to comment under answers other than your own -- I'll upvote your question to help you get there).
Comment: Sigh...I'm quite familiar with the proof given in Semi-abelian topological algebras by Borceux/Clementino. The proof is correct, but not direct. I'm also familiar with every single reference in the paper. It is odd that such a simple true topological assertion is being difficult to prove.
Comment: @ToddTrimble It seems that Lucas has two accounts, one unregistered with 41 points and one registered with 1 point. If they (belong to the same user and) are merged, he will be able to comment on your post as the owner of the question. (I realize the post is old, but this just came up in the review queue.)


Is Laplace's method applicable to this integral?

Question: Consider the following integral
$$
pv\int_0^{\infty}e^{N(-2Ax+A\log x)}\frac{e^{-B\log x}}{1-2x}dx
$$
where $A,B>0$ and we take the Cauchy principal value at $x=1/2$. I am interested in obtaining the asymptotics when $N$ is very big. The first thing I thought of was some variant of Laplace's method but I am unsure if I can proceed here, because of the singularity at $x=1/2$. So, my question is, is some version of the Laplace's method applicable here to obtain the big $N$ asymptotics? and if so, how should I proceed?
Answer: You may estimate the integral on $[1,\infty)$ somehow (it does not affect the asymptotics), after that consider the integral of $\int_0^{1/2}f_N(1/2-t)+f_N(1/2+t)dt$, where $f_N$ is your function. This already does not have a singularity at 0 and you may apply Laplace method.
Answer: Mathematica tells us that the principal value can be evaluated in closed form thus:
$$e^{-A} 2^{-A N+B-1} \left((-1)^{A N-B+1} \Gamma (-B+A N+1) \Gamma (B-A N,-A)-i \pi
   \right).$$
(OK, the $i \pi$ is a little suspicious, but the appearance of incomplete gammas is clearly correct, once you replace terms like $\exp(C \log x)$ by $x^C.$).


Why does Batroc want revenge on Falcon?

Question: In episode 5 of The Falcon and the Winter Soldier, a certain character enlists the mercenary Batroc to attack Falcon, luring him with the promise of revenge. But AFAIK Batroc was captured and taken off the field in Captain America: The Winter Soldier before Sam even got involved. What would Batroc's beef be?
Comment: Did you miss him being defeated by Falcon in episode 1? https://www.youtube.com/watch?v=ocp8jSqCTJM
Answer: Batroc is the mercenary in charge of the plane-jacking and kidnapping of Captain Vassant at the start of The Falcon and the Winter Soldier which Sam intercepts and puts an end to. We see his face clearly a few times.
Comment: That'll teach me not to rewatch. I did check an MCU wiki which listed Batroc's details in Falcon and the Winter Soldier as "pending," which sold me on the idea that he hadn't showed up yet.

Why does Batroc want revenge on Falcon?


Does "reside" mean to live in a place permanently?

Question: Is the word "reside" synonym of "to live in" ?
I am a student and where i live now is not my permanent address. I googled the meaning of "reside" and it says " have one's permanent home in a particular place."
so can i use the word for temporary living place?
Comment: In the UK, student accommodation blocks are called _halls of residence_, so in this context it seems you can.
Comment: @KateBunting - Nicola Sturgeon has said that people 'ordinarily resident' in Scotland on Day One of independence will be eligible for a Scottish passport, which is why my partner and I are checking house prices in Edinburgh.
Answer: "Reside" has a legal meaning.  That legal meaning might vary from jurisdiction to jurisdiction.  And this isn't the right place to discuss the law.
In the general meaning in English, where you "reside" is where you ordinarily live. For a student, only you can answer this.  Do you ordinarily live at university (but stay at you parents' home during the holidays? For example) Or do you ordinarily live with your parents, but visit the university during term time?
Legally there may be an answer to this question.  But practically only you can decide.  What is "ordinary" for you now that you are at university?


How to say "which one" in Russian?

Question: How to say "which one" in Russian (feminine - example: for dresses "Which one should i buy?")
Comment: *платье* ("dress") is neuter in Russian.
Answer: It's которое.
Какое and которое are quite similar in meaning, but the latter is not an open-ended question, it assumes a choice out of several possibilities.

Какое платье мне купить? // What dress should I buy?

A valid answer might be "a long one", "a red one" or "this one".

Которое платье мне купить? // Which dress should I buy?

This question assumes the buyer has several dresses to choose from and needs to pick one.
Comment: Thanks for the answer! Also can i say "какая из двух"?
Comment: @user9144: you can, but _которая из двух_ would be slightly better
Comment: `Которое платье мне купить?` - doesn't sound very usable, with `которое` i'd rather say `Которое ИЗ платьЕВ мне купить?`, well, that's if i were a woman anyway
Answer: Well,  a dress as платье is indeed not a Feminine but a Neutrum word, because it ends in -е (like the rest of -е, -о and -у-ending Neutrum words).
But then, we have одежда, which is less gender-specific socioculturally but is a Feminine word indeed.
If you want to practice some mental acrobatics with Gander/Case/Definite-Indefinite/Animate-Inanimate criteria, you should observe the options for each pair in each case (depending on Animate-Inanimate opposition, an object in Masculine gender could be either in Genitive-like or in Accusative form):
Masculine: какой/который (Inanimate) или какого/которого (Animate)
Neutrum: какое / которое
Feminine: какую / которую
This refers to the objects cases only.
An easier and universal construction (which could sound to a native speaker a little bit strange due to its modality of being non-evident/indefinite) is Что за...?.
It goes like this:
Что за платье / куклу вуду/ сотрудника / компьютер тебе взять?
Answer: In the given question "Which one should i buy?" I would separately focus on two words, "one" and "should".
ONE
The answers given suggest the full phrase "Which of the dresses ...". However in casual speech repeating the topic every now and then often feels excessive, that is why "one" is used instead of "dress".
Depending on the informality level, upon how close are relations and how recent was last mentioning of the topic (like, if you were to the shop month ago - no one would understand which "one" was meant. OTOH going out of the dressing room holding a pack of dresses makes the topic obvious), there can be few options more or less verbose.
Какое из них купить? - Which [one] of them to buy?
Какое покупаем? - Which [one] are we buying?
Ну и какое?/Ну и которое? - So [in the end] which one?
Какое/которое split.
They are very close, so hard to draw the line. For me the "который" pronoun has a slightly different shade, as I feel it. It hints that there is some pressing need, some task to do with one dress, but you do not know which one. Like "Did you washed that your dress clean?" "Which one?" - "Ты отстирала своё платье?" "Какое именно?"/"Которое?"
Or like leaving a dress-room with a pack and met with "Still i think the dress bears an unreasonable pricetag..." you can demand clearance "Which one" - "Которое?". There is a fixed and readily available list of thing, and you have to point into it. Like Quassnoi's comment with "которое из двух" - there is an immediate list of two options, stop hesitating and put your finger upon one of the rows!
But personally in a general surfing around the shop and looking here and there, and maybe deciding to buy nothing or buy pants instead of dress - in such a blurry situation "кoторое" would feel a bit unnatural, a bit too specific, a bit too focused, demanding. Again, in such a surf-around there is not fixed and specific list to point your finger. There is some general idea of dresses suiting better or worse. So, "какое" would feel more natural for it.
SHOULD
The "shall" verb, as I heard, is a very demanding one. To the point in British English today even I/We is often used with "will" instead.
So, i'd start with softer options.
"Какое платье мне лучше купить?" - "Which dress would I better buy?" - asking for an advice rather than order.
"Какое лучше купить?" - the more conversational, informal shortened phrase. Assuming the contexts is immediately available.
"Какое [платье] покупаем?" - "Which dress we are buying now?". Considers the purchase as a joint activity. The wallet is not necessarily shared, but the time and opinions they were.
The "should I buy" is somewhat demanding an order. Like a family in a ties section. The husband can get a bit annoyed "All those shades look the same color to me. I see no difference. If you, sweetheart, can tell them from one another, stop trying 1000 shades of gray, just show me which damned one tie should I bye, and I accept your taste and your judgment."
(В конце концов...) (Ну и всё-таки,..) какое (же) платье мне купить?
Or even "...мне покупать?"
Here it sounds to me like "...мне надлежит купить?" - "...I ought to buy?".
Or "...какое же платье ты мне скажешь купить?" - "...you would tell me to buy?"
In a casual non-stressed situation, i'd "soften" the "buy" verb by "лучше" (just want you non-binding opinion) or by plural inclination (we are together in this activity). The direct indefinite-tense "мне купить" would sound annoyed to my ear.
Comment: I believe you are making things more complicated than they are expected to be
Comment: that is the choice of the asking one, if he wants to be blending into and conveying nuances, or if he wants to be understood in his most basic phrases.
Answer: Which one - какой именно? (Какой конкретно?)

How to say "which one" in Russian?


why recursive languages does not come under Chomsky hierarchy?

Question: why recursive languages does not come under Chomsky hierarchy ? why Chomsky did not classified
 it? any real life resemblance of recursive language something that i can connect it with like regular language are ones which needs finite memory or context free languages are those which can be parsed using single stack .something like that .
Answer: The hierarchy is defined in terms of grammars. It is still an open question whether there is a natural grammar formalism for recursive languages (check out this question), and certainly no such formalism had been known at the time Chomsky wrote his paper.


Why is this ceiling light fixture wired this way?

Question: I'm trying to replace the hanging light below and I've gotten a little confused. Shouldn't the brown wire on the left be connected to the live (red) wires rather than the neutral? I understand that the black wires on the right are connected to the blue wire, both are neutral so that makes sense. The same goes for the earth wires. I just can't understand why it is wired in this way and how it even works?!?! Can someone clarify this for me?
Comment: What country is this?
Comment: And can you post another angle from the other side that shows the bus bar better?  Numbering the black and red lines from left to right as 1-3 I think what you've got is [Brown-Black1] [Red1-Red2-Red3] and [Black2-black3-Blue] but I'm not 100% sure
Comment: @TheEvilGreebo Older UK wiring, by the colors: http://en.wikipedia.org/wiki/Electrical_wiring#Color_code
Answer: The cable on the left runs to the switch. Power comes in from one of the two other cables via red, runs down the red of the switch cable to the switch. When the switch is closed, power runs back along the black and into the light via the brown. Goes thru the lamp into the blue, which connects to the common neutral black of the other two cables.
Switch legs can be confusing because the neutral coloured wire carries power back the the switched fixture. All is as it should be though.
Comment: Thanks very much for the clarification. It makes perfect sense now.


Should I keep an instance of DbContext in a separate thread that performs periodic job

Question: I have a class Worker which sends emails periodically,I start in Global.asax.cs on App_start()
public static class Worker
{
    public static void Start()
    {
        ThreadPool.QueueUserWorkItem(o => Work());
    }

    public static void Work()
    {
        var r = new DbContext();
        var m = new MailSender(new SmtpServerConfig());
        while (true)
        {
            Thread.Sleep(600000);
            try
            {
                var d = DateTime.Now.AddMinutes(-10);
                var ns = r.Set<Notification>().Where(o => o.SendEmail && !o.IsRead && o.Date < d);

                foreach (var n in ns)
                {
                    m.SendEmailAsync("email@example.com", n.Email, NotifyMailTitle(n) + " - forums", NotifyMailBody(n));
                    n.SendEmail = false;
                }

                r.SaveChanges();
            }
            catch (Exception ex)
            {
                ex.Raize();
            }
        }
    }
 }

So I keep this dbcontext alive for the entire lifetime of the application is this a good practice ?
Answer: DbContext is a very light-weight object.
It doesn't matter whether your DbContext stays alive or you instantiate it just before making the call because the actual DB Connection only opens when you SubmitChanges or Enumerate the query (in that case it is closed on end of enumeration).
In your specific case. It doesn't matter at all.
Read Linq DataContext and Dispose for details on this.
Answer: I would wrap it in a using statement inside of Work and let the database connection pool do it's thing:
 using (DbContext r = new DbContext())
 {
     //working
 }

NOTE:  I am not 100% sure how DbContext handles the db connections, I am assuming it opens one.
It is not good practice to keep a database connection 'alive' for the lifetime of an application.  You should use a connection when needed and close it via the API(using statement will take care of that for you).  The database connection pool will actually open and close connections based on connection demands.
Answer: I agree with @rick schott that you should instantiate the DbContext when you need to use it rather than keep it around for the lifetime of the application.  For more information, see Working with Objects (Entity Framework 4.1), especially the section on Lifetime:

When working with long-running context consider the following:

As you load more objects and their references into memory, the
  memory consumption of the context may increase rapidly. This may cause
  performance issues.
If an exception causes the context to be in an unrecoverable state,
  the whole application may terminate.


Cancelling the 3rd party service contracts

Question: My business partner and I recently purchased a small Ltd company. Each of us holds 50% shares each. No changes were made and we simply purchased the business as it is, simply the ownership changed.
We have two third party service providers and we want to cancel their services because it's too costly for us to continue with them, however we cannot cancel this because the previous owner has signed both contracts to run until 2022, and prior to purchasing the business we questioned the previous owner on this and they said we can cancel the contracts once the ownership changes. But this is not the case and the previous owner lied to us and did not disclosed any copies of the contact or documents on this. Is there a way to get the contracts cancelled? We have requested a copy of the contract and it does say it is a binding contract until the end of the term. Are there any laws or general regulations which we can use if the ownerships changes in a company the new owners can cancel the contracts?  Or should anything similar to this should be included generally in service contracts?
Comment: Please [edit your question](https://law.stackexchange.com/posts/48753/edit) to add a tag for the relevant jurisdiction [country/state]. Contract law varies.
Comment: @AndrewLeach "*Contract law varies*". Not really. The principles of contract law are significantly uniform across many countries. I would have suggested the OP to give more specifics about his contract (that is, the language thereof) rather than the jurisdiction.
Answer:
Are there any laws or general regulations which we can use if the ownerships changes in a company the new owners can cancel the contracts?

No, or at least it is very doubtful.
Your recourse is to go after the previous owner and recover from him the losses you are incurring as a result of his misrepresentations. Your issue certainly has to do with contract law, although it does not involve the third party service providers. Instead, it involves the previous owner because he is the one who made the false and misleading statements.
I assume you and your business partner signed a contract with the previous owner. If so, you need to ascertain what the contract says regarding the company's liabilities and commitments that are/were in force at the time of the sale.
Absent any clause in that respect, you would need to proceed on the legal theory of fraud notwithstanding its overlap with contract law. In that case, you will need to prove that the owner's misrepresentations induced you to act in a way (namely, by accepting the price you actually paid to the previous owner) that led or is leading to losses. For instance, had the previous owner been honest about his contract(s) with the service providers, it is foreseeable that you would have settled only at a lower cost.


Which is the best way to implement multiple list?

Question: I want to build an android app. In this app user can pick a student from a school, for this user must pass through school > standards > division > student. How can I make a best picker for picking students easily.
Answer: I am considering that there are multiple schools to choose from as it's not clear from question, however solution for having one school in case will not be far distinct from this.
There can be multiple cases to handle I am listing major three:
User know the name of student for whom he is looking for but doesn't know the school or standard or section
User doesn't know the name, he just wants to see the list of students in any school's std. and than pick a student based on some traits or achievements
User know the name of student as well as school, class and standard
If the case is 1:
Search can be very powerful in this kind of scenario. User can not start finding by selecting a school as he is not aware about school or in case he is aware, he might not be clear about class or section and vice-versa. Using search he can simply type the name of student and will get the result with their details which should be comprised of school, standard and section (or anything else which is important in your scenario). Filter pattern will play a vital role in this scenario to refine the results and get more accurate information. User should have the power to filter result based on school, standard and section (Having filter section can be a really difficult case to handle as different schools can have different way to denote section).
If the case is 2:
One way to achieve objective in this case can be classical way where user select a school then standard and so on to pick a student (Make sure to have a breadcrumb or some kind of components to make sure at which level user is right now in navigation, if you are planning something like this). But I believe pattern like this is not so useful if you have large number of schools in a list. Its better to add a functionality in search where user can select/type any trait, quality or anything which you are planning to have in your database about student and give results based on that and then user can refine it based on filter criteria school, standard, division etc. For e.g.: if user enter basketball user will be able to see a list of all students those someway have enrolled themselves in to basketball game and then user can refine the results.
If the case is 3:
User can pretty easily achieve the objective by selecting school from the list and than narrow down scope by selecting standard and section.
I would recommend to have both the patterns keeping in mind that all user may not like to search in case 3 they might want to go through complete navigation.
Answer: That is a pretty deep hierarchy, though you haven't given a specific use-case.
Normally, you're better of having a STUDENT section then have school, standards, division as FILTER. Filters help you easily pick specific information from a large dataset
Comment: how can i implement a best filter for this.i want more flexible  ui in less space.


How was the "Fly" episode directed?

Question: With the advent of CGI, this may come off as foolish, but I really want to know how the episode "Fly" (S03E10) in Breaking Bad was directed, particularly regarding how the fly itself was so realistically controlled/filmed.
Comment: If you've already done any research it might be worth sharing what you've found out already.
Comment: My research brought up nothing. If it interests you, this type of thing was done earlier in the film _Constantine_, which I happened to see recently.
Comment: No problem - For reference, I managed to find the info that A J submitted below by searching "breaking bad fly vfx". If you're interested in any other effects of that nature, I find *"[film name], vfx, interview"* is a good starting point.
Answer: Well, it's all CGI.
TL;DR

They used CG dots to create a fly. They tried for real flies, but they had to replace these with CG flies.

They researched about fly's movements, variations in speed and directions etc to make it easier to shot like a real fly.

Long read;
From this interview with  Mat Beck,

fxg: The fly that seems to terrorize Walt and eventually lands on his glasses looks like it was fun to do. What was involved in making the fly shots possible?
Beck: Well, the fly is a main character of the piece so it plays a big role. All in all, the fly was in the show for about 20 minutes and was planned to be portrayed in different ways. We had a high-res CG model for the close-ups. For wider flying shots, we figured it could just be a flying CG dot – which turned out to be more trouble than we thought. For wider static shots, the original idea was to use practical flies made by a guy who made fishing flies. It was a really good looking fly, but it didn't take long in a shot of the fly sitting there motionless for it to become apparent that it wasn't a real fly. So we ended up digitally replacing most of the practical flies and doing the bulk of the flies as all-CG.
fxg: What kind of fly reference did you look to?
Beck: Ironically, what we couldn't find reference for was how a fly moves around a room. Everybody knows how they do it, because we've all chased one around with a newspaper or a swatter. But no one that I know has actually gone and filmed it – I mean, why would you?! So we had to work it a little bit to make it move like a real fly does, not like a moth or miniature bat. Flies have certain ways that they move and there are certain variations in speed and direction. Once we got that down, that really helped.
fxg: How did you make the fly read on the screen?
Beck: So what was originally going to be not many instances of a CG fly became, instead, virtually every shot is now a CG fly. For the close-ups, we just had to make a great looking fly with fly-like behaviours. Flies actually do move like little insect-ey robots. They have very stereotypical behaviours. They roll their head around and groom with their legs. We also did some cool things with the wings where we would render the background with the fly's body and then put the wings on top and refract the background, including the fly's body, through it. When the wings moved, it gave more realism and helped your eyes go to it.

How was the "Fly" episode directed?


Window peek view on Windows 10 (not desktop)

Question: Is there a feature or software that allows the user to view an open window (a browser for example) when they hover the mouse on a corner/edge of the screen or on a floating button ?
The feature I am looking for is similar to the desktop peek view on windows that shows the desktop when the user hovers the mouse on the bottom right corner of the screen. But instead of showing the windows, I want a window to be shown
Answer: If you have an application open, and the icon is on the taskbar, you can hover over the icon and then hover over the window to see the "peek view" you're looking for.


Intersectional search from two indices

Question: I have two indices in Elastic: Track and Messages.
Each index has ServiceId field.
Search in the Tracks index is always performed by fields (exact value) in the index.
Search in the Messages is always performed by free text search in the index.
I need to implement an intersectional search from the both indices. To find ServiceIds from Tracks index by exact fields values and then find ServiceIds from Messages index by free text search and then to intersect the results = array of ServiceIds.
The actual result to the user is the list of Tracks by these ServiceIds received from the intersect action.
How can I do it? Each search (from Tracks and Messages) should return all the documents and only then intersect should be performed but as I understand Elastic can not return all the documents (suppose I have hundred of millions documents in each index) and intersect action is not correct...
Intersectional search from two indices
Answer: It could be achieved by using aliasing. Refer https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html for more information.
You  should have some common fields in both your indices, in this case, it is serviceIds.

Intersectional search from two indices


I have an iPhone 6S

Question: Hello I have been searching for ways to update my apps & download without having to use a credit card which I don't have and I don't have the "none or Paypal" option in the payment section and I don't know what else to do. Is there any way without having those options that I can update my apps or even download any??
Answer:
Walk, drive, or hitch a ride to a store that sells iTunes Gift Cards
and buy one with your cash money
Enter Code # from card into iTunes
Purchase Software
Happiness! (Your results may vary).

I have an iPhone 6S


How does having no internship experience affect your employment in industry in Computer Science?

Question: How exactly does an internship experience make you more employable for industry? How does experience in developing your own startup compare to having an internship in terms of employability in the industry?
Comment: You just need to put what you have on your resume.  You may find a startup that favors startup experience.
Comment: I never had internship experience and I found a job in the CS field straight out of college. I did however had experience with small computer side jobs at school though.
Comment: Can you add your country?
Comment: @Trickylastname I am from India....
Answer: In the UK at the moment there is a real problem recruiting developers. salaries are going up and recruiting agencies are asking for 30% of salary to find people.
There seems to be a real shortage of developers, especially good ones. I know my company, it is also true everywhere where I have friends working, They are desperate to find people to hire and if you can produce good work that is all they care about.
If you can represent yourself as a normal human being in an interview and can show in technical test that you are competent then you will get hired, an internship won't matter either way.
Comment: Seconded. An internship, if it was a good one, will make the transition into a real live SDLC setting a lot less painful. That's all it really offers.
Comment: This is certainly my experience in the UK at the moment - companies are absolutely crying out for good developers.
Answer:
How exactly does an internship enrich your experiences if you want to join industry

An internship provides:

Limited but real-world experience in a business / industry
Gives employers confidence that you have already been taught basic employment expectations (show up on time, take notes, attend meetings, etc.)
Gives employers confidence that you know basic industry terms, issues, news, etc.
Provides you with confidence that you want to continue in the same industry
Provides you and the employer confidence that there is good chance you will actually like what you are doing as a full-time employee
Exposure to tools and techniques that schools do not teach (or teach well)

what if you have experience in developing a startup of your own?

Pros:

Most of the list of the internship applies
You are clearly a "self-starter" which can be a huge advantage in some settings
An employer may feel like you will need less supervision

Cons:

You have not had experience with outside management, making the transition to being managed possibly more difficult
You may require added supervision since you are not familiar with corporate policies and politics
An employer may believe that traditional employment is not a good fit for you, and decide to interview other candidates
You may have too much "entrepreneurial spirit" for an established company that is seeking candidates that need to conform to their rules and policies in order to be successful
They may be concerned that your employment will be temporary, as you will likely continue to pursue your start-up efforts while employed (if possible)
They may be concerned about your dedication to your employment since your start-up may continue to distract you after you are employed
Your exposure to outside tools and techniques will be much more limited when they are self-selected by you and/or not present in your start-up.

Sometimes start-up experience is exactly what you need to get where you want to go. Sometimes it is the worst thing you can do because it generally is nothing like large, stable corporate environments that dominant many computer science related jobs.
Nearly all of these are temporary, as you navigate your career and make decisions based on available opportunities, the internship and/or start-up path will make less of a difference. However, the first couple of years in your career can make a huge difference in your career going the right direction in general.
Comment: Emphasis on `Exposure to tools and techniques that schools do not teach (or teach well)`.  Most universities do not cover things like source control, project tracking (scrum/agile seems to be most popular right now), etc.
Answer: Let me explain you from a recruiter's perspective.
Suppose, I am reviewing two candidates for a data science position in my team:
One has nice experience with a project during his internship. Another has a startup.
This is how I would gauge their fit:

If the second guy's startup is anything other than an analytics one, then both would be gauged equally. By equally, I mean their personal projects and skill.
If the second guy's startup is an analytics/ML one, I would be very interested to learn about it.  So, he would be gauged by his experiences at running it, and the first guy would be gauged on his internship exp. and personal projects.

So, the fit would depend on a lot of factors like:

Project done during your internship
The startup domain of the person, and his experiences at running it
Skill of both, when it comes to data and analytics tools

So, a good intern project/ a relevant startup experience <-- YES
Else
NO
Comment: neither is required. Also please write your answer gender neutrally.
Comment: Can you please explain what you meant by _neither is required_.  And sorry, my English is weak, so I wasn't been able to generalize the answer :)
Comment: Neither an intern project nor a relevant startup experience is required. (Your last three lines of your answer literally say exactly this.)
Comment: Yes, a _good intern project_ in the first case, and a _relevant startup exp_ in the second case, would be the factors for being considered for a job

As the OP have asked for an intern exp, when having startup exp; I have considered only that case and it's permutations.
Comment: Just to name one example, I entered my first tech job without internship experience, and without startup experience. You are claiming those are "the factors for being considered for a job."
Comment: As the OP stressed on _intern or startup_, I wrote the answer in that perspective, not taking neither into account.  Yeah, in that case, skills and personal projects would be the ones which would be gauged.
Answer: Internships are by no means a requirement.
They are viewed as great experiences. Technology is a field where there is a shortage of developers however. Arguably, tech companies care more about cementing your interest in the company and the field than any skills or experience you get out of the internship. They are certainly most important as a recruitment tool.
I would view an internship as one of many possible inroads to join the industry. A computer science major is another, even without internship experience. A code boot camp is another. Doing lots of hackathons is another.
Answer: From a hiring manager perspective an internship doesn't matter AT ALL unless it is at my company or I have someone that I know and trust that knew of your work during your internship.
Let's be honest - internships are probably the least defined job at a company.  And when an intern gets hired sometimes the hiring manager has time for them and sometimes they don't.  Quite often the intern just ends up doing whatever they are good at - not the real job.
I have had interns that were crowned at my company as the "next thing"... said intern might wow a non-techie group with basic html skills or taking code from a known website.
And that is why I would not base 1% of my decision on hiring someone on an internship.  I just have seen "interns" all over the place.  Some do it for the career maximizing affect (like I give a crap about that when hiring a developer).  And some do it to learn (I do care about this but have no proof of what they learned there).
Comment: You make it sound like you view internships as a negative? Doesn't seeking employment have its own signs as to the integrity of the candidate? Plenty of college grads have never worked a day in their life. You never know for sure what they did but that's true of any prior experience. The internship is the bouncing off point for interview questions, and definitely ask for references from an internship. Otherwise you are indicating experience is useless and a degree is more important or the only valid measure.
Answer: If you want to work in industry, internships may open doors. A successful internship at a company may turn into a full-time job opportunity for you. Personally, it's also the chance to build experience in things that aren't part of your academic curriculum, network with other professionals in your field, and get exposed to working in one or more settings to see what you like and don't like. If you work toward performing against your expectations, you'll likely have an easier time in seeking full-time work, either with a company that you interned with (because they have some familiarity with your work) or with another company (because you have experience and references to back up your ability to work). In essence, you are less risky to a company because you have an internship.
Developing a startup of your own takes a different set of skills than being an individual contributor to a project team. If you are working toward creating a new project, then you should have a project to show. That could be valuable to a company. If your startup is a small team, you can perhaps speak to leadership and management topics in an interview. And if you end up monetizing your product, you could demonstrate sales and marketing experience.
The value of both depends on the company that you're working for. A large company where you would be working on a technical team and only possibly working with other groups may want to see more technical skills. Internships would stand out. A smaller company, where you would perhaps wear multiple hats, may like to see a startup or project that you started and how you managed and executed both technical and business sides.
Ultimately, it depends on what you're going for in your career path. However, startup experiences won't preclude you from getting a job in industry later and internships won't prevent you from launching your own startup. And having neither isn't a problem, but anyone with experiences would likely have a leg up on you.


How different are the anime and manga versions of Death Note?

Question: Although this question was closed, it was actually through it that I came to realize that the anime and manga versions of Death Note are different, having only seen the anime version.
Just how different are the two versions?
Does the anime simply omit some details, shortening the story?
Or do they take completely different directions at some point? (much like the FMA manga and its first anime series) If this is the case, at which point do they part?
Comment: The definite difference between your and the closed question is you're asking easily verifiable facts, while the other asked reasons, which unless given by Word of God, would be all just wild guesses.
Answer: There are some minor differences.
For example, when L loses his life in the Anime, he doesn't say anything. But in the Manga he says something like "I knew I was right".
But the main difference is the ending.
In the Anime

Yagami Light, Near, Matsuda and all the squad are in a sort of warehouse. When Light tries to get the piece of paper of his Death Note from the watch, he gets shot by Matsuda in non-fatal points, both times. While the other guy kills himself, Light runs away, and ends up in another building of what looks like an industrial area. Ryuk is on top of a chimney and speaking to himself, he "reminds" Light about his first promise, i.e. that he would be the one to write Light's name on the Death Note. And that's what he does.

In the Manga

  Light is still in the warehouse and he sees Ryuk (Near sees him too since he has the Note as well) and he begs the Shinigami to write their names. Ryuk says "Ok Light, I'll write..." and while everybody tries to shoot him, he adds "...your name, Light." Light doens't want to believe it but when Ryuk shows the Note, his name is written there. Light sees his entire life and remembers the same sentence Ryuk told him when they met (i.e. that he would be the one to write Light's name on the Death Note). Ryuk adds "it would be hard to see you in prison and your life is over anyways" or something similar. After 40 seconds, Light dies in front of the two detective teams.
Comment: interesting. i wonder why they changed it
Answer: Summary
There are a lot of differences between the Death Note Manga and it's Anime adaptation, but they're mostly minor differences, with the overall story being the same. Compared to the Manga, the Anime has had some scenes removed, new ones added, and some included scenes have been altered.  I'll go over some of the more notable changes, but this won't be a complete list.
L/Light Arc
The conversation between L and Light that happens in the coffee shop was altered significantly, with the Manga scene being a lot longer and containing more dialogue between Light and L. In the Anime the only question L asks Light is the one where L gives Light pictures of the "L, do you know that Gods of Death love apples?" messages. In the anime L also asks Light what he can conclude by L revealing himself, and also asks him a question about the various FBI detectives that were killed by Kira.
The following scene, with Light, L, and Soichiro, had alterations as well.In the manga L asks Light what he thinks Kiras personality is like, which leads L to state that the most likely person to be Kira based on Lights description would be Lights sister, Sayu. This causes Light to be outraged, and Soichiro to state that he doesn't believe it's possible for Sayu to be Kira (but doesn't make the same statement about Light, which is something Ryuk makes note of).
In the Manga the first meeting between Misa and Light contains an explanation from Misa about how much of a persons face she needs to see in order to know their name, which was omitted from the Anime.
Business Arc
The anime also excludes a few scenes between Rem and Higuchi, likely to prevent the watcher from discovering who the new Kira is too long before it's revealed (due to recognizing the voice). The most notable exclusion is a scene where Rem tells Higuchi he can stop killing criminals now, but Higuchi refuses, stating he still needs criminals to die, since it's good for business.
The manga also shows that  Rem is disgusted by Higuchi and the other members of the "Kira board". Rem tells Misa during their bathroom scene that her disgust at the actions of the "Kira Board" have made her come to the conclusion that Light may actually be a good person, and wishes for him to succeed (and, for this reason, is no longer able to kill people in order to help Light succeed, since it would cause Rem to die).
When Light gets the notebook back, and Misa resumes her duties as the second Kira, there's a scene in the Anime which shows Misa walking in the city singing. This scene isn't present in the Manga, and was added to the Anime.
The death of L is handled differently as well. In the Anime there's a scene which takes place on the roof of the task forces HQ, after which L gives Light a foot massage. Immediately after this scene L and Watari are killed by Rem. In the Manga the rooftop scene and foot massage are completely omitted. The scene before and after this, showing that Rem is considering killing L to save Misa, is all just one scene. It's not broken up by anything in the middle. When L does die, he's complete silent in the Anime, but in the Manga he says "I wasn't wrong". Finally, there's a few scenes between L and Watari in the anime (flashback to L at the orphanage and L coming to Wataris computer room at HQ) which aren't present in the Manga.
Near/Mello Arc
The second half of Death Note, featuring Near and Mello, contains a lot of alterations as well, with quite a few scenes being removed. It also adds a few additional scenes between Misa and Light, giving a bit more of  a glimpse into their relationship, and expanding some more on Misas character (you really get to see how much she cares for Light, and how concerned she gets when Light is upset).
In the Manga Near brings Soichiro in for questioning after Near sends a chopper to pick up Soichiro in the desert. The SPK also gets the USA president to send in a squad of soldiers to retrieve the Death Note from Mello, but the assault fails due to Sidoh taking off everyones helmets so Mellos group can kill them with the Death Note.
In the Manga Mello and Halle Lidner are shown to have met prior to the scene where Mello puts a gun to her head, and almost immediately after the meeting between Mello and Near, Mello contacts Mogi and sends him to meet near. Near asks him a few questions and shares some information with him, with Mello and the task force listening in (although Mogi doesn't say anything). Mogi is actually still with the SPK when Demegawa storms their headquarters, and safely escapes with them. Mogi is still with the SPK up until Aizawa goes to meet up with Near, at which point Mogi and Aizawa leave together.  In the Anime Mello never contacts Mogi, and Mello and Halle weren't shown to be in contact prior to Mello putting a gun to her head. When Aizawa gets in touch with Near regarding his doubts about Light he does it over the phone, and not in person. Interestingly enough, though, the Anime scene where Aizawa does first meet Near in person was actually over the phone in the Manga, so they (sort of) swapped those two scenes.
The anime removes a lot of scenes between Misa giving up the Death Note and Light making contact with Mikami as well. In the Manga we actually see Light looking for someone to replace Misa, and notices Mikami during a broadcast of Kiras Kingdom, which results in Light sending Mikami the Death Note. Mikami also tries to reach out to Kira (Light) during an episode of Kiras kingdom, stating that if Kira can't get in touch with him he'll begin acting on his own. Mikami also doesn't get in touch with Light until the second meeting between Takada and Light. In their first meeting Light gets Takada to make some statements during the broadcast in an attempt to have Mikami contact her, and then Mikami contacts her during the second meeting between Light and Takada.
In the manga we see a few more scenes of Mello and Matt (the one who helped Mello kidnapped takada) observing Misa and Light, but nothing really notable happens in these scenes.
Ending
As the other answer already made note of, the ending is changed as well, and is definitely the biggest change. In the anime Light escapes from the warehouse after Mikami kills himself, and dies when Ryuk writes Lights name in the Death Note.
In the Manga Mikami doesn't kill himself in the warehouse, and Light doesn't escape. Instead, after Matsuda uses Light for target practice, Light crawls on over to Ryuk  and begs him to write everyone's name down in his Death Note. Instead Ryuk writes Lights name in the Death Note, resulting in Lights Death. The story then cuts ahead a few years, and there's an epilogue. In the epilogue we learned that Mikami killed himself in prison, and that Aiziwa has taken over  as head of the Japanese Police. Near has taken over the position as L, and still works with the police. The final shot of the Manga shows that people still worship Kira, and pray for him to return one day.
Misc
The Anime also contains a lot more imagery than the Manga does. In the anime there are several scenes which often don't show what's actually happening when some characters are talking. For example, during the "I am in Japan" conversation between Near and Light it shows the two of them going up a construction elevator, whereas in the Manga it just shows them talking over the phone. These changes were likely made to make the long dialogue scenes of the show more visually interesting.
In Closing
So that should cover the majority of the changes between the Manga and Anime, although I may have overlooked something. As you can see, the overall story remains the same, but there's definitely enough differences between the two make reading the Manga worthwhile if you've already seen the anime (and vica versa).
Answer: Most of the major ones have already been brought up, but there are several small ones that make things change in ways you wouldn't expect. The easiest to see  example is that Mello (in the manga) had a cross, both on a necklace (potentially a rosary or a fifteen-decade rosary) and hanging off his gun, in the anime the gun has nothing hanging off of it and there is no horizontal bar on the necklace. To most, these are minor, but the connotations are huge. Death Note had, over and over again, shown that there is no afterlife, that everyone returns to nothingness. We, as viewers, accept that that is the way it is in Death Note, but to the other characters, they would have no way of knowing. To me, such little things made a big impact from a lore and world building perspective.
Answer: For an interesting subtle difference, see the essay Two boys, one post? Or why anime Light is not the same as manga Light by casuistor, which goes in detail about how anime-Light and manga-Light actually differ in characterization.
Some highlights:

So before reading any of this, you may be thinking that manga-Light and anime-Light are fairly similar and they are at least superficially. Otherwise, their respective characterizations are quite different. This, unsurprisingly, gets established right from the beginning of both the anime and manga when you look at Pre-Kira Light.
...
Manga-Light, for all intents and purposes, comes off like a relatively ordinary guy who jokes around with friends. Anime-Light IS the stereotypical loner character who shuns the company of other people. The anime even gives us a montage in Episode 3 to demonstrate exactly this point.
Here's Light walking to school alone.
Here's Light eating lunch at school by himself.
Here's Light being too good to be a team player in a team sport.
Anime-Light well and truly physically distances himself from other people. It isn't just emotional distance. None of these shots above are consistent with the friendly social mask manga-Light clearly puts on for the public.
...
Another interesting difference to note is the way manga-Light is actually talking out loud when he's chattering about the death note. It isn't part of his internal monologue because it isn't a secret. Anime-Light on the other hand examines the note and his thoughts stay internalized.
Anime-Light's first sign of finding the note genuinely amusing happens when he picks up on this potential application of the note.
Taking into context anime-Light's misanthropy, already eyebrow raising humor like this becomes even more alarming. Think back to all those classmates anime-Light is disgusted with. You can very easily picture a list of people anime-Light would consider toying with.
But if that weren't weird enough, anime-Light has this inexplicable need to say this particular thought out loud. He's within the privacy of his own room, of course, but it strikes me as unusual that he reads all of the rules in silence, and then feels the need to physically announce that he could theoretically make someone suffer.
Contrast this with manga-Light.
You'll note that manga-Light keeps the same thought to himself. His dark humor (because that's what it is) is for his own amusement alone and stays private and separated from the casual sense of humor that he would verbalize and share with the world. This is a distinction that isn't present with anime-Light.
...
In short then, the two iterations of Light Yagami are fundamentally different in their psychological make up. To use a glass analogy, at the start of canon, manga-Light is a perfect sheet of glass that shatters into pieces once he finds the death note. Anime-Light however, is characterized as broken fragments at the start of canon that are put back together when he finds the death note. This difference is even highlighted by the titles. The manga's first chapter is entitled "Boredom," Boredom is what compels Light to write in the note initially and boredom is what destroys Light's personal mythos.
In contrast the first episode of the anime is called "Rebirth." From the chaos that the death note introduces into Light's life, we have a metaphorical rebirth. The glass fragments stitch back together to re-create an imperfect but unbroken sheet of glass as Light discovers his true purpose and embarks on his destiny.
Subtle, as I said, but fascinating.


Mapbox- reset a popup offset dynamcally

Question: I have a Mapbox feature layer (with a geoJSON as source) with popups for each marker (with a divIcon).  We are resizing the marker icon on different zoom levels (using css).  How can I reset the offset of the popup on different zoom levels?
Here is the initial setup of the marker and popup (this all works):
var curOffset = [0,1];

Markers.on('layeradd', function(la) {
  var Icon = la.layer,
  feature = Icon.feature;
  var popupContent = "<some html>"

var popupOptions = {
    autoPan:true,
    closeButton: false,
    minWidth: 220,
    maxWidth: 220,
    zoomAnimation:true,
    offset: curOffset
  };

 Icon.setIcon(L.divIcon(Iconfeature.properties.icon));

 Markers.bindPopup(popupContent, popupOptions);
});

I tried to reset the offset on a zoom event like so, but it doesn't work:
map.on('zoomend', function(e) {
if (layerOn == true) {
  size = map.getZoom();
  switch (size){
    case 14: console.log("14"); curOffset = [0,5]; break;
     ...
  }
 }
});

Do I need to close and then open the popup perhaps? I tried something along those lines but I got an error.
I received this suggestion from the a Leaflet Github contributor, but I haven't been able to get this to work either/
'Update the popup.options.offset, then call the private method popup._updatePosition.'
Answer: The GitHub Leaflet contributor also suggested looking into just changing the css for the popup on an event..once my co-worker and I found the right rule to modify, it worked:
map.on('zoomend', function(e) {
    switch (size){  // zoom level

    case 14:  $('.leaflet-popup.leaflet-zoom-animated').css('bottom', '-5px'); $('.leaflet-popup .leaflet-zoom-animated').css('left', '-28px'); break;
     ...

I also had to add an additional check in case the layer was turned off during the zoom, with similar code.

Mapbox- reset a popup offset dynamcally


How do you represent text in WKT

Question: I need to label the simple-features/shapes in a Well-known text file. Is there some best practice on how to achieve this? Should I just keep the labels as separate entities linked to the WKT or is it possible to add this to the WKT itself? Thanks.
Answer: As far as I know WKT doesn't really support any kind of label as it just represents the geometry itself.  What you could do is however just store it as comma separated  list eg:
<code>feature1label, {WKT string}
feature2label, {WKT string}
</code>
You should then be able to display this with X GIS program.  QGIS can open and display text files with a comma separated list of WKT objects using the Delimited Text plugin.
Comment: Nathan is right, the OGC WKT for Simple Features only talks about how to define the feature geometries with text, not the attributes.  I would link directly to their documentation, but they require you to accept their license agreement to view the 'Open' specification.

How do you represent text in WKT


How to de-escalate a situation when a user balances on the edge but others who want to correct them go beyond the rules?

Question: The described situation happens on a Q&A site. An active user spends a lot of time on posting comments with recommendations on how to improve others' posts. The comments are kind of short and even a bit brutal. These comments get rude or abusive flags from time to time. Comments themselves do not seem to violate rules of the site. At the same time there is a group of users who look to disagree with that active user's approach of commenting. As a result they have been name-calling the user a few times in comments which goes against the rules.
What should moderators do to de-escalate the situation? What guidance should moderators provide to both groups of users?
Answer: I've been the user leaving comments before. There are a couple of things worth bearing in mind.
First off, the user commenting in all likelihood doesn't realize that their comments are coming across as curt. This often happens when there is a large amount of these low-quality posts. It's not really sustainable to write a personalized comment for a hundred different answers, so one thing that users do is to create a stock comment, and post that with minimal edits on each answer. So you've got this user leaving this stock comment, that they don't realize is curt, on a bunch of different posts.
Then, you've got the user on the receiving end of the comment. They don't know that it's a stock comment, so they've just gotten a comment pointing out that their answer doesn't meet requirements, which stings in the first place, and the comment is curt, to boot.
An overworked, tired user and a frustrated new contributor. Not a good combination.
Of course, neither of these people actually have an excuse, so you do need to deal with the situation. What's the best way to approach it?
If things are ongoing, the first step you need to take is to stop the immediate situation. If it's happening in chat, or comments, and things are degrading, you need to stop the immediate situation - essentially separating the users. This could be achieved by simply deleting the comments, or locking the post, or freezing a chatroom, or trashing messages, depending on what seems like the best option at the time. Try to keep it impersonal, and consider telling them that you'll reach out to each of them personally.
Second off, reaching out to the offended new users would be a good next step. Apologize for the curtness of the previous commenter. Acknowledging that there was a misstep is always a good idea. Once that's done, you can explain to them that even if the other person was curt, being out of line in response is still not a appropriate response. If it seems like it could end productively, work with the user to help them improve their answer or whatever.
In addition, reach out to the commenter. Explain that their comments have been curt and could be improved, and that they need to improve it a bit. Thank them for the effort they've been putting in. Including praise and gratitude is a great way to get them to be more receptive to what you're saying - just telling someone off is unlikely to be received well. Make sure to balance appreciating what they're doing but informing them that they need to improve things a bit.
Of course, things will be dependent on the exact situation. In your position as an exception handler, you'll need to make a judgement call about the specific circumstances you find yourself in and what steps need to be changed.
Answer: I believe you posted the determining factor in your question, with "Comments themselves do not seem to violate rules of the site." It is important to follow policy. If the policy is bad, it should be revised. You may be in a position to revise it, or just in a position to advocate for a revision. If you feel strongly about it, you should do that.
In short though, you appear to not like your site's own policy... You believe someone is not behaving appropriately, yet the policy says he or she is. If you are not in a position to revise the policy, you have to let that go. In a professional environment, you don't get to arbitrarily make rules for one user that are not announced for all. And that is effectively what you appear to be wanting to do.
Regarding the others... You also stated the decisive factor in your question. You clearly believe some of these do violate policy. I assume your policy proscribes action to be taken when a policy is violated... So what do you do? You take the proscribed action. Hopefully, this just means telling the person "Personal attacks and name calling are not allowed. Please keep it on topic."
This is going to be hard if you know and appreciate the typical input of the users you are policing. But you need to remember that you are in fact policing the site. Your job, at least in this regard, is to apply the policy fairly and equally regardless of your personal relation to the members there.
All of this said, you can do the above in a nice way. When you tell someone not to name-call, the person might respond, "But he started it with (whatever)". You can use that as an opportunity to explain that while the other person's opinion was stated bluntly or harshly, it wasn't a personal attack. And the policy of the site draws a line at personal attacks. That's why your comment was removed, but the other person's is still there, etc.
Good luck.


Identifying polarity of capacitor from PCB printing

Question: I took out the old capacitor and didn't remember to check the polarity because I assumed the board would have more standard markings. Is there any way to figure it out with a meter or by the printing?
Comment: Did C1 look like C3?  If so, polarity doesn't matter.
Comment: Probably non-polar.  Otherwise it would be marked.
Answer: The pin on the left is connected to the large power plane, the next task is to figure out if it's positive or negative with respect to the other pin, since the HC125 is connected to it, it would be the ground plane, but if the board has multiple voltages, you may have dig a bit more. If the right pin is connected to pin 14 of the HC125 then it would be positive wrt the ground plane connection.
Comment: You're about 90% of the way to solving it with your plane comment.  We can clearly see that the left pin is connected to the top plane, and so is pin 7 of the IC, which is ground...  Edit it in that pin 7 is ground and I'd say you have the winning answer, as I was too busy typing to see the plane connection.
Comment: Pin 14 does indeed show continuity with the right pin of the cap. Interestingly, I found that some other boards of the machine (Marquee 9500 CRT projector) had the similar closed bracket marking as negative, which can be seen on the right pin. Thanks for the answers!
Comment: Pin 14 is the top right pin on the HC125 btw, directly across from dimple (pin 1) indicator.
Comment: At first I was, but I can't tell what the other pin is going to 99% sure it's going to be Vcc, but... A quick continuity between that pin and pin 14 would confirm it (check continuity both ways to make sure there's no diode in between).
Comment: If the board had a bipolar power supply, then yes, ground could be positive for that capacitor if the other side goes to a negative supply.  But it probably doesn't.  And that should be something easy to determine by looking at the totality of what is on the board and its supply connections.  If I had to guess the big cap is in parallel with the little one.
Answer: You cannot identify this from the board printing.
However you could look up the pin-out of the 74HC125AN and use a continuity testor on the powered-off board to figure out if either lead of the capacitor is connected to its ground or supply.  Or to a labeled ground connection elsewhere on the board.
Continuity testors must only be used on unpowered systems, and unpowered means not only having no supply connected, but also not having any high voltage capacitors which retain charge (especially in legacy TVs, camera flash units, etc).  That's probably not the case here but still needs to be said.  Also using a continuity testor is not 100% safe - in theory the injected current can damage sensitive circuits but that is also relatively unlikely here.
You may also be able to trace connections to known power/ground pins by eye.
Comment: I'll leave this here as a general solution but isdi's observation of the top surface plane makes this particular case quite easy to figure out by eye.


Why am I getting "Attribute cannot be read HRESULT : 0x80650002" in C#?

Question: I am getting exception Attribute cannot be read HRESULT : 0x80650002 from the following line:-
GattReadResult readResult = await tempMeasurementCharacterisitic[0].ReadValueAsync();
How to solve this problem. I am doing this for HealthThermometer. Characteristic UUID 0x2A1C
Comment: Any Explanation for negative vote?
Answer: Got that. The problem is that the characteristic I am trying to read is not allowed by this particular service to be read. If you see specification of bluetooth helath thermometer service, u can see that characteristic uuid 0x2A1C cannot be read. However you are allowed to use indicate method. So instead of reading use characteritic.valuechanged += value_change_event_handler;


Cowboy framework: Sending HTTP calls

Question: I want to send an HTTP request within Cowboy framework, and read the response's body. Is there any meta level functionality to do so or I should go down to Erlang to do it? From the document I only see 'handlers'. Any help is appreciated.
Comment: `Cowboy` is an HTTP server, for sending HTTP request you require some HTTP client such as `hackney` https://github.com/benoitc/hackney.
Answer: Cowboy is a web server, it is not a framework. It does not provide HTTP client functionality of sending requests and receiving responses. Its role is opposite, it supports receiving requests from clients and responding to them.
In order to send requests you need HTTP client. In Erlang you can choose among several. httpc is part of Erlang distribution. The team which developed Cowboy also created Gun, an asynchronous HTTP client. There exist several others.
Comment: Why cowboy cannot be classified as a web framework?
Comment: @Viacheslav Cowboy is direct equivalent of packages like Apache or nginx. They are normally described as web servers not web frameworks. Frameworks normally support functionalities like templating, session management, database access, etc. I think addressing Cowboy as web framework would be misleading, and Cowboy authors say "cowboy - Small, fast, modern HTTP server for Erlang/OTP".
Comment: I see. Got it. Looks like the tag `web-framework` in cowboy github page misled me. As I understand then cowboy can be classified as web server erlang library or application, because templating can be done by erlydtl and database access byt other similar librairies and applications like epgsql, eredis etc. Then when we collect cowboy/gun/epgsql/eredis then we can say that this is a web-framework - correct?
Comment: @Viacheslav Correct!
Answer: The cowboy is a Erlang server application but for sending HTTP request you can use libraries like gun, shot or you can use httpc directly out of the box of Erlang.

Cowboy framework: Sending HTTP calls