Why can we add counterterms?

Question: I'm having a hard time understanding why renormalized perturbation theory works. Why is it permissible to add counterterms to the Lagrangian? Terms which are often divergent themselves and carry unphysical parameters. How is the Lagrangian still well-defined after renormalization?
Comment: related: https://physics.stackexchange.com/q/298963/
Comment: Possible duplicates: https://physics.stackexchange.com/q/262284/2451 , https://physics.stackexchange.com/q/2596/2451  and links therein.
Comment: The Lagrangian is not "still well-defined", but becomes "better defined" due to subtracting wrong parts from the originally wrong Lagrangian. Briefly, in order to obtain the right solution from a wrong one, you just subtract the wrong part and leave the right one. This is the only right renormalization understanding.
Comment: Does this answer your question? [Why Does Renormalized Perturbation Theory Work?](https://physics.stackexchange.com/questions/262284/why-does-renormalized-perturbation-theory-work)
Comment: You must regularise any QFT, otherwise it's mathematically nonsense (divergent). For any given (reasonable) regularisation of the theory, there's a curve in (cut-off,coupling) space, i.e. $(\Lambda, e_i)(t)$, along which the theory is equivalent. Actually there's a curve passing through any point you start at. Those curves define the so-called 'renormalisation group flow'. The altered couplings are called the 'renormalised couplings', and the change to the cutoff scale is realised by adding something to the action-- the counterterm.
Answer: We can never "add counterterms" to a Lagrangian. The Lagrangian is just the Lagrangian; if you change it by adding terms, then you've got a different theory. There's a similar issue when textbooks talk about "adding" a term for "gauge fixing", which is equally nonsensical. Such language only exists because of historical confusion.
It all much sense in the framework of Wilsonian renormalization, in which every theory has a cutoff scale. Suppose a theory is described by a Lagrangian $\mathcal{L}_{\text{fund}}$ at a high cutoff scale $\Lambda$. Then it is equivalent to some theory with an effective Lagrangian $\mathcal{L}_{\text{eff}}$ at low cutoff scale $\mu$, and we define
$$\mathcal{L}_{\text{fund}} = \mathcal{L}_{\text{eff}} + \Delta \mathcal{L}.$$
Now, since the cutoff scale $\mu$ is low, quantum corrections in the effective theory are not as important. In particular, the full results in the effective theory can be roughly extracted by working at tree level.
This is the modern approach to the subject, but historically the logic went almost completely backwards. First, people computed only at tree level, and found they could fit physical observations using $\mathcal{L}_{\text{eff}}$. Then they tried to compute loop corrections with an infinite cutoff. If one does this with $\mathcal{L}_{\text{eff}}$, then one gets completely incorrect results, so textbooks speak of "adding the counterterm" $\Delta \mathcal{L}$. This is conceptually wrong because, if we wanted to work with a high cutoff, then we should have included $\Delta \mathcal{L}$ in the Lagrangian from the start. The way most textbooks phrase it, it looks like an ad hoc correction pasted on halfway through a calculation, but it really needs to be there the whole time. (For more detail about how the old textbook approach fits onto the modern approach, see here.)
Incidentally, the infinities are another red herring. In the modern view, we know that all cutoffs should be finite, in which case all predictions and parameters are finite. The trouble only occurs when one tries to take $\Lambda \to \infty$, which we have no reason to do. For example, textbooks will often tell you the QED coupling diverges at high energies, but it remains perturbative for any finite cutoff below the Planck scale.
Comment: @my2cts The path integral gives an unambiguous prescription for computing results: just integrate $e^{iS}$ over gauge inequivalent configurations, where $S$ doesn't contain any funny extra "gauge fixing" terms. It turns out that you can also write this in terms of a path integral over all configurations (i.e. counting gauge equivalent configurations multiple times), but then $S$ has to pick up extra terms to keep the result of the path integral the same.
Comment: @my2cts But this is always explained backwards. Instead, textbooks will say, "we integrate over all configurations, except this gives nonsensical results, so that means we need to change the action", which sounds completely ad hoc.
Comment: The (unregularised) path integral does not give an unambiguous prescription for computing results. There are different quantisations of the same classical theory, which are the different regularisations. The regularisation determines the symmetries of the theory, for example.
Comment: "There's a similar issue when textbooks talk about "adding" a term for "gauge fixing", which is equally nonsensical" Can you explain that in more detail ? How can the standard Lagrangian lead to quantisation without altering it ?
Answer: The counterterms are a prickly subject, I recently got used to it, this will be a good opportunity to explain it if I've understood it well.
Actually the counterterms are not added to the Lagrangian, they arise by splitting up the Lagrangian in its renormalized part and the rest , the counterterms.
Upon the computation of loop diagrams in perturbation theory many -- not all -- turn out to be infinite. The physicists understood in the meantime (from the first confrontation to this problem until today) that the important parameters (typically mass and coupling of the particle to its interactions) of a quantum field theory (QFT) which appear in the Lagrangian are not the same than the parameters they actually measure. This is actually not so difficult to understand, you probably heard that the electron when exposed to electromagnetic (EM) interaction changes its charge because it is surrounded by a cloud of virtual electron-positron pairs. So if measured from a large distance the charge of the electron is shielded by this cloud and is not the real electron charge which is usually called the bare charge of the electron or particle. The same happens with the mass of the electron: if the self-interaction of the electron's field is taken into account, its mass changes.
Everthing would be rather easy to understand if these parameter shifts due to interaction were finite, but unfortunately they are not. This observation is certainly related with the fact that we consider electrons as point-like particles. Doing the contrary usually also leads to contradictions, so in usual QFT electrons and other particles are considered as point-like.
As computations with infinities are senseless, the first step is to carry out a regularisation to make the corresponding expressions finite which allows us to keep on with the calculations. The final goal is of course to get rid of the infinite or potentially infinite == regularized expressions.
So in renormalized perturbation theory the following strategy is pursued: As we physicists know that infinite expressions appear in the loop computations, their appearence is already anticipated in the establishment of the Lagrangian. The bare parameters of the corresponding Lagrangian are assumed to be infinite and then split up in 2 parts: its renormalized part and the singular part, the latter corresponds to the counterterms.
Then the not yet fixed counterterms are considered as part of the interactive Lagrangian and included into the computation of the loop diagrams and finally adapted (i.e. fixed) in order to compensate the infinite expressions in the loop diagram evaluation. This is done meticulously order by order in perturbation theoy. In this way the resulting expression become finite and independent of the chosen regularisation.
I think, it is actually more intuitive to use bare perturbation theory where the anticipation of the splitting of the Lagrangian is not done and only at the very end of the computation after the regularisation the renormalized parameters are set in the expressions (with the final consequence that the dependence of the renormalized parameters and the bare parameters shows that by doing so the bare parameter will be infinite once the finite cutoff used for the regularisation is taken to infinite.).
But this latter procedure is technically more complicated in particular in perturbation theory of higher order and above all has the disadvantage that the perturbation series is developed in the bare coupling parameter which is supposed to be small but is actually not small at all. But renormalized perturbation theory where the development of the series is done in the renormalized coupling parameter has not this problem.
This post only sketches the strategy applied in regularisation and renormalisation in QFT, many details should be still said, I limit myself to the following:
One has to be used to the fact that the bare Lagrangian contains formally many "infinite" (after the regularisation cutoff is taken to infinite) expressions, however all the symmetries a Lagrangian has to comply are usually preserved, so the Lagrangian has still all the properties which are required from a Lagrangian. And one has to bear in mind that a Lagrangian and "its contents" cannot be measured. This is actually what is now called "effective field theory", it is not considered to be a fundamental theory, a fundamental theory should be completely finite, so not exposed to infinities. This fundamental theory is still to be found, and many physicists are hard working on it. That also explains the interest of the physics community in string theory which is a possible answer to this problem .. but there are still many open questions.
Comment: See the problem I have is that textbooks keep saying things like "The bare parameters are infinite" or "This or that cannot be measured" and these all seem like completely baseless statements. Why do the bare parameters have to be infinite? Can't we set them to whatever we wish? They're just numbers in the theory.

In general I've just found QFT to be very difficult and unintuitive compared to regular QM. Every derivation that I've read seems to hinge on some completely unobvious fact that is never explained.
Comment: We know that cross sections $\sigma$ are finite. In order to give sense to perturbation theory (PT) at some point in the renormalization procedure measured values have to included in the computation in order to make $\sigma$ finite. Consequently, as $e_{bare} = e_{bare}(e,\Lambda)$ $\Lambda$ being the cut-off, upon $\Lambda\rightarrow\infty$ $e_{bare}$ ends up to be infinite. One could take the point of view to throw away PT altogether. But using the  renormalization procedure the predictions of PT are getting better order by order. So it's probably not the best approach.
Answer: This point used to confuse me a lot. I think the following toy example may clear up much confusion.
Imagine a theory with only one coupling constant which I will call $g$. We think Wilsonian, where our theory has a finite cutoff at a scale $\Lambda$ way beyond whatever scale of interest we are discussing. We know that if we integrate out modes progressively, one $d\Lambda$ slice at a time, we generate a smooth flow in the space of couplings. Suppose the one-loop beta function is $$\Lambda \frac{dg}{d\Lambda} = - \frac{g^2}{2\pi}$$ Again, in principle this can be derived totally from the Wilsonian picture where we integrate out thin shells in momentum space and work iteratively: no infinities in, no infinities out. This describes an asymptotically free theory for which perturbation theory becomes uniformly valid in the high energy regime. We can integrate this equation to find $$g(\Lambda) = \frac{g(\mu)}{1 + \frac{g(\mu)}{2\pi} \ln(\Lambda/\mu)}$$ As we take $\Lambda \to \infty$, we have $g \to 0$, a totally well defined limit. Here, $g(\Lambda)$ is the bare coupling and $g(\mu)$ is the effective (renormalized) coupling at some scale $\mu$. This describes a totally smooth (and logarithmically slow) flow down to whatever the scale $\mu$ is. The numerical difference between $g(\Lambda)$ and $g(\mu)$ will not be too serious (that is, it will not be infinite) provided we stay within the regime of perturbation theory, that is, don't go to too low energy.
However, if we insist on doing everything in a power series in the renormalized coupling $g(\mu)$ (and this is the situation we consider in counterterms, where we expand the bare coupling as renormalized coupling plus perturbative corrections), we find $$g(\Lambda) = g(\mu) - \frac{g^2(\mu)}{2\pi} \ln(\Lambda/\mu) + \frac{g^3(\mu)}{4\pi^2} (\ln(\Lambda/\mu))^2 + ...$$
Even though the coupling has a totally regular $\Lambda \to \infty$ limit, there are "ultraviolet divergences" at each order of the expansion. The $g^2$ term neutralizes the one loop singularity which generated the flow in the first place, and the higher order terms are the leading logs from higher orders. The "divergences" in perturbation theory just come from a long RG flow, but disappear once we use the effective couplings, which is the general statement of universality (renormalizability). No couplings are truly singular (unless something drastic like a Landau pole happens), and renormalization is in this sense a small correction: after the bookkeeping, it just gives small logarithmic corrections to scaling. What makes it look like wizardry is using the perturbative technique without explaining the Wilsonian origin, but usually the perturbative technique is easier to calculate with.
Hope this helped.

Why can we add counterterms?


Do I need JTS Topology Suite if I use PostGIS?

Question: They seem to overlap in functionality, so if I only use PostGIS and Postgres SQL, do I miss anything important from JTS Topology Suite?
Answer: To expand on the answer given by tinlyx, you will not miss anything as PostGIS utilizes the GEOS library, which is a direct C++ port of JTS, for many of its spatial functions. In addition, PostGIS uses gdal under the hood and proj4, for transforming from one coordinate system to another. PostGIS also supports a raster datatype, so you can do raster/vector operations, very common in GIS, directly in SQL. There is also support for topology, growing support for 3D, Lidar point clouds, routing via pgRouting, and the list goes on... A full list of PostGIS functions should convince you fairly quickly that everything from JTS is covered.
You also gain the data management environment of Postgres, which is an extremely fully featured, MVCC, ACID compliant RMDBS, which also supports some NoSQL type features via JSONB (binary JSON) and hstore (a key/value extension), which is used by Open Street Map to store attributes.
TL;DR. No, not only will you not miss any functionality from JTS by adopting Postgres/PostGIS but you will also gain a lot of things — not least of which is the huge power that comes from being able to do advanced GIS type functionality in SQL, directly where the data resides. I say all of this as an ex Java developer, who used to use JTS extensively, but I now use Postgres/PostGIS for all my spatial work, as it scales much better.
Is there any particular JTS functionality that you are particularly concerned about -- it would make the answer more focussed, potentially.
Comment: @dnang, yes, as far as I know Hibernate Spatial is very good. I don't really do much dev work these days, I'm more of a data scientist/engineer, so maybe you should ask another question for views on ORBs :-). You will love Postgres/Postgis, though. Very impressive community, very stable, very powerful.
Comment: Thank you for the detailed answer. The project is just at the start so I don't have all the requirements yet. I just wanted to make sure we save the location data (GEOJson, generated from Leaflet GUI) in the right format for now and can work out the processing part later.
Comment: Now that PostGIS seems a much better choice, I will just look for a good Java library that can at least do some conversion and insert into the DB. [Hibernate Spatial](http://www.hibernatespatial.org/) ([newest version)](http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#spatial) looks very strong, if you have other suggestions please let me know.
Comment: Have a look at H2GIS http://www.h2gis.org/ as well.
Answer: I don't think you need JTS per se. PostGIS uses GEOS, a C++ port of the Java library JTS.
Comment: Link to GEOS https://trac.osgeo.org/geos/
Answer: No ...no need unless u want to do some thing in Java...Postgis itself has overlap functionality..
Comment: This is not a particularly imformative answer. It adds nothign to what @tinlyx has already stated.


What was the specific allegory of District 9?

Question: I realize, in general - apartheid, I get it. But was there anything more subtle that someone closer to the culture and politics in South Africa picked up that general audiences around the world would not?
Comment: I think that the film has some spectacularly funny scenes provided that you have a allowed your soul to atrophy.
Comment: @chris Lutz District 9 is funny, if you have a very black sense of humour.
Comment: Satire usually implies humor.
Comment: @Christi - Actually I _do_. Though I will admit the catfood bit was quite amusing.
Answer: I think the film may be making more of a general statement regarding the feelings of South Africa regarding issues with illegal immigration, first from Rhodesia and then from Zimbabwe, Mozambique, and Nigeria. As I understand it they have major issues with South Africans lashing out at the migrants in the form of riots. As a response to this a number of camps were established to "house" the migrants.
This story from the BBC website gives more specific details. The general description of the camps sounds disturbingly similar to the conditions of District 9. These events (riots and camps) occurred in 2008.
I'm not convinced the film is even really concerned with apartheid. It's concerned primarily with an external population coming in and creating a nuisance (as opposed to apartheid where an external population came in and totally rebuilt society).
I think the key point of the film is how do you deal with major humanitarian\xenotarian issues. If you a have a population that moves in and brings tens\hundreds of thousands of beings with no means to survive how do you assimilate that. What if the migrant population DOESN'T want to assimilate but retain their own cultural values in the face of an established society? Do you allow them to starve on the street? Do you evict them to a fate of certain death or torture. If there is no land willing to accept them do you march them into the sea? If your own population rejects their presence do you allow said "native" population to murder the migrants in the street?
I think the film (or at least the first half of the film) is really just trying to shock people into seeing the major issues associated with migrant populations\refuges.
Comment: If only this answer could be made required reading for anyone commenting on District 9 online. So tired of the assumption that "it's South Africa and bad things are happening, so it must be an allegory for apartheid herp derp." It's worth noting that (AFAIK) the script was already written and shooting was over by the time the actual 2008 riots erupted. So it was either right on top of current events or a bit prescient in its allegory about xenophobia, as opposed to commenting on the quarter-century-old Cold War politics that everyone's minds seem to jump to when they hear "South Africa."
Comment: The first version of the movie (I believe it was a short film) made some years before the real one, used some real footage of South Africans talking about migrants from other countries.
Answer: It's less apartheid and more contemporary South Africa - the aliens represent Zimbabwean immigrants.

"I was asking black South Africans about black Nigerians and Zimbabweans. That's actually where the idea came from was there are aliens living in South Africa, I asked "What do you feel about Zimbabwean Africans living here?" And those answers — they weren't actors, those are real answers..."
Neill Blomkamp, Director of District 9
Answer: Well, for another example, the role of the Nigerian gangs mirrors a lot of the problems that South Africa really does have with Nigerian OC. In the real world it's drugs and prostitutes instead of the satirical cat food and alien tech.
Answer: In addition to what others have mentioned, I think a key idea/theme is "dehumanization." I am thinking about how subjects were treated in concentration camp medical experiments and also the Tuskegee syphilis experiment. Experimenters need to treat subjects impartially and this is much easier if one does not think of them as sentient creatures.
In District 9, Wikus destroys the eggs of the aliens and jokes about it sounding like popcorn. Now, these are not humans but the attitude that he has towards the eggs (or larval forms) of the aliens is similar to that of the experimenters towards humans in the aforementioned cases. And Wikus knows already that the aliens are intelligent -- everyone does.
But the really key scene is after Wikus is taken into custody and then subjected to experimentation, seeing if his new limb is able to activate the alien weaponry. He is scarcely acknowledged, only commanded to fire the weapons and when he does not cooperate, they simply use a cattle prod to force him to do so. (Note also that for some reason, perhaps because they need proof that the weapons will work against the aliens, they force him to fire upon a living alien, not sure if they do this more than once but throughout the movie, the "prawns" are really treated as unfeeling, dumb beasts, despite the fact that they are members of a civilization with technology perhaps thousands of years ahead of our own -- we simply have no hope of understanding the technology, only are attempting to use it, which they can only do once Wikus is partially transformed -- the weapons are just inert bricks.)
His transformation may have helped the researchers disregard his rights as a human or simply the fact that he is being experimented that causes them to treat him as a "guinea pig" - Note also that he is was an employee of the company and even more significant is the fact that his own father-in-law is present -- that Wikus is married to his daughter matters not at all.
Of course, his complete transformation later in the film underlines this theme.


8086 emulator for unix-like OSs?

Question: Is there any 8086 emulator (free or paid) for Fedora 17? I am learning assembly language using AT&T style.
Comment: You don't really need an emulator for that unless you don't have an x86/x86_64 machine. All you need is an assembler if you do.
Comment: agree. but emulator can quicken the learning when you can see data moving in and out of the registers, instruction by instruction.
Comment: Not really, you'd be better off using a debugger for that.
Comment: Should this be a community wiki question?
Comment: @EvanTeitelman No. Community wiki basically just invites unmaintained lists of random links. If the question seems too broad or otherwise like there's no real correct answer, it should be closed.
Comment: @Mat After assembling the code using an assembler like `as -march=i8086` how/where do I run that binary since I don't have 8086 processor? Wouldn't I need 8086 emulator for that?
Answer: Here are two 8086 emulators:

i8086emu - A cross-platform emulator
for the Intel 8086 microprocessor. It has support for dynamically loadable
device plugins and some peripherals like a PIT, PIC, 8-segment-displays,
buttons and leds. i8086emu comes with an ncurses and an GTK-2 gui.
fake86 - An 8086 PC emulator written in
C. It seems to have less device support than i8086emu.
Answer: There is Bochs kind of oldest virtual machines.
Off-course, you must check Qemu project. It is a mainstream open-source virtual emulator.
You can always nag the thing what you need and make a contribution to the project's core.
Comment: Exactly. A virtualized computer environment is a lot more than the CPU.
Comment: Both Bochs and QEMU virtualize the entire environment, which might not be what the OP is after.
Comment: "8086 emulator (free or paid) for Fedora 17"
Answer: You can use any hypervisor software.for example:Qemu-kvm,Virtualbox,Xen,Vmware and so on.
    I suggest that  you  use qemu-kvm or virtualbox to launch a virtual machine. Because qemu-kvm and virtualbox are open source hypervisor,and they are easy to use.Virtual box has a good GUI that written by QT. Qemu-KVM has a powerful command line.
   Libvirt is also a good command line to support all hypervisor.Specially support qemu-kvm.
   You can do every things in vm.If your vm crashs,your host will not be affected.
Comment: I have the same comment on this as on [@innocent-world's answer](http://unix.stackexchange.com/a/87596/2465): there is a lot more to a virtualized computer environment than just the CPU. And if software running inside any sort of emulator can crash bringing anything on the host along with it, something is horribly broken in the emulator.
Answer: PCEm does a great job emulating the full hardware: https://pcem-emulator.co.uk/
if you live in Windows only world then 86box (fork of PCEm) may interest you: https://github.com/86Box/86Box
They do not only emulate the CPU but a whole lot of hardware including voodoo 3dfx etc
check some posts who have played with these: https://virtuallyfun.com/wordpress/category/80386/
and you can check pcem forums to use with Linux https://pcem-emulator.co.uk/phpBB3/viewtopic.php?t=3155

8086 emulator for unix-like OSs?


Farthest from Edge in Raster-QGIS

Question: I have a raster image (green colour in image). I would like to find the point in this raster that is the farthest from the edge i.e. that point from which the largest number of uninterrupted cells in a given direction to the edge?
Comment: Do you want to find the green pixel that has the longest minimal path that is only on green pixels? Or on any coloured pixels? That might be the green pixel nearest the centre. What about that green island in the middle? The distance on only-green cells from there is infinite if you can't go on the black pixels...
Comment: I don't want to include the island as the black surrounding it are road/rivers. I want to find the green pixel that has the longest minimal path that is only on green pixels.
Answer: QGIS has a tool for called "pole of inaccessibility" which does exactly what you ask for, with one caveat: it works on polygons, not rasters. Fortunately, it should be fairly simple to polygonize this raster.

Instructions to find the "pole of inaccessibility" for the green areas on your raster:

Polygonize your raster. Quality control the new polygonized layer as follows:

Make sure the output is separate single polygon features, not  multipolygon features. Run multipart to single part if necessary.
Make sure the output only contains the parts of the raster you want to analyze. If the black parts of the raster are not defined as "no data" areas, your polygonized layer will have polygons covering these areas as well. Select and delete any polygons that you don't want included in this analysis (the "select by value" tool might be helpful for this step).

Calculate Pole of inaccessibility of the polygonized layer. This will create a new point layer, with a point in the most inaccessible spot inside each polygon.
The new layer of inaccessible points has a field called "dist_pole" with the distance from the point to the boundary of the polygon. Select the point with the highest "dist_pole" value. This is the most inaccessible point on your raster.

Farthest from Edge in Raster-QGIS


MapInfo Tab Files - Which feature types are contained?

Question: Without opening the TAB within a GIS package, is it possible to determine which feature class it contains?
Could the TAB file be open in notepad and assessed for example?
Comment: I think an important question here is: why? Why do you need to do this? If we knew that, someone might have an alternative solution.
Comment: Because these tab files need sorting depending on the feature class contained. The systems being used are unable to have a GIS package installed.
Answer: A TAB file can contain multiple object types at one time, both points, lines, polygons etc. But starting from byte 316 in the map file you can read number of points, number of lines, number of polygons and finally number of text objects. That was 4 int32 integers. But I am not sure if that information is still uptodate, considering more object types has been added later on to the TAB format.
But notepad is surely not the answer here.
Comment: How do I find byte 316? Is this something I can complete in Notepad?
Comment: I don't think you can use notepad as the information about geometry is in a compiled file (.map). Might be worth a look at this post [link]http://gis.stackexchange.com/questions/94070/gdal-how-to-get-gemetry-type-of-a-mapinfo-tab-file[/link]
Answer: Uffe's answer is still correct in current versions of the .map file as far as I can tell. In order to do this you would need to open the file in a hex editor (or programatically read the binary file) and read the binary values from byte 316. These will be displayed as hexadecimal format in a hex editor.
As an example, I used a hex editor to open a .MAP file which I know has 1627 region objects in it. I found byte 316 and read the bytes up to 319 - all 0's which means there are no point objects, bytes 320 to 323 all 0's also so no linear objects, bytes 324 to 327 - ah ha! I get the 4 bytes as hexadecimal 5B 06 00 00.
To convert this to decimal (base 10) from hexadecimal (base 16) we need to know that hex values run from 1-9, then A, B, C, D, E, F are 10 - 16.
So to convert 5B: B = 11 and the 5 is equal to 5 * 16 = 80. So 5B equals the sum of those, 91. Following the same convention, 06 is equal to just 6 in decimal.
So these are the binary values stored in the file. To get the actual int32 value we need to convert this to decimal. 6*256 = 1536 then add the 91 = 1627. That's confirmation that we have 1627 region objects in our map file.
Assuming you're not concerned with the number of features but just the type stored in the file then you can simply check those 4 byte chunks for non-zero values to determine if each feature type exists in the file.
There's a good description of the .MAP file format here: http://spatialnews.geocomm.com/features/mif_format/
Hopefully I've explained this in an understandable manner, but depending on your knowledge of binary and hex it may be worth reading up about it if you decide to take this approach.


System calls in linux

Question: Generally, systems provide a library or API that sits between normal programs and the operating system. On Unix-like systems, that API is usually part of an implementation of the C library (libc), such as glibc, that provides wrapper functions for the system calls.In C i can use these wrapper functions to make system calls. How do i make system calls in other languages?
Answer: Most of the time your language of choice will provide functions (of some sort) that eventually map to the relevant syscalls. In those cases, just use those and call it a day; no need to consider syscall interfaces at all. In fact, I'd argue that unless you're writing a standard library, there should be no need to consider the lower-level details in the first place. It's not like the days of the original IBM PC, where accessing memory structures directly could dramatically increase performance (and even then it was recognized to be a non-optimal solution, because it severely limited portability).
That said, you can perform direct syscalls in any language that allows you to mimic the expected calling convention. In fact, this is not really any different from any inter-binary calls, including library calls (although with libraries it's usually less of an issue since those are likely to be written to the same calling convention anyway).
The calling convention dictates things like how parameters and return values are passed to and from a called function, and forms one part of the ABI (Application Binary Interface) of a platform. Note that in this case, "platform" is a quite wide term, potentially encompassing both operating system, runtime environment, language, compiler and settings (including source-code-level declarations).
So what you need to do is make your other language make a function call that conforms to the calling convention used and then simply call the appropriate interface. If you're using assembler, that's trivial as you're most likely already doing all parameter and results passing by yourself anyway; if you're using something on the other extreme end of the scale like BASIC or Perl, you'll have a very hard time conforming to a foreign calling convention because the languages pretty much lack the concept.
Exactly how you would write the code to use an alternate (or specific) calling convention depends very much on the language (and likely compiler) in question, and is much too broad to answer generally. And of course, you'd need to know which calling convention to conform to.
Comment: what do you mean by "mimic the expected calling convention"? plz explain it..
Comment: @saurav1405 Did you read the answer in full? I feel it is explained fairly well in the paragraphs following that, and certainly better than can be done in the space of a comment. If you aren't familiar with these concepts, I suggest you just do yourself a favor and simply use the facilities offered by your language and runtime of choice, as suggested in the top paragraph. If there is something in particular you want to know, please be a lot more specific.

System calls in linux


Muffler inlet corrosion problem

Question: My 2001 Honda Civic needs a new muffler every two (2) years or so, because the inlet pipe corrodes just after the union.  Is this a common problem, or would installing a better quality muffler prevent this?  Aren't most exhaust system components stainless steel, how is it that it corrodes so quickly?
Comment: Are you replacing the muffler with an OEM muffler or with the cheapest option that the local exhaust place offers to you?
Comment: I did not do the previous installs, I let my mechanic do it but I believe he uses [FlowMaster](http://www.flowmastermufflers.com/) mufflers.
Comment: @Tester101: what is your typical commute duration?
Comment: @DXM: 30 minutes.  I live in Northeast USA, so winters are a factor as well.
Answer: Stainless steel is merely corrosion resistant, not corrosion proof, and some are better than others.  My 1991 Toyota with 251,000 miles (including daily driving in the rust belt Winters) is still on its original exhaust (getting rusty, but no leaks/holes).  My 1995 Mitsubishi with only 116,000 miles, rarely Winter driven is already on its third.  This time around I spent more money and had a nice custom one fabricated out of higher quality materials...  I thought the first replacement exhaust was a good one, but it rusted out in only 9 years.
Comment: I know stainless is only corrosion resistant, I just wonder why it's corroding so fast on my car. 2 years seems quick.
Answer: I believe that the OEM muffler for the Honda Civic is only aluminized steel, not stainless steel.  As such, it doesn't even have the higher resistance to rust that a stainless part will have.
As noted previously, a stainless part is only resistant to corrosion, not immune (nothing really is).  If you choose to go with an aftermarket stainless part, you can visually inspect the connecting flange and welds.  You want to see a nice thick piece of metal with solid welds.
My preference is to purchase a stainless replacement and use that for as many years as possible.  I hate the sound that a progressively degrading muffler makes over time.
Your purchasing preferences may vary.

Muffler inlet corrosion problem


Windows 7 Federated Search & SharePoint 3 osdx file?

Question: Can a osdx file be built for Sharepoint Services 3 to allow it to be included in Windows 7 Federated Search?  I see stuff for MOSS 2007, but I can't seem to get it to work for Sharepoint 3.
Answer: Unfortunately, I think WSS doesn't have an RSS feed for search results - which means it isn't usable as a Win7 Federated Search source.
If your WSS environment is single-server, you could upgrade for free to Search Server 2008 Express and gain this functionality (and a lot of other cool stuff).
If you have a multi-server WSS farm, then I don't think it is possible without paying to upgrade to MOSS or Search Server 2008


Sensor fusion for IMU

Question: I'm working with MPU-6050 sensor with Raspberry Pi 4. I can read acceleration and gyroscope raw data from the sensor. However I want to get yaw, pitch and roll angles from these data. I tried to search for something like DMP which is used in the Arduino library but I did not find anything.
Answer: According to https://www.youtube.com/watch?v=uTFBW-Mm4b0 you must integrate the velocity $\omega$ to get the angle position $\theta$. The velocity is obtained from the gyroscope.
Discrete integration can be made in few ways, one of them is
$$
\theta[i+1] = \theta[i] + \omega \cdot \, dt.
$$
So for yaw, pitch and roll angles you should calculate
$$
\theta_{yaw}[i+1] = \theta_y[i] + \omega_y[i] \cdot \, dt \\
\phi_{pitch}[i+1] = \theta_y[i] + \omega_x[i] \cdot \, dt \\
\rho_{roll}[i+1] = \theta_y[i] + \omega_z[i] \cdot \, dt
$$

Sensor fusion for IMU


Configuring Windows 7 Quick Launch taskbar icon (for Google Chrome)

Question: I have two different machines both running the same version of Windows 7 Pro. One (the good one, from my point of view) has a QuickLaunch Google Chrome button on my Taskbar immediately to the right of the Windows Start button. But I can't remember how I set it up, and I don't seem to be able to replicate the functionality on the other machine.
What's good about the "good" QuickLaunch button is that if Chrome is already running, clicking on it simply makes that existing copy of Chrome the "foreground application". This is the same behaviour as "normal" (not "pinned") Taskbar buttons, except they don't exist at all until I actually start an app for the first time within the current session. The Chrome button is always there.
On the "bad" machine, I've tried both these approaches...

1: Create a shortcut to [ProgFiles]\Google\Chrome.exe on the desktop and drag to the Taskbar
   2: Right-click Chrome in Start->All Programs, and select "Pin to Taskbar"

...but whenever I click on my shiny new button, it starts another instance of Chrome, regardless of whether Chrome is already running. How can I make it the same as the good one?

I don't know if this is relevant, but I have the Foobar2000 music player installed on the good machine, and a button on my remote configured using Eventghost to "Run Foobar2000".
My remote button works just the way I want (if Foobar's already running, just give it the "focus", otherwise start it), because often I've no idea whether it's running or not - I just want the music on. Maybe someone else paused or muted Foobar, switched focus to a different app, or whatever (it's a "house" PC, so there could be others involved - or perhaps it was me, and I just forgot).
I don't recall doing anything special to make Foobar work the way I want (effectively, allow only one instance of this program), but that's not quite the same thing as my Chrome problem. I do sometimes want to deliberately start another copy of Chrome, rather than just open a new browser "pane" in the one already running (using my desktop shortcut rather than QuickLaunch does this).

EDIT: Getting no response here, I tracked down and carried out the instructions in Restore the Quick Launch toolbar in Windows 7, which seem way more complicated than anything I might have done without remembering. But it didn't do what I wanted - the newly-created QuickLanch taskbar shows smaller icons that what I had before, but they still create a new instance of Google Chrome whenever I click on them.
Answer: For those who are new here. When you start Google Chrome from Task Bar and a new instance comes up, all you have to do is to right click on the new instance that just opened and click on "Pin this program to taskbar" and remove the old Google Chrome icon, there you have it!


how can I erase a folder or a file from the u1 cloud

Question: I have being trying to erase a set of files and folders that I do not longer need but I do not find any option on my phone or on my Ubuntu box. How can I do it?
Answer: The Ubuntu One files app on the phone is not a synchronization client. It simply allows you to download some files that you have in Ubuntu One.
You can delete the files from your Ubuntu computer, or on the Ubuntu One web site, and the changes will be synchronized to all the computers you have connected to Ubuntu One. Note that on the computers where you did not perform the delete from, the files will simply be moved to trash. And you will have to manually delete any files you downloaded to your phone which were in Ubuntu One that you don't wish to keep around.


What is the meaning of these lines

Question:
Are these pedal signs? I have never seen one in Bach pieces.
Comment: It might help if the question mentioned which lines are meant.
Comment: "I have never seen one in Bach pieces": the pedal was developed well after Bach had departed this world (along with most other developments in piano design and manufacture).  This edition is basically Egon Petri's instructions for playing the piece on an instrument for which it was not written.  You may choose to follow those instructions or not.
Answer: This edition of the score calls for two pedals.

The script "P" is the instruction to use the damper pedal1, and the lines are instructions for pressing, holding, and releasing that pedal2. It's anachronistic to Bach, but the editor was clearly considering how they thought the piece should be executed to make use of the piano.3
The una corda is the instruction to (also) use the una corda pedal — a.k.a the soft pedal. That pedal is just held throughout; there is likely a tre corde instruction later in the piece indicating the pedal should be released. The lines related only to the damper pedal, not the una corda.

1) See also What does this 'Led' or 'Σed' indication mean? and Why does the pedal sign look like "Leo"?.
2) For example, The proper way to mark sustain pedal for MuseScore playback and live performer?.
3) There are several questions regarding the use of pedal when playing Bach on the piano. Try the search bach piano pedal is:question. Strictly speaking, Bach wrote for keyboard instruments that did not have a sustain pedal (harpsichord, organ, clavichord), so there is endless debate among pianists about whether it's appropriate to use pedal when playing Bach on the piano. The strictest purists would not play Bach on the piano in the first place, while a "True Romantic" (which the editor of this edition likely was) might choose to make use of the piano's full capabilities in the interest of enhancing (in their view) the music.
Answer: The very first one says 'una corda' - meaning soft pedal. On a grand, it does just that - the hammers move sideways to hit only one string of two or three. On a studio, it brings the whole bank of hammers closer to the strings. Can't for the life of me think why it would need releasing and deploying again and again, though. That's usually kept for the sustain or damper pedal (on the right), to stop muddiness.
EDIT: it's not crystal clear here, but may well be explained as una chorda is applied all through (piece is marked dolce), and the rest is actually sustain pedal. Although playing staccato notes with pedal deployed has always been a mystery to me.
Comment: The second part of this answer is why the lines must indicate the damper pedal.
Comment: Regarding your comment on staccato and sustain pedal deployed. It might not be a contradiction, because the staccato sign can inspire the player to give the note a different attack compared with no staccato sign.

What is the meaning of these lines


What is good water-pan placement for offset smoker

Question: I want to smoke a pork shoulder low and slow: 240 degrees at around 15-20 hours.  I'm using an offset smoker, Oklahoma Joe Highland.
What is a good placement of water pan(s) and why?
Answer: I have a couple offsets, I put my water pan on the grill grate closest to the firebox. This does 2 things, it's easy to replace the water after it all evaporates and it adds a block to keep hot firebox direct heat off the meat.
Answer: According to Meathead Goldwyn, water pans can go over the heat source or under the meat, depending on the style of cooker you are using, and the desired effect.  They can aid in maintaining temperature or adding moisture to the environment.  I would say, in your case, to avoid placing it under the meat, as there will be quite a bit of air circulation in your offset smoker.
Answer: I don't have a smoker like yours, but I have one of those drum style charcoal smoker/grills with the chimney.  I smoke my Boston butt on indirect heat by putting it on a "V" shaped rack.  I put the rack in an aluminum pan and put the water in the bottom of the pan because there isn't a lower rack on which to put a water pan. The meat/rack/pan is on the grill grate on the left side and the fire with the wood chips is in the bottom of the right side.
I usually rotate the meat after some time so that the heat is evenly distributed.  It usually turns out great!  Be sure you have a meat thermometer so that you get the meat to just the desired doneness.


Use of "buenísimo" vs "mejorísimo"?

Question: If the absolute superlatives are superlatives, why can we use buenísimo? Shouldn't we use mejorísimo?
Comment: What do you mean? The use of *buenísimo* is consistent with other superlatives in Spanish (e.g.: from *blanco* you derive *blanquísimo*, not *más blanquísimo*).
Answer: Bueno is just an adjective, it means "good". It does not compare things.
Buenísimo is not an absolute superlative but a normal one. It just means muy bueno → "very good". Many things can be buenísimo at the same time.
Mejor is a comparative. It is used to say that something is better, more bueno than something else: Toyota es mejor que Honda → "Toyota is better than Honda".
The particle -ísimo is a suffix that means "very": dificilísimo → "very difficult", rarísimo → "very rare". It is used to easily form superlatives from adjectives in Spanish.
It doesn't make sense to say ❌mejorísimo, just like it doesn't make sense to say "Toyota is very better than Honda".
Some adjectives like bueno use a different word like mejor when making comparisons, but in most cases you just use más: Tú eres más guapo que yo → "You are prettier than me"; El Empire State es más alto que el edificio Chrysler → "The Empire State building is taller than the Chrysler building"; Otras preguntas podrían ser más interesantes que esta → "Other questions might be more interesting than this one".
Finally, you have absolutes. In Spanish, you form those by preceding the comparative with a definite article (el, la, lo → the) — but, unlike in English, the form doesn't change. So: Tú eres el más guapo → "You are the prettiest"; El edificio Burj Khalifa es el más alto → "The Burj Khalifa building is the tallest"; Esta pregunta es la más interesante → "This question is the most interesting".
Mejorísimo would only be used in an exaggerated, almost wrong-on-purpose way, just like "very best"; and, just like it, it is grammatically incorrect (though "very best" is much more established and accepted in English, while most everybody would recognize mejorísimo as wrong in Spanish).
Note: if mejorísimo was right, I think it'd probably be spelled mejorcísimo instead, just like its diminutive mejorcito. Spanish ♂.

Use of "buenísimo" vs "mejorísimo"?


Dividing relations to achieve BCNF

Question: Is the relation from below correctly divided into relations in BCNF:
R(a,b,c,d,e) - a and b are primary keys and there are dependencies such as:
a → c
a → e
c → e
I split the above relations into:
AC(a,c)
CE(c,e)
AB(a,b,d)
Answer: Are you sure about that primary key?  Normally, determining all the candidate keys is part of these kinds of exercises.
An informal way of expressing what we know about candidate keys is that every attribute that's not on the right-hand side (RHS) of any functional dependency must be part of every candidate key.
Since I don't know how you determined that {ab} is a candidate key, I'd be inclined to say that, because {abd} is not on any RHS, {abd} must be part of every candidate key.
In short, your FDs say that {abd} is the primary key, not {ab}.
In order for your key and your decomposition to be right, you need to have the additional FD ab->d.
Answer: Is it the case that a is a primary key and b is a primary key, or is it the case that {a,b} is the (composite) primary key?  If the columns are separately primary keys, then you have a number of additional but not explicitly stated functional dependencies: a → bd and b → acde.  If the columns {a,b} are a composite PK, then you have an additional functional dependency ab → cde.  Either way, the AC and CE relations are fine, and the ABD relation is the other necessary one.  The only issue is 'what are the candidate keys of ABD'?  And the answer is 'either {a,b} as a composite PK, or a and b as two separate candidate keys'.

Dividing relations to achieve BCNF


What is the difference between ionic bonding and the general transmission of charge?

Question: I understand that in ionic bonding electrons are transferred from atom to atom and these ions are then attracted to each other forming a new compound. How is this different from any other transfer of charge situation? For instance, when silk and glass are rubbed together, electrons are transferred between them. These two items then attract each other but we do not say that a new chemical compound has formed, we still just have silk and glass.
Comment: It is matter of proportion. When you receive an electron from some material, you do not notice it. When an atom or small molecule receives an electron from another one, it is a life changing event for both. If every molecule of your body received an electron, it would lead to a coulombic explosion of gigantic proportions.
Comment: When silk and glas are rubbed together, the number of electrons being transferred is probably included between $10$ and $10^6$. This is enough to show the electrostatic effect. When an ionic bond is made between  macroscopic amounts of $\ce{Na}$ and $\ce{Cl}$ to make up $\ce{NaCl}$, each atom reacts : the number of electrons so transferred is probably between $10^{15}$ to $10^{23}$
Comment: Electron transmission in ionic bond is just a myth! The ionic bond is only a result of force of attraction. Rubbering silk and than detaching is result of breakage of ionic bond.
Answer: General transmission of change does not specify

the source of the charge
the receiver of the charge
the amount of transmitted charge
the distance of charge transmission

On the other hand ionic bond is partial electron transfer between adjacent atoms in contact, being bond by electrostatic force between the opposite charges.
No ionic bond is purely ionic, but is in fact partly ionic, partly covalent. As cations always more or less deform  electron density of anions, decreasing the value of the electrostatic dipole.
As the rule of thumb to determine 50% of bond "ionicity" is usually considered electronegativity difference 1.7.
Answer: Maurice's comment gives an idea of magnitude in the glass-wool-cat fur situation. It is quite different in a lightning discharge. Every transfer of electrons, if traced back far enough, involves atoms, molecules, electronic orbitals. It is just that some orbitals are of higher energy and can lose electrons more easily, but those electrons still must have somewhere to go except possibly when in flight in a cathode ray tube. That is why when you walk along a rug in winter and touch a metal post all those electrons stored in your molecules antibonding orbitals readily transfer to empty conduction bands in the metal.  Physical forces as well as magnetic and electrical forces can transfer electrons among orbitals. It may be hard to analyze but that is what is happening. Some of that glass and wool is most likely chemically changed. Some of the molecules in the lightning bolt most certainly do get rearranged.


Depth vs breadth of opening knowledge

Question: When searching the web about how people learn about chess openings, I see many questions regarding the depth of the opening knowledge one has (with answers such as "I know some lines 20 moves deep") but a line is just a sequence of moves not a tree of possible moves.
This leads me to the following question : what is the best tradeoff between learning some lines really deep vs learning many variations but not as deep? How does one decide what lines should be learnt deeper?
Answer:
what is the best tradeoff between learning some lines really deep vs learning many variations but not as deep?

There are several cut-offs you can use:

Cut short the depth in a particular line when it becomes "calm". So, both sides have developed and there are no immediate tricky tactics.
As a first cut on breadth, make sure you include critical lines which have tactics which you need to know to survive. Do this even if they are relatively unpopular. You don't want your first game in that variation to be a quick loss.
For less critical lines cut short the breadth according to popularity, unless you particularly like an unpopular line. In general you get the most benefit by studying the most popular lines first because they are the ones you will face the most often. Use a large database to identify these and make a cut-off point in popularity below which you are not going to spend much time. Only study an unpopular line after you have faced it as part of your post-game analysis.
Another useful breadth cut-off if you don't have a great deal of time to spend is to do so according to how much your choice limits your opponent's choice. Examples would be: As an e4 player with white against the French only study the Exchange Variation (even though it is less popular) because it allows you to limit your opponent's choice of moves and so drastically reduce the amount of learning you have to do. Same argument for playing the Exchange Variation against the Slav.
Comment: Thanks a lot for this detailed answer, this is exactly what I was looking for! I find (4) especially interesting since that's a great way to reduce the tree of possible responses (vs just choosing the best response according to chess engine / human analysis), I hadn't thought about it at all.
Answer: Chess should be a game of understanding and not of memorization. In large part this is because understanding is a whole lot more fun than memorizing. Memorization has become prominent because it has become seen as necessary at the very top levels, and perhaps it is, but that should not be of concern if you are content with less. And not all that much less; you can be a serious contender for most state championships
without keeping abreast of the latest opening theory. It has been said, very properly, that the ONLY purpose of knowing the openings is to enter the middlegame with a playable position.
Brian Towers suggests "cutting off" opening theory when the position has become "calm", but although this is good advice, the position does not always take the same number of moves to do this. Some lines remain unclear after thirty moves, but if you are intimidated by this, do not enter those lines. There are many players, even at world championship level, whose aim, to make an analogy with tennis, is merely to keep the ball in play without aiming for every shot to be a winner (just a little bit tricky). There is no rule saying you have to play the most theoretical lines.
I am reminded of something once said by Bent Larsen, in recommendation of the Nimzoindian defence, that to play for advantage with Black you must first make some concession. And that in his view, giving up a Bishop for a Knight was not such a serious concession to make. This is opening theory at the level of understanding. Read everything you can about it, and enjoy the game.
Comment: I don't feel like this answer accurately describes what memorization can do for you in chess. Basically when learning opening, we are borrowing the understanding of all the grandmasters before us that have analyzed the line. Even at mediocre levels you are not going to survive without memorizing at least a few moves of the most common openings, and it really doesn't matter how much understanding there is. The point is just to prevent running into some tactical trap devised by the best of the best that your opponent has memorized.
Comment: @blues I would agree with you in certain cases. It would be impossible to understand *the most common openings* without memorizing *a few moves*. That is how understanding works. But the question was about depth; should you memorize a lot of moves? Should that be what you understand by *learning*? My answer stands; you dont have to.
Comment: Thank you for your answer. I get your point and will also keep it in mind. My understanding is that it should be a balance between understanding and learning and that this is also dependent on the level of each player. As a beginner I find that learning some opening moves makes me more confident. I also agree with @blues on the fact that traps/tricky gambits learned by your opponent are, at my level, much better designed than the actual level of both players, which may make it hard to properly react to it as a lower level player if you just rely your own understanding

Depth vs breadth of opening knowledge


Is inplview.aspx api based on search in SharePoint Online?

Question: I want to filter a large library in SharePoint Online using columns headers filters on managed metadata fields. I know it's also possible to use Managed Metadata Navigation in classic mode, but users like filter on column headers because of less clicks needed. So if they use columns headers filter, does it have throttling limits or is it search based?
Answer: Whatever ways (indexing, filtering, folders, and offline data) you're using, they all have throttling limits.
In general, Indexes work with filters.
If the number of items in your list or library exceeds the List View Threshold, but are still under 20,000 items, you can usually add indexes to existing columns. You can then apply filters to get the displayed data under the List view Threshold of 5000 items.
Reference:
https://support.office.com/en-us/article/Add-an-index-to-a-SharePoint-column-f3f00554-b7dc-44d1-a2ed-d477eac463b0?ui=en-US&rs=en-US&ad=US


Does more surface area mean more traction?

Question: I came across this question when considering new vehicle tires in a snowy environment. It appears that big off-road tires have very deep treads which greatly increase the surface area of the tire. Does this allow the tire to have more traction since more surface area is in contact with the ground resulting in the concept of "more surface area equals more traction"?
Comment: More on [friction & area](http://physics.stackexchange.com/search?q=is%3Aq+friction+area).
Comment: Generally speaking for friction the somewhat idealised model $F_f=\mu F_N$ is used, where $\mu$ is a friction coefficient and $F_N$ the Normal force. It's surface area invariant. I believe it's the same here. The deep grooves act like shovels, thereby greatly increasing traction. So I would argue that such a design increases $\mu$, and so also $F_f$.
Answer: No. Tread is there to account for the presence of "other material" between the tire and the road surface. For example, if there is water on the road, a perfectly smooth tire would be susceptible to aquaplaning: the water has nowhere to go, and becomes a thin film between the tire and the road.
If anything, deep profile tends to reduce the area of the tire in contact with the road, and increases the pressure. Both of these things give the "other stuff" (water, snow, loose gravel etc) a chance to get away from between the tire and the road, allowing the tire itself to grip the road.
In situations where there is a thin layer of snow (and to a lesser extent, mud or clay), a deep tire grip can shape the snow into a waffle like pattern that interlocks with the tires, and results in (much) greater lateral force - no "simple friction", but the kind of resistance to relative motion that comes about from having interlocking structures (like the teeth of gears). The deeper and wider the profile, the better the chance of a solid ridge of snow/mud being built up.
\Once you have the "intended" interface between tire and road (without the other material), the force of friction is largely independent of area, since the total normal force will be constant. But most of the time, tires slip because you are not dealing with just the road; and the profile is intended to deal with "the other stuff".


UV unwrap doesn't affect the texture on my model

Question: I have already uv unwrapped my model (to not the best possible result perhaps, but I've done it) and in order to test it, I have applied a material with brick texture to my model. But the texture on my model remains unchanged, as if no unwrapping has been done.
What am I getting wrong?
I seem to be missing something although i don't really understand what.
Thank you.
Answer: You probably need a Texture Coordinate node in your material setting the Brick Texture node's Vector input to UV:

Without that the Vector input's default is Generated:
Comment: thank you for your response, it was the most helpful.
Comment: Glad to hear it!  If I've answered your question I'd appreciate it if you'd click the checkmark next to my answer.


how to make a tabbed page, when you have 6-7 pages to load?(css/jquery)

Question: i want to make a css/jquery tabbed for an "Admin panel", so it will all be loaded without the need to refresh.
im going to do it dynamicly but its a small exercise site so i know ill have only 3-4 main "areas" to edit in the panel (the tabs in the top).
the thing is i have other links for each editing area.
is there a way to do it with jquery, without the need of putting all the code in 1 page,  in 3-4 divs and make them all invisble except the tabed being choosen(like ive seen in examples)?
in examples i saw all the content in one page, and if adding the top tabs and also the pages of each area(lets say delete, edit etc) its alot of code.
is there a comfortable way of doing it, while being able to make it dynamicly in the future?
edit to answers:
i already made tab from the this tutorial:
http://net.tutsplus.com/html-css-techniques/how-to-create-a-slick-tabbed-content-area/
the thing is, at first in the admin menu i have like 13-14 html pages(before it becomes php) with different operations.
how would you take 13 pieces of code(they have the layout and the admin+admin menu yet the content is changed) that should be in different files, and make them show up in the same tab?
would you have to split each code to only its div, and then load it someway?
from the tutorial above, they used all of the content in one page and used invisible......
how would you load 13 pieces?
Answer: Have a look at the jQuery UI Tab Widget:

you can load the tab content statically or dynamically with AJAX
it uses the jQuery CSS framework
it's easy and full of sample code


Is it possible to add permissions to a Ctools content type plugin?

Question: Is it possible to add permissions to a Ctools content type plugin, similar to a node entity?  I want to be able to check if a user has permission to add a certain content pane to a panels page through the IPE.
Answer: It should be possible using a ctools access plugin.  From the linked site:

Firstly, just like during work with Сtools content type, for the web developer it is necessary to call hook_ctools_plugin_directory() to indicate that we have ctools plugins of specific type in our module:

<code>/*
 * Implements hook_ctools_plugin_directory().
 */
function access_example_ctools_plugin_directory($owner, $plugin_type) {
  if ($owner == 'ctools' && !empty($plugin_type)) {
   return "plugins/{$plugin_type}";
  }
}
</code>

Then in module folder we need to create "plugins" folder and "access" folder inside of "plugins" folder. Create plugin file with the name "access_example_plugin.inc" inside of "access" folder. Write the access rule by array in this file:

<code>/**
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */
$plugin = array(
  // Plugin user-friendly name.
  'title' => t('Eldership rule'),
  // Plugin description.
  'description' => t('Controls access depends on eldership'),
  // Without required context plugin will now be shown in Panels UI.
  'required context' => array(new ctools_context_required(t('User'), 'user')),
  // Function which will allow or restrict access.
  'callback' => 'access_example_who_elder_access',
  // Plugin settings form.
  'settings form' => 'access_example_who_elder_access_settings_form',
  // Provides a summary descriptions depends on settings selected.
  'summary' => 'access_example_who_elder_access_summary',
);
</code>
It goes on to explain how to create the various callbacks but that's beyond the scope of this question I think.
Comment: So a ctools access plugin controls the access to a ctools content type plugin?
Comment: They appear to control access to just about every aspect of page manager/panels.
Comment: Ctools Access plugins provide options for selection rules in variants.  They don't govern whether or not a single content type plugin is available to a user.  I'm also looking for a solution to this issue, however, so if I come up with something I will post an answer.


WSS 3.0 Permissions Add docs but not change

Question: Is there a security configuration in WSS 3 that would allow end-users to add documents to a site, but then not be able to change this document?
Answer: Are you able to configure document lists to accept email messages with attachments? If so, then you could configure your list to accept messages from any address while granting read-only access.
This is easy to do with Microsoft Office Sharepoint Server, and that's built on top of WSS 3.


How do you unsubscribe from a ubiquity command

Question: I can't seem to find details on how to unsubscribe from ubiquity commands.   The command list page only seems to have information about the installed commands and there are no links to deleting them.  Am I missing something?
Answer: Go to about:ubiquity in Firefox. Under the section "subscribed feeds" there should be an option to unsubscribe to command feeds you no longer desire.
Also, if you clear your entire browser history, it will delete all command feeds (this will be fixed by 0.2)
Answer: The way to delete commands is to find them in the Subscribed Feeds section of the main help page:

ubiq help  |  about:ubiquity
Scroll down to "Subscribed Feeds" in the right hand column
Click '[unsubscribe]' for the one you want to delete.
Profit!
Answer: Check this out:
http://getsatisfaction.com/mozilla/topics/how_do_you_edit_delete_the_default_ubiquity_commands_verbs
Also, you can find a utility to reset your ubiquity to default in \extensions\email@example.com\chrome\content\reset.html
EDIT1: The above file does nothing, please ignore.
EDIT2 (answer?): You can use the ffx addon SQLite Manager to open the \ubiquity_ann.sqlite database and remove all rows for the command you want to delete (there will be several rows, but they are identified by the url the script came from and so easy to identify).  When you restart firefox, the command will be gone.
(The code that populates the Commands page uses javascript to create an instance of UbiquitySetup object, and executes the method .createServices().commandSource which reads that SQLite database directly for a list of commands (returning an object or array of objects/commands to iterate through).  This seems to delete the command itself, since it will no longer be found in ubiquity or the command list.)
Good luck.


How to use ArrayList.addAll()?

Question: I want to fill an ArrayList with these characters +,-,*,^ etc. How can I do this without having to add every character with arrayList.add()?
Answer: Collections.addAll is what you want.
Collections.addAll(myArrayList, '+', '-', '*', '^');

Another option is to pass the list into the constructor using Arrays.asList like this:
List<Character> myArrayList = new ArrayList<Character>(Arrays.asList('+', '-', '*', '^'));

If, however, you are good with the arrayList being fixed-length, you can go with the creation as simple as list = Arrays.asList(...). Arrays.asList specification states that it returns a fixed-length list which acts as a bridge to the passed array, which could be not what you need.
Answer: Assuming you have an ArrayList that contains characters, you could do this:
List<Character> list = new ArrayList<Character>();
list.addAll(Arrays.asList('+', '-', '*', '^'));

Comment: `Collections.addAll` is a better way to go, as it simply iterates through given items adding all of them to the list, while with `Arrays.asList` you would create a temporary `List` object to achieve the same result.
Answer: You can use Google guava as such:
ImmutableList<char> dirs = ImmutableList.of('+', '-', '*', '^');

Answer: You can use the asList method with varargs to do this in one line:
java.util.Arrays.asList('+', '-', '*', '^');

If the list does not need to be modified further then this would already be enough. Otherwise you can pass it to the ArrayList constructor to create a mutable list:
new ArrayList(Arrays.asList('+', '-', '*', '^'));

Answer: May be this helps
List<String> l = Arrays.asList("+","-");

Answer: Use Arrays class in Java which will return you an ArrayList :
final List<String> characters = Arrays.asList("+","-");

You will need a bit more work if you need a List<Character>.
Comment: Actually, for it to be a `List` you simply change `"` to `'` and `List` to `List`. Generics will handle the rest.

How to use ArrayList.addAll()?


Repetitive use of word "Basically"

Question: Why do people use the word "Basically" alot? Like they would mostly start their sentence with "Basically I am trying to do this".
Comment: It's like using **you know** or **umm** a lot, it's a bad habit, might be used to buy time while they are thinking about what they will say next
Comment: It's usually not much more than a "filler" word (as with *well, so, erm, see, you know,* etc.) A longer alternative with much the same "meaning" (to the extent that it really does have a meaning) would be something like *The essence of what I'm trying to say is...* (where often it's basically a device used to "play for time" while you think of how to say what you *really* want to convey). Like one might say much the same about OP's use of ***like*** above.
Comment: Are you referring to written or spoken English?
Comment: Also "Basically..." can be used when a person is unsure about what they are saying, or how it will be understood or reacted to by the recipient. (same for "what I'm trying to say is...")
Answer: To quote Arch Lustberg, author of How To Sell Yourself,

"Sometimes we use garbage fillers, phrases, and sentences. I'm tired of 'so to speak,' 'if you will,' 'as it were,' 'at this point in time,' and 'in a manner of speaking.' John F. Kennedy had 'let me say this about that.' Richard M. Nixon's classic was 'let me make one thing perfectly clear.' Some others we hear all the time are: 'I'm glad you asked me that question,' 'to be perfectly honest,' and 'to tell you the truth.'" etc.

Overuse or misuse of words like "basically," "literally," and others qualify as such "garbage fillers," used either as a way to buy time while thinking of what to say next or simply as bad speech habits.
Answer: Mark Hubbard's answer, and in turn the quote from Arch Lustberg, are very insightful, as far as bad speech habits are concerned.
From a more Machiavellian interpretation though, the overuse of words like "basically" may point to the use of speechcraft and neuro-linguistic programming to get the addressee to agree with the speaker's point of view.
By using such words or phrases, the speaker draws attention and adds emphasis to the words that immediately follow -- and at times away from other things they said. This is especially effective if used at the end of a long argument, because it leaves a strong final impact, which makes it more likely to be remembered, and at the same time reinforces the conclusion (and maybe drawing attention away from supporting arguments).
Incidentally, Monty Python reference!
Answer: We use basically to show that you are describing a situation in a simple, general way, and that you are not concerned with less important details. So there is nothing wrong in using it. But, some of the speakers use it very frequently in their speech which probably decreases the significance of that word which isn't correct.
So it should be used in a limit. And most important thing is if the word 'basically' is used in its proper sense it's an attention-seeker word.

Repetitive use of word "Basically"


git client and rsa authentication

Question: I've installed git client on windows 7 on administrator account. On first pull git asked me if i wanted to add host to trusted locations. After that '.ssh' folder was creted in user home. When i placed my key 'id_rsa' in it I was able to pull from remote repository. I've created new windows user and tried to repeat the routine but i kept getting fatal error: "the remote end hung up unexpectedly". Any idea what may be the reason of this behaviour?
Answer:
Have you tried to run ssh-agent (shipped with git) and add ppk key there?
Try to create "config" file in .ssh directory with following content:
Host ${repo_host}
IdentityFile ~/.ssh/private_key
Comment: 1. i tried after reading your post with no effect, 2. i didn't try this, i got it working by using ssh from git\bin instead of plink from putty family

git client and rsa authentication


Can I use Manhattan distance on binary data for hierarchical clustering?

Question: I understand that classically Jaccard and Hamming work best with binary data, but is there anything specifically wrong with using a Manhattan distance instead with the complete linkage function?
Comment: Do the math. Hamming on binary = Manhattan. It's just faster to compute Hamming properly using bit operations like POPCNT.
Answer: No, there's nothing inherently incorrect about doing that. In fact, for binary data, the Manhattan distance and Hamming distance are equivalent. For each variable the distance contribution is either 0 or 1; these contributions are summed over all variables. The Hamming distance explicitly sets these contributions to 0 or 1 as match/mismatch. The Manhattan distance works out to be the same because the underlying data is binary and so the only possible Manhattan distances between two values are 0 and 1.
Answer: Hamming and Manhattan distance for binary data are equivalent. I will show this graphically for a simple case:
Let's consider we have a dataset with two people and two variables:

Now for this case a contingency matrix of agreement/disagreement between two people is very simple:

We can see that with variable $var_1$ and $var_2$ the same pattern is repeated twice where $n_1=0$ and $n_2=1$.
We know from theory that Hamming distance from contingency table is calculated as $b+c=2+0=2$. Furthermore the definition of Hamming distance is as follows:

Hamming distance between two strings of equal length is the number of
  positions at which the corresponding symbols are different.

So in our case we have two strings $0 0$ and $1 1$. We can see that in both positions the symbols between two strings are different so the Hamming distance is $2$.
Now this is a geometric representation of our data:

$n_1$ has a value of $0$ on both variables and $n_2$ has a value of $1$ on both variables. You can see that manhattan distance between these two points equals the length of a dashed green line $1+1=2$.
EDIT: this can also be shown graphically with three variables. Then the graphical representation would be a cube defined in three dimensions by three variables. I suggest you look up a post about Hamming distance on Wikipedia to get an idea: Hamming distance
So to answer your question directly. There is no difference between using Hammond or Manhattan distance but there is a difference if you use Jaccard distance which is defined as $\frac{a}{a+b+c}$. There is no direct correspondence between Jaccard and Manhattan distance.
Comment: @user3324491 did the post answer your question?
Answer: With binary data Hamming and Manhattan are equivalent, so it's a question of "Hamming/Jaccard" vs. "Hamming/Complete Linkage".
Complete linkage takes the cluster distance as the distance between the farthest two points that are in different clusters and for binary Jaccard  will be similar, except Jaccard does not consider absence of a feature as a sign of similarity, while complete linkage does.


Cat6 termination problem

Question: After terminating Cat6 cable I plug it in to cable tester to check if every ping/pair is fine and I can use the cable. The problem I am having is that after crimping Cat6 cable with either T568A or T568B termination my tester says that there is a problem with pin 3 and 6. When I get into my office and do the same with a different cable the tester says everything is fine and the cable is working ok. Is something wrong with my outside cable or am I doing it wrong?
Comment: Okay, I'm confused - what's different between inside and outside the office.  Just the cable spool you're pulling from?
Comment: That's correct.
Comment: I guess in the absence of anything else it almost HAS to be that, though.  Maybe one of those wires was threaded to too thin a gauge or something at the factory...try just cutting a short piece and seeing what a continuity tester has to say about those wires?
Comment: Nevermind, you tried with both specs, so using DIFFERENT cable pairs?!  Now I'm really confused.  (Unless they're the same between A and B - I don't have these memorized.)
Answer: That's not a lot to go on. Are you using the correct connector for the type of cable? (stranded vs solid? They also have combination types, but make sure you're not using the wrong one) also, 3 and 6 are stripe vs solid pairs of green or orange depending on if you're using T568A or B. Are you sure you haven't swapped them on one end? I'm guessing the fact that you get the same pin error regardless of A or B standard indicates that you're probably NOT accidentally swapping them, but it's worth checking. You may not be pressing the strands far enough into the connector before crimping or your crimp tool may be damaged at one or both of those pins. Make sure the pjns are all pressed in evenly and that none of "teeth" in the crimp die are broken and that the strands are all flush against the face of the connector.
Comment: I do press the strands into the connector evenly and far enough. I performed it several times on the outside cable and once in the office on a different cable. I am successful at crimping in my office with the same type of connector and the same crimping tool.
Answer: If you terminate T568A and T568B and you get the same 3/6 error, then the problem is the other end. A and B swap pairs 1/2 and 3/6, so if the error is on the same pins, then the actual pairs are good but the termination point on the other end is bad. Otherwise you would see a 1/2 error when you went from B to A.
Comment: That might be it. Now I have to trace the cable. Geez

Cat6 termination problem


How do I remove gapps from CyanogenMod

Question: I installed CyanogenMod 11 on my HTC One with CyanogenMod Installer. So I got also the google Apps (gapps) on my device. But I need a CM11 without gapps.
I did then the following without success:

copy cm-11-20140308-SNAPSHOT-M4-m7.zip to /sdcard/
boot to recovery mode -> recovery -> ClockworkMod Recovery v184.108.40.206:
"wipe data/factory reset"
"install zip" choosing the zip-file
"reboot system now"
So I got a new CM11 but with gapps still installed.
What should I do in addition to "wipe data/factory reset" to get rid of this apps?
Comment: Formatting the system partition before re-installing would probably do it. I think CM is automatically backing up and restoring Gapps, the idea being that it makes updates easier for people who use Gapps. Since they get installed to the system partition, the factory reset won't delete them.
Answer: The solution for my my problem was:

Wipe data/factory reset AND
Clear cache and Dalvik cache AND
Format system partition

This can be done using ClockworkMod using various menus.
Comment: There is no additional software involved, other than booting into Recovery.
Comment: I also had to install CM again after these steps, but maybe because I said "No" to rooting the phone again on a reboot, and perhaps CM does that anyway (yes this is not the most intellectual comment)
Comment: Set as solution. Maybe you want to add the software you used for these steps.
Answer: Seems like you can remove it without a reinstall

adb shell
su
mount -o rw,remount /system
rm -R /system/addon.d

Source here : How to fix wrong Google apps
Comment: @atrioom it skips wiping or formatting the system partition, so you're not quite starting from scratch
Comment: Doesn't it say that after you did this you had to reboot and flash ROM again? Not sure if that doesn't count as a reinstall...
Comment: This only remove the gapp autoload scripts. Then reboot and you can uninstall them.
Answer: I know this is an old thread but it shows up pretty high on Google and is the only relevant one to my own quest when I was trying to remove Gapps/Google Apps from my phone, so I figured I'd add my two cents.
The above answers did not work for me. What I did was the following:
(WARNING: this may brick some devices!)

Forcibly flash a bogus image using a low level flash tool (e.g Androxyde FlashTool) into the phone's system ROM, e.g 10mb worth zeroes should do the trick to overwrite the file allocation table.
Install recovery if it has been removed by the above operation. You can do this by holding the phone specific button combo to put it in flash mode (e.g power and volume-down), and then flashing the boot.img file that's included in most rom files using the flash tool you used in the previous step.
Boot into recovery, and install your rom of choice.

This will create a completely clean system ROM with only the applications included in the ROM itself.
If you decide that you want Google apps later after all, just search for 'GApps android' or go to http://opengapps.org .
Answer: Wipe your cache partition and wipe your dalvik cache and reinstall.
Comment: I'm guessing this is missing the step "Format system partition" and that's why it got the downvote.

How do I remove gapps from CyanogenMod


Editing a bitmap image

Question: I have these two icons:
Image without a tick sign

Image with a tick sign

I want to add a tick sign on the top image which is without a tick sign. I am a developer extremely novice in graphic design. Could anybody guide me to do that in the simplest possible way?
Comment: Hi there and welcome to GD - do you have those in a larger versions?
Comment: Sorry I do not have, these are icons in my desktop app.
Answer: Ok, Ideally, you should have had those bigger and or in vector. But as it is, here it goes.. This is in photoshop:
Select the checkmark.
You can do this by using the "select in quick mask mode":

When you have switched modes, select the brush:

Use the brush to "paint" over the checkmark. When you are happy with your painting, that you have covered the pixels you need, switch over to "normal mode" (the first button we switched).

If you are not happy with the selection you can switch between the modes. When you have got all the pixels, copy it. You can make a new document and paste this checkmark in, in case you might need it later.

Paste and place the checkmark in on your other icon:
Comment: You should adjust the placement better than I did; and probably remove the blue line (date?) underneath it.

Editing a bitmap image


Is it a security risk to put Craft templates inside public root?

Question: Due to the way our build and deployment process works, it's convenient for us to have the Craft templates inside our /public/assets folder together with our css and javascript, instead of in /craft. Does this make the site less secure than having them outside of the public root?
Answer: If you're running Apache, you can put a .htaccess file in your templates/ folder with this in it:
Deny from all

and any HTTP traffic to that folder will be given an Apache 403 error.
Even better, you can put this in there:
# Send the request to Craft
RewriteEngine On
RewriteRule (.*) /index.php?p=$1 [QSA,L]

and the request will be redirected to Craft's index.php file behind the scenes, the same way that would-be 404s are sent there. So even if you go to /templates/index.html, or any other URL that points to an actual file within your templates/ folder, it will end up as /index.php?p=templates/index.html, leaving Craft to handle the request, which will most likely result in a Craft-based 404.
Answer: It depends on what kind of secure infos you write into your templates. I wouldn't put my credit card infos into a twig comment for example, if the template is not above the root.
But normally all one could make up from the raw template code is rather uninteresting and not really relevant for further hacking attempts, I'd say.
Note: please do NOT put the craft/config/ folder above the root!
Comment: Agree with carlcs, but to be safe, I'd add a .htaccess which denies direct user access


Sample test cases for all owasp top 10 vulnerabilities

Question: I am looking for sample test cases for all 10 vulnerabilities to exploit those scenarios. I would highly appreciate if any one share or share the link for test cases for a web application with all 10 vulnerabilities or any OWASP vulnerability?
Comment: While I do not know whether such a test case exist I doubt that it will be very valuable. SQL Injection samples are available in the web. Having a sample showing one specific type may create the impression that fixing this will make your app save from sql injection, which is not necessarily true. Therefore such test cases would not be complete and imply that making these test cases pass result in a secure application.
Comment: you're looking for test cases to run against your own site? There are numerous testing suites that run a battery of tests for most of the OWASP top 10.
Answer: There are loads. Mutillidae, Damn Vulnerable Web App, WebGoat, BWaPP etc. Also, check out vulnhub, hack.me and others like them.
Comment: @Aruna maybe you should first look up what WebGoat is, actually put in some effort and then come back with a request for help if you have a SPECIFIC problem.
Comment: I want to test manually..so asking for test cases. Please help me out here
Answer: You can take a look at the Software Assurance Reference Dataset  http://samate.nist.gov/SARD/index.php  - These are effectively vulnerable code snippets for multiple programming languages and include the OWASP top 10 vulnerabilities.
However, if you want to try live examples you can try a number of opensource or commercial wargame apps:
HackMe
Owasp WebGoat
Codebashing
Damn Vulnerable Web Application
Answer: We have an OWASP project which tracks vulnerable web apps: https://www.owasp.org/index.php/OWASP_Vulnerable_Web_Applications_Directory_Project
The OWASP Top 10 is actually all about risks rather than vulnerabilities.
So its not really possible to have simple examples for all of them.
For example, how many ways are there to 'misconfigure security' (A5)? As many ways as there are different web apps I'd guess ;)


Meaning of "I'll make due"

Question: When someone says "I'll make due" what does it mean?
Comment: @agc Your edit changed the core of the question. The original posed an eggcorn; the edited version is simply a dictionary lookup. (Admittedly, this question might be closed for lack of research if posted today.)
Comment: Typos should only be fixed if they are *not* in the sample sentence or if the question is not focused on that word. By fixing the spelling, 8 years later,  you are in fact harming the answers. Invalidating answers is not the name of the game here.
Comment: @Hot Licks. Not a very convincing stance, that people wouildn't know how to spell do. If that's supposed to be comical, imagine how funny I find that *make due* misspelled *make do* in 90% of instances.
Comment: @vectory How often do you find "make due"? It seems a strange construction on its own, unless you're referring to a longer expression where *due* is the adjective in a noun phrase, e.g. "make due restitution" (where *due* means "proper"). Do you really find most instances of an expression like that misspelled with *do*?
Comment: @Chappo No, *due* doesn't mean *proper*. It means *due* as in *due date* (*duesday*?) also *duly*, *duty* (cp. Ger. *Dienst* "duty", *Diensttag* "tuesday"?). Especially with *restitution* the sense *owed* is implied. It may have a connotation of *proper, good*, sure. Ostensible typos of *make do* number around 10% in a google news corpus https://grammarist.com/usage/make-do-make-due/ that's far higher than a mere misspelling, though I can't vouch for their accuracy. Sure you don't see it often, if editors try to correct it (more so in print, I guess?)
Comment: @Mari-LouA, Sorry, I hadn't even *looked* at the date of the Q., and had I read further, would probably have given up in despair.  After now reading the whole page, none of the various reasons given for an inference of *eggcorn* seem cogent.  Not all different-word typos are eggcorns.  Maybe people just love the word *eggcorn*.
Answer: The idiom is actually "to make do", and it means to work with what you have, to continue somehow despite an impediment or non-ideal circumstance.
It uses do in the sense of "suffice", as in "That'll do".
Comment: You have no authoritative source to back that claim, do you, on grounds of evidence? *That'll do* may derive from make do, so your definition is almost circular.
Answer: Some supplementary information in addition to Jon Purdy's answer:
In British English (as opposed to American English) due is pronounced like few or queue so it's never confused with do.
To "make do" is a useful expression in tough times such as war or recession. [This British Library page](http://www.bl.uk/learning/timeline/item106365.html] provides an example of both historic and contemporary usage:

Make Do and Mend was a pamphlet issued by the British Ministry of
  Information in the midst of WWII. It was intended to provide
  housewives with useful tips on how to be both frugal and stylish in
  times of harsh rationing. With its thrifty design ideas and advice on
  reusing old clothing, the pamphlet was an indispensable guide for
  households. Readers were advised to create pretty 'decorative patches'
  to cover holes in warn garments; unpick old jumpers to re-knit chic
  alternatives; turn men's clothes into women's; as well as darn, alter
  and protect against the 'moth menace'. An updated version of the book
  was recently released to coincide with the economic recession,
  offering similar frugal advice for 21st century families.
Comment: There's another possible misspelling though.."**I'll make dew**" and what's more, it's grammatical!
Comment: Welcome to EL&U. This had merit, but it was too short: the system had flagged it as "low-quality because of its **length** and **content**." I didn't want to see it deleted so I've taken the liberty of editing it, but you can [edit] it further if you don't like my changes. [NB the *-uel* words don't work since some pronounce these as "yoo-el" rather than "yool".] For further guidance, see [answer] and take the EL&U **[Tour]** :-)
Comment: @Mari-LouA - I had a cousin in Appalachia that did that!
Answer: A further note regarding the usage of make due (an eggcorn in the question's original wording) and the intended expression make do...
A Google Ngram shows that of the two expressions, make do is currently about 15 times more common than make due, but was rarely used until about 1930. I think it's not too far of a stretch to suggest that the Great Depression may have had something to do with its increased popularity.
Usage of make do seems to have plateaued in the late '30s as economies started to recover, but it surged again from about 1940 (coinciding with World War II), and continued to gain in popularity right up to the 1980s (perhaps coinciding with thrift going out of fashion?). It's yet to be seen whether the recent "re-issuing" of the term following the Global Financial Crisis (see this answer) will transform the plateau from the 1980s into a renewed surge of popularity...
Comment: It seems to me that "make do" does not quite make literal sense (which is why we call it an idiom) as is, but is shortened from something like "make it (whatever you've got) do" as in the old saying "use it up, wear it out, **make it do,** or do without". Is that abpit right?
Comment: @bot that's your native speakers intuition and about as correct as any opinion, but only a historical treatment would be rather convincing. For what it's worth. *make it * is still odd and idiomatic.
Comment: @bof I think that makes sense. [Etymonline](https://www.etymonline.com/word/make#etymonline_v_2237) says "To ***make do*** 'manage with what is available' is attested by 1867" but gives no indication of how it came about - it's certainly a weird construction, as it's the only "make" idiom with a bare infinitive.
Answer: I think that as is our wont, we have lost the historic context of "make due". Once again leading to a debasement of the English language due to our lack of understanding. Then we have "turned around" and claimed that our version, is the correct one. The other version being just a spelling mistake. I do believe if explored in more detail, the historic context of "make due", involved money/tithe owed. As in being able to get together enough to cover you due.
I owe much on my farm and times are hard. However, I will do my utmost to "make due".
In modern English, everyone uses "make do". That does not make it historically correct. Just as 'ain't' is not really proper English, simply because a lot of people use it in the vernacular.
due noun : something due  or owed: such as - something that rightfully belongs to one
give him his due or a payment or obligation required by law or custom : DEBT
In this context to "make do" would have a different meaning that "make due". One would imply doing more with less and the other would imply doing enough to cover what is owed.
Does that not make sense in context? So I would choose the version that fits your situation.
My mortgage payment has to be in on the first of the month and I am lacking funds. I will find a way to "make due".
I only have 6 potatoes and have to feed 10 people. I will find a way to "make do".
Comment: This would be improved with a source or two.
Answer: I always think that "make due" would make almost more sense (I realize the idiom is actually "make do"). "Making due" could imply accomplishing something owed/expected despite obstacles, which is really the sense of the phrase.
Comment: The sense of the idiom is "make X do the job that (the more difficult/rare/expensive) Y would do if there were no limitations.
Answer: make due means the same as make do, to get along with little, to reach a certain goal.
It is often called a spelling mistake, but there's no established dividing line between accepted and unacceptable spellings. It's however not a subjective issue. If somebody, objectively, does not think of the verb to do in this idiom, than it's not a spelling mistake. The issue is more complicated.
It's perfectly reasonable to assume this stem from an expression to make dues to get by or from to make due restitution, but that should be hard to prove. Americans, barring knowledge of French and English history, have a hard time fathoming this. And due to lack of historical sources, it should be hard to prove either way.
to make ends meet has a ring of direction towards a goal. To pay the bills and save money for food, debtors may scrape together all their pennies, to make do.
Also note that lend or borrow do not denote the same directions of lending everywhere. Colloquial speech is prone to corrupting legal terms. Hence somebody who has to make due, will later have to pay due. The -s there might be a possessive clitic 's, reinterpreted as plural. I don't know.
Comment: *Durely*? *scrap*? Maybe you meant "surely" and "scrape"? Or were you making a point about "misspellings"?
Comment: In order to support your stance, a sentence showing how "make due" makes logical sense would be helpful. I can't think of any full sentence where this could work. *She is making her dues.* has not the same meaning as *She is making do (with what she's got)*
Comment: @Mari-LouA to make debt, to pay debt, to pay due, to make due. Does make sense, does it?

Meaning of "I'll make due"