Particle Double slit

Question: How was the Particle Double Slit Experiment really done? To be precise, what kind of double slits were used and how can such slits be small enough, especially for electrons and buckys balls?
Comment: Not exactly a *double* slit but electron diffraction by crystals is related.  In that case the rows of atoms in the crystal act as multiple slits.
Comment: One can use a wire at high voltage. This acts as a biprism. I think that is how they did C$_{60}$ in Aarhus.
Answer: Here is a description of the single electron experiment

This figure from our book "Exploring Quantum Physics Through Hands-On Projects" shows a schematic representation of the modifications that Tonomura made to a transmission electron microscope to develop his experimental setup. Electrons are emitted from a very sharp tungsten tip by applying a potential difference of 3 to 5kV between the tip and a first anode ring through an effect known as "field emission." These electrons are then accelerated to the second anode potential of 50kV (the de Broglie wavelength for the accelerated electrons is λ=0.0055nm). Assorted "electron optics" within the modified electron microscope attenuate and focus the electron beam so that a current of barely 1,000 electrons per second is beamed towards the double-slit.
The double-slit is actually an extremely fine wire filament (1μm diameter) placed between two conductive plates a centimeter apart. The wire is biased at a positive voltage of 10V relative to the plates. This arrangement is known as an electron biprism.

Italics mine
This link has a video

Particle Double slit


Why does a heavier object move in larger orbit in a circular motion?

Question: In a non-planetary circular orbit, where centripetal force is given by the contact with the rotating tube wall instead of gravity, why does a heavier object tend to move in a larger orbit?
For instance, when you have solid suspended within water, the solid particles, which is heavier than water molecules, move outwards and accumulate along the inner tube wall, while the lighter water molecules keep moving in the smaller orbit, staying closer to the centre than those particles.
How can you express why objects with higher mass move in larger orbit?
As the object move outwards, the radius increases but the velocity also increases (when you spin a circle, the point near the centre moves slower than the edge).
Different mass, different velocity, different radius, and different force. I'm just not sure how the whole thing works.
Comment: Are you asking how a centrifuge works?
Comment: Possible duplicate of [Balloons and lifting gases](https://physics.stackexchange.com/questions/1888/balloons-and-lifting-gases)
Comment: Yes..I'm having trouble understanding the relationship between velocity and orbit radius as mass changes, because in a centrifuge more massive objects move outwards, which has larger orbit but also faster velocity.
Comment: See DavidZ's answer at https://physics.stackexchange.com/questions/1888/balloons-and-lifting-gases#1892
Answer: Imagine yourself in front of a cup of tea.
You notice that there are tea leaves in the cup (that came out of a hole in your teabag). Some lighter leaves seem to float on top of the surface, while some heavier ones have gathered at the bottom. You shrug it off, and take a spoon of sugar and put it into the tea and start stirring it. You now notice that the tea leaves which were initially floating randomly now seem to have gathered at the center of your cup, while the ones at the bottom have gathered around the edge.
(In fact you can try this experiment with things simple as water and pieces of plastic or oil drops and tiny pebbles or beads!)
And now you start thinking.
Initially, the leaves were at the top, while the water was a the bottom. Surely that must be because the tea leaves are "lighter" than water. But what we actually mean by "lighter" is less dense.
But what does it being less dense than water have to do with the fact that its at the top?
Water is a fluid. And fluids have a tendency to flow; to flow to whatever direction they feel a tug(force). This causes them to exert pressure (force on the surface area) on objects in contact with it and this in turn causes buoyancy, which Archimedes has beautifully taught us to interpret.
Hence if the object in question is less dense than the fluid in question, then it will be pushed around by the fluid to a place where the fluid will least want to go, and vice-versa.
When you stir the cup of tea, what happens is you give the water molecules a rotational kinetic energy; they start revolving around an axis, the center of the cup.
Now, looking at the system from a non-inertial frame of reference where the rotational velocity is zero, all the particles must have a pseudo force acting on it. That force is always directed towards the axis of rotation.
The net force on all the particles is oblique. The water wants to go to the bottom center, so do the tea leaves.
If you haven't figured out by now, applying the same logic of buoyancy, we get our answer. The water will push the lighter leaves to the top and to the edge of your cup, while it is unable to do so for the heavier tea leaves, which then dominate and stay at the bottom center.
I hope I answered your question, and also cleared your doubts. Your doubt had little to do with rotational kinematics and more to do with buoyancy. It is wrong to assume that solids are always heavier than liquids. And that solids will always sink in liquids.
P.S. First post. Yaaay! ;)
Comment: How would this apply in a case of suspended gas molecules? For instance if you have U-235 and U-238 mixed together, and spin the tube containing them and end up with U-238 accumulating along the edge. Apparently it's because objects with higher mass tend to move at larger circular orbit; but why is it so? Why do heavier objects move at larger circular orbit? I know it sounds quite intuitive but I can't really express in physics equations.
Comment: You are still confused between the notion of density, mass and weight. A kilogram of foam sheets, or a kilogram of gold, which one would weigh more? Both would weigh the same! But now put both in water. The gold sinks, while the foam floats. The foam also occupies much more space than the gold, it is ***less dense***. Isotopic separation works on the principle of Graham's Law of Diffusion, and not directly on rotational dynamics.
Comment: But we can still attempt to look at the scenario. U238F, and U235F, here both of these are gasses, but due to different isotopes of U, U238 is heavier than U235, by 5amu per molecule, or 5 grams per mole, while occupying the same space, hence U238 is more dense than U235.


How to connect Salesforce to Quickbooks?

Question: I am wondering is there a way to connect Salesforce with Quickbooks for free. I have seen a few applications that do the job however, they are just trails and must be bought. Is there any way that I could do it without using a third party application and could usig mapping?
Comment: Here's the Quickbooks API manual. Hope this helps.

https://developer.intuit.com/docs/0050_quickbooks_api
Answer: You could use any integration tool from appexchange & choose free version . Some tools have free version which support one way integration between salesforce & quickbooks like customr sync & invoice sync .


Drywall skimcoating

Question: Is this wall finish considered Level 3 or Level 4 Drywall? The place was built in 1980s, and has very unsmooth appearance, compared to newer places. Just curious if skimcoat would help, and if has to be Level 5 finish? A drywall contractor said Level 5 is very expensive to conduct. I am trying to do a job with the proper budget.
Comment: Would say someone put a textual finish on the wall.  Drywall itself should be flat/smooth.
Comment: We can't tell what quality finish your wall is from the photo. You could skim it and get it to look acceptable. Level 5 is for picky people, problematic lighting and higher gloss paints.
Answer: That is a textured finish called "orange peel". It is typically applied over a level 3 finish (taped, a build up coat or "blocked", then skimmed and sanded), and is usually sprayed on by one means or another.
If you small repairs needing to be touched up , it is available in aerosol cans.
If you want to cover the texture, and have a smooth wall, then skim coating everything, which pretty much a level 5 finish , is your only option. Well, there are other options, but that will be your cheapest route if you want smooth wall.
Comment: I just bought a house that's damn close to this in the basement.   Drives me bonkers.   Why?   Why?   Good answer.   You could edit it a little though... Probably a level 3 but who knows because it is covered up with a thick texture!
Comment: @DMoore  Texture finishes are used a LOT out here in the NW. In MD where I am from originally, level 3 was used most of the time with level 5 on occasion. I have observed many a texture applied since I have been out here and it all starts with a level 3 finish. At first when I got here I thought it was a way of "cheating" to hide crappy work or incomplete finishing work, a shortcut in other words. But the finished level 3 walls I have seen this texture sprayed on would have been a great smooth wall finish all by itself
Answer: no it is not level 5.  level 5 looks almost perfectly smooth.
Comment: Could you add some sort of reference, maybe, to support your statement? That would go a long way toward helping.

Drywall skimcoating


How should I beat Empress of Light in Terraria?

Question: I am having so much trouble with Empress of light. How should I go about beating her? I can't beat Moon Lord,so his gear is out of question, I have pillar weapons, beetle armor, a Celestial Shell, Mothron wings, and a comic car key. My friend has the same stuff as me, with Vampire Knifes. How can I improve my build?
Answer: If you get battle armour that means that you have beat Golem, I recommend that you rush Pillar to get more powerful items
I'm ranger class player, the most simple way is using rail on the sky , (on the Minecarts the most of projectile cant catch u when u at max speed )
get a Vortex Beater ,Chlorophyte Bullet
If you didn't have Vortex Beater , you can use mega shark
Also, reforge your items to +4% dmg will speed up
If you're a warrior player, you need an arena and repeat few timesé
for learning the boss skill for easier dodge it
Comment: Thank you, I did pillars, (though i had forgotten to add that to my post) I will try your method.Thanks!
Comment: Also, would you recommend regular Minecart or the one from Expert mechs?
Comment: @Yharon both work , but recommande Expert mechs one :)
Comment: thanks! I will let you know if this works!


Translation of Hex Colours to RGB Colours?

Question: Apparently Illustrator and Photoshop uses different colour settings - Illustrator uses RGB and Photoshop uses some hex/HTML-like colour system with a combination of letters and numbers. Is there any way of 'translating' a RGB colour swatch to Photoshop easily?
Comment: Do you understand how hexadecimal numbers work? It's just a way to represent numbers in Base-16. `A=10`, `B=11`, `C=12`, `D=13`, `E=14`, `F=15`. So `0xFF = 15*16+15 = 255`. You can even have Google calculate it for you: http://www.mattcutts.com/blog/easy-tip-to-convert-hex-to-decimal/
Comment: Photoshop uses a whole range of color systems. You should be able to change what it uses in the color picker settings.
Comment: Btw, what OS/platform are you on? (curious)
Comment: @Moshe: Mac OS X.
Comment: @CalvinHuang: and to finish your series, 10(hex) = 16(decimal). `@`the OP: Each column represents (16 raised to the power of the column number)+ a differential, with the right-most column being column 0. This is how base-10 numbers work as well
Answer: Both Illustrator and Photoshop use hexadecimal values! The screenshot below: Illustrator is on the left, photoshop is on the right
You can use either RGB or hexa between the two programs.
To transfer simply select your swatch and open the Color Picker and select the hexadecimal value.
Fun fact: The first two letters/numbers of hexadecimal value colors are the Red color.
The second pair are the Green colors, and the third pair are the Blue colors.
I hope I understood your question correctly.
If you want to match up PANTONE swatches...
http://kb2.adobe.com/cps/330/330728.html
Comment: Nice answer. (With both Photoshop and Illustrator, you couldn't put a little overlay on each screenshot to label each one?)
Comment: mosh...0 and 255.
Comment: I'll add to your fun fact that each "part" of the hex value represents a value between 0 and 256. Translating the numbers is a matter of translating the hex number to decimal.
Comment: There are 256 values. 0 through 255 = 256
Answer: I think it's worth underlining that hex is just an alternative notation for RGB 8 bit-per-channel values, e.g. #DB7093 means exactly the same as rgb(219,112,147). So you can freely translate between them without any issues.
In contrast, HSB, Lab, CYMK and Pantone etc are different colour spaces/systems/models and so  a direct or exact conversion is not necessarily possible.


Combine two L78L05 voltage regulator to double voltage output

Question: Is it possible to use two 5V linear regulator to get 10V output like this (I already have a bunch of 5V regulators):

simulate this circuit – Schematic created using CircuitLab
Are there any problems with circuit ?
Thanks
Answer: No, not directly like in your picture.
First of all the bypass capacitors are missing.
Second problem is the quiescent current of the top 7805 that flows out of the GND pin, which the output stage of the bottom 7805 output cannot sink in, as it is only meant to source out current.
This can be fixed by putting an extra load resistor from the top 7805 GND pin to ground, and sizing it so that the quiescent current can't raise the GND pin voltage near 5V, so that extra current out from the bottom 7805 output is always needed to lift the voltage over the resistor to 5V.
If for example the quiescent current is about 7mA, maybe a resistor that is about in the range of 220 to 470 ohms could be low enough.
Answer: As others have said you need to provide a path for the GND pin current of U2.
You can also get a higher voltage from an LM7805 by using a zener diode or shunt reference:

simulate this circuit – Schematic created using CircuitLab
The current coming out of the GND pin is a fairly constant 5mA typically, so regulation is pretty good even with a zener (images from TI datasheet):

In each of these cases, only one 7805 carries the output current so the second one (where present) will not require a heatsink.
You could replace R3 in my first schematic with a series power indicator LED and resistor, but I have a visceral dislike for circuits that destroy what they are connected to if you remove an apparently innocent LED. Note that I've made the current a bit over 10mA because the 5mA typical is not guaranteed and bad things will happen if the output of U5 is lifted. TI's LM7805 product has a guaranteed 8.5mA maximum over temperature. ST's L7805 appears to guarantee 6mA but I'm not convinced that is correct.
Answer: As others have noted, that will mostly work,  however I give you Figure 10  from the TI LM78L05 datasheet.
Answer: That -- should work.  Or almost.  The 7805 is a "one quadrant" device, meaning that it only holds regulation for +5V and current flowing strictly out of its output pin.  It also dumps current into its "ground" pin.
If you don't do something about that, U2 will dump current into U1's output node, which will float up -- probably until U2 doesn't supply current any more.
So you'd need to check the data sheet of the device you intend to use, and put a resistor in parallel to your "VM1", sized so that it draws at least as much current as you expect out of the U2's ground pin (I'd go for twice as much, to be safe).
Note that there's also a dodge that you can do where you treat a 7805 as an adjustable regulator, wiring it the same as an LM317, but being mindful of the extra current coming out of the ground terminal (and, of course, the fact that the "adjust" voltage is 5V).  Your idea, as screwy as it seems on the surface, is better IMHO -- at least, given that you have an excess of 7805 parts around.


mysql polygon search fails

Question: In my table I have three geospatial fields:
`lat` decimal(12,7) NOT NULL,
`lon` decimal(12,7) NOT NULL,
`location` point NOT NULL,

And three geospatial indices:
KEY `lat` (`lat`),
KEY `lon` (`lon`),
SPATIAL KEY `location` (`location`)

I then have a trigger defined as 'on before update' which sets the location from the lat/lon pair like this:
FOR EACH ROW SET NEW.location = PointFromText(CONCAT('POINT(',NEW.lat,' ',NEW.lon,')'))

I'm pretty certain the data is correct because I can do all sorts of circle queries.  Now, I also need to do some polygon queries and just can't get it to return any results! Here's my polygon query:
SET @bbox = 'POLYGON((32.70 -117.16, 47.97 -122.19, 44.80 -68.77, 25.77 -80.19, 32.70 -117.16))';
SELECT * , AsText( location )
FROM geo_table
WHERE Intersects( location, GeomFromText( @bbox ) );

Running this query through phpMyAdmin I get the following message for both SQL statements:
# MySQL returned an empty result set (i.e. zero rows).

As an FYI, the data points shown in the above SET @bbox are from 4 corners of the US (entered clockwise) and should return 99% of all points but returns nothing.  Here are the coordinates:
San Diego, CA: +32.70 -117.16
Seatle, WA: 47.97 -122.19
Bangor, Maine: 44.80 -68.77
Miami, FL: 25.77 -80.19
I have also tried this against over 3500 polygons from the NWS CAP 1.1 feed and I get nothing!  I figure I must be doing something wrong but, for the life of me, I can't figure out what it is!
Any suggestions?
Answer: I don't think you should use Intersects, try with Contains instead.
SET @bbox = 'POLYGON((32.70 -117.16, 47.97 -122.19, 44.80 -68.77, 25.77 -80.19, 32.70 -117.16))';
SET @USA = GeomFromText(@bbox);
SET @Lincoln = PointFromText('POINT(40.82 -96.71)');
SELECT Contains(@USA, @Lincoln);

mysql polygon search fails


AWS Braket Backend for Qiskit?

Question: Is there a working AWS Braket backend provider for Qiskit 0.29 that can be used with the MinimumEigenOptimizer interface? The qiskit-aws-braket-provider package is unfortunately not working.
Comment: There is a new qiskit-braket-plugin that is being actively developed under Qiskit Advocate Mentorship Program. It might be useful for you after it's initial release, probably in a few months: https://github.com/qiskit-community/qiskit-braket-plugin
Answer: qbraid does!
qbraid has a transpiler for Qiskit <> Braket <> Pennylane (QNodes) <> Cirq <> Pyquil which is also backend compatible.
You'll have to sign up to access the SDK which can be done @ https://qbraid.com (it's free). The SDK should also have an opensource version at some point. Stay tuned!
Gaining access to the qBraid-transpiler
In terms of accessing the qbraid-sdk they have a youtube video which can get you started with credits etc for free! However, the qbraid CLI is frequently updated and checking the syntax to access various QCs (Rigetti, IONQ, OQC etc) by typing qbraid -h might be necessary in your qBraid Lab terminal.
They provide documentation for how their transpiler works here.
Check out the demo repo and an example from QCHack  as well!
Hope this helps and if you have any questions just message me :)
The repository is now open source:
https://github.com/qbraid/qbraid
Answer: As a general follow-up on this question the qiskit-braket provider, https://github.com/qiskit-community/qiskit-braket-provider, mentioned earlier is actively monitored and maintained by both the open-source community as well as people at IBM and Amazon Braket. If there are limitations or bugs that you encounter when running Qiskit on Amazon Braket via that provider it is worth raising as an Issue in that GitHub repository.

AWS Braket Backend for Qiskit?


How to see the value of a piece of land that is owned by a company or government

Question: In Capitalism Lab, the land cost and the Customer Traffic Index is displayed when buying a piece of land that is not owned by a player or government.

From my observations, the higher the Customer Traffic Index, the more valuable the land. How can I know the value or Customer Traffic Index of a piece of land after it has been bought by either a player or a government?
To illustrate the problem, when I hover my mouse cursor over a piece of land owned by the government (beneath an apartment building owned by the government), the value of the land and its Customer Traffic Index are not shown:

How can I find the value of the land and its Customer Traffic Index?
Answer: I haven't found a way to find the value of a plot of land beneath a building.
However, for undeveloped plots of land, one can easily find the market value and Customer Traffic Index by hovering the mouse cursor over the small square of land. This method works for both undeveloped land owned by one's own company, and land owned by competitors.
For example:

The market value of the small square at the top is $2,812,485, and its Customer Traffic Index is 33.


Do you know any system in which a PhD Student can apply for their own reserch grant?

Question: I would like to ask about any funding for PhD Students to buy lab equipments, reagents etc. Because I know a lot of scholarships and travel grants for PhD students, but no research grants.
I know PIs and postdocs are eligible to apply for grants and provide the funding of experiments. But in many cases I cannot see any differences between an experienced PhD Student with good publications or a young Postdoc with less outstanding publication list. Neither of them will get a grant for postdocs but the young Postdoc has the chance to apply. I understand that it is necessary to make a difference between a postdoc and a PhD Student, but okay, let's provide less money as a grant or sg.
Comment: Some scholarships come with some money  for lab consumables or equipment, books etc., for example the [Kekule fellowship](https://www.vci.de/fonds/stipendien/kekule-stipendium/seiten-2.jsp).
Comment: I think it's probably worthwhile to add a subject tag and a country tag to this question. Otherwise it's so broad that there's probably some trivial answer of "yes, there is at least one", but this isn't so useful.
Comment: Yes, you are absolutely right. My field is molecular biology and my country is Hungary. I am not sure whether I can find sy from my country, and it is not necessary. I am curious about this question in general in any country.
Answer: Yes. For example several of the fellowships listed as answers to the question, Options other than the NSF for PhD level grants?, will fund research expenses.
Answer: As far as I witnessed while doing my doctoral degree in Germany (in applied computer science), it was pretty much the norm that most doctoral candidates would write - or at least contribute to - one or two research grant applications in the course of their candidacy.
These grant applications were usually meant to secure follow-up funding for the doctoral candidate themselves (once their current funding runs out), or for other future doctoral candidates in the same institute (who could, for instance, build upon the work of the applying doctoral candidate).
Now, I'm not sure whether this is what you are looking for, as these doctoral candidates would technically not personally apply for the grant themselves, even though they collected all the input for the application and wrote it. However, unless I'm mistaken, it's also not the PI or postdoc who would personally receive e.g. money for lab equipment, but their institute or group, as a (depending on the size/scope of the grant, the sole) participant of the project.
Comment: Thank you for your answer. It seems there are differences between fields and countries. In my country we don't need to write research grant applications and our PhD scholarship is funded by the government for 4 years. Additionally, we have the chance to apply for extra scholarships given by either the government or companies, but this is only for living costs, so it's a scholarship, not for buying lab stuff. And the fact that we have no chance to provide the financial basis of our experiments (at least partially), makes us much more vulnerable.
Comment: @research_isn't_easy: Ah, then to add some context: There are various ways of how doctoral candidates can be paid in Germany, but a common one (at least in applied CS) is to be employed by the university. Your salary comes from a grant that has been awarded to the institute you work for, which covers some amount of staff (i.e. money to pay to employees working on the project), material (i.e. money to buy lab equipment etc. from), and other expenses (e.g. travel expenses to project meetings or conferences).


Bathroom Vanity wood getting damaged slowly

Question: Anyway to stop this happening. I always use the fan when taking a shower still the top edge of the vanity wood is opening slowly. Anyway i can stop this and fix it ?
Answer: The problem is all those vanities are made with particle board and will absorb moisture way before your fan can get rid of it. You might be able to slow it down by coating it with an exterior wood glue and then painting it or by using a quality silicone caulk and forcing it in there. Make sure the area it dry before applying anything or you'll trap the moisture.
Comment: Any chance of fixing it ? Or reducing the opening i am renting n wanna try n fix if possible
Comment: You might be able to scrape out some of the expanded particle board and the glue and clamp that corner.... just be very careful not to crack the laminate because that's impossible to hide or patch.
Comment: As a renter, @SP979, you may want to point it out to the landlord and ask him what she'd like to do about it before it gets worse. Maybe send an email with a picture so you've documented that you brought it up, just in case he tries to charge you for repairs when you move out.
Answer: You can fix it but not really as a renter.   If you glue it it will just happen again or the moisture will damage other areas.   You will need to use some sort of light epoxy filler plus a coating to keep mdf vanities from failing.    This is not a change a renter does to a vanity without landlord approval.    I would for sure take pictures and send to landlord - because when this fails and then you bump into it and it breaks pieces off, well the landlord may say you are at fault.
If the landlord has a maintenance guy he will come out and glue it back and then it will fail in a few months.   He will not spend the time giving the vanity a coating because said coating is not easy to do while looking good, especially on white+mdf.   Sorry to be a downer here.


Reusing the same tex files in different base files

Question: I have a number of .tex files containing sections which are \input{} into a large document. I'd now like to create an "excerpt" document that includes only a subset of these sections. The problem is, the hierarchy level should be different in the excerpt than in the main document. That is, in the main document the concerned section may be a \subsection, but in the excerpt it must be a \section (i.e. everything moves up a level). Is there a way to handle this hierarchy level correctly in different files using \input{}?
Comment: You could just put `\renewcommand\subsection{\section}` and similar redefinitions in the preamble for the excerpt.
Comment: That's a great idea. I guess this still means that I'd have to be consistent with hierarchy differential though? i.e. I can't have a \subsection and a \subsubsection from the original document both be \sections in the excerpt... That may be too much to ask in any case. Thanks for your help!
Comment: You could rename `\subsubsection` to `\section` as well if you want to. Anything is possible with `TeX`...
Comment: Right but the \subsection itself has \subsubsections which should be preserved as one-level-below. So these \subsubsections should become \subsections, while other stand-alone \subsections used should become \sections... I guess I could just have all the .tex files without sectioning tags and manually add those tags in each base file. Would be tedious though, since that would mean having a separate .tex file for every section, subsection, subsubsection, ...
Answer: Since in comments you imply that you want to change the relative levels rather than just move a branch up or down the hierarchy, I'd use custom commands in  the input files.
If qqqq.tex looks like
\sectA{zzzz}
zz zz zz
\sectB{thing}
xx xx xx
\sectB{more things}
ww ww ww

Then one document can go
\newcommand\sectA{\section}
\newcommand\sectB{\section}
\input{qqq}

with everything at the same level, and another can go
\newcommand\sectA{\subsection}
\newcommand\sectB{\subsubsection}
\input{qqq}

with A headings a level down and B headings two levels down
Comment: I think that just might do it!


Taylor-Hood elements for Darcy's equation

Question: I would like to know if Taylor-Hood elements $P_2$-$P_1$ form a stable pair for the mixed approximation of Darcy's equation ( or  Poisson's equation) with Dirichlet B.C. In the literature I only find them only in the context of the Stokes problem.
Answer: I found some evidence that this method is not optimal, see the introductions in the following papers:

He, Mingyan; Sun, Pengtao, Error analysis of mixed finite element method for Poisson-Nernst-Planck system, Numer. Methods Partial Differ. Equations 33, No. 6, 1924-1948 (2017). ZBL1383.78029.

Brezzi, Franco; Fortin, Michel; Marini, L. Donatella, Mixed finite element methods with continuous stresses, Math. Models Methods Appl. Sci. 3, No. 2, 275-287 (1993). ZBL0774.73066.

I tried doing some experimental numerics to check the convergence rates. I'm working with the mixed formulation
$$
\begin{aligned}
(\sigma, \tau) + (u, \mathrm{div}\, \tau) & = 0 \\
(\mathrm{div}\, \sigma, v) &=-(f,v)
\end{aligned}
$$
and $f=2 \pi^2 \sin(\pi x) \sin(\pi y)$. Then I'm evaluating $\| \sigma - \sigma_h \|_{0}$ for different elements as a function of the mesh parameter $h$.
Results for $RT_0 - P_0$:

Results for $BDM_1 - P_0$:

Results for $[P_2]^2 - P_1$:

While you would expect $\| \sigma - \sigma_h \|_0 = O(h^2)$ for such basis functions, I'm instead observing $\| \sigma - \sigma_h \|_0 = O(h^{1.5})$ which might be caused by the missing (uniform?) compatibility condition.  Despite this, I'm observing a quadratic convergence rate for $\|u - u_h\|_0$.  However, I believe the energy norm is $\| \sigma - \sigma_h \|_{div} + \| u - u_h\|_0$ and for the first term I'm observing $\| \sigma - \sigma_h\|_{div} = O(h^{0.5})$ for $[P_2]^2-P_1$ while for the other elements ($RT_0$ and $BDM_1$) I'm observing $O(h)$.
So I guess it depends on what you mean by "stable". There is inf-sup condition and there is ellipticity on the kernel. To get optimal rates you need these to hold uniformly with constants independent of the mesh. I think this is not the case here since we observe suboptimal rates.
Edit: Here is the source code after pip install scikit-fem[all]==6.0.0:
import numpy as np
import matplotlib.pyplot as plt
from skfem import *
from skfem.helpers import dot, div

hs, errors = [], []

for refs in [3, 4, 5]:
  m = MeshTri.init_sqsymmetric().refined(refs)
  e = ElementVector(ElementTriP2()) * ElementTriP1()
  #e = ElementTriRT0() * ElementTriP0()
  #e = ElementTriBDM1() * ElementTriP0()
  basis = Basis(m, e)

  @BilinearForm
  def bilinf(sigma, u, tau, v, w):
      return dot(sigma, tau) + div(sigma) * v + div(tau) * u

  @LinearForm
  def linf(tau, v, w):
      return - 2* np.pi ** 2 * np.sin(np.pi * w.x[0]) * np.sin(np.pi * w.x[1]) *v

  A = asm(bilinf, basis)
  b = asm(linf, basis)
  x = solve(A, b)
  (sigma, sigmabasis), (u, ubasis) = basis.split(x)

  @Functional
  def error(w):
    return (w['u'] - np.sin(np.pi * w.x[0]) * np.sin(np.pi * w.x[1])) ** 2

  @Functional
  def derror(w):
    return (div(w['sigma']) + 2 * np.pi ** 2 * np.sin(np.pi * w.x[0]) * np.sin(np.pi * w.x[1])) ** 2

  hs.append(m.param())
  #errors.append(error.assemble(ubasis, u=u))
  errors.append(derror.assemble(sigmabasis, sigma=sigma))

errors = np.sqrt(np.array(errors))
plt.title(str(e.elems[0].__class__))
plt.loglog(hs, errors, 'bo-')
plt.legend(['rate = {:.2f}'.format(np.polyfit(np.log(hs), np.log(errors), 1)[0])])

Comment: Thanks a lot for the detailed explanation. Apparently the uniform ellipticity is  not required for the well posedness of the discrete problem nor for the convergence.
Answer: Yes, they are. I don't remember a reference to the literature, but the proof goes along the same line as for the Stokes case.
Comment: For Stokes problem, the uniform ellipticity of
holds naturally for $H^1(\Omega)^2.$ In Poisson problem the $H(div)$ uniform ellipticity holds only on the kernel of .


Tab Sound/Mute indicator not showing in Firefox 42

Question: Basically the title. The new feature in Firefox 42 where you can mute the tab from a little icon isn't showing. While in the tab I can hit control-m to supposedly mute it, but this does nothing other than briefly show a little muted icon in the tab. I'm running Ubuntu 14.04
Comment: I've found that it depends on the website whether the indicator icons are shown. They're not shown on youtube.com, but they're visible and working on vimeo.com, for example. Maybe it's a CSS or theme problem, or a problem flash video/audio vs. HTML 5 video/audio.
Comment: Not sure what changed, but since I updated to Firefox 43 earlier today, the indicator icons are visible and working on youtube.com, too. With FF 43, I haven't come across a site with audio where the indicator icons are missing so far.
Answer: Sadly, Firefox makes it possible to style that icon.
I watch some Televisions on Internet which tend to show advertisments as follows:
1) They style the icon to not show up, some starter pointers about doing that may be seen here.
2) They purposedly raise the volume during ads by up to 200%.
3) They disable the volume on the video player.
4) They disable the ability to pause or stop the video player.
It's very intentional, in the first weeks past the mute button release I could silence those very noisy ads by clicking the mute button on the tab, now they just remove it so to force to listen to the whole ads.


Why does resistance reduce when a conductive fabric is stretched?

Question: I just purchased some conductive fabric and noticed that stretching the fabric reduced its resistance. This seems counter-intuitive since stretching a wire leads to an increase in its resistance. I have also found this video where you can see this happen. Why is this happening? How does stretching the fabric lead to drop in the resistance? and is there any relation between the two?
Answer: It probably causes closer contact between conductive bits, however note that your observation is not universally true. For example, this fabric from Holland Shielding has the following note:

When the material is stretched lengthwise, its conductivity increases;
  when you stretch it crosswise, conductivity decreases
Comment: Data sheets but it's going to be very approximate, unless you can somehow model what is going on (smart material research has been going on in earnest in recent years) but again the match to reality is likely not so reliable.
Comment: Any way to figure out a relation between the length and resistance in that case?
Answer: a simple web search reveals your answer.

Eeontex fabrics are fabrics coated/doped with an inherently conductive polymer, making them conductive with quite a high resistance. But the resistance changes of distance, pressure through the material, and stretch over the material – making them ideal for sensor construction. velostat is a plastic sheet with similar properties to Eeontex, but because it is plastic it has none of the advantages of a textile.

thus it is an insulator with conductive coating and becomes more conductive with stretching like virtual skin, gloves etc for similar applications.
It is not a piezo electric effect but a rather wide tolerance dynamic potentiometer with not great accuracy for absolute value but great dynamic range.
there are a wide range of products and datasheets avail.
A conductor that increases with distance would be elastic and get thinner and thus increase, but this is an insulator with conductive coatings weakly connected until stretched.
Comment: Looks like @Jack was here


High-Performance UI Framework for .NET

Question: My current task is to develop a software for measurement and testing purposes which will communicate with various devices. Because i have to assume that there will be a high amount of data transferred from the devices that needs to be displayed in some plotting component or similar, the UI framework used should be as fast and responsive as possible.
I have a few years experience in WPF, but i think it will not be the best choice performance-wise. I am considering using Windows Forms at the moment, but i would like to explore some options first.
Do you know any good UI frameworks for .NET (wrappers for native frameworks are fine, too) and what is your experience using them? Thanks!
Comment: You can always go with a text based UI using nCurses :)
Comment: not sure how the speed of a UI framework and the ability to plot data quickly are related...?
Comment: Isn't WPF supposed to be graphic card accelerated? About how many plots per second are you expecting?
Comment: interfaces for implementing data acquisition drivers in native languages are already planned. but i also need to display the data, whether it be in a graph control or something else, but i think displaying of the data is UI-related.
Answer: Build a prototype to see if there are actually performance problems.
Choosing Windows Forms over WPF seems questionable if it is purely based on assumptions.
Answer: So, let's say you have 1.000 readings per second. Do you really think you should refresh display 1000 times per second?
Such display would be meaningless. There would be too much flicker on screen. If you display text data - it would scroll too fast or it would flicker and it could not be read.
Movies display 24 frames per second, everything faster than that is irrelevant for human eyes. What can you get if your system displays more changes per second? Humans cannot react that fast. So if you need system adjustment several times per second, than you must have some automatic systems.
You should generally reconsider goals that you want to accomplish with your UI.
Search Google for "Dashboard Design".
I worked on system that controlled water wells (pumps and valves) some 12-13 years ago when state of the art was Pentium II. We did it with Delphi 2 and Windows NT and it had nice graphic representation of system. Performance problematic part were serial interfaces that we used for reading data. Display was way faster than that.
Answer: It's a common problem that many line of business charts aren't able to scale to render massive datasets as required in scientific or financial applications. This is especially apparent in retained mode rendering engines like WPF and Silverlight, which can be very slow when you need to rapidly update the screen, although this applies to most GUI technologies.
As a response to this need, I've created a high performance WPF/SL chart component called SciChart. SciChart seeks to fill the gap for ultra high performance scientific / stock charts and as part of its optimisation it uses proprietary resampling algorithms to reduce the dataset before drawing, immediate mode rendering and a host of other optimisations such as object pooling and resource re-use.
Please click on the SciChart link to view a performance demonstration (requires Silverlight 4 - WPF version also available). The chart is able to draw multiple series totalling 5 or 6-figure point counts at interactive framerates (20-50FPS depending on hardware). This is equivalent to around 2million datapoints per second (100,000 datapoints @ 20FPS). A full version ready for commercial licensing will be available very soon, possibly by end Jan 2012.
In response to your specific requirement, note that the WPF/SL rendering pipeline will only render at a maximum of 60FPS, which is typically the monitor refresh rate. I would suggest in this case batching the data and appending to the chart in the CompositionTarget.Rendering event would be the best solution. SciChart supports batch updates with one render at the end via its API, which is compatible with code-behind or MVVM. The result is, you can push data as fast as you like to the chart, but it only renders as fast as WPF/SL is able to render. More than 30FPS is virtually undetectable by human eye.
Another consideration you may want is memory footprint and CPU as well as speed. I would choose carefully when evaluating chart components as WPF/SL can be a major memory hog!
Answer: Sounds like the extra precision of WPF would make this an ideal candidate.
Funny enough while typing this there is an ad next to me typing this which says Radcontrols for WPF when you are serious about performance, with some plotting in it.
Might be what your looking for :)
Also keep in mind that WPF got quite a performance boost with the 4.0 release.
Answer: I think .Net form should work, since VB6 UI does.
I developed similar application which plots Line Graph on screen but it was in VB6, and also same time it logs the data in txt file. there are 700 + read per second(Analog to Digital signal conversion).
You may need to plot the data by coding(not using third party control), its another option.
Hope this will give you some idea.
Answer: You could use XNA or some other 3D api to draw the graphics but this might be overkill.

High-Performance UI Framework for .NET


GoogleAuthUtil like device authentication for iOS to verify that requests originate from an Apple device

Question: Google Auth Util lets Android developers verify that the requests their servers receive come from an Android device.
The device gets a token from Google based on the Google account associated with the device, then the requests from the device are sent with that token to the server, where the server then asks Google if the token is valid. Any keys are kept out of the app source, so malicious folks cannot crack the app and access private keys and fudge requests to the server.
I've looked for a while and it seems Apple doesn't offer anything like this but I was hoping there was something functionally similar I could use for iOS.
Answer: Update
While the implicit assumption in the question seems reasonable, it is not actually true. Further readings of the Google sources reveal that the purpose of the Auth Util (and later Firebase) are to authenticate the user and secure the server. Given that the server only sees network traffic, it's possible to replicate the traffic from another client.
In addition, the definition of Android is fairly blurry, as OEM modify the base OS to suit their needs.
This is likely wrong

One option is to use the Apple Push Notification. You can register a device and push notifications specifically to it. When your app loads, it sends a request to the server with its device token and receives what is essentially a session cookie via the APN.
One caveat is that it is not encrypted. You can easily solve this by sending a randomly generated symmetric key in the request. The cookie you get would be encrypted on the server and decrypted using the same key in the iOS device.
This solves the issue of storing keys in the source and proves the requests came from an iOS device.
Of course, this can be simplified by generating a certificate, storing it in the key chain and sending the private key to the server for storage during registration. After the initial registration and validation using APN, subsequent messages can be signed using the device id + certificate public key.
One last issue is that APN can also be used to register OSX devices. I haven't been able to figure out how to exclude those (yet).
Disclaimer: It's been a long day of writing specs. I'm reasonably comfortable with the mechanism of initially registering the iOS device using APN. I may have gotten the encryption parts wrong. If so, comment gently, please.


Windows 7 x64 hard disk light continuously flashing

Question: My Windows 7 x64 hard disk light is continuously flashing. I had a look in the task manager but i cant find any programs which is over using the memory or cpu. I was wondering if there are any good free / open source tools to monitor hard disk activity which can tell me which program is causing the IO.
Comment: Try disabling your CD/DVD drive in Device Manager.
Answer: sysinternals procmon should do the trick - it lets monitors almost everything that a process does - file write, registry, and file operations
Comment: the sysinternals utilities are incredible, kind of surprising the level of access they provide aren't easily accessible in Windows by now.


Would you like the down-vote to be somehow commented or at least labeled?

Question: I think it would be useful and clarifying; and may it be anonymous.
Comment: Further reading: http://meta.stackexchange.com/q/135/165581
Answer: Down votes already contain stock explanations:
For a question: "This question does not show any research effort; it is unclear or not useful."
For an answer: "This answer is not useful."
I think these are pretty clear. Simply hover your cursor over the down vote arrow to see them.
I don't feel down votes are "superfluous" in a community driven site. Flagging for moderators should only be used if something violates the TOS or is inappropriate. And while meta can be used to discuss issues with a question, it shouldn't be littered with commentary on every question or answer a user feels is "not useful".
The down vote allows a user to show their opinion without any great impact. I mean it is only a -2 to rep. For someone simply browsing the site, seeing some questions/answers with lower votes clearly indicates that other users don't feel the question/answer useful and they may wish to pay more attention to those answers/questions with higher scores.
You can't force people to comment when down voting. There's already the pop up urging users to comment, but if they choose to ignore it, they have that option.
Comment: Actually, there is a penalty for question down votes. And I'm pretty aware of what could or could not happen in terms of mis-votes. It's not like I'm new here. The entire point of a community driven site is no one user has *that* much impact. Honestly, if anyone is *that* concerned about votes, they are probably here for the wrong reasons.
Comment: And the comment above made much more sense before @xxx deleted his/her comment.
Comment: Thank you, @Scott. I do know the actual SE explanations, but I'm curious (may be too much?:)). I thought the idea of just labeling the given down-vote (e.g. "wrong advice" or "off-topic" etc) would clarify the mistake for a down-voted author
Answer: The down-vote functionality is the result of over engineering, in light of the other tools available it's superfluous .
It's enough for a post to have a score of zero if it is not useful. If the post is bad or inappropriate users can flag it and moderators can remove it. If a user finds that they have a problem with a post they can post a comment against the post or raise their concerns on the meta site.
The down-vote by virtue of it's very nature can only have a negative impact.
Comment: I *strongly* disagree with your point. A downvote is an easy way of saying that you think the information in a post is invalid, incorrect or unhelpful. Votes are SE's way of ensuring good content floats to the top and *the chaff falls to the bottom*.
Comment: @Vincent the idea is that invalid, incorrect or unhelpful posts get no votes. valid, correct and helpful posts get votes. that way good content floats to the top. if it's wrong don't vote for it or leave a comment saying that it's wrong and why, downvoting is ambiguous.
Comment: I'm afraid people don't upvote enough for this not getting any votes to work properly, at least on this site. I guess we'll have to agree to disagree :)
Comment: @Vincent someone on another site have given a very good description of what the downvote is, I think it illustrates some of it's weeknesses quite well, see the answer to [Questions about odd in-game functions](http://meta.gaming.stackexchange.com/a/10207/61492). what you say about people not voting is certainly a valid point worth thinking about, though I feel that it's more of a problem on small sites with only a few users


Usage of product name on commercial website

Question: I have a software application that backups up customer data to their respective Google Cloud or Onedrive or Sharepoint.
If I mention this feature on my application's website, will I have to take permission from Google or Microsoft ?
Comment: I see that you've listed your location on your profile as Mumbai, so I'm assuming that is the jurisdiction the website is in. (Is it?) Also, are you asking this question from a standpoint of whether you would be breaking the law, or whether you would be breaking the terms of service? In any case, I'm not a lawyer but my gut feeling here is that as long as you clarify on your website e.g. that Onedrive and Sharepoint are Microsoft trademarks, a simple mention of an application feature shouldn't be against the law in most places.
Comment: You are right I am from Mumbai (Maharashtra) so laws of this place will apply ? Yes I can make a clear mention that Onedrive and Sharepoint are Microsoft Trademarks. Thank You.
Comment: [Fair Use in US Trademark Law](https://en.wikipedia.org/wiki/Fair_use_(U.S._trademark_law))
Answer: The large corporations such as those you've mentioned have certain guidelines when it comes to usage of their brand names (and logos).
If you search for "corporation name" + copyright permission you should get some relevant links. In the case of Microsoft for example: Microsoft Trademark and Brand Guidelines
Abbreviated for demonstration purposes but that page should answer all your questions:

Do's
In general, you may do the following with Microsoft's wordmarks and names of software, products, or services:

Note if your product or service is compatible or interoperable with a Microsoft product or service.

Contoso software works with Microsoft OneDrive.
Contoso headphones are compatible with Microsoft Surface devices.
Contoso Software for Microsoft Azure
Contoso is a new device designed for Microsoft Teams Rooms.

Truthfully and accurately refer to Microsoft and its products and services.

Contoso is a three-dimensional model city created by students using Minecraft gaming software.

...

Include a trademark footnote to give notice that you are using Microsoft's trademarks, e.g., "Microsoft, (list additional trademarks
in alphabetical order) are trademarks of the Microsoft group of
companies."
...

But that can depend on the type of relationship you have with those service providers (if any). If you are an approved reseller of some kind, then different guidelines may apply and you may enjoy some more privileges. For example you may be eligible to display a gold partner badge or permitted to advertise your brand more prominently along your partner's.
Another useful and related link: Use of Microsoft copyrighted content


How to prevent arp spoofing

Question: How to prevent arp spoofing and mitm attack?
I need simple solution. In network we have several workstation, switch and router.
Answer: Way to prevent ARP spoofing is to create a static ARP table on a device, which will be loaded into RAM everytime the operating system is loaded and accessed everytime a device needs to send a frame to a certain device on the LAN, without sending out a ARP request.
Every packet for ip address witch is not in local lan will be send trought default gateway. If you do not use local dns, mail server, ...  we do not need make to many permanent entry in arp table.
You can add static arp with command
<code>sudo arp -i eth0 -s 192.168.1.1 00:e0:1e:b4:12:42
</code>
but this will disapear after reboot. For permanent we need to create a file with the IP addresses to MAC addresses mappings:
<code> sudo nano /etc/network/if-up.d/static-arp
</code>
We add the MAC address and IP address of our gateway. Replace "eth0" with your current interface name, the IP field with IP and MAC of your gateway
<code> #!/bin/sh
 arp -i eth0 -s 192.168.1.1 00:e0:1e:b4:12:42
</code>
Save and exit
Change permission
<code> sudo chmod 755 /etc/network/if-up.d/static-arp
</code>
After the restart, the mappings will be shown as follows:
<code> host1@mydomain:~$ arp -va

 host1.mydomain (192.168.1.1) at XX:XX:XX:XX:XX:XX [ether] PERM on eth0
 Entries: 1 Skipped: 0  Found: 1
</code>
Note the PERM entry in the ARP table.
Comment: Is there a way to script this in a small sh or bash script so that you can switch the ARP table entry to reflect the correct network topology and interface depending on which network you join and with which interface? Perhaps some script that auto-detects what network you're on and what interface is connected to that network?

EDIT: Apoligies, I did not notice the other thread which has a application doing what's needed.
Comment: is there a way for static-arp to take changes without restarting PC?

How to prevent arp spoofing


2D rocket lander vectors (gamedev)

Question: I'm writing a game prototype with simple 2D Physics, of a 2D rocket "lander" style.
Let's assume that there is a downward gravity of (0, -1).
The rocket has an up-vector (that can be also described as an angle) and it generates a thrust of e = -2g from its "down" vector;
From a simple formula:
v = (u * e) + g

I'm able to predict the resulting 2d velocity when the Rocket is pointing upward to u vector. For example, if the rocket is pointing up (90 degree, normalized vector (0, 1)):
v = ((0, 1) * 2) + (0, -1)
v = 0,1 (rocket lifts with 1g force and no movement in x, as expected)

Now, for a 30 degree inclination:
v = ((0.87, 0.5) * 2) + (0, -1) v = (1.74, 0)

At this angle, the rocket finds a balance between gravity and its thrust moving only sideways.
This is also verifiable by assuming that to keep movement y = 0 the resulting y component of thrust vector should cancel gravity (for e = 2g, it should be 0.5)
So the angle should have a Sine of 0.5, then
arcsin(0.5) = 30 degrees

The question is, I want to be able to find the correct up vector to give the rocket an arbitrary v resulting velocity (to reach any target in 2d space).
If we rearrange the formula:
u = (v - g) / e

The Problem is, to this work I should input vector v in correct length and I don't have it. I have just a direction to the target, normalized.
In the above example, 30 degrees should be the result if I was asking for 0 degrees (right vector) resulting velocity. But I would input v as (1, 0) and not (1.74, 0).
I'm sure I'm missing something very very basic but right now my mind can't unwrap it.
Comment: I think what you are asking is really a math question. Can you provide with a sketch of the thrust vectors and other important things.
Answer: Your calculations are correct, but the problem is that if the angle of the vector $u$ is the only thing you can change then you cannot have control on both the angle and the magnitude of the output $v$: they will not be independent. So as long as the thrust $e$ is fixed you cannot have $v=(1,0)$, whichever the angle is.

2D rocket lander vectors (gamedev)


If you were lost and without water and food in the desert or other wilderness would a horse be an advantage or not?

Question: This is assuming you would not kill the horse for any reason. I am wondering if a horse would firstly, be better at remembering how to get home (like dogs and cats seem to be); secondly, finding water; and finally would it help scare away or at least detect predators? (I am ignoring the obvious increased travel speed and figure that might be offset by the need to provide for the horse.)
Comment: A horse is a big source of food. It will not be a companion afterwards though.
Comment: Horses need a lot of water!
Comment: @Bob1: right so we would balance its needs against its ability to, for example, help find water. I sure would rather be stranded anyplace with any animal companion rather than being alone, but I am wondering specifically about a horse.
Comment: By saying "desert or other wilderness" the question becomes too broad. In a desert the horse may collapse in a day or so because of the lack of water (horses need a LOT of water). The fact that horses may be better than people at smelling distant water won't help, because there simply may not be any sources of water. On the other hand in forested mountains or grass lands with water the horse can graze and feed itself, and carry you conserving your energy.
Answer: I sense a disconnect between the described scenario, and your question. But maybe that is because I'm not a horse person...
Since water is so much more critical, we can essentially ignore the food aspect here... You could survive some three days without drinking (less, depending on environmental conditions), but some three weeks without food.
Being truly lost in a desert / wilderness area without any food or water is a dangerous situation, that will become life-threatening if you can't manage becoming "un-lost" within those three days.
--> I would argue that the health and safety of the horse will quite quickly become less and less important as the danger to your own health and safety increases - up to a point where most people would probably sacrifice the horse to ensure their own survival.

If the horse knows the area better than you, it could potentially lead you to safety or to food/water sources. Will it though? That is hard to answer.
I have read stories about horses being able to find water sources, but honestly these could also be urban myths - at least I have not yet seen any solid evidence which describes this behaviour in domesticated horses.
The horse can of course allow you to travel faster while saving energy on your end. This will increase your chance to get to safety, especially if you press the horse forward and don't care for it's well being too much.
In a last ditch attempt, the horse could serve as an emergency source of food or fluids.
Answer: There's an obvious way it will help:  You will expend less of your reserves while riding the horse than if you're on foot.  Thus the maximum range you can travel before dying is increased.
So long as that travel is intelligent that will increase your odds of survival.
(And, no, eating the horse when it drops is not advisable.  The critical survival resource here is water and if you're short on water you do not want to eat as that will use up water.)
Comment: @ab2 While you could you shouldn't--there's enough stuff in blood that the net effect will be to dehydrate you, not hydrate you.
Comment: You can drink its blood.
Comment: I'll remember that!


TSQL foreign keys on views?

Question: I have a SQL-Server 2008 database and a schema which uses foreign key constraints to enforce referential integrity. Works as intended. Now the user creates views on the original tables to work on subsets of the data only. My problem is that filtering certain datasets in some tables but not in others will violate the foreign key constraints.
Imagine two tables "one" and "two". "one" contains just an id column with values 1,2,3. "Two" references "one". Now you create views on both tables. The view for table "two" doesn't filter anything while the view for table "one" removes all rows but the first. You'll end up with entries in the second view that point nowhere.
Is there any way to avoid this? Can you have foreign key constraints between views?
Some Clarification in response to some of the comments:
I'm aware that the underlying constraints will ensure integrity of the data even when inserting through the views. My problem lies with the statements consuming the views. Those statements have been written with the original tables in mind and assume certain joins cannot fail. This assumption is always valid when working with the tables - but views potentially break it.
Joining/checking all constraints when creating the views in the first place is annyoing because of the large number of referencing tables. Thus I was hoping to avoid that.
Comment: Could you provide an example? I do not understand how reading tables can influence referential integrity? Maybe few tables with some data, the views and the problem you have?
Comment: Why don't you filter both views?
Comment: Do you need to worry about this? Foreign keys control insert/update of data - they are not checked when selecting.
Comment: "certain joins cannot **fail**?"  A join never "fails."  If you perform an INNER JOIN from View2 to View1 then the net result will have the same filter that View1 has.  Works as intended.
Comment: As Aaron said, joins cannot fail. What DO you want to happen in your application? Do you want rows to not show in either view if they violate either one? Do you want that particular user to be unable to create a row that violates the view to which they have access?
Comment: Have you considered asking at http://ask.sqlservercentral.com - which is a site that uses the StackOverflow engine, but has an increasing number of SQL experts hanging out there?
Answer: I love your question. It screams of familiarity with the Query Optimizer, and how it can see that some joins are redundant if they serve no purpose, or if it can simplify something knowing that there is at most one hit on the other side of a join.
So, the big question is around whether you can make a FK against the CIX of an Indexed View. And the answer is no.
create table dbo.testtable (id int identity(1,1) primary key, val int not null);
go
create view dbo.testview with schemabinding as
select id, val
from dbo.testtable
where val >= 50
;
go
insert dbo.testtable
select 20 union all
select 30 union all
select 40 union all
select 50 union all
select 60 union all
select 70
go
create unique clustered index ixV on dbo.testview(id);
go
create table dbo.secondtable (id int references dbo.testview(id));
go

All this works except for the last statement, which errors with:
Msg 1768, Level 16, State 0, Line 1
Foreign key 'FK__secondtable__id__6A325CF7' references object 'dbo.testview' which is not a user table.

So the Foreign key must reference a user table.
But... the next question is about whether you could reference a unique index that is filtered in SQL 2008, to achieve a view-like FK.
And still the answer is no.
create unique index ixUV on dbo.testtable(val) where val >= 50;
go

This succeeded.
But now if I try to create a table that references the val column
create table dbo.thirdtable (id int identity(1,1) primary key, val int not null check (val >= 50) references dbo.testtable(val));

(I was hoping that the check constraint that matched the filter in the filtered index might help the system understand that the FK should hold)
But I get an error saying:
There are no primary or candidate keys in the referenced table 'dbo.testtable' that matching the referencing column list in the foreign key 'FK__thirdtable__val__0EA330E9'.

If I drop the filtered index and create a non-filtered unique non-clustered index, then I can create dbo.thirdtable without any problems.
So I'm afraid the answer still seems to be No.
Comment: From a data integrity perspective, you are going to end up being stuck with triggers and constraints. From an optimisation perspective, I'm not sure you can do much. I'm writing a blog post for you now at msmvps.com/blogs/robfarley. It'll be published tomorrow.
Answer: It took me some time to figure out the misunderstaning here -- not sure if I still understand completely, but here it is.
I will use an example, close to yours, but with some data -- easier for me to think in these terms.
So first two tables; A = Department B = Employee
CREATE TABLE Department
  (
   DepartmentID int PRIMARY KEY
  ,DepartmentName varchar(20)
  ,DepartmentColor varchar(10)
  )
GO
CREATE TABLE Employee
  (
   EmployeeID int PRIMARY KEY
  ,EmployeeName varchar(20)
  ,DepartmentID int FOREIGN KEY REFERENCES Department ( DepartmentID )
  )
GO

Now I'll toss some data in
INSERT  INTO Department
  ( DepartmentID, DepartmentName, DepartmentColor )
 SELECT 1, 'Accounting', 'RED' UNION
 SELECT 2, 'Engineering', 'BLUE' UNION
 SELECT 3, 'Sales', 'YELLOW'  UNION
 SELECT 4, 'Marketing', 'GREEN' ;

INSERT  INTO Employee
  ( EmployeeID, EmployeeName, DepartmentID )
 SELECT 1, 'Lyne', 1 UNION
 SELECT 2, 'Damir', 2 UNION
 SELECT 3, 'Sandy', 2 UNION
 SELECT 4, 'Steve', 3 UNION
 SELECT 5, 'Brian', 3 UNION
 SELECT 6, 'Susan', 3 UNION
    SELECT 7, 'Joe', 4 ;

So, now I'll create a view on the first table to filter some departments out.
CREATE VIEW dbo.BlueDepartments
AS
SELECT * FROM dbo.Department
WHERE DepartmentColor = 'BLUE'
GO

This returns
DepartmentID DepartmentName       DepartmentColor
------------ -------------------- ---------------
2            Engineering          BLUE

And per your example, I'll add a view for the second table which does not filter anything.
CREATE VIEW dbo.AllEmployees
AS
SELECT * FROM dbo.Employee
GO

This returns
EmployeeID  EmployeeName         DepartmentID
----------- -------------------- ------------
1           Lyne                 1
2           Damir                2
3           Sandy                2
4           Steve                3
5           Brian                3
6           Susan                3
7           Joe                  4

It seems to me that you think that Employee No 5, DepartmentID = 3 points to nowhere?

"You'll end up with entries in the
  second view that point nowhere."

Well, it points to the Department table DepartmentID = 3, as specified with the foreign key. Even if you try to join view on view nothing is broken:
SELECT  e.EmployeeID
       ,e.EmployeeName
       ,d.DepartmentID
       ,d.DepartmentName
       ,d.DepartmentColor
FROM    dbo.AllEmployees AS e
        JOIN dbo.BlueDepartments AS d ON d.DepartmentID = e.DepartmentID
        ORDER BY e.EmployeeID

Returns
EmployeeID  EmployeeName         DepartmentID DepartmentName       DepartmentColor
----------- -------------------- ------------ -------------------- ---------------
2           Damir                2            Engineering          BLUE
3           Sandy                2            Engineering          BLUE

So nothing is broken here, the join simply did not find matching records for DepartmentID <> 2 This is actually the same as if I join tables and then include filter as in the first view:
SELECT  e.EmployeeID
       ,e.EmployeeName
       ,d.DepartmentID
       ,d.DepartmentName
       ,d.DepartmentColor
FROM    dbo.Employee AS e
        JOIN dbo.Department AS d ON d.DepartmentID = e.DepartmentID
        WHERE d.DepartmentColor = 'BLUE'
     ORDER BY e.EmployeeID

Returns again:
EmployeeID  EmployeeName         DepartmentID DepartmentName       DepartmentColor
----------- -------------------- ------------ -------------------- ---------------
2           Damir                2            Engineering          BLUE
3           Sandy                2            Engineering          BLUE

In both cases joins do not fail, they simply do as expected.
Now I will try to break the referential integrity through a view (there is no DepartmentID= 127)
INSERT  INTO dbo.AllEmployees
      ( EmployeeID, EmployeeName, DepartmentID )
VALUES( 10, 'Bob', 127 )

And this results in:
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint "FK__Employee__Depart__0519C6AF". The conflict occurred in database "Tinker_2", table "dbo.Department", column 'DepartmentID'.

If I try to delete a department through the view
DELETE FROM dbo.BlueDepartments
WHERE DepartmentID = 2

Which results in:
Msg 547, Level 16, State 0, Line 1
The DELETE statement conflicted with the REFERENCE constraint "FK__Employee__Depart__0519C6AF". The conflict occurred in database "Tinker_2", table "dbo.Employee", column 'DepartmentID'.

So constraints on underlying tables still apply.
Hope this helps, but then maybe I misunderstood your problem.
Comment: Problem stated perfectly. And yes, if the consuming queries used inner joins there would be no problem. They don't however. Since the foreign key may be null left joins are used. Which leads to the situation that you may get null columns due to the foreign key being null (which is intended) or null columns due to the referenced view not containing the requested rows (not intended and what I meant by "join failing").
Answer: Peter already hit on this, but the best solution is to:

Create the "main" logic (that filtering the referenced table) once.
Have all views on related tables join to the view created for (1), not the original table.

I.e.,
CREATE VIEW v1 AS SELECT * FROM table1 WHERE blah

CREATE VIEW v2 AS SELECT * FROM table2 WHERE EXISTS
  (SELECT NULL FROM v1 WHERE v1.id = table2.FKtoTable1)

Sure, syntactic sugar for propagating filters for views on one table to views on subordinate tables would be handy, but alas, it's not part of the SQL standard. That said, this solution is still good enough -- efficient, straightforward, maintainable, and guarantees the desired state for the consuming code.
Comment: Yes, I'd do it like this if I needed a feature like this.
Answer: If you try to insert, update or delete data through a view, the underlying table constraints still apply.
Comment: +1 for good answer. You cannot alter or modify all columns visible in view. Only those columns which do not affect any constraint, whether it is check constraint or any other u can modify that column
Answer: Something like this in View2 is probably your best bet:
CREATE VIEW View2
AS
     SELECT
          T2.col1,
          T2.col2,
          ...
     FROM
          Table2 T2
     INNER JOIN Table1 T1 ON
          T1.pk = T2.t1_fk

Comment: yeah, I'm aware of this solution but was hoping it could be avoided. Thanks.
Comment: If T-SQL hypothetically had such a feature for filtering one view based on another, I think Tom's answer would be the closest to what SQL server would be doing to produce the results.
Answer: If rolling over tables so that Identity columns will not clash, one possibility would be to use a lookup table that referenced the different data tables by Identity and a table reference.
Foreign keys on this table would work down the line for referencing tables.
This would be expensive in a number of ways
Referential integrity on the lookup table would have to be be enforced using triggers.
Additional storage of the lookup table and indexing in addition to the data tables.
Data reading would almost certainly involve a Stored Procedure or three to execute a filtered UNION.
Query plan evaluation would also have a development cost.
The list goes on but it might work on some scenarios.
Answer: Using Rob Farley's schema:
CREATE TABLE dbo.testtable(
id int IDENTITY(1,1) PRIMARY KEY,
val int NOT NULL);
go
INSERT dbo.testtable(val)
VALUES(20),(30),(40),(50),(60),(70);
go
CREATE TABLE dbo.secondtable(
id int NOT NULL,
CONSTRAINT FK_SecondTable FOREIGN KEY(id) REFERENCES dbo.TestTable(id));
go

CREATE TABLE z(n tinyint PRIMARY KEY);
INSERT z(n)
VALUES(0),(1);
go
CREATE VIEW dbo.SecondTableCheck WITH SCHEMABINDING AS
SELECT 1 n
FROM dbo.TestTable AS t JOIN dbo.SecondTable AS s ON t.Id = s.Id
CROSS JOIN dbo.z
WHERE t.Val < 50;
go
CREATE UNIQUE CLUSTERED INDEX NoSmallIds ON dbo.SecondTableCheck(n);
go

I had to create a tiny helper table (dbo.z) in order to make this work, because indexed views cannot have self joins, outer joins, subqueries, or derived tables (and TVCs count as derived tables).
Answer: You could stage the filtered table 1 data to another table.  The contents of this staging table are your view 1, and then you build view 2 via a join of the staging table and table 2.  This way the proccessing for filtering table 1 is done once and reused for both views.
Really what it boils down to is that view 2 has no idea what kind of filtering you performed in view 1, unless you tell view 2 the filtering criteria, or make it somehow dependent on the results of view 1, which means emulating the same filtering that occurs on view1.
Constraints don't perform any kind of filtering, they only prevent invalid data, or cascade key changes and deletes.
Answer: Another approach, depending on your requirements, would be to use a stored procedure to return two recordsets.  You pass it filtering criteria and it uses the filtering criteria to query table 1, and then those results can be used to filter the query to table 2 so that it's results are also consistent.  Then you return both results.
Answer: From a purely data integrity perspective (and nothing to do with the Query Optimizer), I had considered an Indexed View. I figured you could make a unique index on it, which could be broken when you try to have broken integrity in your underlying tables.
But... I don't think you can get around the restrictions of indexed views well enough.
For example:
You can't use outer joins, or sub-queries. That makes it very hard to find the rows that don't exist in the view. If you use aggregates, you can't use HAVING, so that cuts out some options you could use there too. You can't even have constants in an indexed view if you have grouping (whether or not you use a GROUP BY clause), so you can't even try putting an index on a constant field so that a second row will fall over. You can't use UNION ALL, so the idea of having a count which will break a unique index when it hits a second zero won't work.
I feel like there should be an answer, but I'm afraid you're going to have to take a good look at your actual design and work out what you really need. Perhaps triggers (and good indexes) on the tables involved, so that any changes that might break something can roll it all that.
But I was really hoping to be able to suggest something that the Query Optimizer might be able to leverage to help the performance of your system, but I don't think I can.
Answer: No, you can't create foreign keys on views.
Even if you could, where would that leave you? You would still have to declare the FK after creating the view. Who would declare the FK, you or the user? If the user is sophisticated enough to declare a FK, why couldn't he add an inner join to the referenced view? eg:
create view1 as select a, b, c, d from table1 where a in (1, 2, 3)
go
create view2 as select a, m, n, o from table2 where a in (select a from view1)
go

vs:
create view1 as select a, b, c, d from table1 where a in (1, 2, 3)
go
create view2 as select a, m, n, o from table2
--# pseudo-syntax for fk:
alter view2 add foreign key (a) references view1 (a)
go

I don't see how the foreign key would simplify your job.
Alternatively:
Copy the subset of data into another schema or database. Same tables, same keys, less data, faster analysis, less contention.
If you need a subset of all the tables, use another database. If you only need a subset of some tables, use a schema in the same database. That way your new tables can still reference the non-copied tables.
Then use the existing views to copy the data over. Any FK violations will raise an error and identify which views require editing. Create a job and schedule it daily, if necessary.

TSQL foreign keys on views?


How to create a Debian/Fedora live USB on Ubuntu 17.10?

Question: I tried to use Startup Disk Creator, but it seems that it can only create Ubuntu live disks. Is there any software that can help me create live USB disk for any .iso files? Please also mention how to use that software or provide a link to the guide of using that software.
Answer: You can use mkusb in Ubuntu to create USB boot drives for all the major linux distros. And you can use it in many other linux distros to create Ubuntu boot drives. The standard method clones the iso file to a live-only system on the target drive using dd under the hood. mkusb 'wraps a safety belt' around the powerful but dangerous dd tool.
See this link,
help.ubuntu.com/community/mkusb
sudo add-apt-repository universe  # only for standard Ubuntu

sudo add-apt-repository ppa:mkusb/ppa  # and press Enter
sudo apt-get update
sudo apt-get install mkusb mkusb-nox usb-pack-efi

There is a list of tested operating systems,
Linux distros where mkusb works
Answer: You could use dd from the terminal.
sudo dd if=/path/to/image.iso of=/dev/sd{device letter here}

You can get the device letter by running in the terminal
fdisk -l

and check which device is your pendrive.
Answer: You can use the restore disk image option in Disk Utility.

Unetbootin is also a great tool for making bootable pendrive.
Installation:
sudo add-apt-repository ppa:gezakovacs/ppa
sudo apt-get update
sudo apt-get install unetbootin

After installation, run the software and follow the on-screen instructions.
Comment: option has moved/changed in ubuntu 22.04. it is now at the top right. click the 3 dots and click restore image not create image


recpatcha returns 200, still get error with jQuery ajax

Question: All of my other searches yield responses about cross-domain requests.  It appears that I'm not having a problem with that.  I'm getting a response from the recaptcha server, but it's not being interpreted correctly.

This function lives in a page that's the target of a submitted form.  When I check fireBug for the results, I get this in my alert message:
Request Status: 200 Status Text: success Response Text: undefined

And the response captured by FireBug is
{
   "success": true
}

It seems that it gets mad without the parens wrapped around the returned JSON which I thought were supposed to come free with dataType: 'jsonp'
How do I resolve the success of this?
UPDATE
Adding additional return parameters to the error funcion: ( xhr , message , errorThrown ) produced the following:
Request Status: 200
Status Text: success
Response Text: undefined
Message: parsererror
ErrorThrown: Error: jQuery1120043068059910713263_1455115913634 was not called

I'm guessing that the jQuery1120043068059910713263_1455115913634 was not called message is the callback function randomly named by jQuery.  Does this mean that I need to add something to my logic, or that the reCaptcha server does not indeed support jsonp ?
Setting the dataType to "json" gives me a request status of 0.
UPDATE 2
I added this to my function:
jsonp: false,
jsonpCallback: 'onJSONPLoad',

and my errorThrown text changed to:
Error: onJSONPLoad was not called which leads me to conclude that reCaptcha does not support jsonp.  Can anyone confirm this?
Answer: I guess the Answer is:
The POST method is not available for jsonp, only GET
update:
As well as in the comment stated setting the dataType to"json" and it will automatically converted to jsonp, maybe try that
also you can add a third argument to the error function
error: function( xhr, message, errorThrown ) {

and errorThrown maybe is more explicit
Comment: While it is true that jsonp only works with GET, jquery will automatically ignore the method setting of POST and setup the call properly using a script tag. The op is wondering why the call is appearing to return properly but the json returned is causing the errror method to run.


Copy shipment data from canceled order to the new one on edit

Question: anyone one knows how to duplicate/copy shipment data with status from canceled order to The new one on edit? When i edit order my shipment data os reset to default status. I override The paynent methods to copy data and its ok but shipment os wrong. Anyone?
Answer: I would guess, just load the shipment data, clone it (check wether everything is cloned recursive), unset the ID, change the order id and save it :)


How to compile a plain LuaTeX file

Question: How do I write and compile a .tex file with plain LuaTeX? I use LuaLaTeX to compile some .tex files but how is an example of a plain LuaTeX file and how do I compile it? In the reference manual I did not find any example or a tutorial of how to do it. Is there any resource material in which I can learn more about creating and compile .tex files with plain LuaTeX?
Comment: I don't think there's anything special between plain LuaTeX vs. LuaLaTeX files as compared to how plain TeX vs. LaTeX files differ. You just write a plain TeX file in which you can use the new LuaTeX primitves, and compile that file via `luatex myfile.tex`.
Answer: It's important to understand than Plain TeX is only defined for TeX although it can be seen as a model to build more advanced TeX engines. Strictly speaking, there is no Plain TeX format for LuaTeX but a plain LuaTeX.
The idea is to define its own format like e.g. OpTeX or define a format "from scratch" using the engine primitives.
Note: In practice luatex-plain.tex actually reads plain.tex but it also reads luatex-basics, luatex-fonts, luatex-math....

How to compile a plain LuaTeX file


Looking for old Garageband loop

Question: I bought a Macbook Pro in 2005 which got destroyed. I used a glockenspiel loop on garageband and would like to use it again now I"m starting out with Logic x. This is all the info I have. Can anybody help?
Answer: First, I know little about Garage Band, but I got it on or with my first Macbook. The old version now shows up in the App Store under the 'Purchased' tab at the top of the page. You could try getting that version again.
Answer: What you could do is using the  DVD that came with your old mac, the DVD that holds iLife. You should be able to install the old garageband from it and to retrieve from this garageband the free apple loops.
What Scott suggests is a good idea, you just need to download the old Garageband and to download the loop from it. But this solution only works if your destroyed MacBook made the way from its original OSX version to Mavericks that introduces the new GarageBand
If your loop came from an Apple Jam Pack you can still install it on your new Mac, you can easily find it on amazon if you lose the DVD.
Answer: If you want to take a different route and look at what's available right now in the Apple software, there are 6 glockenspiel loops that show up in my GarageBand 10.1.0 loop search, and they came with the Jam Pack Symphony Orchestra, packaged with MainStage 3:

I hope this helps.

Looking for old Garageband loop


Samsung Galaxy S20 camera cannot use the flashlight

Question: I wanted to use the light with the camera, then it said that some other app is using the light and I see that the two icons on the right on the top are faded out. It's so horrible getting a high-end smartphone and I cannot even use the light with the camera. What can I do?
Answer: The first thing I see from the image you posted, it appears there is a line through the Flash Lightening Bolt on the left, meaning it is disabled. So I would attempt that button first. Otherwise...
Exit out of the camera app and use the following steps. Go back to camera app after each one to see if it allows normal flash use.

Clear cache on camera app
Force stop one app at a time that you believe may be the culprit, stopping you from using flash.
Try another camera app.
Verify you have a working light with some flashlight app.
Verify your phone hardware is legit with one of the verification apps in the play store.

All else fails, you can always factory reset. But if it is all original hardware, it's probably from something you recently downloaded.
Comment: I could activate the flash and like that take a photo with the built-in flash to get around the problem but it would be better to be able to use the flashlight and shine light on some object as an alternative.
Comment: Most "Camera apps" are made to be used as cameras, not flashlights. It sounds like what you're trying to do is just not a feature of your Camera app. Use a flashlight app instead.


What happens with MAC table in switch when I disconnect some device?

Question: I have found some information about switch MAC table here: How does a switch learn a switch table? . There is explained how switch learns MAC addresses but what happens when I manipulate cables? What happens when I disconnect one cable? What happens when I disconnect one cable and I will connect it to another port?
Answer: The entry in the switch mac table has a timestamp and all records have a lifetime. (300 seconds is a common value but it can be another value, and it may be configurable, depending on the switch vendor / model / software version).
So when you disconnect a device, the entry will be removed after some times.
Additionally some switches will immediately remove all entries listing a port if this port goes down.
A switch will keep a single entry for a given mac address, and if needed update it. So if you move a device from one port to another, when the device will sent a frame, the switch will update the mac table with the new port.
Things become more complex when you have many switches interconnected.
Comment: Thank you for your answer. Now I think that I understand it but imagine this situation: I move device from one port to another, old record is still in table because it hadn't reached lifetime yet and new record was not created because device hadn't sent anything yet. If now switch receives massage for this device it will be forwarded to a wrong port. Am I wrong?
Comment: @JohnR. Usually when a link comes up the device will send some traffic  almost immediately, e.g. DHCP or gratuitous ARP, so "device hadn't sent anything yet" is unlikely to occur. Unlikely but not impossible; e.g. if you have `switch -- hub -- PC` and you disconnect the hub from the switch, and reconnect it to a different port, then the PC does not see a link-down/link-up, so there will be no DHCP or GARP and so there is indeed a potential for that host to be unreachable until the mac aging timer on the switch expires (if there also is no other traffic like NTP or mDNS, or ...)
Comment: Mac-address table and arp-cache are located on the RAM, so, once switch is turned off, all info disappear.


Is there a way to have SQL work in parallelism with two computers?

Question: Amateur here. I have a couple of the same old 4 core computers that I am trying to use to beef up some automatic query scripts that run every evening for my hobby. I recently found MPICH to have the two computers communicate with each other.  I also found documentstion that allows postresql to use more than the default number of cores (It was set at 2). I am hoping there is some way of being able to use all 8 cores to run some SQL queries.  Is this possible? Any thoughts or recommendations are appreciated.
Comment: @ypercubeᵀᴹ setting up this beast on "a couple of the same old 4 core computers" might become a full-scale hobby in itself, don't you think?
Comment: Check **[Postgres-XL](https://www.2ndquadrant.com/en/resources/postgres-xl/)**.
Comment: @mustaccio sounds kinda cool to me! Better that than being mindlessly sat in front of a television or drinking yourself silly every evening!  To the OP, come back if you have problems! p.s. welcome to the forum! :-)
Comment: @mustaccio you are absolutely right but it does answer the question. If I posted an answer, there would be a notice or something about the extra work needed (compared to a Postgres installation).
Answer: If you want a solution using plain PostgreSQL, you will have to use sharding, that is, you will have to split the database into parts that you keep on different machines.
You can use PL/Proxy to have a single query run on all machines in parallel.


What does ringing the bell in Belfry Luna/Sol do?

Question: I explored Belfry Luna/Sol and I pull the lever that rings the bell but I totally failed to understand what does that actually do. Apparently, nothing happens, at least in single players but since those are pvp areas I wonder if it triggers some kind of online events.
Comment: I read somewhere that ringing the bell opens the door to the gargoyle boss fight, but I'm not sure if this is true. I had already rung it when I got there, so I don't know if the door was closed before.
Answer: If you're referring to the lever at the top of the ladder in Belfry Luna[The area you access via the Pharros' Lockstone passage] then it opens the gate blocking the mist for the Gargoyle boss fight.
The second bell in Belfry Sol (the sunlight roof area) unlocks the gate at the end of the rooftop area. I confirmed this today.
Comment: Yep I'm referring to both. Now that you mention it I remember the gate in front of the gate in Belfry Luna!
Comment: This is all that ringing the bells does, simply unlocks the boss fights. There is no in-game special event that is triggered by ringing both.


central a/c won't cool

Question: My A/C unit was just checked last week- the tech said it had enough freon.  Monday we had a nasty storm- electricity flickered, but never went out.  After the storm, we noticed the a/c went on, but it doesn't cool.  Checked the thermostats and the circut breaker- both are working correctly.  What can be wrong?  The unit is 22yrs old.  The tech did say we are running on borrowed time.  He did mention replacing the capacitor and contactor.
Comment: When did "the tech" say that the time was borrowed?
Comment: How have you verified that the thermostat is working? Is it turning the A/C unit on and off on the "cool" mode?
Answer: It could be a variety of things, but there's no way to be sure without troubleshooting the system.
Thermostat
It could be that the thermostat isn't signalling the A/C unit to start.
Things to check

The indoor blower comes on
The outdoor unit turns on
There's voltage on the A/C signal wire from the thermostat

Control board
The control board in the air handler/furnace could be bad.
Things to check

The indoor blower comes on
The outdoor unit turns on
There's voltage on the A/C signal wire to the A/C unit

Contactor
If the contactor is bad, the A/C unit will get the signal to come on, but the unit will not turn on.
Things to check

The outdoor unit turns on
There's voltage at the normally open contacts of the contactor (T1, T2, T3)

Blower
If the blower in the air handler/furnace is bad, cool air will not be blown throughout the home.
Things to check

The blower in the air handler/furnace comes on
Air flows from the supply ducts

Condenser fan
If the condenser fan isn't working, the system will have difficulty removing heat from the refrigerant.
Things to check

The fan on the outdoor unit (condenser fan) comes on

Compressor
If the compressor in the condensing unit is bad, the system will not move refrigerant through the system.
Things to check

The refrigerant lines are different temperatures
The compressor turns on (may have to touch the unit to tell)

Restricted air
If air isn't moving through the system properly, it won't work well.
Things to check

Air is being moved by condenser fan
Condensing unit coils look clean and free of debris
Air handler/furnace filter(s) are clean
Air is flowing from the supply ducts
Evaporator coils are clean and free of dust and ice

Refrigerant level
If there's not the correct amount of refrigerant in the system, it will not function properly.
Things to check

Refrigerant lines are at the proper operating temperature (requires knowing the operating temperature)
Operating pressure of the refrigerant lines (requires a set of gauges)

central a/c won't cool


How can I change the default file type for "Save Selection As"

Question: When using the menu item File - Save Selection As, the default file type is PDF. Is there any way to change the default to something else, for example PNG?
Answer: I am not aware of a programmatic way of doing this (other than programmatically opening/editing/saving this file) but you can do it by editing an internal file.

In a text editor open
FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd",
"TextResources", "CommonFrontEndInit.tr"}]
Find AddFileBrowserFilterPacket["SaveSelection", ...
Change the order of the file types, e.g. to show PNG by default move PNG to the top of the list

Now the default will always be PNG
Comment: Thanks a lot for this. I've been wanting to make this change for a long time, but didn't know how to do it.
Comment: works well thanks +1
Comment: Exactly what I needed, thanks Mike.


Why will a background image not show up?

Question:
Can someone please help me thanks!
https://www.the-blueprints.com/blueprints/modernplanes/boeing/19885/view/boeing_747-300/
this is where I got the image from
Comment: background images only appear in ortho views (numpad + 1, 3, 7 or ctrl to the opposite view)
Comment: you confused me do what?
Comment: @JustinH Please accept the answer that helped you as the answer to your question.
Comment: Alright so I went to right view then added a cylinder how do I make the cylinder longer / wider?
Answer: Background images are only visible in Camera View or in the Preset Ortho views along an axis.

Numpad 0 for camera view
Numpad 5 : shifts between ortho and perspective view
Numpad 1 : front view
Numpad 3 : right view
Numpad 7 : top view
Ctrl+Numpad 1 : back view
Ctrl+Numpad 3 : left view
Ctrl+Numpad 7 : bottom view
Answer: Background images only show up in camera view or on your Top, Bottom, Left... etc views, and you also have to be in orthographic mode.  To see the background image you need to switch to one of those views, and then switch to ortho mode by pressing 5 on the numpad or by pressing View Pers/Ortho in the view menu.


Download and View PDFs in iPhone

Question: I'm planning to develop an iPhone app in which will do the following:

download PDF file from my
website.
open PDF file which is password
protected
access this PDF file offline from
the iPhone

I really want to know how to achieve the above, what classes to use and what tips should I consider?
Thanks
Comment: you may want to look at this similiar question: http://stackoverflow.com/questions/4949809/pdf-viewer-ipad-app
Comment: As yms.cu suggested above, a password protected PDF will need to be opened by a custom PDF viewer, which the above link has some decent info on.
Answer:
When downloading large files on mobile devices it's a good idea to save the data as it comes in. I suggest you use a good network library that performs all this work for you: ASIHTTPRequest and AFNetworking are both very good and actively maintained.
Since your pdf files are password protected you'll need to write a custom pdf viewer. For non-password protected pdf files you could have used the QuickLook framework to display pdf files.

You can unlock pdf files by using the CGPDFDocumentUnlockWithPassword function which takes 2 arguments: a CGPDFDocumentRef reference to the pdf document and a const char* password. Opening the pdf file first with the CGPDFDocumentCreateWithURL function will give you a CGPDFDocumentRef reference.

Now that you've opened the pdf file you'll need to draw each page individually to a UIView. This is the hardest part and takes a lot of work to get it done right. This question on SO has helped me a lot while working on my customizable framework for rendering PDF files.
Answer: I've written a pretty good Kiosk-Example that does the download, displaying the progress bar, saving the pdf in documents directory, displaying, opening - everything you want.
Password support is included, and looks like that:
<code>const char *key = [passwordString UTF8String];
BOOL success = CGPDFDocumentUnlockWithPassword(pdf, key);
</code>

Download and View PDFs in iPhone


What is an integral transform, and is integration by parts an example?

Question: I came across the term "integral transform", and I'm curious what exactly this means, and whether integration by parts would be considered an integral transform.
Comment: Examples of integral transforms include Laplace, Fourier, Mellin, Hankel, and Bessel transforms.
Comment: No, int by parts is not considered a transform.  At best it's kind of the analogue to the product rule for derivatives.
Answer: Integral transforms look like
$$ \int_a ^b K(s, t) f(t) \ dt $$
where the function $K$ is called the kernel. The function $K$ acts as a catalyst, changing the form of the function $f$ fed into the function.
As @Dr. MV has said, the Laplace and Fourier transforms are common examples. The Laplace transform is
$$ \mathcal{L}(f) = \int_0 ^{\infty} e^{-st}f(t) \ dt $$
and the Fourier (well, the convention used in the text I'm reading) is
$$ \mathcal{F}(f) = \frac{1}{2\pi}\int_{-\infty} ^{\infty} e^{i\omega x} f(x) \ dx $$
Integration by parts is not an integral transform; it is a method we use to turn hard integrals into easier ones. You'll usually use integral transforms in differential equations. They're very powerful there.
Answer: Just a comment:
One thing is what a "integral transform" is. Another, for what it is useful to. The beauty of Laplace Transform for example, is to change a "differential equation" problem into a "algebraic" one. So, instead of solving the differential equation directly, you first transfom it (to the "s" variable), solve the algebraic equation, and transform back by a Laplace Inverse transformation to get the solution in the original variable. Very common aplication over electrical circuits on steady-state analysis: instead of analyzing the problem over "time" (using t as a variable) you transform it over the "frecuency space" (using s as a variable) and make the analysis as you need.