Unable to get signer which is required for completing transactions

Question: We are integrating Gnosis Safe Wallet into our app with ethers library but we are unable to get a signer, i.e., required for completing transactions.
I used @gnosis.pm/safe-apps-react-sdk for getting sdk into our app and @gnosis.pm/safe-apps-provider for getting a provider, which I used to fetch provider, safeAddress, account etc., and I am able to connect my app with safe app with safe app address. But when I am trying to do transaction using the safe app, I am unable to get a signer which is required to complete the transaction.
Can someone help from team how I am able to get signer so that I am able to do transactions on safe app with a safe app address?
Answer: You should be able to get a signer like this:
<code>const signer = new SafeAppsSDK({
      allowedDomains: [/app.safe.global/],
      debug: false,
    });

const { safeTxHash } = signer.txs.signMessage(message);

</code>


How much energy does a powerlifter need to perform a session of squats?

Question: So I started the math myself and I'm hoping someone can look this over and improve on my idea.
Let's say that a powerlifter performs the following sets of squats:

% 1RM = lifted weight in percent of the maximum weight the person can lift. If we look at set 10, where the weight of 105 kg is lifted for 1 repetition, this is the 1RM (1 rep max). All other/above weights' 1%RM are counted from this value. We expect the powerlifter has long pauses/rests between sets, so the last set is his real 1RM. Why/how this value is important, I will mention later on.
If we take the sum of the total weight lifted (4th column), it is: 3125 kg lifted during this session.
The distance the bar travels during the squat is 70 centimeters from top to bottom and another 70 centimeters back to top. The bar travels on a vertical path.
The gravity is 9.81 m/s/s.
So the force required to do the above is 3125 kg * 9.81 m/s/s = 30656.25 N, as long as my math is correct up to this point.
The total distance is 1.4 meters (70 cm traveled twice).
The mechanical energy required is then force * distance (I hope), which would be 30656.25 N * 1.4 m = 42918,75 Joules.
As long as my math is correct up to this point, the last important part would be to consider muscle efficiency. The Wikipedia article about muscle, the efficiency part states:

The efficiency of human muscle has been measured (in the context of rowing and cycling) at 18% to 26%. The efficiency is defined as the ratio of mechanical work output to the total metabolic cost, as can be calculated from oxygen consumption. This low efficiency is the result of about 40% efficiency of generating ATP from food energy, losses in converting energy from ATP into mechanical work inside the muscle, and mechanical losses inside the body. The latter two losses are dependent on the type of exercise and the type of muscle fibers being used (fast-twitch or slow-twitch). For an overall efficiency of 20 percent, one watt of mechanical power is equivalent to 4.3 kcal per hour. For example, one manufacturer of rowing equipment calibrates its rowing ergometer to count burned calories as equal to four times the actual mechanical work, plus 300 kcal per hour, this amounts to about 20 percent efficiency at 250 watts of mechanical output.

This is where my math/physics skills start to fail. If from the above I take that average muscle efficiency would be around 20%, I could simply do the following:
42918,75 Joules * (100/20) = 214593,75 J required to perform those squats.
However, the 20% muscle efficiency is an average value for rowing and cycling. For squats, the efficiency will be a lot lower, I suppose. I also suppose that the efficiency correlates with %1RM that is being performed.
As you can see from the table above, the lifted total decreases as the weight being lifted increases (sets 6 to 10). This says that the efficiency decreases, right?
Does anyone know how to perform the math here? How do we get a close approximation of the muscle efficiency for each weight/set, so that we can count the energy properly?
Answer: %1RM has nothing to do with the work, because it was not lifted.
The correct way is to divide by the efficiency so you would be right in your calculation of 214593,75 J
1 Joule = 0.000239 Kcal, so the total would be 51.28 Kcal.
The only comment I have is that you forgot to add the weightlifters own weight because he is also lifting his own weight at every repetition.


I logged into one of my freinds phone with my gmail and logged out this afternoon.

Question: Still it is syncs all my contact list on gmail though I logged out of my gmail from her her phone. Please let me know how can I fix it. I want to delete the unwanted ids from her phone. It would be really time consuming job if I do this manually, delete one by one. Is there any better way for this?
Answer: Although you've signed out you most likely still need to unsync. What you can do is go to the apps where your information was synced in this case it's the contacts I'd assume, go to accounts and unsync from any gmail account then. In some Android systems this can be done through settings and not the contacts app.


Primitive 8th roots of unity in Z17

Question: If $\omega=\frac{\sqrt{2}}{2}+i \frac{\sqrt{2}}{2}$, then $\omega$ is an 8th root of unity. And I know $\omega,\omega^3,\omega^5$,and $\omega^7$ are furthermore primitive 8th roots of unity in $\mathbb{C}$. But what happens when we change $\mathbb{C}$ to $\mathbb{Z}/17\mathbb{Z}$ (integers mod 17)? How can I find the primitive 8th roots of unity in $\mathbb{Z}/17\mathbb{Z}$?
Comment: I changed $\mathbb{Z}$ to $\mathbb{C}$ because $\omega$ is not an integer, hopefully that's what you had in mind.
Answer: Note that $2^4\equiv -1$ (mod 17), hence $2^8\equiv 1$ (mod 17). So $2$ is a primitive 8th root of unity. The other primitive 8th roots of unity mod 17 are $2^3=8$, $2^5\equiv 15$, and $2^7\equiv 9$.
In general, $\mathbb{Z}/p\mathbb{Z}$ for a prime $p$ contains all the $n$th roots of unity precisely when $n$ divides $p-1$.
Answer: The multiplicative group of $\mathbb{Z}/17\mathbb{Z}$ is cyclic of order $16$.
Therefore, there are $\phi(8)=4$ elements of order $8$. (Just like in $\mathbb C^\times !$)
In the context of groups, a primitive 8th root of unity is the same as an element of order $8$.

Primitive 8th roots of unity in Z17


What is a simple example illustrating the concept of "commensurate" and "incommensurate" order in condensed matter physics?

Question: In a wide range of contexts in condensed matter physics, e.g this paper, the concepts of commensurate and incommensurate orders are invoked to describe particular ordered phases. I think I have some intuition for what this means - that somehow lattice translation symmetry is inconsistent with the structure of the ordered phase - but I would like to refine this notion. A clear formal definition of these terms would also be useful.
Answer: Commensurate means that the ration of two parameters is an integer or, more generally, a ratio of integers.
For example, if we consider a one-dimensional lattice with period $a$, and we impose on top of it a perturbation potential $$V(x)=V_0\cos(kx)$$ with spatial period $$\lambda=\frac{2\pi}{k}.$$
The sutuations where $\frac{\lambda}{a}=n$ or $\frac{\lambda}{a}=\frac{1}{n}$ or $\frac{\lambda}{a}=\frac{n}{m}$, where $n,m$ are integers, can be all referred to as commensurate perturbation, although the results would be somewhat different. Such a perturbation preserves some of the translational symmetries (which could be treated as another definition of the term commensurate).  On the other hand, a general periodic perturbation would not fall in any of these classes and is usually more difficult to treat.
Answer: I am very new at this and have seen these two terms come up in various topics within CM physics so the answer depends on what you are talking about. I'll provide an answer in different words than what was stated in the previous answer.
Commensurate means integer multiple of the crystal lattice constant.
Incommensurate means not an integer multiple of the crystal lattice constant.
Near-commensurate is, of course, somewhere in between.
Example:
A commensurate charge density wave has a wavelength that is exactly an integer multiple of the lattice constant.
See the second paragraph in Charge Density Wave Wikipedia


Intersection of two flat submodules

Question: Let $A$ be a ring, $M$ an $A$-module and $M_1,M_2$ two flat $A$-submodules of $M$. Is $M_1 \cap M_2$ a flat $A$-submodule of $M$?
Answer: No. Pick any flat $A$-module $F$ admitting a non-flat submodule $N\subset F$, and take $M$ to be the pushout of $N\hookrightarrow F$ with itself, i.e. $M := \text{coker}(N\xrightarrow{\Delta} F\oplus F)$, i.e. the "glueing" of two copies of $F$ along $N$. Then $M$ has two copies of the flat module $F$ as submodules, and their intersection is the non-flat module $N$.
To find an example of a non-flat submodule of a flat module, you may restrict to finitely generated modules over a Noetherian ring $A$, where flatness and projectivity are the same, and pick any non-projective submodule of a projective module - for that, see Is every submodule of a projective module projective?
Addendum Concretely, the answer of user26857 gives an example for the above.
Answer: No. Let $R=K[X,Y]$, $I=(X,Y)$, $L=\{(r,-r)\mid r\in I\}$, $M=R^2/L$, $\pi:R^2\to M$, $M_1=\pi(R\times\{0\})$ and $M_2=\pi(\{0\}\times R)$. Then $M_i$ are isomorphic to $R$, while $M_1\cap M_2$ is isomorphic to... (A proof that $I$ is not $R$-flat can be found in this answer.)

Intersection of two flat submodules


How to solder to this glass pcb?

Question: I have this glass PCB I took from a calculator that I'd like to get working with my Arduino as a numpad, but it's a glass PCB. Is there any way I could solder wires to it?
Comment: How did the original calculator make those connections? I'm guessing it wasn't solder. You'll need to duplicate that method -- probably some sort of elastomeric bridge ("zebra strip").
Comment: I actually like @rdtsc suggestion to use card edge connector the most. It should be fairly easy to find a socket of suitable width and mechanically limit sideways movement, so that inserting glass will always make contact with same pins. And if more permanent solution is desired then a bit of epoxy along connector's edge will create neat and permanent bond
Answer: The transparent conductors are ITO (Indium Tin Oxide) deposited on glass. They're not easily solderable (perhaps possible with an ultrasonic soldering iron but even then they would likely be mechanically very weak).
You can use an elastomeric connector (zebra connector) as Dave Tweed suggests, but you'll need a closely matching pattern (preferably gold plated, or carbon printed) on a PCB.
It's also possible to use FPCs with conductive adhesive such as heat sealed types, but that's not practical for small quantities or one-off.
Silver-loaded or carbon loaded conductive paint might be a possible way to weakly attach to thin copper wires such as (stripped) AWG 36 magnet wire. I believe conductive paint is sold in auto shops for repairing heated car windows.
Comment: If they could find a card-edge connector with the same pitch and separation to match the glass, a press-fit (then epoxy) solution may be possible.
Comment: Is [this connection](https://i.imgur.com/cfvKbKq.jpg) the FPC with conductive adhesive that you mention?
Comment: "but you'll need a closely matching pattern" Form the photo it seems to be quite standard 1mm pitch, nothing to worry about. The primary concerns would be 1) choosing zebra strip with small enough pitch, 2) ensuring correct positioning of the glass over PCB and 3) finding a way to press glass down evenly and strong enough without breaking it.
Comment: Why is gluing on a flex cable not practical? That would be my first idea... get a flex cable with a fine pitch, some conductive glue and glue it on with a heat gun. I have repaired many kitchen scales like that, although I always used the glue that was still on the cable, so I wouldn't know how to buy the glue.
Answer: You can't, it's a very thin layer of printed-on metal.
As Dave says, you need a Zebra strip or similar pressure connector.
Answer: You can try using anisotropic conductive tape. Adafruit will sell you a 50mm x 150mm strip. It's double-sided tape that only conducts through the thickness of the tape when you press it between two surfaces. That way, you can make multiple independent electrical connections without shorting them.

Make a PCB with exposed contacts of the same pitch and geometry as that of contacts of the glass. Then sandwich the tape between the PCB and the glass. Obviously, be sure the conductive sides of the board surfaces face each other.
Answer: As mentioned by others these aren't meant to be soldered to.  In theory with indium based solder it might be possible, but it's really not worth the cost of the attempt.
If this originally had a thermally bonded flex cable, you can often non-destructively remove those from the original board with a hair dryer.
You can then stick them to a compatible PCB footprint by effectively "ironing" them down - a clothes iron would work if it can fit, perhaps a sealing iron as used for model airplane covering film.  I was able to get a solder station with a large curved tip to sort of work at low temperature, tested by touching against the side of the ribbon to make sure it would not melt it, then to make sure the temperature controller couldn't hit it with another bolus of heat actually powered off the iron before using the residual heat to iron the ribbon onto the board.
If it had zebra strips and you didn't break those, then with suitable fixturing you could probably do the same thing with a suitable footprint on a custom PCB.  A 3d printer might help make something that would hold the display vs. board in the right place.
For an LCD display you'd also need to work out the column and segment mapping and figure out an appropriate driving circuit.  Something generating about a volt or two of AC across two probes can be handy for exploring.  You can also simply toggle GPIOs in opposite phase.
Edit: realized what was hiding behind your link was actually a keypad not a display, but much of the same still applies, except that you can probably sort out the connectivity visually.  That said, for a keypad you might do better just making your own conventional PCB...
Comment: @J... if you have the right supplies and tools and technique, perhaps.  But it's not really a realistic or economic option for someone who would post this question.
Comment: Indium definitely works.
Comment: Indeed, as you previously noted.  Only meant to support what you posited as theory - that indium might work.  It does.

How to solder to this glass pcb?


Saving raster data in ArcPy?

Question: I am new to arcpy and I'm trying to write a script to get the raster and check for the minimum cell size value using Get Raster Properties method.
After I run my code I get a message of the minimum value but the raster is not saved. Below are my line of codes:
import arcpy ,os ,sys
from arcpy import env
from arcpy.sa import *

input_raster= arcpy.GetParameterAsText(0)
output_folder = arcpy.GetParameterAsText(1)

arcpy.CreateFileGDB_management(output_folder,"output.gdb")
outputgdb = output_folder +"\\output.gdb"+ os.sep

output_con_raster = outputgdb + "cond_raster"

inRas1 = arcpy.Raster(input_raster)
rasterValue = arcpy.GetRasterProperties_management(inRas1,'MINIMUM')
elevation_min= rasterValue.getOutput(0)
elevation_min.Save(output_con_raster)

Is there anything wrong with my code as the save method is not working?
Answer: You are confusing yourself with the naming convention you are using.
rasterValue is a result object.
Your next line returns the output of the result object which will be a number, the minimum value in your raster.
Knowing this then the final line elevation_min.Save(output_con_raster) make absolutely no sense as your syntax is suggesting you are trying to save a raster when in fact you have nothing more than a number (float or integer).
You could write this value to a table?

Saving raster data in ArcPy?


What do the fixed points of a RG equation mean and what are its importance?

Question: Can somebody explain to me what the fixed points of a renormalization group mean? What is their physical significance in the sense that why do we study them and what do we get to know from them?
Comment: If you have a graduate student level in physics, then the review by Shankar is the best starting point. Here is arXiv version (it was published in Rev. Mod. Phys.) https://arxiv.org/abs/cond-mat/9307009
Answer: The RG describes how a QFT changes under an overall change of scale -- loosely speaking, as we "zoom in" or "zoom out". Fixed points of the RG are scale-invariant QFTs: they look the same at all scales. If you start with some generic QFT and follow the RG flow to its low- or high-resolution limit, the usual expectation is that it approaches a scale-invariant QFT (if the limit is defined at all).
Many different QFTs may flow to the same fixed point, so we can think of the scale-invariant QFTs as unifying landmarks in the landscape of all QFTs. This is what universality is about. (This is also closely related to why renormalizable QFTs are often sufficient in applications. Roughly speaking, at low enough resolution, any QFT looks the same as a renormalizable one, even if we don't go all the way to the fixed point.) Knowing what scale-invariant QFTs lie at the low- and high-resolution endpoints of a given RG flow can tell us a lot about the QFTs that lie along intermediate points on that flow. Conversely, one way to approach the study of QFT is to start with a scale-invariant QFT and perturb it in different ways, which is like taking little steps out into the various RG flows that go to/from that particular fixed point in various directions.
The study of critical phenomena in statistical mechanics, like the critical point that terminates the liquid-vapor phase transition of a typical fluid, uses the same ideas. (This was probably the inspiration for some of the key ideas.)
Interestingly, scale-invariant QFTs tend to be invariant under a larger set of transformations, the conformal transformations. This sometimes allows additional non-perturbative results to be derived, especially in 2-d spacetime.
Comment: @mithusengupta123  By "different" QFTs, I simply mean QFTs whose physical predictions differ. Saying that two different QFT's can flow to the same IR fixed point (for example) means that if we only consider processes with sufficiently low momentum, then the two theories' predictions for those processes are indistinguishable. If we take the limit all the way to the IR, so that the distinctions between the original QFTs are lost, we get the "fixed point" QFT, which is scale-invariant. Not only to the both flow to *a* scale-invariant theory, they both flow to the *same* scale-invariant theory.
Comment: Dear @ChialAnomaly Sorry, it took me quite a long time to appreciate your answer. I am a little confused. If I understood it right, then you are saying that at the fixed points (which could be at a high scale or at a low scale) a QFT is scale-invariant. However, when you say that **different** QFTs flow into the same fixed point, what do you mean? What do you mean by **different** here?
Comment: As far as I could understand from your post, universality has to do with many different QFTs behaving as scale-invariant theories at the fixed point and in the context of critical phenomena, this 'fixed point' refers to the critical point. When you say that many different QFTs flow to the same fixed point, do you mean different systems such as Fe and Ni (in the other answer) described by the same Heisenberg model but with different parameters, flows into a scale-invariant theory? I am not sure.
Answer: Chiral anomaly gave an excellent answer in QFT language but I'll provide a more physical way of thinking about fixed points.
Consider two distinct physical systems (for example Ni or Fe magnet) that flow to the same fixed point under RG, then near the critical point, they have similar behaviors in heat capacity or magnetic susceptibility measurements. More precisely, the critical exponents, which characterize how these quantities diverge, are the same. That is to say they correspond to the same universality class, since they flow to the same fixed point.
But you can say the fixed points don't exactly describe the physical systems we are studying so why bother? Because studying Fe/Ni exactly is too complicated. We are content enough to correctly get the exponents that describe a non-generic measurement.
Edits
To be more explicit, the example of ferromagnetism I gave can be described by the Landau-Ginzburg hamiltonian
$$\beta H = \int d^dx \, [\frac{t}{2}m^2 + \frac{K}{2} (\nabla m)^2+..] + u \int d^dx \,m^4$$
where $t$ is the reduced temperature and $u$ the interaction term. The RG flow diagram is given by Kardar chapter 5 which I copy below,
for $d<4$, the non-zero fixed point is called Wilson-Fisher fixed point, which describe the paramagnet/ferromagnet phase transition. You can see there are two relatively straight lines flow into the same WF fixed point. Real materials like Ni/Fe will have some curve in this t-u parameter plane that people measure and at some point both will cross the straight line and flow into WF fixed point.
Comment: I'm referring to ferromagnetic Fe/Ni, which are described by Landau-Ginzburg hamiltonian or O(N) model (see Kardar Chapter 5). I'll edit my answer a bit
Comment: When you say, that Fe and Ni flow to the same fixed point under RG, what microscopic/field theory do you have in mind for them?
Comment: Thank you for your edits. Unfortunately, I cannot accept more than one answer.


Plot a Raster of Weather data in Leaflet JavaScript Map without generating server-side tiles?

Question: I want to show different weather data I have as binary arrays on a server using leaflet. But I do not want to generate tiles on the server. For each point in an a array I have the coordinates in another array. I also have the proj-string for the projection. Is it possible to retrieve the arrays from the server and dynamically generate the map for leaflet in the client? If so, how?
Answer: Leaflet appears to be focused on GeoJSON and tiles.  You would need to put your raster data in GeoJSON format along with lon lat information.  Depending on the size of your raster data pixel count, one large GeoJSON file with all the weather data could swamp a web browser's memory.  You have to have some way of working with a bounding box of the data either in your Leaflet script or from a server service.  You want to look for marker information in Leaflet. Also note that there is a GeoCVS Leaflet plugin. There's some links to get you started.
How to interact with leaflet marker layer from outside the map
Leaflet - How to find existing markers, and delete markers?
How to plot tweets by location in real time on to a map e.g. leaflet
Leaflet plugin for loading a CSV file as geoJSON layer
Answer: Your best bet is to convert it to JSON.
I assume the binary array is a file type, so you have a X,Y,(Attribute) grid in some format and you want to display it on Leaflet.
If you have a way of reading the file, then work out how to output it just as points, so CSV, or GeoJSON as a first preference. If there are less than, say, 3000 points, that will render just fine. If it's more then you need to look at how to handle that.
GeoServer does WMS rendering very easily, but it does need some configuration and has an overhead of being a piece of software to manage. When you know what you're doing, GeoServer is very easy and fast to set up. You will probably still be stuck if your file format isn't supported by GDAL.
Answer: I'm not aware of any solutions that render on the client, but you may be interested in geotrellis, which could handle a lot of the required functionality on the server.


GPU computation on Linux using open source kernel drivers

Question: Assuming freedom to choose whichever currently available GPU is most suited for the job, is it currently feasible to do GPU computation (either CUDA or OpenCL) on Linux using one of the open source GPU kernel drivers (i.e. not fgrlx or nvidia's binary driver)?
Answer: Not really. And it won't be supported for the foreseeable future. They still have so much work to do with just the graphics part that there is no time to develop the computing stack.
I personally relate to the closed drivers as I do to the actual HW, I cannot change the HW so I don't mind that I cannot change the drivers. Even though the closed drivers tend to be rather buggy and it takes ages for them to support new kernels and new X.org.
Answer: sharpneli already provided the right answer. However, I would like to also point out this article which indicates that there might be a change in thinking at least from AMD. But that will most likely take several month (years) before we will actually see a real open source driver that runs OpenCL.


Cold start recommender system with features

Question: I have to develop a recommender system where most of the users only buy 1 item, so I have a cold-start problem. For this reason, I'm discarding matrix factorization techniques and content-based systems in general.
Luckily, I have lots of features for each user. I have the location, age, gender, the device they use to log in, the web browser, mobile carrier, answers to a small login form, among others.
What approaches can I follow given that I have this cold start problem with features?
I understand I can treat it as a multi-class classification problem, where I predict the item that the user is most likely to buy. This has two inconveniences I can think of:

What happens when a new item is added? Do I need to retrain the whole model?
How do I prevent the system from recommending only the most common item? The multi-class problem might give higher probabilities to very common items and my recommendations might get dummy (like recommending bread on a supermarket, doesn't add any value since the user is going to buy it anyway).

Can these issues be solved with a classification approach? Are the other approaches to address these?
Answer: Since you have access to user level features, try a k nearest neighbors recommender algo.
When a user signs into your site, find the k most similar looking users (based on a similarity metric such as cosine similarity), and recommend products that those users have purchased.


Are packets signed before encryption in Tor?

Question: When the clients sends a packet through relay nodes, is each packet signed then encrypted? If so, how do the relay nodes know the client's static public key to check the signature, as knowing this would give the other relay nodes knowledge of the who the client is. If the packets aren't signed, then can any packets have their authenticity proved?
Answer: At each hop, no, payloads are not authenticated. However, the inner most layer is. This enables the exit node (or onion service) to detect tampering. This lack of authentication opens tor up to tagging attacks because AES-CTR, as used to encrypt the payloads, is malleable and any tagging can be detected by observing the tag between the CELLs at a later hop in the circuit. This attack can only usefully be applied by malicious guards and exits who collude.
This tagging attack can and will be mitigated by replacing AES-CTR with an SPRP, which does not prevent the malleability, but does prevent the trivial linking of corrupted CELLs.
FYI we don't need asymmetric signatures with public keys to authenticate a message. A MAC, Message Authentication Code, is the symmetric variation using a single secret key. Just like a symmetric cipher uses a single secret key. These secret keys are known only to the sender and receiver and must not be known by your adversaries. Otherwise messages may be decrypted or forged.
Answer: This is a rather complex question. The super-simplistic answer is that you and the guard node each make 1/2 of a key that is then used to encrypt/decrypt traffic.
OK for the real answer, read section 4.2  Circuits and streams of the Tor design paper. It's pretty dense and takes time to wrap your head around, just FYI, but it should give you all of the info that you need.
Comment: This is a very old reference. Please refer to the active [tor-spec.txt](https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt).
Answer: You're asking how Tor works in a few simple lines. It takes a long answer and knowledge of the Tor network itself to understand how this works.
TL;DR The client knows the public key for the nodes he communicates with. The node can decrypt with his own private key and doesn't know anything about the client.
Longer answer: When a Tor client wants to send a data package it needs a route. This route contains a guard node, middle node and an exit node. The client generates this route by himself with the data he received from the directory service. This directory service also sends along the public keys for all the nodes he communicates with the client.
When the client wants to send a data package it encrypts the package 3 times. Once with the exit node's public key, once with the middle node's public key and once with the guard node's public key. When the guard node receives the package it decrypts it with his private key, then sends it to the middle relay. The middle relay decrypts the next layer of encryption with his private key and sends the package to the exit node. The exit node decrypts the last encryption layer with his private key and sends the unencrypted package to its final destination. It all works like the layers of an onion. That's why Tor's name is actually The Onion Router.
Comment: I understand the layered encryption concept, but how are packets authenticated if they are?
Comment: Sorry, I misunderstood the question. Why should packets need to be signed? The whole concept is to stay anonymous. Signing a package would break that concept wouldn't it?


Name of fundamental energy fields

Question: The photon is the quantum of EM energy (field).  What is the name of the energy fields of the rest of the fundamental particles? ( I.E. the up quark, down quark, electron etc.)
Answer: Fermions don't produce fields in the same way that bosons do, because they obey Fermi-Dirac statistics, rather than Bose-Einstein statistics. Strictly speaking, the electron is the quantum of an "electron field", each quark is the quantum of its own "quark field", etc.
These fields don't do much, however, because the particles that mediate them can't multiply in an unlimited sense (see Pauli's exclusion principle.)
All of the fundamental bosons, however, have their own fields: W's and Z's are the quanta of the charged and neutral weak fields, respectively, the gluons of the color fields, and there's the special "Higgs field", which is a whole nother animal, because the Higgs has a non-zero vacuum expectation value (vev).
Comment: What field are fermions a part of then.
Comment: The fermions are each part of their own field, as I explained.  I put electron field in quotes because there's no special name for it, it's just the field associated with the electron. So the electric field is the "photon field", but we don't call it as such, because we have a special name for it.  We don't experience the fermion fields, because they only couple through the boson fields.

Name of fundamental energy fields


Packaging C# Applications with third party libraries?

Question: I have an application that utilises the BouncyCastle framework, how can I package this application so that I don't have to manually put BouncyCastle's <code>.dll</code> on others computers? I'm assuming that this can be done with an installer or something similar? Where do applications look for referenced third party libraries by default?
Answer: As an alternate approach, you can inject assemblies into your main assembly.
There are cemmercial tools that support this like DeepSea Obfuscator or you can use ilmerge.
The general way of working is that you develop using separate assemblies and when you ship the product you do an additional build step that merges assemblies into one big assembly. You can even internalize the injected assemblies so only your public interface is accessible.
This way you can deploy your product as a single assembly which is especially nice if you're building components.
To answer your second question; the .NET framework will look in a couple of locations. The GAC is dominant but if you make sure the referenced assembly is in the same folder as your main assembly .NET will find it. No need to register it in the GAC.
Answer: You need to create installer. Best one to start with is ClickOnce. It will give you ability to put all needed files into one and provide UI for installation.
Second question. The default place to look for assemblies is GAC.
Answer: Since BouncyCastle is a managed library, if you create an installer project in Visual Studio and add your application's exe to it, the installer will automatically detect the dependency on BouncyCastle, and add it to the installer project. When users install your application, BouncyCastle's dlls will be automatically copied to the installation directory and everything will be good.


Why does a buffer work best at the pH closest to its pKa?

Question: I think I'm having trouble understanding exactly how the $\mathrm{p}K_\mathrm{a}$ relates here on a conceptual level. For example I know that carbonic acid works somewhat well as a buffer at $\mathrm{pH}$ near 7, since its $\mathrm{p}K_\mathrm{a}$ is relatively close, but why is that exactly?
Comment: A good way to think about pKa is that it is the pH at which the molecule is 50% ionized.
Answer: A buffer works best when there is the same amount of weak acid/base and its conjugate. If you look at the Henderson Hasselbalch equation, and set the concentration of the weak acid/base equal to each other, $\mathrm{pH} = \mathrm{p}K_\mathrm{a}$.
Answer: I propose this simple graphic answer as a complement to the more thorough replies above (comments welcome to confirm validity of my answer).
Trace pH Vs % [HA] and [A-]. 0% means you only have the acid [HA] and 100% you only have [A-].
Addition of acid or base, to the buffer solution, affects the ratio [A-]/[AH] and consequently, pH. This has been explained quantitatively in previous answers.
On the plot, you see two drops in HA % due to addition of base. Compare the corresponding changes in pH and notice that operating around pH =pKa lowers the impact on the pH..
Answer:
Why does a buffer work best at the $\mathrm{pH}$ closest to its $\mathrm{p}K_\mathrm{a}$?

For the novices like you who just begin to learn chemistry, this question can be easily explain by using Henderson Hasselbalch equation. Suppose you have an aqueous weak acid solution ($\ce{HA}$). It will be in ionic equilibrium as follows:
$$\ce{HA (aq) <=> H+ (aq) + A- (aq)} \tag1$$
Thus by definition:
$$K_\mathrm{a} = \frac{[\ce{H+}][\ce{A-}]}{[\ce{HA}]}\tag2$$
Take $-\log$ on both side of the equation $(2)$:
$$-\log K_\mathrm{a} = -\log \left(\frac{[\ce{H+}][\ce{A-}]}{[\ce{HA}]} \right) \ \Rightarrow \ -\log K_\mathrm{a} = -\log [\ce{H+}] - \log\left(\frac{[\ce{A-}]}{[\ce{HA}]} \right)$$
$$\therefore \ \mathrm{pH} = \mathrm{p}K_\mathrm{a} + \log\left(\frac{[\ce{A-}]}{[\ce{HA}]} \right)\tag3$$
The equation $(3)$ is called Henderson Hasselbalch equation, which is valid for calculation of buffer solutions (e.g., a solution of a weak acid and its congugate base or a weak base and its congugate acid). By this equation, if you know the $\mathrm{p}K_\mathrm{a}$ of any weak acid $\ce{HA}$ and molar ratio $\frac{[\ce{A-}]}{[\ce{HA}]}$ of the solution where $[\ce{A-}]$ is the concentration of the weak acid's conjugate base, you can calculate the $\mathrm{pH}$ of the solution.
For example, suppose you have a buffer solution of acetic acid/sodium acetate mixture in $1:1$ mole ratio (say $\pu{0.1 M}$). The $\mathrm{p}K_\mathrm{a}$ is given as $4.75$. What is the $\mathrm{pH}$ of the solution?
You can apply the values to the equation $(3)$: $\mathrm{pH} = 4.75 + \log \left(\frac{\pu{0.1 M}}{\pu{0.1 M}}\right) = 4.75$.
If the molar ratio is $1:2$ (say $\pu{0.1 M}$ in acetate and say $\pu{0.2 M}$ in acetic acid), then $\mathrm{pH} = 4.75 + \log \left(\frac{\pu{0.1 M}}{\pu{0.2 M}}\right) = 4.75 - 0.301 = 4.45$. Thus, as long as if you keep $[\ce{A-}]: [\ce{HA}] \approx 1:1$,  $\mathrm{pH} \approx  \mathrm{p}K_\mathrm{a}$, because $\log 1 \rightarrow 0$ in the equation $(3)$.
In your example, $\mathrm{p}K_\mathrm{a1}$ of carbonic acid (which is a polyprotic acid) is $6.35$, thus $\mathrm{pH}$ of $1:1$ carbonic acid : bicarbonate solution is $6.35$. If you want it at exactly at $7.00$, the mole ratio should be:
$$7.00 = 6.35 + \log \left(\frac{[\ce{HCO3-}]}{[\ce{H2CO3}]}\right)  \ \Rightarrow  \ \left(\frac{[\ce{HCO3-}]}{[\ce{H2CO3}]}\right) = 10^{(7.00 - 6.35)} = 4.47$$
Answer: When the pH is equal to the pKa, you have high concentrations of both conjugate acid and conjugate base. You need the weak base to react with added acid, and the weak acid to react with added base to stabilize the pH.
When the pH is very different from the pKa, one of those two species will be at very very low concentration (there is an exponential relationship).
For a more quantitative explanation, see the other answers, which introduce the Henderson Hasselbalch relationship, and look up buffer capacity. The pKa of carbonic acid is 6.35, so it buffers better at pH 6 than at pH 7.
Answer: Buffers are made with weak acids or weak bases, that dissociate slower in water. In your example, carbonic acid is a weak acid written as $\ce{HA}$ and will dissociate into $\ce{A-}$ and $\ce{H+}$ when a strong base is poured into its solution. During this titration, the $\mathrm{pH}$ of the solution will increase steadily as $\ce{HA}$ dissociates, because:

Dissociation is forming $\ce{A-}$, which is a conjugate base and $\ce{HA}$ concentration is reducing; and

You are adding a base ($\ce{OH-}$) to the solution, and there is also $\ce{H+}$ being formed through the weak acid's dissociation. But it will react with the $\ce{OH-}$ to neutralize each other and the solution will be resisting a huge increase to $\mathrm{pH}$ but increasing steadily with the increase of $\ce{A-}$.

This will happen throughout the buffer region and in the middle of that region is the point where the amount of $\ce{HA}$ (original weak acid) becomes equal to the amount of $\ce{A-}$ (conjugate base). If you can get a weak acid or weak base in an environment with $\mathrm{pH}$ close to its $\mathrm{p}K_\mathrm{a}$, it is guaranteed you'll be within this buffer region since $\mathrm{p}K_\mathrm{a}$ is in the midpoint of that region.
Comment: > *that dissociate slower in water*

It is not about speed, but equilibrium. They dissociate just partially, regardless of speed.


Karate - Hangetsu (Seisan) - can one damage one's muscles through slow movements?

Question: I was practicing Hangestu this morning with a lot of focus and tension. Throughout the final move I kept the tension, with my muscles working against each other, and felt a definite pain within my biceps. I was wondering if anybody else had encountered this, and if it is possible to injure yourself by doing this. Is it beneficial to do Hangetsu with a lot of tension?
It's not a kata I have trained much in the past.
Comment: I heard that in Goju-ryu, a style of karate that emphasizes dynamic tension, many of the art's masters have died earlier than those in other styles which do not practice dynamic tension. This is just a rumor in so far as I can't substantiate it with hard evidence. I wish I had the data or the time to investigate it. It would make for a great paper.
Answer: If Hangetsu is really similar to the Seisan I know, it is indeed a kata traditionally performed with a lot of tension. Most of the tension should be in your core however, as if you were preparing to get punched and wanted to reduce the damage. While your arms should be tensed, they shouldn't be as tense as your abdominal muscles. One of the goal of seisan is to teach you to put your core into your blocks and punches. Combined with a good leg stance and proper weight shifting, you'll be able to generate a lot more power compared to simply using your arms to perform these movements.
What you describe in your question looks a lot like improper stretching to me, though. If you are performing the kata with heavy tension in your arms and legs, you're putting your muscles under constant strain. That kata is also done pretty slowly, too, with short bursts of speed and power where it's easy to put even more strain on your already tense muscles.
You seem to imply doing katas as part of your morning workout. Do you stretch beforehand? If so, do you give enough attention to your biceps? If they aren't warmed up properly, it's entirely possible that the pain you're feeling is due to the constant strain you're putting your unprepared muscles under. Ask your sensei (and maybe a certified trainer if you have a gym membership somewhere) for proper bicep stretching techniques and try to perform this kata while properly warmed up.
If the pain persists, try to talk your sensei into looking at your stance, posture, movements and technique carefully. You mention not having much experience with this kata, and this could be why you're feeling some pain, as it's not impossible that you're simply doing the movements slightly off. Correcting your technique might alleviate the strain on your muscles. I'd still suggest investigating proper stretching techniques, though. Usually can't go wrong with that anyways.
Comment: Starting with slow katas and gradually increasing speed is a good way to get into a rythm before training, but it doesn't stretch your muscles enough for the more demanding stuff. Keep up the good work, and be sure to check with your sensei and/or a doctor if the pain persists despite proper stretches!
Comment: Great bit of info regarding putting your core into the blocks & punches.
I used to train three times a week but now I only get an hour before spin class at the gym, so other than slow Heian/Pinan katas to warm up there is no stretching. I'll give that a try, thanks.


Does Find My Mac work if the disk gets erased?

Question: My MacBook Pro was stolen a couple of days ago and Find my Mac had been enabled on it. I have already locked the Mac with a passcode and a message as well as clicked on the play sound feature(on the find my iPhone app), but those actions are pending until the computer comes online. The Mac is on El Capitan and came with Mavericks. The admin user is password protected but I had not enabled FileVault which is the disk encryption feature, so the computer can be wiped by erasing the disk in Recovery. The computer doesn't need to connect to the internet to be erased but it does need an internet connection to reinstall the operating system after the wipe. My question is, if the computer is erased and then goes online, will Find my Mac still work and notify me when it does? Is it still asociated with my Apple ID after the wipe?
Comment: its part of iCloud - if your mac is erased, then the required iCloud info go to, phone Apple and tell them its been stolen, they will help.
Answer: As long as the thief does not manually clear the NVRAM in any way, or reconfigures iCloud with another account, the device can still be tracked when online.
see this answer


Thai national to Spain from UK

Question: My Thai girlfriend has a six month visa to visit the Uk and we would like to go on holiday to Spain for two weeks while she is here.Is this possible without too much expense and documentation required for visas etc.
Comment: She will need a Schengen visa.  It will be easiest if she applies at the consulate responsible for her place of residence, but she cannot apply more than 90 days (or three months, I do not remember the precise requirement) before she plans to enter Spain, so it will be easiest if you plan the Spain trip for the early part of her stay in the UK.
Comment: She has already arrived here last week,so we are looking at a holiday in possibly the middle of August. Would it be better to go in person to the Spanish consulate to ask or request an entry visa.
Comment: If she is already in the UK then you probably cannot go to Spain until *after*  three months have elapsed, because you likely have no reason to ask for an exception to the rule that she should apply in her place of residence.  Even then, for tourism, it is unlikely that the consulate would grant an exception in any case. But I do not know how strictly the Spanish observe that rule.  It may be worth it to you to try.  Finally, if your relationship is long-standing and "durable" then you may be able to apply for a visa under freedom of movement, in which case the restrictions are not applicable.
Comment: Thankyou. we will apply in person at the Spanish consulate
Comment: In general, consulates have only been taking in-person applications from EU family (freedom of movement) applicants, though again I don't know Spain's practices. If you've been together for a while, definitely start with that.  Most other applicants have to go through third-party processing firms. This could make it harder for you to get to talk with someone who knows anything.  Good luck, and please let us know what happens by posting an answer to your question.
Answer: The Embassy of Spain in London may not entertain a visa application as it requires it be done where she legally resides. You can try and, in advance, complete the application. While the expense is modest, it takes some effort to assemble the documentation: passport and previous visas, travel insurance, purpose of visit, flight and hotel reservations, and proof of means of subsistence. Before you do, you might enquire about the feasibility of applying through the consulate.
Consulate General of Spain in London
20 Draycott Place, London SW3 2RZ
Tel: 020 7589 8989
Fax: 020 7581 7888
firstname.lastname@example.com

Thai national to Spain from UK


How to access Docker web app from host OS?

Question: I've followed the tutorial on the docker.io website here:
http://docs.docker.io/en/latest/examples/python_web_app/
How would I access this app from a browser on my host OS?
Answer: The tutorial explains how this works:
<code>WEB_PORT=$(sudo docker port $WEB_WORKER 5000)
</code>

Look up the public-facing port which is NAT-ed. Find the private port used by the container and store it inside of the WEB_PORT variable.

<code># install curl if necessary, then ...
curl http://127.0.0.1:$WEB_PORT
  Hello world!
</code>

Access the web app using curl. If everything worked as planned you should see the line "Hello world!" inside of your console.

Inside the container the application is listening on port 5000. This is translated automatically to an external port number accessible outside of the container. This makes sense because it allows multiple copies of your application to coexist on the same machine, each mapping port 5000 to a uniquely accessible port number for each app instance.
The documentation on port redirection has more details.
Answer: Docker Remote API provides a way of accessing your Docker images and containers and performing many operations on them, through your Browser.
Here is the link for Docker API v1.6 Documentation
Hope it helps.
Comment: I want to access the web application itself not the Docker API. Thanks.


Error message, subscript out of range in vb6

Question: I hava a program that monitor a folder name it prog1 and a program that will render the file in database name it prog2. Everytime that a new file is being drag and drop to the monitored folder prog1 will get the filename and pass it to prog2 to render. There is no problem regarding drag/drop no matter how many files you drag/drop to a monitored folder. My problem is there is a pop up error when i try to copy and paste 5 files and above to a monitored folder saying that subscript out of range. Is theres a difference between drag/drop vs copy/paste regarding the time when its actually being copied to a monitored folder? Thanks for anyone who can help me.
Answer: Without seeing your code I'm only guessing here....
You have to make prog2 an array. You can't pass more than 1 string in the same variable without an array.


Can importing an .ics file be dangerous?

Question: Can there theoretically be any possible malicious code hidden in .ics files, which would steal your calendar data or something similar? For an example case, we'd be importing the .ics file into Google Calendar.
Answer: The real risk here would be the application importing the .ics file, the file in itself is harmless. Only if that application would improperly handle parts of the file content you would be at risk. With Google Calendar, I think those chances are very, very slim.
Answer: Yes.
If the application importing the ICUS file had a vulnerability that a malicious ICS file took advantage of that could open up various possibilities for code execution.  That's true for any application that reads data.
Answer: An .ics or .ical file absolutely can be harmful.  They can contain many calendar events containing weaponized links.  The result can be an annoying amount of appointment reminders containing links.  Be very careful with these files and how they are delivered.
Comment: Links inside an invite are not in scope of the question.


How to update a table column based on it's relation to another table?

Question: I have a table called "profiles". There was a column in this table called "user_id" which I have changed the name to "username" and the type from INT(11) to Varchar(255) . However the contents of this column are still numeric ids.
These ids correspond to another table called "users". That table has fields called "user_id" and "username". For each row on the "profiles" table I need to first check to see what the username field has for the id and do a look up on the users table to get the username that correcponds to that id and then update the profile table's username value for with the proper username.
Profiles table:
username | blah blah...
------------------------
1        | ...

Users table:
user_id | username
------------------------
1       | Joe

I need the value for the username field on the profiles table to be updated to "Joe".
I came up with this php script but it stops working after updating just 4 records for some reason:
    $sql = 'SELECT username FROM profiles';
    $query = mysql_query($sql);
    while($row = mysql_fetch_assoc($query)) {
        $id = $row['username'];
        $sql = 'SELECT username FROM users WHERE user_id = '. $id;
        $query = mysql_query($sql);
        while($row = mysql_fetch_assoc($query)) {
            $sql = "UPDATE profiles SET username = '".$row['username']."' WHERE username = $id";
            $query = mysql_query($sql);
            if(!$query) {
                echo 'error!';
            }
        }
    }

My script isn't all that efficient to begin with, although that's not that big an issue since the table has just 50k records. Anyway what would be a way to do this directly from mysql?
Comment: My question would be why you want to do this? You're moving from a well-structured normalised schema to something that is likely to be harder to work with and cause you problems.
Comment: @liquorvicar Yeah I decided not to. My intial reason was to select users based on username by having urls look like mysite.com/profile?user=Bob rather than having the id instead of Bob. But I didn't consider the fact that selecting by numeric id vs varchar content would be faster, id is forever unchanging, etc. So now instead I will so something like: mysite.com/profile?user=Bob&id=123, that way the name and id are both there but I am just selecting by id and having the name there for asthetic/usability reasons.
Answer: You are manipulating the $row variable inside the first loop. Obviously it does not work. Try giving the variable in inner loop a different name.
And not only that almost all the variables you are using, outside the first loop, you are using the same names inside the inner loop.
Also coming to db schema I would prefer ids to be foreign keys not usernames because querying using ids would be faster than with columns of type varchar.
One more suggestion is that there is no need to use
while($row = mysql_fetch_assoc($query))

because there would be only one row
Answer: As Napster said you're overwriting your $query, and $row variables. That should fix your immediate issue.
Additionally, a query inside of a while loop, inside of a while loop is absolutely terrible. No offense intended! We all have to start somewhere. But I would strongly look into how you can rewrite this with a JOIN just so you have something in your toolbelt for that next time.
Hope that helps!
Answer: I think relationship between your tables is wrong, you should have a foreign key in profiles table that links to user_id in the users table, then if you change something like Joe to Michael, its corresponding record in profiles table will be updated.
Profiles table:
user_id  | blah blah...
------------------------
1        | ...

Users table:
user_id | username
------------------------
1       | Joe

Answer: You can do this in one query
UPDATE profiles t1
    INNER JOIN users t2 ON t1.username=t2.user_id
SET t1.username=t2.username

Why you would want to do this is another question.


Ubuntu installer won't recognize NVMe SSD - Lenovo Yoga 720 15-IKB

Question: I'm trying to dual boot Ubuntu on my new Lenovo Yoga 720. I know that the OEM Windows installation was in RAID mode. It also had a bunch of bloatware. So I changed the storage controller to AHCI mode in the BIOS and clean installed Windows 10.
Now, whenever I try to install Ubuntu, the installer doesn't recognize the SSD. Initially, the installer wouldn't even start and I'd get a black screen. It turned out I needed a BIOS update. After updating the BIOS I get the installer screen but it always gets stuck on the searching for partitions screen or just before it. I've tried Ubuntu 16.04, 17.10, and 18.04, but no luck. I thought this might be an issue with a my USB stick, so I tried different ones from different brands but to no avail. I've tried different settings in the BIOS, but it didn't help either. Thinking that it might be a problem with the way my Windows installation set up the SSD partitions, I even tried zapping the Windows installation and install Ubuntu on a clean SSD but that didn't work either. I even tried installing Windows in both UEFI and Legacy modes but it made no difference.
I can boot Ubuntu from the USB stick in live mode. The Ubuntu file manager can see the SSD and its partitions. I can even browse the Windows files from there. However, when I try opening GParted it never opens. I get an indefinitely spinning cursor. I tried running the
sudo parted -l and sudo gdisk -l /dev/sda/ commands but terminal hangs up. Worse yet, new instances of the terminal don't open after it failing on the above mentioned commands.
I've tried browsing through various forums and trying different things but have had no success. I'm at my wits' end. Any help would be appreciated.
The laptop's specs are as follows.
Core i7 7700HQ
16 GB DDR4 RAM
512 GB NVMe SSD
BIOS version 2.03
Thank you very much.
Answer: Well, so not long after posting this question, I tried disabling "Intel Platform Trust Technology" option in the BIOS, and voilà, I was able to install Ubuntu 18.04.
That seems to have solved the problem.
Only problem now is to enable switchable graphics.
Thank you for reading.
I hope this can help someone else facing a similar issue.
Cheers!


Selecting point feature on Mouse click using ArcObjects?

Question: How do I select point feature on mouse click?
I can select polygon feature but I cannot select apoint feature.
ESRI.ArcGIS.Carto.IIdentify identifyLayer = (IIdentify)iLayer;
IArray array = identifyLayer.Identify(identifyPoint);

Answer: The first step is to convert your clicked point into map coordinates, on your event the X and Y are screen coordinates which need to be converted with IDisplayTransformation:
In your OnMouseDown event:
IPoint pQueryPoint = new PointClass();
pQueryPoint = gDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);

gDoc is of type IMxDocument. Then buffer the query point to a query geometry, this example is in pixels to map coordinates:
int PxTol = 6; // 6 pixels to select by
IPoint pNextPoint = gDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X + PxTol, arg.Y);
double pSrchDist = pNextPoint.X - pQueryPoint.X; // measure the distance between points PxTol apart
ITopologicalOperator pTopOp = (ITopologicalOperator)pQueryPoint;
IGeometry pSrchGeom = pTopOp.Buffer(pSrchDist);

If your feature class has a spatial reference other than the FocusMap you will need to project the points first before creating the buffer. Then setup a spatial filter:
ISpatialFilter pSF = new SpatialFilterClass();
pSF.Geometry = pSrchGeom;
pSF.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

Now search from the ILayer as IFeatureLayer to return a cursor:
IFeatureCursor pDestCur = (YourLayer as IFeatureLayer).FeatureClass.Search(pSF, true);
// recycling cursor, use non-recycling if you're going to modify any part of the feature

which you can iterate through:
IFeature pFeat = pDestCur.NextFeature();

do
{
    // do something with pFeat
    pFeat = pDestCur.NextFeature();
} while (pFeat != null);

Or you can select to get an ISelectionSet:
ISelectionSet pSelSet = (YourLayer as IFeatureLayer).FeatureClass.Select(
pSF,
esriSelectionType.esriSelectionTypeHybrid,
esriSelectionOption.esriSelectionOptionNormal,
YourWorkspace);

Comment: I could select point feature.. thank you very much..
Answer: You didn't post much code but I'm going to assume that identifyPoint is an IPoint in map coordinates.
IGeometry buffer = (identifyPoint as ITopologicalOperator).Buffer(1);
map.SelectByShape(buffer, null, true);

First you buffer the point you are using to search. The buffer will be in the units of the current geometry. So if I'm in UTM, the buffer would buffer 1 meter out. (doc)
Now I can take my current map and use select by shape. This will select anything within the buffer that is currently on the map. (doc)


"clear shopping cart" and "continue shopping" buttons are not coming in checkout page in magento 2.3

Question: I want to display "clear shopping cart" and "continue shopping" buttons on my checkout page. But i dont see configurations for the same.
i checked the /srv/public_html/vendor/magento/module-checkout/view/frontend/templates/cart/form.phtml and in this buttons are der . But i dont know how to configure them.
plz help
Answer: Their is 3 case
1 -> Go to view/frontend/templates/cart/form.phtml under which theme you used.
Then Check on that before clear shopping cart button
  if ($block->getViewModel()->isClearShoppingCartEnabled())

remove this condition . It Shows.

2-> If You used default luma theme Then Please remove above condition on form.phtml
3-> .cart-container .form-cart .actions.main .continue { display: none; }
you can overwrite this by display:block ,
for Continue Shopping
.cart-container .form-cart .actions.main .continue {display: block !important;}

For Clear Shopping Cart
.cart-container .form-cart .actions.main #empty_cart_button {display: block !imortant;

}
Comment: I think that the condition should stay in place and give a more flexibility to decide whether you want to display the continue URL or not, by customizing the functionality and add an admin configuration. Also, your PHP code line is from Magento 2.4.
Comment: Yes You are right . but if any problem to filter this (after enable clear shopping cart on admin configuration ) that is the solution to remove it .
Answer: First of all, these options are available in the cart page, so basically that's where you will find them (not the checkout page). Secondly, they are styled as links by default.
For the 'continue shopping' one I think you need to write some code to enable this functionality. If you check the method getContinueShoppingUrl() mentioned at line 52 of your printscreen, you will see the following:

The solution that I see, is to set the 'continue_shopping_url' property on the cart object by custom code (controlled by a custom admin configuration show/hide), probably via an observer, after adding products to cart. You will have to decide which is the URL to add (it can be anything from the homepage URL as in old versions of Magento, to the referrer URL or a custom setting).
However, if you don't intend to use the referrer and your continue shopping URL is a fixed one, I would probably go with a more permanent solution and change the behavior of this method via a plugin (but keeping the same idea that you can control by admin config whether you want to show it or not).
The checkout session property seen in my printscreen is used in vendor/magento/module-checkout/Controller/Cart.php getBackUrl() method called by the vendor/magento/module-checkout/Controller/Cart/Add.phpaction, where it handles the case where you should remain on the page you added the product to cart from (as per Magento configuration) so it has implicity the value of the referrer URL.


Email for newsletters changed without any notification

Question: I just found out that the email from which Stack Exchange newsletters are sent were changed without any notice. This is a nuisance for those of us who have email filter setup by the sender. I am getting a ton of newsletters in right in my inbox. It would be nice if you revert the change, or at least send an email letting users know.
Answer: Apologies for the lack of communication around this change. It was intended to be transparent, but we didn't consider the sender address when making the change. In addition we didn't expect our users to be very appreciative of an unsolicited email (we have upwards of 300k users subscribed to a newsletter). In retrospect maybe a post on meta.SE would have been appropriate here.
I'm afraid it's not going to be reverted though, we can't send from the stackoverflow.com / stackexchange.com domains for a variety of reasons. If it's a big problem to update your filters you can unsubscribe from all or manage the newsletters you're subscribed to in the newsletter management screen.
Comment: I am not sure why this is downvoted. One of the newsletters ended up in my spam bin by accident. Does this not belong here? I was directed here from the "feedback" link from the newsletter. Who's going to send feedback if you are going to downvoted like this? Any comments?
Comment: @wbkang And why are you asking Dean if he knows about the downvotes? Only the downvoters know why they downvoted you. And whinning about downvotes: not cool.
Comment: @yivi How did I "whine?" Did you read what I said at all? I posted here because the "feedback" link on the newsletter directed me here to post a question instead. I think there is a problem when the only method of "feedback" submission gets you random downvotes.


How do I install Ruby on Mac Leopard?

Question: Can anyone please give directions on how to install ruby 1.9 I tried installation directions given all over the web. Can't get it to work. Please kindly give step by step direction. I tried using macports but everytime I type in ruby -v it gives me 1.8.6.
Comment: Found the answer, anyone interested please see this link: http://stackoverflow.com/questions/3243088/
Answer: rvm is easiest way to manage your ruby installation on OSX.
If you are using rvm, you will able to install 1.9.1, 1.9.2, jruby, ree by typing rvm install 1.9.1
type rvm default to reset your ruby version back to 1.8.6
How to install rvm
sudo gem install rvm -s http://gemcutter.org/

rvm-install

rvm install 1.9.1

rvm use 1.9.1

ruby -v  # show ruby 1.9.1 version

rvm default

ruby -v  # show ruby 1.8.6 version

cheers
Comment: Hi Bry4n,

Tried but encounter a block, please help:

http://stackoverflow.com/questions/3209269/about-ruby-version-manager-installation
Comment: It appears the installation instructions above may be outdated; For latest RVM installation instructions see: https://rvm.beginrescueend.com/rvm/install/
Comment: ~/.rvm/bin/rvm-installer ; you will probably have to add rvm to path yourself
Answer: Install Homebrew.
brew install ruby installs the current stable version of ruby.
Comment: @macek, make sure /usr/local/bin or where ever you chose to install Homebrew is in your PATH
Comment: this installs 1.9.2 (current version) for me but `ruby -v` still shows 1.8.7. How do I make Homebrew's version my "default"?
Answer: Use Ruby Version Manager. It will allow you to install most versions of Ruby and help you manage gems across them.
Answer: Ok this is how I remember doing it

Install Macports
Type sudo port install ruby19
Make sure that /opt/local/bin is in your path. If not add it.
Now to use ruby1.9 you type ruby1.9 example.rb

Also additionally if you dont want to use ruby command to use the default version. You can create a simple symlink in which make the ruby at /usr/bin/ruby point to /opt/local/bin/ruby1.9.
That way your ruby version will be 1.9. However I dont recommend doing that. As there are certain gems, that might not work with 1.9, which might be affected
Comment: can you please give direction on how to make sure that /opt/local/bin is in your path.
Comment: fire up the terminsal and type `echo $PATH`, if you see /opt/local/bin there you are fine.To ad it to your PATH this article will help `http://hayne.net/MacDev/Notes/unixFAQ.html#executionPath`
Answer: Not sure if you ever solved this.  But it sounds like 1 of 2 problems:
1.  You installed the wrong ruby with MacPorts
if you just ran  port install ruby, then you installed the old version, which explains why ruby -v still shows 1.8.6.
If you ran port install ruby19, then you installed ruby 1.9, but under the name ruby19.  To access it, you'd have to type ruby19 in place of ruby...so ruby19 script/generate, ruby19 -v...etc.
To fix that you can do port install ruby19+nosuffix
2.  you still have your PATH set to the old Ruby, which is why you're getting 1.8.6 on ruby -v.
First you gotta figure out where OSX is looking for your ruby by typing which ruby.  If you're using MacPorts, that command should return /opt/local/bin/ruby.  If which ruby returns /usr/bin/ruby, then it's still finding the default ruby that comes with OSX, which is 1.8.6.
To change your PATH, go open up .bash_profile, located in your user folder (if you have textmate, you can do mate ~/.bash_profile).  Add in this line and save:
echo PATH="/opt/local/bin:/opt/bin:$PATH"
Basically you add the MacPorts ruby into your PATH, so the system looks for ruby in the /opt folder too.  Also, maybe more importantly, you put the MacPorts path in front of the default PATH, so it will find that one first.
Goodluck with that.  Personally though, I vote for Homebrew.  You can find my setup for that at my blog.
Comment: Hi FunkyMunky,

Great Blog, ran into a block, not sure if I messed up my system files already, but this is the error I get:

kapplej-4:homebrew Home$ curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   121    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0tar: homebrew: Cannot chdir: No such file or directory
tar: Error is not recoverable: exiting now
Comment: 22  283k   22 66374    0     0   182k      0  0:00:01 --:--:--  0:00:01  182k
curl: (23) Failed writing body
kapplej-4:homebrew Home$
Comment: Hey Ken.  Not entirely sure what your error is, but the instructions on that blog are a little outdated now.  For updated instructions go to the [website](http://github.com/mxcl/homebrew).  I'd recommend running the script under 'Quick Install to /usr/local' unless you know what you're doing.
Answer: On my MacBook Pro I just did a good old compile and install.  Download the 1.9.1 source from the Ruby web site (www.ruby-lang.org) and then compile.  It'll install to /usr/local/bin so you will not corrupt the 1.8 if you wanted to revert back.
I never used the ports myself, but I know a lot that have/do.  http://hivelogic.com/articles/ruby-rails-leopard  is a good online guide for people not familiar with compiling and installing from source code.
Answer: Just had to do this on a factory-fresh Mac last night, and it's gotten slightly more complicated recently. GCC is no longer directly supported by Apple, as they prefer Clang, and Xcode 4.3+ requires the command line tools to be installed separately before you can access Clang from the terminal. So here goes!
1.) Install XCode.(it's free!)
2.) Install RVM. Go to a terminal window and enter:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

3a.) If you've installed XCode before 4.3, skip this step. Go to Xcode>Preferences>Downloads tab and install the XCode command Line Tools. This will let you access clang from Terminal.
3.)Open up terminal and enter:
rvm install 1.9.3 --with-gcc=clang

this will install ruby 1.9.3 in OSX
Answer: You can use the one-click-installer :
http://rubyosx.rubyforge.org/
Answer:
Install MacPorts
Type port install ruby19
Comment: I get the following error:

kapplej-4:~ Home$ port install ruby19
Warning: MacPorts running without privileges. You may be unable to complete certain actions (e.g. install).
--->  Computing dependencies for ruby19
--->  Dependencies to be installed: libiconv gperf ncurses ncursesw openssl zlib readline
--->  Installing gperf @3.0.4_0
Error: Target org.macports.install returned: MacPorts requires root privileges for this action
Error: The following dependencies failed to build: libiconv gperf ncurses ncursesw openssl zlib readline
Comment: Error: Status 1 encountered during processing.
To report a bug, see
kapplej-4:~ Home$ ruby-v
-bash: ruby-v: command not found

How do I install Ruby on Mac Leopard?


Building RF power meter

Question: I want to build power meter for wifi signals. One way to do it is to use a diode to rectify AC signal and amplify that before measuring. But are there diodes which work at such high frequency? Also, are there other methods?
Comment: You may have to think about this a little farther. Do you want to detect only WIFI signals or just general signals at 2.4GHz?
Comment: Before start reinventing the cart wheel you might want to take a look at these [wifi power meter smartphone](https://www.google.com/webhp?sourceid=chrome-instant&rlz=1C1_____enUS481US481&ion=1&espv=2&ie=UTF-8#q=wifi+power+meter+smartphone+)
Comment: @MahendraGunawardena Those apps are useless for detecting interference. WiFi uses the ISM bands so there will be many sources of non-wifi signals at the same frequency.
Answer: The basic approach is correct, but it won't be as easy as just slapping a diode there, for several reasons:

If you are receiving the signal with an antenna, the power level will be very small. A typical value might be -40dBm, which equals 0.1µW. In a 50 ohm load, this would be 2mV of voltage and 44µA of current.
Diodes have forward voltage ranging from 200mV up to 1V, depending on diode type. You'd need to bias it somehow to avoid your 2mV signal getting completely cut off.
Diodes have capacitance ranging from 1pF up to hundreds of pF. This capacitance will provide a path for the RF signal to get past your diode, no matter what polarity it is. So you won't get an exact cutoff but it will just conduct slightly better in one direction than the other.

So I suggest starting with a premade schematic which has these things thought out. Any such schematic would also indicate a suitable diode, for example this one uses MBD301:

(Image from http://www.qsl.net/n9zia/wireless/appendixF.html#10)
The MBD301 used there has a 15ps charge carrier lifetime, so in theory you could claim it can switch up to 66 GHz. But as I've explained above, for RF signals it is not so clear-cut. Therefore most datasheets won't give a figure for maximum switching frequency, as it depends on application.

Building RF power meter


My Nvidia 540m graphics card stopped responding error

Question: I got a problem with my Nvidia 540m 2gb graphics card. Whenever i play any game, (after a while) my laptop freezes and the game exits with a notification that "Nvidia graphics kernel sttoped responding and has been recovered" . I tried - formating my computer and reinstalling windows, tdrdelay method, installing lestest graphics driver, changing rams, high performance mode, through cleaning of inside of my laptop but nothing seems to be working. Also i have noticed that when I play games DISABILING my Nvidia graphics card (my laptop has dual gpu ie on intel hd graphics 3000 2gb) it works without any errors or freezing. I have Dell XPS L502X laptop. Can anyone please advise me what should I do to cure this error.
Answer: It sounds like you've done most forms of diagnostics. If the issue is persisting beyond a clean installation and latest driver installation, this points more towards a hardware issue of some form. If you can remember a point where the device worked without a problem, it may be worth using an older driver just to completely eliminate a software cause.
It's worth keeping an eye on the temperature of the GPU with some form of monitoring software (The first that comes to mind is GPUTemp) to see if there's a link between the temperature and when it crashes.
If there is a link and the temperatures are getting particularly high, I realise you have said you've cleaned it but it may be worth opening the machine and making sure air can flow properly. The heatsinks may need clearing, then fan may need replacing. I've also seen cases where heatpipes have failed and don't transfer heat correctly, and replacing the block with the heatpipes can resolve overheating issues. Finally, it could be a bad contact with the GPU itself, and replacing the thermal pad may be beneficial.
If temperature isn't the issue, it's likely the GPU itself is failing. Depending on the laptop, this may be replaceable, but looking at this thread gives a fairly swift indication that this isn't possible. As such, you could find out from Dell what it would cost to repair this, if the machine is outside of it's warranty period.
Comment: I have throughly cleaned my laptop (every possible dust collecting component) but the problem still presist. But my laptop does heats up during heavy gaming. Thx Jonno for your interest in my question.
Comment: @KartikPillai It's worth monitoring the temps so you can see if it is raising particularly quickly. Realistically I'd expect it to attempt to throttle performance before it actually crashed. I think you may be looking at the beginnings of a faulty GPU.
Comment: I've even tried installing old driver which I got with my Dell driver DVD. But same
Comment: Ok i will monitor my gpu temperature and inform u soon
Comment: I used gputemp to find out at what temperature my game crashes and I found out that it occurs when the gpu (Nvidia) temperature goes up to somewhere above 80°C (as 80°C is gputemp's max temperature i cant say the accurate temperature)
Comment: Hey,  I just found out that when I unplugg my charger (During the crash *audio repeating phase of crash*)of my laptop it recovers from the crash! Also when I play on battery it doesn't crash. Is my charger here faulty?


Index of a particular subfactor

Question: If a compact group $G$ acts on vN algebra factor $M\subset B(L^{2}(M))$, what would be the index of subfactor $[M^{G}:M]$? KIndly explain the answer.
Comment: Are you asking if it could be infinite? This is indeed the case: consider the very first example (which led to Vaughan Jones' results), the product type action of SU(2) on the $2^{\infty}$ UHF C*-algebra, extended to the action on the hyperfinite factor. If the group is connected and the action is nontrivial, presumably the index is always infinite.
Comment: Dear Desperate mathematician, it would be useful if you could explain what are the things that you've already studied and understood, that go in the direction of the question asked. For example, do you understand the case when $G$ is $\mathbb Z/2 \mathbb Z$? If yes, do you understand the case when $G$ is finite... etc.
Comment: No, I do not understand in any case. The definition of index to me is the dimension of $L^{2}(M)$ over $M^{G}$ module.
Answer: Case $G=\mathbb Z/2$, generated by $g\in G$:
In that case, the action of $G$ on $M$ induces a grading $M=M_0 \oplus M_1$ where $M_0=M^G=\{m\in M: gm=m\}$ and $M_1=\{m\in M: gm=-m\}$.
Similarly, the action of $G$ on $L^2M$ induces a grading $L^2M=(L^2M)_0\oplus (L^2M)_1$. The subspace $(L^2M)_0$ is isomorphic to $L^2(M^G)$.
And both $(L^2M)_0$ and $(L^2M)_1$ are isomorphic as $M^G$-modules.
So
$$
\dim_{M^G}(L^2M) = \dim_{M^G}(L^2M)_0 + \dim_{M^G}(L^2M)_1 = 2\cdot \dim_{M^G}(L^2(M^G))=2.
$$

Index of a particular subfactor


Technical difference between a stand alone app vs web app

Question: I am reframing my previous question, this question was asked by my senior engineer, who wasnt convinced with my answer. Q: What is the technical difference between designing a 'web hosted application' and a 'downloadable stand alone application' eg. wrt HTTP layer coding etc.
Comment: @JBNizet: There are significant differences.  Web applications have architectural constraints given by web standards, whereas stand-alone apps have enormous freedom to select an architecture.
Comment: There is none. Both designs need a good understanding of what needs to be done and what the technical constraints are. Your question is really much too vague to have a good answer.
Answer: Broadly speaking, web hosted applications rely on the following architectural features:
Web Application

The UI is rendered on a client machine, using a specialized client (a.k.a. web browser)
The UI capabilities on the client machine are limited to what the web browser (including plugins) supports.  The programmer generally has no ability to implement arbitrary functionality on the client, but rather must work within the capabilities supported by the client.
Business logic and data storage are not on the client machine (generally speaking, there can be limited exceptions).  Rather, one or more servers take those architectural roles.
Communication between the client and server occurs using a standardized network communication protocol (HTTP).

Stand Alone Application

There are a vast number of different architectures for stand-alone applications.  Some can be quite similar to a web hosted application; others are quite different.
The programmer has full control (within the capabilities of the operating system and with support of a broad selection of UI frameworks) over the user interface.
The business logic layer and data layer may reside on the same machine or on a remote server.
If one or more remote servers are involved in the solution, many different remote communication protocols can be selected from.  There's no requirement to use HTTP over TCP/IP (and in fact, more efficient protocols are often selected).
Comment: I know this post was old. But I have a question.
Comment: @ArchieZineg: If you have a question, please ask it as a new question.  Feel free to link to your new question from the comments here.
Comment: http://stackoverflow.com/questions/28259750/web-based-system-security
Answer: Standalone app uses your resources, web app executes on the server, rendering is done on your system.
Answer: Standalone application that runs locally on your computer.
Ex: notepad, wordpad, paint...
Web application that can't run without webbrowser.....also run on webservers where the web application is hosted.
Connect to web application by:
Launching your browser.....
enter URL to the web application...
after entering URL web application loads in ur browser.....
EX: Yahoo mail,
Hot mail.......
Answer: Architecturally speaking, there is a world of different.  'Downloadable stone alone app' run purely on client side, and traditional 3-tier web app run small parts on user's browser (fancy javascript) and large part on the web/app and DB servers.
Also, downloadable apps are platform dependent.  Unless you write it in Adobe AIR or Flash, chances are you'll have to write once for Windows, Linux, then Mac.
Answer: This takes a small bit of history...
Microsoft originally tried to modify java, which is not allowed when you agree to the agreement in the installation process. MS paid a token $1 million fine and stop cooperating with Java.
The java plug-in must have been previously installed, and...

we have java applications, which run like computer programs because we add them to the hard drive.
we have web pages with java applets added as a page element, the browser is capable of running java.
we have java Web Start, that downloads the application from a distant server, checks the user has the Java Runtime, offers to install that runtime, and then runs the downloaded application.

Web application have merit in that the programmer can maintain the updates. But, people also like the feeling of owning their software, like recorded music.
Comment: There are lots of programs that are not written in Java.
Answer: A standalone license comes with a hardware security key. The software can be installed on any computer running Windows but only on the computer where the security key is inserted you can work with the software. If you want to work with the software on another computer, you just need to attach the key to this computer.
Comment: That is seldom true.  Very few applications use a hardware key, and many standalone programs are completely free to use.
Answer: the standalone applications are the applications that can run only on the one system on which it is being installed.

the application which being developed using c and c++ are the standalone application because do not form platform independency


looping function call with commit

Question: I have a plpgsql function which updates table data. I want to call this function within a loop passing the looping variable as an argument, and commit after each function call.
I tried to make another plpgsql function, but I figured out that i can't do commit in a function unlike oracle procedure.
Is there a way to do this in a regular sql editor or psql?
Answer: Well, you can, but you have to use the dblink-extension to make an external connection to your database. A lot of overhead, will be slower, but it works. Maybe this will do for your situation.

looping function call with commit


Is there a limit to the height to which a helium balloon can rise?

Question: My professor's answer to this is "It will rise until the weight of air displaced equals the mass of the balloon". I am a bit confused by this. Wouldn't it depend on densities rather than weights and masses? I thought it will keep rising till the density of air is the same as helium. Can anyone point out where I am wrong?
Comment: You are correct in only if the weight of the balloon material is negligible.
Answer: You are correct that the balloon will keep rising until the density of the air equals the density of the helium in the balloon. But since $W=\rho g V$ the weight $W$ of the volume $V$ of air displaced by the equal volume of helium will also be the same as the weight of the helium (neglecting the weight of the balloon material) when the densities $\rho$ are equal .
Hope this helps.
Comment: Actually, the balloon will rise until it pops: as the surrounding pressure decreases, the balloon expands, displacing even more volume and thus lowering the loss of buoyancy. At some point the material will just break down due to excessive expansion.
Comment: @Ruslan Perhaps so, but some can go pretty high before bursting. High enough for the FAA to be concerned enough about the potential danger toy balloons can pose for air traffic that they conducted the following study:
https://www.balloonhq.com/faq/deco_releases/blnstudy.html
In any event, the topic of the OP is buoyancy, not the strength of balloons.
Answer: Per Archimedes' principle, a body immersed in a fluid has a buoyant force equal to the weight of the fluid it displaces. As air density changes for various reasons, its weight per volume also changes. The helium's density may also change for various reasons. The balloon's volume may expand or contract with changing conditions. All of these things may change at different altitudes, temperatures, or other reasons, but Archimedes' principle will hold true in any set of conditions. If the total weight of the balloon and its contents are less than the weight of the volume of air it displaces it will still rise. By the way it would be more accurate for your professor to say "weight" of the balloon, rather than "mass" of the balloon, as weight can change slightly with altitude in Earth's non uniform gravitational field but an object's mass does not change.


Can I install Android on my Samsung Omnia W8350 - windows 7 phone?

Question: I have a samsung omnia w 8350 with windows 7.5, I want to install Android OS on the phone, can anyone help?
Comment: See this question for more info on installing Android on non-Android devices, with links to some known installs and projects, including for an older Omnia: [Can I install Android on my non-Android device?](http://android.stackexchange.com/questions/6849/)
Answer: Doubtful. A Google search suggests that even getting custom Windows 7.5 firmware installed is difficult, let alone a wholly different OS. In theory it should be possible, but I think you'd be better off getting an Android phone instead of waiting.
From XDA:

So far, we haven't even gotten custom WP7 ROMs to run on the Omnia W. In fact, we don't even have a flashing tool to replace the stock ROMs with.
Answer: I only know of one Windows phone that got Android on it (HTC Photon) and it was because the hardware was basically identical to an Android-based phone (HTC Legend) that was put out by the same company, it was a simple port.
The reality is that the phones hardware likely doesn't have proper Android support. This could require writing drivers from scratch and creating many interface layers (like interacting with the camera). Many times this is extremely difficult even if the phone does run Android due to the code being closed source. In fact, many times manufacturers will change the drivers to interact with the OS differently than Vanilla Android, so just trying to get a custom ROM working on the device can be a nightmare. This is why many devices aren't supported with 3rd-party ROMs like CyanogenMod or AOKP. The developers just can't reverse engineer things to work properly.
So, it wouldn't be as simple as installing Android, because you would have to fully port Android over to the device and be a highly skilled programmer to do so. It would most likely require a lot of reverse engineering and debugging just so their custom drivers would work. Simply put, it just isn't worth any developers time to try and attempt this. Their time would be far better spent starting with a device that already has Android running.
And even if they were to get some basic support, you would likely have many functions of the "smartphone" not working, such as GPS or wifi. Your money (and sanity) would be much better spent with getting a device that runs the OS you want.


General description of surface with zero gaussian curvature

Question: Let suppose function $g(s,t)$ satisfies partial differential equations:
$g_{ss} g_{tt} - g_{st}^2=0$. It may be treated as the surface has zero gaussian curvature. I am searching for general solution of this equation locally. Are there any results for it?
Answer: A surface of Gaussian curvature zero is locally isometric to the plane, and is said to be developable. A complete surface of Gaussian curvature zero in Euclidean three space is a cylinder (where a cylinder means the surface generated by the lines parallel to a given axis passing through a fixed curve in the subspace perpendicular to the axis; the plane is a cylinder in this sense when the curve is itself a line). This is due to Pogorelov, although it is usually attributed to Hartman-Nirenberg (they attribute it to Pogorelov). It can be found proved as Theorem 1 in W. Massey's Surfaces of Gaussian curvature zero in Euclidean $3$-space or in part II of Hartman and Nirenberg's On spherical image maps whose Jacobians do not change sign (Hartman and Nirenberg prove a more general result, for hypersurfaces in Euclidean space of arbitrary dimension). The papers of Massey and Hartman-Nirenberg contain more detailed results applicable to the incomplete case. Corollaries $3$ and $3^{\prime}$ of Hartman-Nirenberg show that every point of a $C^{2}$ surface of Gauss curvature zero has a neighborhood which admits a parameterization of the form $x = a(u)v + b(u)$ where $(u, v)$ varies over some simply-connected plane domain and $a$ and $b$ take values in $\mathbb{R}^{3}$. (see also chapter IX of the English translation Extrinsic Geometry of Convex Surfaces of a book of Pogorelov.)
Comment: @user12355: I added some remarks to the answer to address the local case.
Comment: Thanks. Well, I know this paper. Actually I'm looking for solution locally. I can reduce this equation to first order equation $g_s = h(g_t)$ and then using technique of solving first-order PDES, write in parametric form general solution. But it is rather huge and cumbersome...
Comment: Thanks. The parametrization is very useful for me. But actually functions $a(u)$ and $b(u)$ cannot be arbitrary. Right?
Answer: I think this article might be helpful (see section 3, http://arxiv.org/pdf/1402.4751v2.pdf), also see this one (http://arxiv.org/abs/1205.7018).
Let me explain you very briefly what is happening there.
Let us use the following notations: $g(x,y)=B(x,y)$  and $B$ satisfies $B_{11}B_{22}-B_{12}^{2}=0$.
Take some  suitable space curve $\gamma(t) = (f_{1}(t),f_{2}(t),f_{3}(t)) :I\to \mathbb{R}^{3}$ and lets require that $B(f_{1}(t),f_{2}(t))=f_{3}(t)$ (this is boundary condition for your function $B(x,y)$ ---  this means that we are assuming that there is a domain $\Omega \subset \mathbb{R}^{2}$ where the function $B$ is given and $B$ has prescribed boundary data on $\partial \Omega$. By the way, in this case $(f_{1}(t),f_{2}(t))$ parametrizes $\partial \Omega$ and $f_{3}$ is your boundary data for $B$).
Then this already gives you one equation after differentiating $B(f_{1}(t),f_{2}(t))=f_{3}(t)$ in variable $t$:
$$
B_{1}f'_{1}+B_{2}f'_{2}=f'_{3}
$$
where $f'_{j}=\frac{df_{j}}{dt}$.
This information is nothing unless you use the fact that $B$ satisfies homogeneous Monge--Ampere equation  (i.e., the fact that it has zero Gaussian curvature).
It means (thanks to Pogorelov) that you can draw some family of line segments close to the boundary $\Omega$ which start from the curve $(f_{1}(t),f_{2}(t))$ and go inside the $\Omega$. Moreover the function $B$ is linear along these segments and the gradient of $B$ is constant along these segments. The typical picture of these family of segments is given here (see the picture below)

This picture close to the boundary of $\Omega$ is true if the  things are not degenerate (i.e., torsion of $\gamma$ does not vanish on any subinterval $I$) then the domains, where $B$ is linear, cannot touch $\partial\Omega$ on a thick interval. however they can touch $\partial \Omega$ at some finite number of points (or countable number of points if the torsion of $\gamma$ changes sign infinitely many times).
In other words this means that the gradient of $B$ in $\Omega$ you can parametrize by one parameter $s$ i.e., $\nabla B = (t_{1}(s),t_{2}(s))$ where $s \in I$
So our equation $B_{1}f'_{1}+B_{2}f'_{2}=f'_{3}$ can be rewritten as follows
$$
t_{1}(s)f'_{1}(s)+t_{2}(s)f'_{2}(s)=f'_{3}(s).
$$
Of course this information is not enough to find $(t_{1}(s),t_{2}(s))$. But there is one more equation which you can also obtain, namely:
$$
t_{1}'(s)\cos(\alpha(s))+t'_{2}(s)\sin(\alpha(s))=0,
$$
where $(\cos(\alpha(s)),\sin(\alpha(s)))$ is the direction of the line segment starting at point $(f_{1}(s),f_{2}(s))$ i.e., unit vector, starting at point $(f_{1}(s),f_{2}(s))$ and  going inside $\Omega$ along the line segment, along which $B$ is linear.
These two equations
$$
t_{1}(s)f'_{1}(s)+t_{2}(s)f'_{2}(s)=f'_{3}(s);\\
t_{1}'(s)\cos(\alpha(s))+t'_{2}(s)\sin(\alpha(s))=0,
$$
allow you to find $(t_{1}(s),t_{2}(s))$ up to a constant $C$ which you still have to choose later in order to glue these local  pieces and to get some global picture for $B$. Thus you find $B$
$$
B(x,y)=f_{3}(s)+t_{1}(s)(x-f_{1}(s))+t_{2}(s)(y-f_{2}(s)) \quad(*),
$$
where $(x,y)$ belongs to the line segment starting at point $(f_{1}(s),f_{2}(s))$.
For example if $\gamma(t)=(t,g(t),f(t))$ then
$$
t_{2}(s)=C\exp\left(-\int_{s_{1}}^{s}\frac{g''(r)}{K(r)}\cos(\alpha(r))dr \right)+\frac{f''(r)}{g''(r)}-\int_{s_{1}}^{s}\left[ \frac{f''(y)}{g''(y)}\right]'\exp\left(-\int_{y}^{s}\frac{g''(r)}{K(r)}\cos(\alpha(r))dr \right)dy
$$
where $K(s)=g'(s)\cos(\alpha(s))-\sin \alpha(s)$, and you can also notice that the expression $\left[ \frac{f''(y)}{g''(y)}\right]'$ coincides up to a curvature factor of $\gamma$  with the torsion of $\gamma$ which further plays a crucial role.
By the way the equation $t_{1}'(s)\cos(\alpha(s))+t'_{2}(s)\sin(\alpha(s))$ also can be obtained by differentiating (*) with respect to $x$ and treating $s$ as a function of $s(x,y)$.
Now there are lot of questions left:

How do you find these family of segments (or it is the same as to ask how do you find directions $(\cos(\alpha(s)),\sin(\alpha(s)))$).
How do you glue a global picture?
Under what conditions this ``roughly speaking'' is justified?

Some partial answers are given in the articles that I mentioned above.