Erik the slayer disappeared

Question: I hired Erik the slayer, gave him new armor and weapons and went to a nummer of locations Before he disappeared and i could not find him. I waited for 5 days, did not help.
But then I found him in Rorikstead again, but witout the armor and things I gave him. I had to "rehire" him but then he sain that "it looks like you already got someone.." althoug I didnt. Someone know why? Even lydia says the same thing.
Comment: Are you playing on PC?  If so, have you used any console commands that would have created a duplicate copy of Erik the Slayer?  If not, have you started any other quests that would require you to pick up a new follower?  Erik might be holding your gear, but just not wearing it, as followers are prone to doing when they leave your service.
Comment: Anyway to fix without having to load?
Answer: I have had a lot of difficulty with Erik disappearing after quests make him go away. I've found asking to trade with him will make the items reappear (if you can manage to work around him not following you). I also know that some people have randomly encountered their dismissed followers in the wild. If you can remember where you were when you dismissed your last follower (not Erik), follow the route from there to that follower's home. You will encounter a metric ton of deer, saber cats, wolves, and random enemies, but there is a chance the follower you can't get rid of is wandering out there, lost and alone and taking up a precious spot on your team. Just a chance, mind, but this is the only solution I've come across in my MANY "quests to find where the hell Erik went to" that relates to your problem. IF your problem is that you already have a follower lost out there, there is also a possibility that you accidentally interrupted that follower's route home by walking to near them and triggering a dialogue. In this case (this has happened to me), that follower will be where you interrupted them, loyally waiting for your return.
Comment: Even unusually smart companions (Eric is a good example) often get stuck on a mountain somewhere. It's very likely you have a companion wandering the wild. They often also take very circuitous paths and can end up in the entirely wrong city. I recommend two options, and neither are pretty (sorry): One, continue to play the game. Take the long way to quests. Go hunting. Get a new companion. Hopefully, you'll meet your lost friend again somewhere completely random. Two: reset to oldest save that you're sure you had that person. This is what I had to do.
Answer: The original thing for this is a couple years old, but incase anyone still looks at it what I did was just take the road from rorikstead to whiterun and I found him along the way! (Right when a dragon attacked though, he almost died)

Erik the slayer disappeared


WPF 2-Way Databound DataGrid

Question: Can anyone point me to a very simple example(C#4.0) of a WPF Datagrid thats bound to a SQL table.  I'd really like the simplist example possible.  I want to be able to add, edit and delete rows.  Thanks.
Answer: Seems like an old thread, but hopefully this will still be useful.  If you can get your data into an ObservableCollection, then most of the hard stuff will be done for you.  From there you can just do something like this:
ObservableCollection<Items> ocItems = new ObservableCollection<Items>();
ocItems.Add(new Items());

dgGrid.ItemsSource = ocItems;

or, if you want to do it in XAML, you can do something like this:
<DataGrid Name="dgGrid" ItemsSource="{Binding ocItems, Mode=TwoWay}" AutoGenerateColumns="True" />

and then make sure you have an object called ocItems in your code.
By using an ObservableCollection, you get add and delete updates automatically for you so you don't have to tell the DataGrid to update.  By using twoway binding, you get any editing that has been done taken care of for you as well.  You can customize the look of the DataGrid with the DataGridColumns items, but I'll let you look that up yourself.
Answer: If you are looking for something so simplistic that all the add/edit/delete commands are generated/done for you, then I think you are out of luck, because as far as I know, you have to code all that your self. Unless you perhaps use ADO.NET and DataSets, because Visual Studio does have wizards that will generate update/insert/delete/select statements for datasets...
I myself use LINQ to SQL for all my SQL related stuff, including showing data in a DataGrid. It's fairly simple, although I did find the DataGrid (v1, included in .NET Framework 4) to be a half baked piece of cr*p riddled with bugs and quirks. But in general the steps required to edit some SQL table data would be:
1) Create a "LINQ to SQL Classes" file with your SQL schema;
2) Load data into your datagrid, eg. - this.DataGrid1.ItemsSource = new BindingList((from c in Customers select c).ToList());
3) For the bindings in the DataGrid's columns, set NotifyOnSourceUpdated to true and then handle the DataGrid's SourceUpdated event. In the event handler you can insert the updated item (obtainable via event handler arguments -> BindingOperations.GetBindingExpression(e.TargetObject, e.Property).DataItem) into a pre-determined HashSet (hashsets contain only unique values, so if multiple cells are updated in the same row, there will still only be unique items in your hashset).
4) In your save button click event handler you can iterate through the HashSet and push the modified data back to the SQL database, again via LINQ. If the primary key column is int you can check for new rows via item.Id == 0 (item is an enumerated object from the hashset) and then insert the item into the table. Otherwise if Id != 0, select an object from the database with the specified Id and update it's properties with the values of the enumerated item.

WPF 2-Way Databound DataGrid


Extract zip file to different location without Terminal

Question: Without third-party software, is there a way to extract a zip file to a different location without using Terminal?
I realize I could use unzip file.zip -d /path/to/destination, but I'd love to do it just by dragging and dropping with a keyboard modifier or something.  Is this possible?
Answer: Try throwing your terminal script into automators run shell script and saving as a service, then you just right click on the file and select the new service and it'll extract to your chosen destination.
there are a few other answers here
https://discussions.apple.com/message/17831395#17831395
I also found a very interesting tool today called Keka, which is fantastic for creating seperate zip files from one large folder. It has an option to save to a new folder, perhaps this could help.


Occurrences of (co)homology in other disciplines and/or nature

Question: I am curious if the setup for (co)homology theory appears outside the realm of pure mathematics.  The idea of a family of groups linked by a series of arrows such that the composition of consecutive arrows is zero seems like a fairly general notion, but I have not come across it in fields like biology, economics, etc.  Are there examples of non-trivial (co)homology appearing outside of pure mathematics?
I think Hatcher has a couple illustrations of homology in his textbook involving electric circuits.  This is the type of thing I'm looking for, but it still feels like topology since it is about closed loops.  Since the relation $d^2=0$ seems so simple to state, I would imagine this setup to be ubiquitous.  Is it?  And if not, why is it so special to topology and related fields?
Comment: Ghrist has written a number of papers applying homology to different applied fields. See for example his paper on Sensor Networks.
Comment: This question should be Community Wiki, since it's looking for a list of examples rather than an answer to a specific question.  I also feel like the question isn't very clear, since any answer has to be homological in nature so fundamentally mathematical.  So the question seems somewhat conflicted.
Comment: The first paragraph seems to suggest that the question is not so much about homology/topology in the large, but more about the idea of chain complexes. Is my reading correct?
Comment: Applied topology at Stanford: http://comptop.stanford.edu/
Comment: Do you count string theory as "outside the realm of pure mathematics"?
Comment: Why are "topology" and "outside the realm of pure mathematics" mutually exclusive?
Answer: Actually even schoolchildren calculate group co-cycle. (Without knowing that it is called like this).  Cohomology occurs in everyday life as soon as one learns to count.
5+7 = 1 2
4 + 5 = 0 9
2 + 8 = 1 0
What is the function on which sends a pair (a,b) to the $0$ or $1$ depending result is greater than 9 or not ?
( e.g. f(5,7)= 1,  f(4,5) = 0, f(2,8)= 1).
This is actually a 2-cocycle for group $Z/nZ$ with values in $Z$.
It can be checked directly or...
Let us look on it more conceptually. Consider the standard short exact sequence of abelian groups $0 \to Z \to Z \to Z/nZ \to 0$. (First map is multiplication by $n$, the second is factorization and will be denoted by $p$).
Choose section $s: Z/nZ \to Z$ (i.e. any map such $ps=Id$, where $p: Z \to Z/nZ$, it is like connection in differential geometry (can be made precise)).
Define $f(a,b)=s(a)+s(b) - s(a+b)$
Note that:  a) this function $f(a,b)$ is exactly as we talked above
b) from general theory this is a 2-cocyle, (it corresponds to this extension, (it is like "curvature" of connection in differential geometry (can be made precise))).
That is all: we explained why it is group cocycle and what is its role.

I would like to learn this 20 years ago when I learned group cohomology as an undergraduate, but I learned this 1 year ago, doing some engineering work in wireless communication...
I am still surprised that it is not written on the first page of any textbook which deals
with group cohomology. When I am explaining  this to my friends most of them did not know this also, and after knowing, they share my feeling of surprise.
Comment: While not on the first page of a textbook, this is written up in an article in the American Mathematical Monthly (Daniel C. Isaksen, A cohomological viewpoint on elementary school arithmetic, Amer. Math. Monthly (109), no. 9 (2002), p. 796--805)
Comment: @36min In http://arxiv.org/abs/hep-th/0212195 we have discussed such a  look on connections (actually for more general setup of Courant algebroids), it might be possible to get idea from there, but may be it is not good starting point. I am sorry I do not know reference for standard exposition of this approach in the case of usual connections.
Comment: @36min Let me give an idea consider module V over M. Consider the following exact triple: End(V) ->A(V) -> Der(M), where A(M) - the set of all "derivations" of module V. The idea is that connection is exactly the same is a section s: A(V) <- Der(M) !!! The curvature is the following - take two elements a,b in Der(M) , consider F(a,b) = [s(a),s(b)] -s([a,b]) observe that F(a,b) lies actually in End(V) \subset A(V) so we get map F(a,b) : Der(M)^2 -> End(V) - this is curvature
Comment: Thank you for reference. I di not know it.
Comment: is it easy to generalize to larger digits? how about for multiplication?
Comment: @36min , what is Der(M) - set of all derivations of algebra of functions on M, i.e. all vector fields. What is A(V) - set of all derivations of module V. Map d: V-> V is called derivation of module V, if there exists derivation dd \in Der(M) such that for any element "a" of algebra M , it is true that d(a v) = dd(a) v + a dd(v) !!!!!!!! It is simple, may be I am explaining not in a right way. Is it clear ?
Comment: @unknown good questions sorry to say I cannot say much. About higher digets we can think about N=10^2 10^3 and so on.... arguments will be the same.
Comment: Can you explain the things you claim "can be made precise"? I'm really curious.
Comment: "Consider the following exact triple: End(V) ->A(V) -> Der(M)" I don't get this part, what do you mean?
Comment: Let M be an algebra. V - module over it. Der(M) - Lie algebra of all derivations of M.  End(V) - set of all endomorphism of module V, i.e. maps V-> V such that they commute with action of M. Is this part Okay ?
Comment: Now the key part - define A(V). A(V) is the set of all "derivations" of module V, where derivation is defined like this: Map d: V-> V is called derivation of module V, if there exists derivation dd \in Der(M) such that for any element "a" of algebra M , it is true that d(a v) = dd(a) v + a dd(v) !!! This is key definition. It sometimes called Atiyah alegrebroid, but do not be afraid of big name - it simple. Is it Okay ?
Comment: Now End(V) naturally embeds in A(V), (corresponding dd = zero). And by definition there is projection A(V)->Der(M): d->dd.  So we get exact triple End(V)-> A(V) ->Der(M). Is this part Okay ?
Comment: I see, I was confused about the definition of A(V).
Comment: Sorry for being late: a precise description to connections and curvatures is described in David's nice answer: the Atiyah class is the obstructure to the existence of a connection, and the curvature is the obstruction of it being a Lie-algebra map: https://mathoverflow.net/a/51369/
Comment: This idea was also described in a [series of sci.math posts by James Dolan](https://web.archive.org/web/20230221031611/http://timothychow.net/mathstuff/jdolan.pdf) back in January 1994.
Answer: Robert Ghrist is all about applied topology:  Sensor Network, Signal Processing, and Fluid Dynamics.  (homepage:  http://www.math.upenn.edu/~ghrist/index.html ).  For instance, we want to use the least number of sensors to cover a certain area, such that when we remove one sensor, a part of that area is undetectable.  We can form a complex of these sensors and hence its nerve, and use homology to determine whether there are any gaps in the sensor-collection.  I've met with him in person and he expressed confidence that this is going to be a big thing of the future.
There are also applications of cohomology to Crystallography (see Howard Hiller) and Quasicrystals in physics (see Benji Fisher and David Rabson).  In particular, it uses cohomology in connection with Fourier space to reformulate the language of quasicrystals/physics in terms of cohomology... Extinctions in x-ray diffraction patterns and degeneracy of electronic levels are interpreted as physical manifestations of nonzero homology classes.
Another application is on fermion lattices (http://arxiv.org/abs/0804.0174v2), using homology combinatorially.  We want to see how fermions can align themselves in a lattice, noting that by the Pauli Exclusion principle we cannot put a bunch of fermions next to each other.  Homology is defined on the patterns of fermion-distributions.
Comment: In general, I think that homology will play a role in the mathematics of information.  We had a talk by Gunnar Carlsson recently in Edinburgh about "persistent homology" and it was quite an eye opener.
See http://comptop.stanford.edu/ for instance.
Comment: Robert Ghrist is coming to Edinburgh for the Science Festival this year to talk about the Mathematics of holes.  (Alas I will be away.)   If anyone is around, it will be worth your while to attend!
Answer: Recently, it was realized that quantum many-body states can be divided into short-range entangled states and long-range entangled states.
The quantum phases with long-range entanglements correspond to topologically ordered phases, which, in two spatial dimensions, can be described by  tensor category theory (see cond-mat/0404617). Topological order
in higher dimensions may need higher category to describe them.
One can also show that the quantum phases with short-range entanglements
and symmetry $G$  in any dimensions can be "classified" by Borel group cohomology theory of the symmetry group.
(Those phases are called symmetry protected trivial (SPT) phases.)
The   quantum phases with short-range entanglements that break the symmetry
are the familar Landau symmetry breaking states, which can be described by group theory.
So, to understand the symmetry breaking states, physicists have been
forced to learn group theory.
It looks like to understand patterns of many-body entanglements
that correspond to topological order and SPT order, physicists will be forced to
learn tensor category theory and group cohomology theory.
In modern quantum many-body physics and in modern condensed matter physics, tensor category theory and group cohomology theory will be as useful as group theory. The days when physics students need to learn tensor category theory and group cohomology theory are coming, may be soon.
Answer: My understanding, from conversations with Raoul Bott, is that his early work on electrical circuits and the Bott-Duffin theorem can be intepreted as exhibiting close connections between de Rham cohomology and the laws of electrical circuits, and that this is part of what led him into pure mathematics early in his career.
Comment: He talked about this connection to electrical circuits in teaching graduate algebraic topology, to help motivate cohomology and give intuition for it.
Comment: See the paper Geometry and Topology: Seven Lectures by Raoul Bott edited by J. M. Rojas.
Comment: Bott gave a very nice talk (c. 1960) to electrical engineers on the subject, but I cannot find a reference right now.
Answer: Quantum field theory is outside the realm of pure mathematics, makes contact with the real world and features chain complexes and cohomology.
The current paradigm for gauge theories such as the standard model is based on Yang-Mills theories coupled to matter.  The quantisation of nonabelian (and, depending on your choice of gauge fixing function, also abelian) Yang-Mills theories features a cohomology theory known by the moniker of BRST, after the inventors: Becchi, Rouet, Stora and, independently, Tyutin.  The cleanest proofs of the renormalizability of Yang-Mills theories are cohomological in nature.
Answer: The mass of a classical mechanical system is an element in the (one-dimensional) second cohomology group of the Lie algebra of the Galilei group. See J. M. Souriau, Stucture des Systèmes Dynamiques, Chap. III, section (12.136). Or in english translation, search inside here for "total mass".
Comment: A layman question. You say *second* cohomology group, however Souriau does not tell a number for it. Similarly to you, Guillemin and Sternberg tells "second" ($H^2$)(Symplectic Techniques in Physics, p. 417), but Liberman and Marle tells *first* ($H^1$) (Symplectic Geometry and Analytical Mechanics, p.204). Could you resolve  this apparent contradiction in a couple of words?
Comment: As @mma points out, the note on p. 107 explicitly mentions that Souriau's "cohomology" is always "cohomology in degree 1".  (I can't manage to trace through his definitions to tell in what sense $m$ is a cocycle at all, regardless of degree.)
Answer: The Aharonov–Bohm effect. Classically, you can't distinguish two electromagnetic potentials which are in the same cohomology class. From quantum viewpoint, they can be distinguished, because an electron changes its phase under parallel transport defined by the connection associated to a potential.
Answer:
Something resembling de Rham complex with differential-algebraic flavor appears in (variant of) control theory, see, for example, G. Conte, C.H. Moog, A.M. Perdon, Algebraic Methods for Nonlinear Control Systems, 2nd ed., Springer, 2006. But, as far as I can tell, they do not use the word "cohomology" explicitly.
Spencer cohomology (which is, essentially, a Lie algebra cohomology) appears as obstructions to integrability of some differential-geometric structures (G-structures) and, through it, of (some) differential equations. Potentially this opens a wide possibilities for applications, and indeed, Dimitry Leites advocates this approach in (some of) his writings. An emblematic publication which is available, unfortunately, only in Russian, is: "Application of cohomology of Lie algebras in national economy", Seminar "Globus", Independent Univ. of Moscow, Vol. 2, 2005, 82-102. The Russian original for "national economy" in the title is (a somewhat pejorative and untranslatable term) "narodnoe khozyai'stvo".

Edit: J.-F. Pommaret has published extensively on the applications of Spencer cohomology to continuum mechanics, control theory and mathematical physics - for example, see "Spencer Operator and Applications: From Continuum Mechanics to Mathematical Physics"
Comment: I love that there be a pejorative form of "national economy" ;-)
Answer: The finite element method- a numerical method for solving PDE's- has a homological interpretation:
MR2269741 (2007j:58002)
Arnold, Douglas N.(1-MN-MA); Falk, Richard S.(1-RTG); Winther, Ragnar(N-OSLO-CMA)
Finite element exterior calculus, homological techniques, and applications. (English summary)
Acta Numer. 15 (2006), 1–155
Answer: A classical and elegant application is to the solution of Kirchhoff's theorem on electrical cricuits. See:
Nerode, A.; Shank, H.: An algebraic proof of Kirchhoff's network theorem.
Amer. Math. Monthly, 68 (1961) 244–247
Comment: @TomCopeland The source you gave works with both chain and cochain complexes at the same time. It seems to me that it's merely reproducing the Bott-Duffin approach. The advantage of the Nerode-Shank argument is that it easily generalizes to higher dimensions. See:
Catanzaro, Michael J.(1-WYNS); Chernyak, Vladimir Y.(1-WYNS-KM); Klein, John R.(1-WYNS)
Kirchhoff's theorems in higher dimensions and Reidemeister torsion.
Homology Homotopy Appl. 17 (2015), no. 1, 165–189.
Comment: This is discussed in more detail in Quantum Field Theory III: Gauge Theory by Eberhard Zeidler (Springer, 4/2011), pg. 1009, 1020, 1027.
Answer: Anders Björner and László Lovász used bounds on the Betti numbers for the complement of a real subspace arrangement called the $k$-equal arrangement to give a complexity theory lower bound that agreed, up to a scalar multiple, with the previously known upper bound in:
A. Björner and L. Lovász, Linear decision trees, subspace arrangements, and Mobius functions, Journal of the American Mathematical Society, Vol. 7, No. 3 (1994), 677--706.
The basic question addressed in their paper (along with other questions of a similar flavor) is how many pairwise comparisons of coordinates are needed to decide if a vector in ${\bf R}^n$ has $k$ coordinates all equal to each other for fixed $k$ and $n$.  They observed that this is equivalent to deciding whether the vector lies on the so-called $k$-equal arrangement or in its complement, where the $k$-equal arrangement is the subspace arrangement comprised of the ${n\choose k}$ subspaces where $k$ coordinates are set equal to each other.
To this end, they gave a lower bound on the number of leaves in a linear decision tree -- a tree where one starts at the root, and each time one does a comparison of two coordinates $a_i$ and $a_j$, then one proceeds down to either the $a_i < a_j$ child or the $a_i = a_j$ child or the $a_i > a_j$ child.  One reaches a leaf when no further queries are necessary to make a decision as to containment in the arrangement or its complement.  The log base 3 of the number of leaves is a lower bound on the depth of the tree, i.e. on the number of queries needed in the worst case.
To get some intuition for why this bound depended fundamentally on the Betti numbers of the complement, consider the $k=2$ case -- where the number of connected components of the complement of the subspace arrangement (which in this case is a hyperplane arrangement) is an obvious lower bound on the number of leaves in any linear decision tree.
Answer: It's my understanding that Carina Curto and Vladmir Itskov at the University of Nebraska - Lincoln apply algebraic topology (among other things) to study theoretical and applied neuroscience.
Comment: Their work is very similar in spirit to Ghrist's work alluded to in one of the other answers.
Answer: To add a touch of very belated whimsy, cohomology has manifestations in art. Here are two:

A Penrose triangle (an "impossible figure") can be viewed as a Čech $1$-cycle associated to an open covering of the image plane, taking values in the sheaf of positive functions under pointwise multiplication.
In more detail, place your eye at the origin of Cartesian space, let $P$ be a region in some plane (the screen) not through the origin, and let $C \simeq P \times (0, \infty)$ (for cone) be the union of open rays from your eye to a point of $P$.
A spatial scene in $C$ is rendered in the plane region $P$ by radial projection, discarding depth (distance) information. Recovering a spatial scene from its rendering on paper amounts to assigning a depth to each point of $P$, i.e., to choosing a section of the projection $C \to P$.
Roger Penrose's three-page article On the Cohomology of Impossible Figures describes in detail (copiously illustrated with Penrose's inimitable drawings) how a two-dimensional picture can be "locally consistent" (each sufficiently small piece is the projection of a visually-plausible spatial object) yet "globally inconsistent" (the entire picture has no visually-plausible interpretation as a projection of a spatial object).
For example, each corner of a Penrose triangle has a standard interpretation as a plane projection of an L-shaped object with square cross-section, but the resulting local depth data cannot be merged consistently in a way conforming to visual expectations.
Of course, the depth data can be merged consistently (from a carefully-selected origin!) by circumventing visual expectations. There are at least two "natural" approaches: use curved sides, or break one vertex.
M. C. Escher's Print Gallery is a planar, "self-including" rendition of the complex exponential map, viewed as an infinite cyclic covering of the punctured plane. (Contrary to mathematical convention, traveling clockwise around the center in Escher's print "goes up one level".) I know of no better reference that Hendrik Lenstra's and Bart de Smit's 2003 analysis of the Droste effect.
Answer:
http://sigact.org/Prizes/Godel/2004.html
http://www.cs.brown.edu/~mph/HerlihyS99/p858-herlihy.pdf

Maurice Herlihy and Nir Shavit won the 2004 Gödel Prize for topological analysis of asynchronous computation.  Homology was involved.
Answer: Cohomology has appeared in game theoretic research on equilibrium refinements.  Loosely speaking, John Nash's 1951 original notion of an equilibrium point does too little to limit the set of 'reasonable' outcomes. A variety of so-called 'equilibrium refinements' sprang up in the economic literature intended to address this.  A common theme in many of them was robustness to perturbation (if one perturbs the underlying game played, one would wish that 'nearby fixed point problems have nearby solutions').
In 1989 JF Mertens formulated a notion of a stable equilibrium over two papers that relies on the cohomological essentiality of a projection map from the graph of the equilibrium correspondence to the space of games (the two papers may be found here and here) to arrive at a solution concept with a number of normatively reasonable properties.
Answer: The group cohomology can be useful to describe the many-body quantum Condensed Matter systems with emergent underlying intrinsic Topological Orders. These classes of systems at low energy and long distance behave like certain TQFT theories. In particular, one can write explicit exact solvable Lattice quantum Hamiltonian operator $\hat{H}$ on the space discretized lattice, and its ground states give rise to discrete gauge theory TQFT with finite group $G$ (quantum double models in 2+1d or its 3+1d, etc analogous, $D(G)$, with Drinfield and Hopf algebra), twisted discrete gauge theories (twisted quantum double models $D^\omega(G)$).
See:

Twisted Quantum Double Model of Topological Phases in Two-Dimension arxiv:1211.3695 PhysRevB.87.125114
Twisted Gauge Theory Model of Topological Phases in Three Dimensions arxiv:1409.3216
 PhysRevB.92.045101
Non-Abelian String and Particle Braiding in Topological Order: Modular SL(3,Z) Representation and 3+1D Twisted Gauge Theory arxiv:1404.7854 PhysRevB.91.035134

The low energy and long distance physics of the theories are the same as the Dijkgraaf-Witten topological gauge theories, Kitaev toric code and quantum double models, and some of Levin-Wen string-net models, and many of twisted discrete gauge theory.
This is how the quantum Hamiltonian operator (acting on the Hilbert space of quantum states) looks like:
$$
  \hat{H}=-\sum_v A_v-\sum_f B_f,
$$
where $B_f$ is the face operator defined at each triangular face $f$, and $A_v$ is the vertex operator defined on each vertex $v$. As in the TQD model in $(2+1)$-d, each operator $A_v$ behaves as a gauge transformation on the group elements respectively on the edges meeting at $v$, and a $B_f$ detects whether the flux through face $f$ is zero. This kind of Hamiltonians generically feature ground states that are gauge invariant and bear zero flux everywhere.
A normalized
$$\omega_d\in H^d(G,U(1)),$$
as a function
$\omega:G^4\rightarrow U(1)$, satisfies the $d$-cocycle
condition. The cocycle $\omega$ will fill into the spacetime lattice $d$-simplex ($d+1$-cell). Let us take $D=4$-dim spacetime as an example below.
The operator $A_v$ is a summation
$$ A_v=\frac{1}{|G|}\sum_{[vv']=g\in G}A_v^g.
$$
The value $|G|$ is the order of the group $G$. The operator $A_v^g$ acts on
a vertex $v$ with a group element $g\in G$ by replacing $v$ by a new enumeration $v'$ that is ``slightly" less than $v$ but greater than all the enumerations that are less than $v$ in the original set of enumerations before the action of the operator, such that $v'v=g$. In a dynamical picture of Hamiltonian evolution, $v'$ is understood as on the next \textquotedblleft time" slice, and there is an edge $v'v\in G$ in the $(3+1)$ dimensional \textquotedblleft spacetime" picture. That is, the new vertex $v'$ and the original vertices before the action of $A_v$ delineate a $4$-dimensional picture. Let us consider as follows the simplest subgraph---namely a single tetrahedron---of some large $\Gamma$ to illustrate how an $A_v$ acts:

where $v'_4v_4=g$.
The action of $B_f$ on a basis vector is

The discrete
delta function $\delta_{v_1v_2\cdot v_2v_3\cdot v_3v_1}$ is unity if ${v_1v_2\cdot v_2v_3\cdot v_3v_1=1 }$, where $1$ is the identity element in $G$, and 0 otherwise. Note again that here, the ordering of $v_1,v_2$, and $v_3$ does not matter because of the identities
$\delta_{v_1v_2\cdot v_2v_3\cdot v_3v_1}
=\delta_{v_3v_1\cdot v_1v_2\cdot v_2v_3}$ and
$\delta_{v_1v_2\cdot v_2v_3\cdot v_3v_1}
=\delta_{\overline{v_1v_2\cdot v_2v_3\cdot v_3v_1}}
=\delta_{\overline{v_3v_1}\cdot \overline{v_2v_3}\cdot \overline{v_1v_2}}
=\delta_{v_1v_3\cdot v_3v_2\cdot v_2v_1}$.
In other words,
in any state on which $B_f=1$ on a triangular face $f$, the three group degrees of freedom
around $v$ is related by a chain
rule:
$$
v_1v_3=v_1v_2\cdot v_2v_3
$$
for any enumeration
$v_1,v_2,v_3$ of the three vertices of the face $f$.
Here are how the space lattice and the triangulation of spacetime lattices  looks like:

Here are how the $SL(N,\mathbb{Z})$'s modular $S$ and $T$-transformations look like:
Answer:
There's a CST.SE thread of possible interest here: https://cstheory.stackexchange.com/questions/7958/papers-on-relation-between-computational-complexity-and-algebraic-geometry-topol

It mentions stuff like Geometric Complexity Theory, a far-out program for proving P!=NP with algebraic geometry.

Similarly here: https://cstheory.stackexchange.com/questions/2898/applications-of-topology-to-computer-science

Mentions the thing I actually first websearched for, Herlihy's work on concurrent and distributed computing using cohomology.
Answer: I am surprised no-one has mentioned Persistent Homology.
Comment: See also José Figueroa-O'Farrill's comment on the accepted answer, in which he mentions a talk by Gunnar Carlsson about persistent homology.
Comment: http://en.wikipedia.org/wiki/Topological_data_analysis#Persistent_homology
Answer: There is also an argument by Roman Jackiw that 3-cocycles appear in the quantum mechanics of a charged particle in the field of a magnetic monopole. There it happens that you can generate spatial translations either with the canonical momentum, which is gauge dependent because it involves the vector potential, or with the velocity, which is gauge invariant, because both have the same commutation relations with position. If you want to generate translations in a gauge invariant way, then translations turn out to be non-associative, i.e., you can compose 3 translation operators in different orders and get different results, all differing by a 3-cocycle in a particular cohomology. Restoring associativity leads to Dirac's quantization condition. This condition can also be obtained by different cohomological arguments, as Orlando Alvarez does, considering certain ambiguities that appear when you integrate a connection 1-form along paths covered by two or three patches. It happens that it is not trivial how to do this, you cannot just integrate along one patch up to a point in the intersection and keep integrating along the other patch. You have to do extra tricks that lead to ambiguities, which can be resolved if you impose some condition which is equivalent to Dirac's quantization condition when the connection is the vector potential of a monopole. The condition that you have to impose can be recast in terms of Cech cohomology. The papers: http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.54.159, http://link.springer.com/article/10.1007%2FBF01212452
Answer: In (real world, for $n=3$) crystallography, given a point group $K\subseteq\mathrm{O}(n)$ and a ($K$-invariant) lattice $T\subseteq\mathbb{R}^n$,
the set of possible crystallographic classes (where, in the real world, a "crystallographic class" is unederstood as "the class of all crystals that have isomorphic isometry group"; and in general it just means a space group or crystallographic group, i.e. a discrete subgroup $G\subseteq\mathrm{Euc}(n)$ that contains $n$ linearly independent translations, up to conjugation by elements in the affine group $\mathrm{Aff(n,\mathbb{R})}$ or -which is the same by a theorem of Bieberbach- up to just abstract isomorphism)
that lie in the arithmetic crystal class determined by $(K,T)$, that is:

have $K$ as point group (up to conjugation by $\mathrm{GL}(n,\mathbb{Z})$, where $K\subseteq\mathrm{GL}(n,\mathbb{Z})$ via a lattice basis)
and have $T$ as translation lattice,

is in bijection with the quotient set
$$\frac{\mathrm{H}^1(K,\mathbb{R}^n/T)}{\mathcal{N}_{\mathrm{GL}(n,\mathbb{Z})}(K)}$$
where $\mathcal{N}_{\mathrm{GL}(n,\mathbb{Z})}(K)$ is the integral normalizer of $K$, acting on group cohomology $\mathrm{H}^1(K,\mathbb{R}^n/T)\simeq\mathrm{H}^2(K,T)$ (induced via the defining action of $K$ on $T$).
According to the crystallographer's terminology, crystals that correspond to the zero element in cohomology are said to be symmorphic.
Answer: Jim Stasheff has surveyed the history of cohomology in physics in the 20th century: see the pdf linked at https://ncatlab.org/nlab/show/A+Survey+of+Cohomological+Physics
Answer: In the theory of error correcting codes, linear codes are most prominent. These can be seen as the kernel of a "parity-check" matrix, most commonly working over the two element field, $F_2.$
For example, a simple three bit repetition code corresponds to the kernel of the linear operator
$$ \partial =
\begin{pmatrix}
1 & 1 & 0 \\
0 & 1 & 1 \\
1 & 0 & 1 \\
\end{pmatrix}.
$$
The kernel is one dimensional and so encodes one bit as either $(0,0,0)$ or $(1, 1, 1).$
If there is an error in the message $v\in F_2^3,$ perhaps a single bit was flipped, then we can hope to diagnose and recover the original message by computing $\partial v.$
So this is a way of viewing linear codes as "homologies". In this case we are using the homology of a circle.
This would perhaps not be a very convincing application of homology theory except that it fits into a more general picture once we consider quantum codes. The prime example here is based on the homology of the torus, and is known as the "toric code".
As with the repetition code above, we are working with a given cellular decomposition of the torus.
This time we have a length two chain complex, still over the field $F_2$:
$$
V_2 \xrightarrow{\partial_2} V_1 \xrightarrow{\partial_1} V_0.
$$
In this case the first homology group $ker(\partial_1)/im(\partial_2)$ is two dimensional and so encodes two quantum bits (qubits.)
Error processes act on $V_1$ (by flipping bits) and are diagnosed by $\partial_1.$ The error correction procedure is now a matter of finding the most likely homology class corresponding to the error. The topology of the situation is quite prominent: errors act locally on the torus cellulation, but can only effect the encoded information by percolating around the torus.
The dual chain complex, which we get by taking the transpose of the operators $\partial_2, \partial_1$ is also important, and a similar error correction procedure takes place on this dual complex.
Amazingly, various research groups around the world are presently engaged in actually building such things, as they hold great promise for robust storage of quantum information, which will be needed for any serious attempt at building a quantum computer.
(I should note that I have left out an explanation of how to go from the complex Hilbert spaces where qubits actually live to $F_2$ linear algebra. This is covered in the literature on quantum stabilizer codes.)
Answer: An application of cohomology to provide a geometric/topological description charged particles in General Relativity can be found in
GRAVITATION: An Introduction to Current Research, ed. Louis Witten
and references therein.
Wheeler's geometrodynamics program contained a subprogram named "charge without charge", which aimed to express the electric charge in terms of geometric and/or topological properties. A wormhole allows the existence of an electromagnetic field without source, which looks like having sources - hence the name "charge without charge". The two ends of the wormholes behave as particles of opposite electric charge. And all this can be obtained as a solution to Einstein-Maxwell equations. Roots of the approach of Misner and Wheeler can be found in the paper of Einstein and Rosen, and a series of papers of G. Y. Rainich from 1924-1925.
Answer: There are some applications of topology/cohomology to combinatorics and combinatoric geometry. One of the earliest examples is surely Lovasz's proof of a bound for the chromatic number of the Kneser graph; he uses the Borsuk-Ulam theorem, which is usually proved by homological methods. A modern exposition can be found here.
Another example is Tveberg's theorem with all its variants on the configuration of points in space (the best results can be found in a recent paper of Blagojevic, Matschke and Ziegler. There are many other results in convex geometry/polytope theory which use topological methods and, in particular, cohomology.
Comment: While this isn't so clear from the title of the question, the first sentence in the text of the question mentions wanting things outside of pure mathematics.


How long was Jesus in the tomb?

Question: How can we reconcile that the Bible indicates that Jesus would be in the earth for three days and three nights (Matt. 12:40) but we also read that he died right before the start of the Passover and arose on the morning of the day after the Sabbath?
Answer: The problem in how we see it:

First, we know what we would mean by the phrase in Matthew 12:40: we would mean a seventy-two-hour period or at least most of that period. Second, we know that Jesus was not in the tomb more than thirty-six to thirty-eight hours, since he was buried at evening (which began at about 6 p.m.) on Friday and rose by morning (about 6 a.m.) on Sunday. Third, we know that the phrase "three days and three nights" was not a problem for Matthew, for he can use both that and "on the third day" and include no explanation, which he does in other cases where he senses a problem.
--
Kaiser, W. C., Jr., Davids, P. H., Bruce, F. F., & Brauch, M. T. (1996). Hard sayings of the Bible (pp. 380–381). InterVarsity.

To 1st century Jews any part of a day counted as a day:

First, we may be assuming that first-century Jews thought about time in the same way that we do. In fact they did not. Any part of a day could be counted as if it were a full day, - Ibid.

Jesus was referring to Jonah:

Second, we may be assuming that Jesus was simply making a statement, when, given the unusual nature of this phrase, he was actually quoting Jonah.   - Ibid.

Language differs in different cultures and especially different periods of time. Note that Matthew did not see a problem with the three days.

The main clue for us is that Matthew does not indicate that he feels a problem, so either he did not see the two phrases as meaning anything different or else he realized that what Jesus intended was simply a citation of Jonah. - Ibid.

For a more detailed discussion see How is it that Jesus could be "three days and three nights in the heart of the earth"?
Comment: The language of "three _days_ and three _nights_ is too precise to allow for any part of a day or night getting rounded up into the day count.  No matter how one reckons, the "three nights" is especially problematic for that interpretation.
Comment: Good answer. +1.
Answer: Jesus often intended his words to have a symbolic or spiritual value, as opposed to a strictly literal or physical meaning.  In this particular statement, the phrase in focus is "heart of the earth."

For as Jonas was three days and three nights in the whale's belly; so
shall the Son of man be three days and three nights in the heart of
the earth. (Matthew 12:40, KJV)

In addition to the word "sign"--which is an obvious clue, the word "heart" (Gr. καρδίᾳ/kardia) should help us see that this is a special expression.  Our planet does not have a physical "heart," nor does a human have a means of reaching its literal core.  So the context of this expression indicates we should look deeper than the surface meaning.
The word "earth" (Gr. γῆς/gēs), in this case, is symbolic of a similar thing to what many Christians today would use "world" to mean, e.g. "worldly."  The distinction is that "earth" is used more to represent governments.
When Jesus was handed over to the Roman authorities, he was surrendered into the power of the Roman government, the highest power in the "known" world at that time.  This began his time "in the heart of the earth."
Jesus was betrayed into the power of Rome on Thursday night, and did not emerge from the tomb, which had been sealed by the Romans, until Sunday morning.  By Biblical reckoning, this would comprise the evening and morning of the preparation day (sixth day), the evening and morning of the Sabbath day (seventh day), and the evening and morning of the first day--thus totalling three nights and three days.
Note that Jesus' statement makes no mention of "tomb": however, to answer that question, the Bible is clear that he would have been in the tomb beginning just before sunset on Friday, and ending near sunrise on Sunday, a total of about a day and a half.
The "sign" Jesus gave related to Jonah's time in the belly of the "whale."  This word, in Greek, is κήτους/kētous, and can mean "sea monster" in addition to "great fish."  The word "whale" only occurs 4 times in the KJV translation--this being the only one in the New Testament; the other three times are from a Hebrew word which would more properly be translated as "dragon" or perhaps "sea serpent."
Beasts, which would include whales and serpents, represent nations and kingdoms in prophecy (see Daniel 7:17,23).  So Jonah's time in the whale's belly may be symbolic of time spent within the power or authority of a kingdom.
Conclusion
While Jesus' prophecy makes no mention of the grave or the tomb, it uses symbolic language to address the time in which he would come under the power of Rome--at that time the highest power on "earth."  His statement is not directly addressing his time in the grave, which would have been only about half of the three days and three nights specified.
Comment: This was the only sign given by Jesus 'prophecy' nothing to say it was symbolic, that's just an attempt to provide an explanation / justify it.  Clearly, there are difficulties.  Jesus was placed in a Tomb and not a grave, 3 days & nights issue & Jonah didn't die.  see link -   https://hermeneutics.stackexchange.com/a/83399/33268

How long was Jesus in the tomb?


Problem stacking ADS1292r ECG shield and Wifi shield on Arduino Uno

Question: I want to use ADS1292r ECG shield with Arduino Uno (Seeeduino V4.2) and store the data in an SD card through an Wifi shield. But the ADS1292r shield uses Digital pin 4 for "RESET" purposes, while the same pin is the "SD card select" pin for the WiFi shield. So if I stack all 3 of them, the SD card can't be initialized. Is there any way to solve this problem?
Comment: At the very least for questions like this provide hot-links for the part's circuit diagrams. Most engineers who answer questions here would just design what is needed and so mentioning shields is probably not helpful without links.
Comment: https://store.arduino.cc/usa/arduino-wifi-shield
Comment: I am using below 3 parts: https://store.arduino.cc/usa/arduino-wifi-shield, http://wiki.seeedstudio.com/Seeeduino_v4.2/ https://github.com/Protocentral/ADS1292rShield_Breakout
Answer: As a generic answer to these sorts of problems (same pin needed by different libraries), I have had success with slightly bending the pin of the top shield to the side to that it doesn't make direct contact with the board underneath (ie doesn't plug into the header socket).
Assuming the shields are all stackable, you can run a jumper wire from the top of the pin to any other pin which is permitted by the configuration. If not, you may have to solder a wire.
In your example, put the WiFi shield on top with its D4 pin bent to the side (with ECG shield between Uno and WiFi shield) , and run a jumper between the tops of D3 and D4 (ie on the WiFi Shield). Thus the SD Card select would now be set to D3 instead of D4, and no other connection is made to D4 on the WiFi shield.
I can't verify that you won't have trouble with other pins (eg it looks like both shields use D7).


Change generated model name without deleting model django

Question: In django, by default, if you have a structure like this
app
├── migrations
└── models
      └ example

The generated name of your model will be app_example when executing the command makemigrations.
My problem is that I want to move my model from the directory app to the directory other_app which has the same structure.
other_app
├── migrations
└── models
    -> example will go here

At the same time, I want the generated name of my model to be other_app_example once I migrate without having to delete my table, as to avoid losing the data in it. The thing is, when you create a migration in django after changing a model of place, django delete the model in the migration directory of app and recreate it in another migration in other_app.
I know that I have to create a custom migration, but how can I achieve what I want to do ? All I found was RenameModel, but it doesn't change the name generated by django.
Answer: I found a solution, it may not be the best one but it works !
Simply create an empty migration in other_app with the command python manage.py makemigrations --empty other_app.
In it, I added a runSql query where I renamed the table from app_example to other_app_example, like this :
    migrations.RunSQL(
        "ALTER TABLE app_example RENAME TO other_app_example;"
    ),

Before migrating, I just moved my example model to the model directory of other_app, then proceeded to do a python manage.py migrate and it worked fine !
The only downside to this method is that I did not manage to use other methods than raw sql with RunSQL, like RenameField or AlterField did not work for me. I then had to add every changes I wanted to do in raw sql.
Then, to fake the migrations generated by django that delete and create my model, as I couldn't use migrate --fake, I decided to set the managed parameter of my model to be set to false.


"They are..." vs. "these are" when answering the question "What are these...?"

Question: When asked, "What are these called in English?" or similar, should we use just the right pronoun or can we also answer with the right demonstrative pronoun? For example, which is grammatical or preferred: "They are chopsticks" or "These are chopsticks"?
Comment: A good question (in the sense of a question that is good, hence +1, rather than the idiomatic [ie {slightly} opaque] sense). Though 'What are these ...' is highly idiomatic [ie very commonly used], the response 'These are ...' is far less common than 'They're ...', perhaps because the questioner has identified 'their' location as being near (this) rather than further away from (that) him. 'These are ...' would probably only be used for disambiguation if there were other objects around, or in a slightly ponderous tone.
Comment: @Edwion Ashworth Or perhaps if the responder were very close to the items, or even holding them, also to achieve emphasis as to the importance. e.g. If you hand me three White Fivers and while doing so say 'What are these?', I am likely to reply 'these are "White Fivers".'   * @ £5 note from the 1950s.
Answer: Although "These are ..." would be preferred to match the question, I would use "They are ..." since the item(s) in question (in most of the cases) will not be close enough for me to refer them with "these".
Answer: Both are possible, and grammatical, in Standard English. I might prefer going with "these are..." just to match the question. However, it is safe to say that when presented with a question like this, most people would typically produce the simple one-word answer "Chopsticks". In some dialects, or when aiming for an effect, I could go with "Them's chopsticks", but you should not use that in Standard English (unless aiming for said effect).
Answer: These, in common usage, seems to refer to something close at hand, where they're is most commonly used to refer to something more distant, in local or affiliation.  Although these rules are broken occasionally. e.g."These N.Y. Yankees are a pain in the ass...they're breaking the spirit of the game, the way rich politicians are breaking the democratic system...."A Bostonian"


What are the most commonly used programming languages?

Question: When I took my Java courses a year ago, I was told that Java is used mostly in the overseas gaming companies while C++ is used here in the US. What languages should I focus on learning in-depth?
Comment: I _suspect_ the reason you got this response was because mobile development - which has been historically Java-based - was much bigger in Europe than the US (since smartphones were much bigger in Europe than the US), and the C++-based console development studios, vice versa. "Gaming companies" is a wide range of platforms and markets and budgets.
Answer: C++ is the lingua franca of the console game industry. C# is used pretty heavily for tools and pipelines.
Answer: Common programming languages can be broken up by "type" of game development.
Large, triple-A games that are pushing the envelope when it comes to graphics typically utilized a mixture of straight C and C++ for the majority of the project. Often, a scripting language will be involved--though, this isn't necessarily true of all engines.
Gameplay code is often written in a proprietary language (UnrealScript), Python, Lua (CryTek, Spark Engine), or, in some cases, C# (The Sims 2). A few game engines are starting to support JavaScript (Unity, etc.).
Shader languages are also utilized, of course.
In the mobile realm, iPhones are dominated by objective-C while most other cellphones utilize Java (Android, Brew-based, etc.).
As for indies or small companies, they can be utilizing pretty much anything depending on their target platforms. For instance, C# is common with small time Live developers. Flash developers obviously use ActionScript.
So, there you go. Hope that helps.
Comment: Don't leave out the new crop of web-based Javascript Canvas/WebGL games that run in web browsers!
Comment: Totally, you're correct. Sadly, there aren't a lot of those games that are being monetized. But, yes, that would be correct to add to the list.
Comment: who are you calling small time?
Comment: Quite a few of the top-ranked mobile games are also written in C++ with an Objective-C/Java wrapper (both iOS and Android allow for that.) XNA (C#) is useful for working with Windows Phone 7 as well as the indie market on XBox.
Answer: C++ is fairly prominent in the current gaming market. Thought C is still widely used.
When making games, your main focus should not be language but the end product. Never start a project thinking "How can we make this in language X?" but "How can we make this in the best way possible?"
Comment: Not that I'm disagreeing with you, but the most common languages are arguably the most supported and therefore are more likely to be maintainable than something more esoteric.  Choosing popular languages has its benefits.
Comment: @Tetrad oh I agree fully. But this has often led down a road where something could have been solved in a much simpler manner with some other tool/language.
Comment: Though if the language is simpler, but no dev uses it, is it really simpler?  LIke, lots of things are way simpler in, say, Haskell, or Python or Lisp than in C++.  But is that really so?
Answer: The ultimate source is the TIOBE Index. Granted it won't tell you what each language is being used for...
Comment: Really, all five of them?  That must have taken a while.
Comment: The TIOBE index is far from reliable. The only reason that Delphi is at number 11 is that the Delphi community en masse decided to bombard the index and game their way up the chart.
Comment: @Mike One died from... well I can't tell you. It's a secret.
Comment: -1 that don't answer the question.
Comment: I have been looking for a site like this for so long, only I didn't know it. Thank you!
Answer: As already mentioned, C++ is essentially the language to learn; the major consoles all host a C++ development environment, for better or worse. C# is starting to take off, in XNA-powered games, but is most often also used for tools development.
Lua is also one of the most commonly used scripting languages in games; it's helpful to have at least a passing familiarity with it.
Often the build chain used to build the game will contain scripts written in Python or Perl; it's helpful to be familiar with those too (though it's not a requirement).
Answer: It is best not to learn one language, but to learn different programming concepts and how to apply them in a few different languages, frameworks and enviroments.
Answer: Don't forget PHP. It is very popular in MMORGP played via WWW development. In Poland f.g. there is very large number of MMORPG based on Vallheru engine, written entirely in PHP.
Comment: Or for that matter just web development frameworks in general, good mention though!
Answer: Maybe you shouldn't focus on learning one specific language. You should how to develop.
Yesterday, i downloaded the iOS SDK and Xcode. And i took it right away and made a little tetris. I'm an as3 guy, and i haven't even bother about learning Objective-C. But i was able to make a simple game because i understand how to develop.
So, my point here is that you maybe should spend more time learning new concepts, than a specific language. Or Learn X languages and port your knowledge to other languages.
Answer: Game development is a different ball game form application programming.
In the world of games it is all about speed. When pushing the envelope with 1080p HD graphics, high sampling sound and nex gen AI every last processor cycle counts.
Historically C and C++ have been the fasts but java is now comparable to c++ in terms of speed in some circumstances.
C++ allows you greater control over the architectural you design on than any other language.
Most senior game developer are well senior meaning they were taught the old school way as they were invented an as such are very proficient in older technologies.
But the most major reason that commercial game development favours C++ is that it has been used for over 15 years in the games industry and there are literally billions of in house and public access library's for it. If you want it chances are someone has built it in c++.
Having said that java is becoming more and more popular as it makes it easier to develop on the wide spread and constantly changing mobile architectural but bleeding edge games will continue to have there core written in c++ for some time to come.
Answer: Objective-C for iOS devices of course. https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/chapters/Languages.html
And most OS X programs are coded in it as well : https://developer.apple.com/technologies/mac/cocoa.html
Comment: Not backed up at all.
Comment: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html shows it as #3. Although you can argue the merits of the tiobe index, there's no way you can argue Objective-C is not commonly used.
Comment: A better justification than than the horrid aggregation of junk that is Tiobe would simply be to reference Apple's developer documentation, which indicates that the preferential toolchain for iOS (and OS X) development includes Objective-C as the entire core API is exposed in that language.
Comment: Ok - added links. I can only imagine the downvotes are from haters or people who are rather ignorant.


Entering Spain with a Schengen visa taken from Italian embassy

Question: With the Schengen visa taken from Italian embassy can I enter Spain?
Answer: Yes, you can enter any Schengen country. I've done a similar thing before, using Schengen visa issued by Italy to enter France (not Spain, but it shouldn't matter).
In the unlikely event you're questioned, you should have a plausible (and perhaps documented) story about Italy being your primary destination.


Why does Ethereum state storage cost more than history storage?

Question: According to this spreadsheet that Vitalik has referenced before, stating that it's what they used to determine gas fees for each opcode, state storage costs around 190 gas per byte while history storage costs around 7 gas per byte. Why aren't these numbers the same? I'm guessing it's because every node needs to store state while not every node needs to store history, but I'm not sure!
Answer: That's because state storage allocates new storage space (190 gas), while history storage replaces an existing value, thus not requiring more space (7 gas).
Comment: Isn't history always growing, thus requiring more space? How does that work? Also, why charge at all if there is no extra space required? I'm not convinced that this is true.
Comment: Database grows with time, but when Vitalik is referring to "history" he means preforming a write into an already allocated storage unit, so it doesn't occupy new space, just modifies an existing one. So operations that change an existing value in an array will cost only 7 gas. On the other hand, adding new items to an array is much more expensive since it requires new storage space, thus making the DB grow.


Uploading local files via composer

Question: I'm using composer to manage a Drupal 9 instance. I'm brand new to composer and have no idea what i'm doing. That being said, I've successfully set it up and have used it to install modules and an admin theme. I just purchased a theme and realized that I don't know how how to upload it with composer. For modules and the admin theme I installed, I used composer require drupal/name-of-module(or theme) but this theme doesn't have a shortname and isn't on drupal.org (but rather on my local machine after downloading it). How do I go about uploading this theme with composer? I've looked through the composer documentation but can't find anything about this scenario.
Comment: I'd put it in web/themes/custom and then git add it. Summary: You have a git repo which contains composer.json, composer.lock, custom modules, custom themes and everything else that's not ignored by .gitignore (which foremost ignores `vendor` and `node_modules` folders). Then you commit the changes to the tracked files, pull them on your server or CI and there run `composer install` and `npm i` etc. Repo stays lightweight and dependencies only get pulled down where needed.
Answer: You might want to have a look at the documentation on drupal.org:

Using Composer to Install Drupal and Manage Dependencies
Building a Drupal site with Git

It's a lot to digest, but it goes into quite some detail on how to use composer and git to manage your site.
The gist of it is this:
You use composer to download code (modules, themes, libraries, ...) that is available somewhere on the internet (github, gitlab, npm, your companies private repositories, ...) and manage the dependencies between the different components that you download.
You use git to manage your project, that is to say your composer.json that defines how and where to get external components, but also your custom code, for example custom modules that you write but that you don't make publicly accessible somewhere, but also that theme that you have purchased. Git allows you to do version control for your project, so that you can safely make changes, go back to a known working state if you break something, and create tagged releases for fixed snapshots of your code.
Once you have all set and your site is running on your local machine as you expect it, the next question is how you get that onto a server, so that your site will become publicly available. This is what I would understand as "uploading" (and there are, as usual, multiple possible ways), but I think this is not what you meant.

Uploading local files via composer


Find the maximum (longest) delay to last user in a multicast T. NP complete proof

Question: Given a un-directed weighted graph G=(V,E) where V is the set of vertices and E is the set of edges between vertices, and weights are the time delays on each link between two user. The goal is to construct a multicast tree T (that connects source node to a set of nodes say K) such that to minimize the maximum (longest) delay of the last user in the multicast tree T. The maximum (longest) delay of the multicast tree T should be less than or equal to say d. Thus it seems a an NP-Complete problem but I don't know how to prove it or reduce it. I will appreciate your kind feedback. Thank you
Answer: Refer to Shorted Path Tree (SPT)- https://en.wikipedia.org/wiki/Shortest-path_tree
It ensures that the delay from source node is always minimum for all the nodes including the maximal ones.
Based on your problem description I think it is SPT. If that's the case, it is not a $\text{NP}$-hard problem.


Select same pixels across all images and delete/make transparent them

Question: I have a bunch of images (they are in-game screenshots) that are "watermarked" with the GUI (there are controls, stats, etc.) and I want to select the pixels consistent accross all of them. I messed with it in Photoshop and managed to somehow separate the GUI by loading the images into stack and setting modes of all layers to "difference". There must be an easy solution to this.
Answer: Difference is one way to do it. After you isolate the pixels, flatten the image, select all, copy, then undo the flatten.
Make a new layer group, apply a layer mask to it, then switch to channels, activate the layer mask channel and paste the (copy from above) into the layer mask channel.
Move all your layers into the group and set them back to normal.
You can adjust contrast, invert the mask, and touch up as needed.
Comment: Yeah. That worked too. I originally did the layer mask the hard way. I saved that as selection, then restored that selection on every image and deleted. Is there any way to make photoshop do this more automatically?
Comment: I don't really know, but if you were to, say find a very dark corner or room in the game and then take a screencap, that might serve as a universal mask without much tweaking
Comment: Too bad there are no such corners. :( Anyway, I was making a reposition, I'll try it with these pictures and hope for the best...


Can overheated graphics card damage other PC components on motherboard?

Question: I have a GTX 1080 SEAHAWK graphics card that usually has temperature around 96 Celsius. Since it (usually) does not crash my system, I have used it many hours to play demanding PC games. I am worried if I continue playing games with this overheated graphics card, it may damage my motherboard and other components on it. Can overheated graphics cards damage PC components nearby? If so, is 96 Celsius (over maximum safe temperature for the graphic card) unsafe and may have already damaged my PC components?
Answer: Heat can always damage other components, so it really matters how far the card is from other cards and parts.  If there's sufficient case cooling, it should be fine.
My concern would be to ask why your card temperature is reading temps at just below the boiling point of water.  Do you get graphics artifacts at that temperature?  When it reads at that temperature, can you open the case and feel that much heat in the air near it coming off of the card? Either your overclock is dangerous for the card, or there's a busted component somewhere that is causing you to see these kind of numbers.  That could mean the card is on its way out, but it could also mean that you have a bad thermostat on the board that is reading silly temperatures.  The latter is not uncommon with computer components; you may not actually be hitting 96c.
I would cold shutdown the machine for half an hour and immediately measure temps after booting; if it still says 96c while the PC is idle and has had time to cool down, it's probably just a bad sensor.
Comment: I'd RMA the card.  The rest of your gear should be fine.
Comment: Thank you for your answer. I am not getting any graphics artifacts when hitting 96 celsius. When idle, it has temperature around 49 celsius and rapidly goes up to 96 for full load. Fans run at 100% speed then. If my board is only reporting a false number, can the number also trigger higher fan rpms and crash my system? The graphics card is a refurbished one that I got from Amazon and I am suspecting that it might not have been fixed.
Comment: While I can rma the graphics card, what I am worried is the chance of my motherboard and other components  having been damaged due to the prolonged period of using graphics card at around 96 celsius. If such chance is slim at the temperature, I will be much relieved.


JSON string to UTF8 in PHP

Question: My previous question was closed and marked as already answered by another. It does not help and I still have a problem. deceze, perhaps read the question before you close it.
I've read multiple questions on this and the answer is just to use utf8_encode but that's not working in my case. I've added JSON_UNESCAPED_UNICODE to the json_decode which also doesn't help. I even saw one which applied to Lumen where you added ['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'] to your response, and that didn't work either.
$ship_id_chunks = array_chunk($ship_id_array, 100);
$ship_array = array();

foreach ($ship_id_chunks as $chunk) {
    $ids = $chunk;
    $chunk = implode(",", $chunk);
    $json = file_get_contents($uri);
    $data = json_decode($json, true, JSON_UNESCAPED_UNICODE)["data"];
    foreach ($ids as $id) {
        $name = $data[$id]["name"];
        if (!empty($name)) {
            echo "$name, "; // Here to test name value. Correct here!
            array_push($ship_array, $name);
        }
    }
}
echo PHP_EOL;

return response()->json($ship_array, 200, ['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8']);

Some of the values in the returned JSON are "St.\u00a0Louis", "V\u00e4ster\u00e5s", and "\u00d6sterg\u00f6tland". There are a fair few more of these.
As you can see in the code above, I added an echo to print the name and the values are correct there. It's only when it gets returned through Lumen that it's wrong.
I even added a array_map("utf8_encode", $ship_array) before the return and had no luck there either.
If someone could help me, that would be greatly appreciated.
Answer: This happens to be an issue with Lumen, and not the json_decode.
Changing the return statement to the below solves this issue.
return response()->json($ship_array, 200, ['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'], JSON_UNESCAPED_UNICODE);

JSON string to UTF8 in PHP


Why can't we have a wave of particles?

Question: I understand the nature of light can be complex and has extensive theories/experimental data. We hear light can be both a wave and particle, so why can't it be both, a wave of particles?
Comment: What is a wave of particles? Do you mean a wave composed of particles?
Comment: I think the reason we can't have a "wave of particles", whatever that means, is because there's no experimental data supporting that interpretation.
Comment: I think there is a bit of a misunderstanding of the concept on your side. It is not both wave and particle or sometimes particle, sometimes wave. It is just what it is all the time. This wave-particle interpretation is merely a model which makes our understanding more clear, since it is expressed in terms known to us. We say it sometimes behaves like particle, sometimes like wave, but actually all the time it just behaves like itself and it is described by some complex equation, which sometimes can be approximated by a simple particle or a wave.
Comment: *cue mariachi music*
Answer: The problem is that light is not a wave and it's not a particle. Light is a quantum field, or at least that's our current best description of it.
Quantum fields can behave in ways that appear to be wave like, and they can also behave in ways that appear to be particle like, and this the origin of the claim that light is both a wave and a particle. It's more accurate to say that light can behave like both a wave and a particle.
Anyhow, as far as I know quantum fields can't behave like a wave and like a particle at the same time. Generally speaking they behave like waves when propagating and like particles when exchanging energy. So we can't have a wave of particles or a particle of waves. It's one or the other.
Incidentally, this applies to all particles and not just light.
Comment: Isn't specular reflection a nice case that's explained by both light-as-a-particle and light-as-a-wave? Also, the "it's not either" nature seems to me to be neatly illustrated by diffraction mirrors and similar technology; if it were a particle, it should have a randomness in the angle of reflection (did the particle hit the ridge or the valley?). And really, the same would apply for a wave, wouldn't it? The fact that you can shine a laser (or send an atom) and have it reflect at a given angle IMO isn't explained be neither the particle nor the wave approximation. Or am I missing something?
Comment: @Luaan: A particle explanation of specular reflection strikes me as hard. After all, a surface is lumpy because it's made up of a collection of electrons and nuclei, and it's not obvious why light particles interacting with all those other particles would give rise to specular reflection. With a wave model specular reflection is easy to explain. I'm not sure what you're asking about diffraction mirrors. Maybe it's worth asking as a separate question?
Comment: I was thinking about specular reflection in metals. Doesn't the "electron cloud" produce a relatively flat surface (compared to the "size" of the "particles" involved)? I'll see if I can form a good question out of the diffraction mirrors / gratings thing :)
Comment: *compared to the "size" of the "particles" involved* - and what would the size of the photon be?
Comment: Well, that's part of the issue of photons as particles, isn't it? In the context, I'd say a reasonable definition of that might be the size of a slit that no longer produces a (significant) diffraction pattern for a particular photon wave-length. The fact that photons *aren't* little balls does make this a bit complicated, but this sounds reasonable to me if you subscribe to the particle definition - in a way, it's the diameter, at which the photon no longer seems to throw away particle-like characteristics in favour of wave-like ones. Now, what is the wave-length of the metallic surface? :D
Answer: In the non-quantum sense, most waves we experience in the everyday world are waves of particles. Ocean waves and sound waves are the transmission of energy through a bunch of particles/the medium
Answer: If the wave function was a wave of particles, then you wouldn't get an interference pattern if you did a double slit experiment with one particle at a time going through the apparatus. But there are many experiments in which an interference pattern is observed when particles are sent through double slits one at a time.
The only satisfactory explanation of single particle interference that I am aware of is the many worlds interpretation of quantum mechanics as described by David Deutsch, see Chapter 2 of his book "The Fabric of Reality".
Answer: IT seems that wave phenomena (properties) can possibly be applied to atoms, and then molecules - ie. a bunch of particles (properties) in coherent form, here:

The quantum superchemistry of the out-coupled hybrid matter waves is
  studied by using the powerful tool of positive-P representation in
  quantum optics. We identify the stimulated effects of the molecular
  output step and atomic revivals by steering the rf output couplings.
  The coherent conversion of atoms to molecules is robust, with the
  noise-induced molecular damping occurring near the total conversion.
  If these effects are typical, then the quantum superchemistry in an
  atom laser can be tunable and potentially useful for, e.g., making a
  continuous molecule laser.

Also here: An article (not copy/pastable) regarding interferometry of molecules -only 9 pages, worth a read.
Answer: I think you need to read de broglies Noble lecture:

I thus arrived at the following overall concept which guided my studies:
  for both matter and radiations, light in particular, it is necessary to introduce
  the corpuscle concept and the wave concept at the same time. In other words
  the existence of corpuscles accompanied by waves has to be assumed in all
  cases. However, since corpuscles and waves cannot be independent because,
  according to Bohr's expression, they constitute two complementary forces
  of reality, it must be possible to establish a certain parallelism between the
  motion of a corpuscle and the propagation of the associated wave. The first
  objective to achieve had, therefore, to be to establish this correspondence.

From this I believe you are right in saying that at the same time, each photon is accompained by waves.
Comment: See this question: http://physics.stackexchange.com/questions/103196/quantum-wave-mechanics. The "wave" associated to matter is not a wave in the classical sense. And there are other [formulations](http://en.wikipedia.org/wiki/Path_integral_formulation) which don't use the concept of wave at all.
Comment: You could say it has been reformulated.
Comment: That was in 1929, quantum mechanics has evolved since then.
Comment: I will be happy to know, if any article source is provided which proves this to be false i.e photons are associated with waves.
Comment: Would you like to say de broglies hypothesis has been proved false?
Comment: Light energy is carried by photons, I don't think in between this energy would be vanishing during propagation. It (photons) will be there, but this property is observed only when there is interaction between matter. If not would you like to say that light energy is not carried by photons and it is carried by those "waves"?
Comment: let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/13689/discussion-between-jinawee-and-godparticle)
Answer: Light is neither particle nor wave. It's something different we haven't fully understood. When we try to find behavior of light assuming it's particle, light says affirmative. When we try to find behavior of light assuming it's wave, light says affirmative again. Means, light is behaving like particle and wave at the same time.
But, here your problem starts: Why can't we accept from behavior that light is both? Ok, natures of particle and wave are different, but why can't it be a wave of particles?
Answer:

A wave of particles is disturbance in the medium. When you fire sound waves, you actually fire disturbance not air molecules. So, if light is reaching a dark place from a distance, it'd be dumb to assume Photons are already there. And, if there aren't any Photons already, a Wave of Photon isn't possible.
Even if you fire one Photon, it'd spread out like wave (which you shouldn't accept with one particle) and make interference patterns with other one Photon.
Answer: A simple question about light is, "where is it?"
The wave model says that there's no single precise answer. It's spread out.
The particle model says that each photon has a place in space.
A model that assumes both at the same time doesn't have a good answer to this.
Modern physics of course has much more complicated models, but they are made possible through math. And then it turns out there are rather identical models for other types of waves and particles, so much that De Broglie assumed that all those waves were particles and vice versa, i.e. that you could use the same unified mathematical model. (Which still didn't answer exactly what that model should be, though)

Why can't we have a wave of particles?


Connecting light and temperature sensors and LEDs to an Arduino

Question: Fairly new to arduino, what is the best and simplest way to connect an LM35 temperature sensor, a GL5528 photoresistor and some LEDs as well as the required resistors to an arduino for recording values? Any tutorials with wiring diagrams for something similar would be helpful.
Comment: I'm pretty sure using the text entry box on the top right will find you some.
Comment: Hi, like Ignacio hinted, your requests would be easily answered with a search. I provided an answer by doing the search for you.
Comment: I meant the site search box, but either or.
Answer: The LM35 is a very common temperature sensor. It has 3 pins - Vs, Vout, and Gnd. Connect Vs to the Arduino's Vs pin. Connect the Gnd pin to one of the Arduino's GND pins. The Vout pin should be connected to an Analog input pin. If you google your board, you should find the pinout on Arduino's website. The LM35 pin diagram and information on how to calculate the temperature from voltage is found in the LM35's Datasheet. Here is LadyAda's Temerature Sensor tutorial (note: the tutorial specifies the TMP36, however the two sensors are comparable). Here is an instructable for the LM35 (includes diagrams and source code).
The GL5528 is a photoresistor. That means its resistance changes proportional to how much light strikes its sensor surface. Because of this trait, we can build a Voltage Divider. This will allow us to read in values (again, analog values). AdaFruit's tutorial is very comprehensive and includes diagrams.
LEDs are generally considered output displays (we program to use LEDs as a visual display of state). A good starting place for Arduino LEDs is the Blink Example. we connect an LED and resistor in series with an Arduino output pin and GND or 5v. This allows us to 'write' to the Arduino pin HIGH or LOW, turning the LED on or off.
I found these results by googling 'Arduino LM35', 'Arduino GL5528', and 'Arduino LED' respectively.


Which one I should go for, ADATA SP550 120GB vs Samsung EVO 120GB SSD's?

Question: I'm new to SSD, After doing some research i end up with 2 models ADATA SP550 120GB and Samsung EVO 120GB. ADATA seems to be a TLC NAND Flash which is low in endurance but i have no idea about EVO(Could be TLC/MLC). But both are of 3-bit/cell flash memory. Please suggest me a good one.
Comment: Welcome to Hardware Recommendations. 3 bit/cell and TLC mean the same thing. Samsung has more than one EVO, the 840 and the 850. What are your requirements and budget?
Comment: I'm looking for good Performance and Reliable disk under 4000 INR (~60$ USD). If both have same endurance level then I can go for Adata rite.
Answer: The Samsung is much more durable since all the components are manufactured in house and they have very strict quality control. They are both TLC, but the Samsung has a really good TLC flash chip. The Samsung SSD is also much faster than the ADATA.
Answer: Samsung all day, every day. Their warranty is amazing and the speeds are all at the top of the charts. I've installed several Evos and Pros in systems and have been nothing but thrilled with the results, especially in older systems.
Answer: I'm going for Samsung SSD 850 EVO.
After some research I found ADATA's TLC is a poor performer. In real world tests the file transfer read speed was decent, but the write speed tests would bring the SP550 to its knees. Sequential write is averaged about 50 MB/s, where as Samsung 850 EVO is able to maintain so much better performance.
We can push our self to spend extra bucks to get a quality product.


How to fix postfix: Sender address rejected: need fully-qualified address (in reply to RCPT TO command))?

Question: I've installed dovecot, postfix and roundcube on an ubuntu 12.04 box.
The system is basically working - i.e it is able to send/receive mails to/from other domains.
However, some domains cause the following error message in /var/log/mail.log
Jul 15 01:59:21 one postfix/smtp[2019]: 0D0399C025F: to=<firstname.lastname@example.com>,
      relay=sm01.destdomain.com[x.x.x.x]:25, delay=0.56, delays=0.4/0/0.06/0.1,
      dsn=5.5.2, status=bounced (host sm01.destdomain.com[x.x.x.x] said:
      504 5.5.2 <contact@localhost>: Sender address rejected: need
      fully-qualified address (in reply to RCPT TO command))

Do you have any idea what's wrong here? I.e. How to force postfix to use "email@example.com" instead of "contact@localhost" when connecting to another mail server?
Any hints are appreciated.
Answer: $mydomain is used as a default value for many other configuration parameters, but it does not set the sender domain.
Take a look to the $myorigin parameter in /etc/postfix/main.cf
It specifies the domain that appears in mail that is posted on this machine. The default is to use the local machine name, $myhostname, which defaults to the name of the machine.
For more information, see Postfix basic configuration README
Answer: Programs like "mail email@example.com" may not use myorigin.
Instead create /etc/postfix/canonical
@local @realdomain.com

Add a reference to it in your /etc/postfix/main.cf
canonical_maps = hash:/etc/postfix/canonical

And activate the stuff
postmap /etc/postfix/canonical
service postfix restart

See the docs


How to move the window titlebar icons for maximize, minimize and close to the left in MATE?

Question: I just installed MATE on 16.04 and I would like to move the maximize, minimize and close buttons to the left, as I am used to this placement. I can't seem to find this sort of option in the MATE Control Center.
Answer: You can use MATE Tweak in System > Preferences > Look and Feel

Under Windows, select Contemporary (Left)

Placement will change instantly (I also like the buttons on the left).
Answer: Use the dconf editor which should be provided. Applications > System Tools > dconf Editor. Select org > mate > marco > general > button-layout > menu:minimize,maximize,close for right side, minimize,maximize,close:menu for left side. You can also add spacer to separate any of the buttons.


How to simulate random scope movement?

Question: I want to simulate that random and soft movement that lot of games got (like BF3) when you use the scope of a sniper gun, so the question is how to achieve that.
Comment: Just the algorithm
Comment: Do you need an algorithm how to calculate the involuntary movement or do you need a way to implement the movement itself?
Answer: You could randomly take a new looking direction or a point to look at for the camera, then just lerp or smooth damp towards it. Here is a simple example made with Unity that might get you started, feel free to modify it. You might also want to add player's camera movement to that so the player can actually control aiming.
<code>private float t;
private Vector2 randomPoint;
private Vector3 lookAtPoint;
private Vector3 lookFromPoint;
private const float RADIUS = 0.1f;
private const float MOVEMENT_TIME = 1.0f;

void Start () {
    t = MOVEMENT_TIME;
    lookFromPoint = transform.forward;
}

void Update () {
    if (t >= MOVEMENT_TIME) {
        randomPoint = Random.insideUnitCircle * RADIUS;
        lookFromPoint = lookAtPoint;
        lookAtPoint = new Vector3(transform.forward.x + randomPoint.x, transform.forward.y + randomPoint.y, transform.forward.z);
        t = 0.0f;
    }
    else {
        t += Time.deltaTime;
        transform.LookAt(Vector3.Slerp(lookFromPoint, lookAtPoint, t));
    }
}
</code>
Comment: I had already tried using a simple random but the result isn't that 'soft', I mean it doesn't look natural at all

How to simulate random scope movement?


How to use event bubbling in Flex

Question: Hi
Actually I wanted to know what is bubbling event and how to make use of it. Also, what is the concept of capturing, targeting and bubbling too?  If any one knows or could give any sample piece of code for explanation that would be helpful.
Comment: I'm confused... why do you think you need to use event bubbling if you don't know what it is? (Maybe this is a homework question?)
Answer: Here's another link to an Adobe tutorial, recommended by James Ward.
Answer: What eactly is your problem?
In short, event bubbling pretty much does what the word says: when clicking on a button that "click event" can be listened to at the button but it also bubbles up in the container stack.
Pretty good docs can be found here: http://livedocs.adobe.com/flex/3/html/help.html?content=events_08.html

If this helped, please vote or mark answer as correct. THX

How to use event bubbling in Flex