How do you create divs below the fold in Adobe Edge Reflow?

Question: When designing in Adobe Edge Reflow, how do you create divs that start below the fold? Using this site as an example, after you created the top level purple screen, how would you create and position the next screen down with the cream colored background?
Comment: It's not that it starts 'below the fold' but that the div above just happens to be as tall as your screen. Remember, there is no magic 'fold' in a web page, so it will always be somewhat arbitrary where you decide it is.
Answer: As DA01 said, it's about making the content above equal to the height of the viewport.
I haven't used Edge Reflow (and only mucked about a bit with a version of Edge when it was in beta), so I don't know if there are any Edge Reflow specific commands to make it happen. I'm just installing it now to have a play with, and see if I can discern an answer.
Meanwhile...
What you want done can't be done with just CSS. You have to use Javascript.
In jQuery, you can get the height of the viewport with:
<code>var viewportHeight = $( window ).height();
</code>
Then you assign that to the height of the element you want:
<code>$( "#divAboveTheFold" ).css( 'height', viewportHeight + "px");
</code>
In the example above, you would've assigned an id of "divAboveTheFold" to the element in your html markup that you want to take up the full height of the viewport at the top of your page.
If you have any detailed questions about how to use Javascript / jQuery, you're probably better off searching/asking on StackOverflow.
Things to bear in mind:

If you have top or bottom padding applied to the #divAboveTheFold,
then you have to subtract them from the viewportHeight before you
assign it to #divAbovTheFold.
You would want to make sure this resizing happens not just when the
page loads, but also on browser resize.
If #divAboveTheFold has more content than can fit vertically in the space you've allowed, then the content will be cut off.
Not all devices report the correct viewportHeight, such as Mobile Safari.

There are probably other issues you'll run into as well.
Unless making your top div the height of the viewport is mission critical to your design, I'd probably just leave it.

UPDATE
I've just had a look at Edge Reflow. It doesn't support Javascript, so the answer to your question is:
You can't do what you want to do in Adobe Edge Reflow.
Comment: It doesn't support JavaScript!? I find that a) sad, but also b) believable. *Sigh* :)
Comment: Edge Reflow seems to be used purely for generating CSS (with a focus on responsive design). Edge Code does HTML, CSS and Javascript. The reason they've broken it up into two programs is because... well... um... yeah, no idea :)
Comment: Huh. Maybe I should play with it again, but I can't say it sounds promising. Actually sounds like a step backwards from DreamWeaver (which was never that great at code anyways...)
Comment: I had a quick look, and it apparently integrates with Photoshop to allow you to make quick 'live action' comps from your PS designs. http://html.adobe.com/edge/reflow/photoshop-plug-in.html.  Although I don't think I'd use it to generate production code.


Square root of a positive real analytic function

Question: Let $f(x) : \mathbb{R} \to \mathbb{R}$ be a positive real analytic function of $x$. My question is, how can I prove or disprove that $g(x) := \sqrt{f(x)}$ is also real analytic? I am new to this stuff, and my definition of real analytic functions is something that has a Taylor series expansion. However, I am having trouble implementing this definition on $g(x)$ directly. Is there any other way to check real analyticity? Thanks!
Answer: Okay, I think I have an idea: from Andres Caicedo's answer on this MSE post, we know that the composition of real analytic functions is real analytic.
So, we can write $$\sqrt{f} = e^{\text{log}(\sqrt{f})} = e^{\frac{1}{2}\text{log }f}.$$
I think this solves the problem?
Comment: To be a completely correct solution, you should add something like: The function $\sqrt x$ is analytic on $(0,\infty)$.
Comment: Solution by @novice has a lack: we must require that ln f(x) is analytic, which does not hold for, e.g., f(x)=x at x=0.


How do I animate part of a plane getting longer over time?

Question: I would like to be able to take a plane, and animate one or more parts of it extending (getting longer over time. I include an image of what I want to happen over time.
Answer: You can create this extrusion, then keep the edge selected and CtrlH > Hook to New Object in order to hook these vertices to an empty:

Back to Object mode, select the empty and move it:
Comment: A thousand thanks, moonboot: it worked! If anyone is interested in how I animated the plane moving, I began by following moonboot's advice above. Then, in Object mode, I set a key frame at frame 1, choosing the "location, rotation, scale and custom properties" option. Then, still in Object mode, I moved the empty, which made the plane grow longer. Then at key frame 30, I added another key frame, choosing the "location, rotation, scale and custom properties" option again. When I played back the animation, it looks as though the plane is growing longer along one of it's edges. FABULOUS!


Using ST_LINE_INTERPOLATE_POINT in OGR and Python

Question: I'm interested in finding the midpoint on a linestring using OGR and Python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in Python using the ExecuteSQL() method?
If so, could someone perhaps help me formulate the correct SQL query?
Or is there an alternative option? I considered using Centroid but the centroid can also lie outside of the geometry.
---- UPDATE ----
I have QGIS installed on Windows and use the OSGeo4W shell. I made the following Python code but unfortunately it doesn't work, geom is seen as a NoneType.
from osgeo import ogr

outdriver=ogr.GetDriverByName('SQLITE')
source=outdriver.CreateDataSource('temp')
tmp=outdriver.Open('temp')
layer = tmp.ExecuteSQL("""SELECT ST_AsText(ST_Line_Interpolate_Point(ST_GeomFromText('LINESTRING ( 90 379, 99 278, 189 224, 297 193, 403 189, 459 202 )'),0.5))""")
geom = layer.GetNextFeature().GetGeometryRef()
print geom.ExportToWkt()

Answer: As described in https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html the function is used as

ST_Line_Interpolate_Point( line Curve , fraction Double precision ) :
  Point

An example that can be tested with SQL command line for example with spatialite-gui. Fraction=0.5 finds the midpoint.
SELECT ST_AsText(
ST_Line_Interpolate_Point
(ST_GeomFromText('LINESTRING ( 90 379, 99 278, 189 224, 297 193, 403 189, 459 202 )'),0.5))

POINT(222.434071 214.403183)

You can use that query as a template for your ExecuteSQL(). Remember that you must use the SQLite SQL dialect and GDAL must be compiled with such Spatilite version that has the ST_Line_Interpolate_Point function.
Answer: The PyQGIS geometry object (QgsGeometry) has an interpolate function. The OGR geometry object I am using does not. So I will use QgsGeometry instead.
See: https://woostuff.wordpress.com/2012/08/05/generating-chainage-distance-nodes-in-qgis/


Is my plan for an air admittance valve ok?

Question: I am in the middle of finishing my basement and want to add a sink that will attach to an existing kitchen drain from above. I don't have a way to vent the sink easily unless I use a Air Admittance Valve. The drain will run about 5 feet, make a 90 degree and run another 4 feet. Would the attached diagram work correctly? Anything in blue is the new plumbing.
Comment: question:  isn't the "existing drain from kitchen" already a vented line?
Comment: In the setup you've drawn, the air admittance valve wouldn't be doing anything that the sink hole itself isn't already doing. The point of vents is to stop moving bodies of water on the *sewer side* of the trap from sucking the pipe (and trap) dry. Your existing kitchen DWV might already provide enough air as Leo queried above, but if not, put the AAV in the position Isherwood shows in his answer (as long as it's permitted by local code).
Answer: The valve needs to be downstream of the trap, basically in the position an actual vent would be.

source
Also, be sure they're legal where you are. My local inspector forced me to run a new vent line and tie into the existing stack above the upstairs sink drain when I wanted to add a laundry drain.
Answer: The diagram installation would reduce the vortex of water draining but it would not be protecting the plumbing fixture trap and it would not be proving a means of venting as defined in the plumbing codes.


What potential H2O bio-equivalents would (critically) also float when frozen?

Question: Because water ice is less dense as a liquid than a solid (as an aside - this is due to the basic structure of the oxygen atom) it floats when frozen.  Without this property ice  would  sink, basically filling up every ocean and lake from the bottom up.  In any biosphere, a basic solvent is required, which is water on Earth.  What other solvent in another "bio-mix" (for example, a methane-ethane atmosphere) would also possess that seemingly critical property of floating when frozen?
Comment: This was flagged as unclear.  I think people are confused because the body is written as an adjunct to the Title, rather than being readable on its own.  Look over some of the other questions here to see how they are normally composed.
Answer: From Wikipedia, via Physics.SE,  acetic acid, silicon, gallium,germanium, bismuth, plutonium. Also, Silicon dioxide this property.
Of these, acetic acid (16C) and gallium (30C) both have reasonable melting points. Bismuth melts at 271 C, and germanium at 938 C. Acetic acid has a boiling point of 118 C. The metals, on the other have boiling points of 2400 C, 2833 C, and 1564 C, so even if you could plausibly have an ocean of gallium, you would never have gallium rain (which doesn't sound that great anyways).
Silica and Silicon dioxide have similarly huge melting and boiling points. Plutonium has the problem that an ocean thereof will a. radioactively decay to lead in a few million years, and b. destroy itself in a nuclear blast well before then.
So acetic acid is really our only reasonable contestant for a 'water' cycle like on Earth. With gallium unable to evaporate, there doesn't seem to be any way to get gallium onto land, making life outside the oceans mostly impossible. So any gallium creatures will be 'oceanic'.
The last bit is you want to life-solvent to be able to interact with a lot of other compounds to be able to support metabolic processes. Water, for example, can dissolve almost anything, and reacts with lots of compounds to make interesting and potentially life-sustaining substances. Gallium does not really work in this way. It is related to Aluminum chemically, and can make a lot of crystalline compounds, but those are all solids. It doesn't really make any special liquids or gases, the way the hydrogen and oxygen and water do. On the other hand, as a metal, gallium has a lot of interesting properties of electron transfer that covalent compounds like water do not have. I do not know enough chemistry to speculate on how electron transfer between the metallic bonds could be used to make metabolic processes, but there may be a way.
For a more traditional solvent, acetic acid is the way to go. I can't find anything about the chemical properties of pure acetic acid, since it is usually used in solution with water (as vinegar). However, the acetyl and hydroxyl groups that form it are both chemically active in a great many biological processes. Acetic acid seems like your best bet.
Comment: Plutonium?! Well, now THAT would be an incredible type of life.
Comment: TY - It might come to nothing about my question per se, but I do know that the Defense Department investigated using gallium arsenide instead of silicon in computer chips to better harden them against electromagnetic radiation.
Comment: I've got some old sources that would tell me your choices are Water and Ammonia for the bio-matrix.


Does viewstate expire?

Question: Let's say you have a aspx page that does not rely on session, but does rely on viewstate for persistance between postbacks.
If a user is accessing this page, and leaves for a long lunch, will viewstate still be valid when he returns?
Answer: Viewstate itself does not expire. Since it's posted back in a form, it can be reconstituted any time.
According to MSDN: "...it is possible for view state to expire if a page is not posted back within the session expiration time". So, in a round about sort of way, it can expire if your session does, but viewstate does not directly expire. Since you're not using session state anyway, you don't have to worry about implicit expiration.
Note that I wouldn't have said it expired. That was MS who I quoted in their own article entitled Controlling ViewState
Comment: That 'controlling viewstate' is an article about moving viewstate into sessions to perform better on basic clients like phones.  If you do that and use the default save-viewstate-in-session, it keeps viewstate in session, and only keeps the last X viewstates in the session.  But that doesn't mean viewstate expires - that means the session expires, and you have moved viewstate into session instead of using the form variables.  I think you're mixing up two different things here.
Answer: No ViewState is kept as part of the PostBack process.  You can, however, override the Page class's  SavePageStateToPersistenceMedium() and LoadPageStateFromPersistenceMedium(), to implement that behavior if desired.  For more information read Understanding the ASP.NET ViewState.
Note that Page ViewState is stored in the Session so if your Session expires, the ViewState will be lost.  I wouldn't say this is ViewState expiring, but yes, it will be destroyed after Session timeout.
Comment: How is "No" flagged as the answer?  Viewstate doesn't expire, it's form variables.  Logged in user credentials may expire in this scenario, but that's it.
Comment: I'm not even sure if wprl's answer is "No". it depends whether there is a comma missing after the word "No". Either way I'm struggling to understand what this answer is trying to say
Answer: Also, as a gotcha, by default ASP.NET encrypts ViewState with an autogenerated key. This can be overridden with the MachineKey element in the web.congif file.  Even though ViewState won't expire, it can become invalid if a different autogenerated key is used to decrypt ViewState, such as after an IIS Reset, redeploying an application, or hitting a different server in a web farm.  If you're planning on storing viewstate for long periods of time, watch out for how it's encrypted/decrypted.
http://msdn.microsoft.com/en-us/library/ms998288.aspx
Answer: Viewstate does not expire.
All viewstate data is stored on the client and is submitted back to the server when the user executes a postback.
This has some very interesting implications, and is explained very thoroughly here.
Answer: Yes, ViewState expires in certain conditions. For example when you are using iframe:s, or when you are upkeeping "live" connection to the server with regular postbacks. Then you might want to investigate this option: <sessionPageState historySize="9"/>, which actually hard-codes how many "postback results" are stored in the Session (if SessionPageStatePerster is used). Each postback stores it's ViewState to the end of the Queue in Session["__VIEWSTATEQUEUE"], and deletes ViewStates that are "too old". And how do you think SessionPageStatePerster decides which ViewStates are too old.. by configuring some arbitrary historySize-constant in web.config.. Omg! It too me forever to find this problem...  My hatred toward asp.net programming is undescribable now.. grrr...
Answer: Viewstate does not expire, as long as they are still on the page, it will still be there and functional.
Answer: The ViewState will persist from POST to POST.  It's actually stored inside a hidden field on your form so that it gets POSTed back to your server all the time.
As long as you aren't relying on the Session you shouldn't have any problems rebuilding page state.  It's easy to test your Page's state code if you want though: just set your session to expire after 60 seconds in your web.config then load your page, wait a little more than a minute (surf over to Stack Overflow and answer some questions) and then click a button on your page.
Answer: Sorry to relive this old thread, but new information is available now:
Yes, ViewStates expire. I come from 19 hours researching about a problem of ViewStates losing its values between long time interval postbacks. It took me a while reading MSDN documents and Stackoverflow answers saying it was basically impossible to happen unless a custom ViewState storage implementation was employed, which, now I know, it's not true.
My problem was taking place in a SharePoint 2013 environment. The service known as Distributed Cache (a.k.a. AppFabric) does the caching of the ViewState and has a Time to Live associated to it. You can find more information here:
http://blogs.msdn.com/b/besidethepoint/archive/2013/03/27/appfabric-caching-and-sharepoint-1.aspx
The interesting bit of information can be found in this phrase:
"To improve page performance, beginning in SharePoint 2013 SharePoint caches ViewState data server-side rather than transferring it back and forth to clients."
I hope this information helps somebody so desperate as I was 19 hours ago.
Answer: ViewState is kept in a hidden field on the page itself.  So as long as the user has the page, he'll have the ViewState.  But if your app automatically logs the user out after a certain period of time, still having the ViewState may not do him any good.
Answer: By default, Viewstate is included with the html content as a hidden input.  That means it won't expire, but that everything in viewstate must be uploaded from the user's browser.  Since that's typically the slowest part of the connection in a public site, putting a lot of stuff in viewstate can quickly make your site seem very slow.
Answer: The short answer is: no.
The longer answer is: it depends on implementation of ViewState storage. You can provide custom implementation of ViewState which could expire after given amount of time. For example, you could store ViewState in database or on disk and send only some reference to the stored value in a hidden field. Then you can use batch processing to remove outdated ViewState data or perform expiration upon request.
Answer: No Viewstate doesnot expires.After redirecting to other page then value of view state lost or expire viewstate.
for more detail http://www.c-sharpcorner.com/UploadFile/78d182/Asp-Net-state-management-techniques/

Does viewstate expire?


Which one is correct "Facilitate easy operation" or "Facilitate operation"?

Question: The dictionary says Facilitate means ease and I have seen many people using facilitate easy operation, facilitate easy learning etc. What is the correct usage??
Comment: *Facilitate's*, in the sense of, '[*makes for*] easy operation' is an acceptable redundancy in this case.
Comment: _facilitate_ is often abused as a long word for _enable_, in which case it's not so redundant.
Comment: +1 @Barmar - yes, and 'makes for,' and 'allows for,' (both rather *antiquated*) are cognate with *enable*. Good point.
Answer: One more detailed definition gives:

To make easy or easier.
To help bring about
To preside over (a meeting, a seminar)

It's easier to see how "help bring about easy learning" works than "ease easy learning".
There are other dictionaries that give even more detailed definitions than that.
Still, as a tool to understanding, a dictionary that only listed ease can still be enough here.
Say we want easy learning. That's a goal we need to get to, so we want something to help us get there; we want something that eases easy learning.
There isn't a redundancy or repetition; the ease of the verb (what it does) and the easy of the object (what we want) are not the same easy.
It is a repetition in that it repeats two words that mean the same thing, albeit in places where they do different things, which while it isn't logically wrong does still sound silly, but then that's a reason in itself to use facilitate instead of ease.
In all both "facilitate learning" (help learning happen) and "facilitate easy learning" (help learning happen and be easy) make sense. Either way they refer to easing the process of something happening, but they differ as to whether that thing itself is easy.
Answer: I agree with Larry Terrell. "Facilitate easy learning" is redundant. "Facilitate learning" would work, as would "make learning easy." "Enable easy learning" mixes registers, as "enable" is a lot more formal than "easy" but there's no redundancy in it. I personally would choose "Facilitate learning" in a formal text, or "make learning easy" if I were aiming for simplified English (sometimes called plain speech).
Answer: There is an undeniable sense of redundancy in "facilitate easy learning", since "facilitate" already carries the idea of making something easier.  It's a bit like "learning from past experience".  Is there any other kind?  Could you "facilitate difficult learning"?


Is it possible to relocate the camera to the binded group without double-tap?

Question: I'm looking for an alternative to double-click in StarCraft 2. I would like a number key (or a custom key) to relocate the camera to the associated numbered group with just a single-click. Is it possible?
Comment: I don't think there is a faster way than pressing your group's key twice.
Comment: I'm a bit confused. Do you actually click on the button in the UI or double-tap the key on your keyboard?
Comment: @F.S. By 'double-click' I meant pressing a key twice (on the keyboard) not UI mouse-click of course =)
Answer: The only three methods I am aware of are

Hit the number and then mouse-click at the unit portrait to center your screen over the selected unit/building
Bind your control group keys to 2 hotkeys (Primary and Alternative hotkey) and hit both after each other
Hit the hotkey for Center on Current selection (Ctrl+F by default)

Nevertheless, all ways would need 2 clicks or key presses anyway.
But I think simple double-tapping is the fastest way to move your screen to a control group. Also you don't want your screen to move every time but only check what your group is doing, e.g. building or research progress.
Answer: In starcraft2 there are numerous ways to move your mouse:

Double-Tap Stored Unit Selection Key
Store Screen location (Shift + F5 saves - F5 then jumps to that location)
Select Unit and click Portrait in bottom right.

None will center your screen above a Unit without at least two key presses.
(Unless you own a programmable Keyboard where you could define macros that double-tap the key for you)
Answer: It's indeed impossible afaik to bind to a single button. However, if you bind 'center on selection' to §, or an equally accessible button, you can recall your control group and then immediately press § as a single action, so you don't have to use the clumsy double-tap. Almost as good as a single button.


RC Filter for Low Power consumption

Question: I was thinking about selecting R & C values for an RC filter, so that it consumes less power, in the overall circuit.
Thinking about it, a larger value for R means a larger \$I^2R\$  loss.
But a Larger value for C means requires more current to charge.
Can anyone suggest on how should I go about selecting these?
Comment: `Thinking about it, a larger value for R means a larger I2R loss.` No! Let me correct your thinking: If we have constant voltage, then \$I=\frac{V}{R}\$. Using that, we can rewrite \$I^2R\$ as \$\frac{V^2}{R^2}R\$ or \$\frac{V^2}{R}\$. From this, we cans see that by increasing resistance, losses will decrease. If we look at the \$I^2R\$ equation, we can see that the losses are directly proportional to resistance but have square proportion to current. On the other hand, current is inversely proportional to resistance.
Comment: What's your application.?
Comment: Andy, its a PLL circuit
Answer: For a given RC time constant, you want to increase the value of R and decrease the value of C so that the product of these values is unchanged. The disadvantage is that whatever you connect to the output side of the filter must have a much higher input impedance than R or it will affect the time constant.
Comment: You want to increase R so you can decrease C and keep the RC time constant the same. It's charging and discharging the capacitor that takes energy, so reducing C will reduce the power consumption of the filter.
Comment: Thanks! ,What is the reason for increasing R?
Answer: For an RC low-pass filter with time constant \$\tau = RC\$, the power dissipated (lost as heat in the resistor) by the filter at some frequency \$\omega\$ is proportional to
$$P(\omega) \propto \dfrac{\omega \tau}{1 + (\omega \tau)^2}\omega C $$
Thus, decreasing \$C\$ while increasing \$R\$ in order to keep \$\tau\$ constant will result in less dissipation for a given frequency \$\omega\$.

RC Filter for Low Power consumption


If PGP and GPG both follow the OpenPGP standard, are they 100% compatible in all use cases?

Question: If someone gives me their PGP key, can I use it with GPG, and vice versa, all the time (100% interchangeable)? Or are there times when they are not compatible, when only PGP can be used with a PGP key, and only GPG used with a GPG key?
Answer:
"If PGP and GPG both follow the OpenPGP standard, are they 100% compatible in all use cases?"

No, they are not 100% compatible in all use cases, because — depending on the PGP version — there are known interoperability problems.
The GNUPG FAQ answers this question quite well:

Is GnuPG compatible with PGP?
In general, yes. GnuPG and newer PGP releases should be implementing the OpenPGP standard. But there are some interoperability problems. See question How can I encrypt a message with GnuPG so that PGP is able to decrypt it? for details.

For your convenience, I'll also quote that linked Q&A:

How can I encrypt a message with GnuPG so that PGP is able to decrypt it?
It depends on the PGP version.

PGP 2.x
You can't do that because PGP 2.x normally uses IDEA which is not supported by GnuPG as it is patented (see How do I include support for RSA and IDEA?), but if you have a modified version of PGP you can try this:
<code>$ gpg --rfc1991 --cipher-algo 3des ...
</code>
Please don't pipe the data to encrypt to gpg but provide it using a filename; otherwise, PGP 2 will not be able to handle it.
As for conventional encryption, you can't do this for PGP 2.
PGP 5.x and higher
You need to provide two additional options:
<code>--compress-algo 1 --cipher-algo cast5
</code>
You may also use "3des" instead of "cast5", and "blowfish" does not work with all versions of PGP 5. You may also want to put:
<code>compress-algo 1
</code>
into your ~/.gnupg/options file — this does not affect normal GnuPG operation.
This applies to conventional encryption as well.

I think that pretty much answers your question.
Comment: There are several other subtle hurdles, including: not-so-old-and-still-around versions of GPG insist to require installation of a plugin to handle the IDEA block cipher, required for compatibility with cryptograms generated by PGP when old-format keys are used with default (or at least common) options. Fortunately, the IDEA patent has expired and GPG (starting end of 2012) comes with IDEA built-in.
Comment: @fgrieu: [this SU comment from 2018](https://superuser.com/questions/378873/are-files-encrypted-with-gpg-compatible-with-pgp#comment2069531_378964) says IDEA was still a problem.
Answer: From my recent experience, it's not always compatible. Using the latest version of GnuPG and Symantec PGP, I was able to confirm at least the fact that a 16384-bit RSA key pair (with 4096-bit subkeys) generated in GnuPG will not be usable in Symantec PGP. All of the cipher, hash algorithm, and compression preferences will be displayed as none, the expiry date will be Never, and you cannot even encrypt with the key. The cipher, hash algorithm, and compression preferences cannot be changed either leaving you with a key that is completely unusable. Of course, 16384-bit keys are not guaranteed to work in standard versions of GnuPG either. I've yet to explore the full extent of the compatibility between the two pieces of software, but I suspect the only real way to ensure compatibility is to stick with the lowest common denominator options in both programs.
Answer: Symantec PGP and GnuPG derive different key id's when importing an X.509 certificate (or a PKCS#12 keystore containing a certificate).  Symantec PGP extrapolates the OpenPGP standard, substituting the certificate's "notBefore" date for the key creation date.  GnuPG derives the key id from a hash of the entire certificate.


jQuery object and DOM element

Question: I would like to understand relationship between jQuery object and DOM element..
When jQuery returns an element it shows up as [object Object] in an alert.
When getElementByID returns an element it shows up as [object HTMLDivElement]. What does that mean exactly? I mean are both of them objects with a difference ?
Also what methods can operate on jQuery object vs DOM element? Can a single jQuery object represent multiple DOM elements ?
Comment: http://stackoverflow.com/questions/15479988/raw-dom-element-vs-jquery-object
Answer:
I would like to understand relationship between jQuery object and DOM element

A jQuery object is an array-like object that contains DOM element(s). A jQuery object can contain multiple DOM elements depending on the selector you use.

Also what methods can operate on jQuery object vs DOM element? Can a single jQuery object represent multiple DOM elements ?

jQuery functions (a full list is on the website) operate on jQuery objects and not on DOM elements. You can access the DOM elements inside a jQuery function using .get() or accessing the element at the desired index directly:
$("selector")[0] // Accesses the first DOM element in this jQuery object
$("selector").get(0) // Equivalent to the code above
$("selector").get() // Retrieve a true array of DOM elements matched by this selector

In other words, the following should get you the same result:

alert($("#foo")[0]);
alert($("#foo").get(0));
alert(document.getElementById("foo"));

For more information on the jQuery object, see the documentation. Also check out the documentation for .get()
Answer: When you use jQuery to obtain an DOM element, the jQuery object returns contains a reference to the element. When you use a native function like getElementById, you get the reference to the element directly, not contained within a jQuery object.
A jQuery object is an array-like object that can contain multiple DOM elements:
var jQueryCollection = $("div"); //Contains all div elements in DOM

The above line could be performed without jQuery:
var normalCollection = document.getElementsByTagName("div");

In fact, that's exactly what jQuery will do internally when you pass in a simple selector like div. You can access the actual elements within a jQuery collection using the get method:
var div1 = jQueryCollection.get(0); //Gets the first element in the collection

When you have an element, or set of elements, inside a jQuery object, you can use any of the methods available in the jQuery API, whereas when you have the raw element you can only use native JavaScript methods.
Answer: I just barely started playing with jQuery this last month, and I had a similar question running around in my mind.  All the answers you have received so far are valid and on the dot, but a very precise answer may be this:
Let's say you are in a function, and to refer to the calling element, you can either use this, or $(this); but what is the difference?  Turns out, when you use $(this), you are wrapping this inside a jQuery object.  The benefit is that once an object is a jQuery object, you can use all the jQuery functions on it.
It's pretty powerful, since you can even wrap a string representation of elements, var s = '
hello world
!', inside a jQuery object just by literally wrapping it in $(): $(s).  Now you can manipulate all those elements with jQuery.
Answer: Most jQuery member Functions do not have a return value but rather return the current jQuery Object or another jQuery Object.

So,
console.log("(!!) jquery >> " + $("#id") ) ;

will return [object Object], i.e. a jQuery Object which maintains the collection which is the result of evaluating the selector String ("#id") against the Document,
while ,
console.log("(!!) getElementById >> " + document.getElementById("id") ) ;

will return [object HTMLDivElement] (or in fact [object Object] in IE) because/if the return value is a div Element.

Also what methods can operate on jQuery object vs DOM element? (1) Can a single jQuery object represent multiple DOM elements ? (2)

(1) There is a host of member Functions in jQuery that pertain to DOM Objects. The best thing to do imo is search the jQuery API documentation for a relevant Function once you have a specific task (such as selecting Nodes or manipulating them).

jQuery documentation

(2) Yes, a single jQuery Object may maintain a list of multiple DOM Elements. There are multiple Functions (such as jQuery.find or jQuery.each) that build upon this automatic caching behaviour.
Comment: Oh ok..so only in browsers other tha IE does it specifically state  "[object HTMLDivElement]" vs [object Object]
Comment: As far as I know, yes that's the case. In IE `[object Object]` would still be a `div` `Element` though. If selected with jQuery it would be a `jQuery Object`.
Answer: That's just your browser being clever. They're both objects but DOMElements are special objects. jQuery just wraps DOMElements in a Javascript object.
If you want to get more debug info I recommend you look at debugging tools like Firebug for Firefox and Chrome's built-in inspector (very similar to Firebug).
Answer: Besides what has been mentioned, I'd like to add something about why jQuery object is imported according to description from jquery-object

Compatibility

The implementation of element methods varies across browser vendors and versions.

As an example, set innerHTML of element may not work in most versions of Internet Explorer.
You can set innerHTML in jQuery way and jQuery will help you hide the differences of browser.
// Setting the inner HTML with jQuery.

var target = document.getElementById( "target" );

$( target ).html( "Hello World!	" );

Convenience

jQuery provides a list of methods bound to jQuery object to smooth developer's experience, please check some of them under http://api.jquery.com/. The website also provides a common DOM manipulation, let's see how to insert an element stored in newElement after the target element in both way.
The DOM way,
// Inserting a new element after another with the native DOM API.

var target = document.getElementById( "target" );

var newElement = document.createElement( "div" );

target.parentNode.insertBefore( newElement, target.nextSibling );

The jQuery way,
// Inserting a new element after another with jQuery.

var target = document.getElementById( "target" );

var newElement = document.createElement( "div" );

$( target ).after( newElement );

Hope this is a supplement.

jQuery object and DOM element


Extract error writing to oraociei12.dll while installing QGIS v.2.12.2-1

Question: I keep getting this error about 90% through the installation.  As per answer to another v. similar thread I have checked via Command Prompt tasklist/m function that there are no other processes or applications using the file.  So what now ? Any suggestions most welcome.
Answer: It would appear that library file is used in Oracle. Are you wanting to use this within QGIS? If not then you could consider installing and running the OSGeo4W Network Installer.
When you run it, select the Advanced Install option and follow through the instructions until you see the Select Packages menu. Type "oracle" in the search and select an option that doesn't involve installing it (e.g. Skip or Keep as shown in the red box).

Note: This is purely conjecture on my part as I haven't come across this issue before.
Comment: Many thanks Joseph, I will give that a go as I don't need to use Oracle (best left well alone !).  I have successfully installed QGIS though on another, presumably 'cleaner' laptop so if it doesn't work all is not lost.  Thanks again, Alastair
Comment: I had the same problem. Used the the hint Joseph gave: install teh OSGeo4W Network Installer. It may have to do with Oracle conditions for usage as it came with an agree or not question for oracle usage even though I had already unchecked the oracle parts.
Comment: @AlastairMorton - Most welcome buddy, glad you got installed! It's always handy having more than one computer at your disposal :)
Answer: I had the same problem with QGIS 2.18.12. Before there was installed version 2.18.11 which I deinstalled correctly. So I couldn't believe that oracle is the reason. In pure distress I cleared up my C:-device. This solved the problem.


Can anyone suggest a text on polyhedral theory?

Question: Can anyone suggest a text on polyhedral theory? Particularly on increasing the number of faces under projections. 0,1 polytopes
Comment: Günter M. Ziegler's *Lectures on Polytopes* ([Springer link](http://link.springer.com/book/10.1007%2F978-1-4613-8431-1)) is superb,
but may not be the best source for your specific interests (upon which you might elaborate).
Answer: Reading between the lines of your comment about increasing the number of faces under projections, I'm guessing that you're interested in the subject known as "extension complexity."  Starting with some complicated polytope like the traveling salesman polytope, one wants to know if it is the projection of a much simpler polytope in slightly higher dimension.  This recent paper by Fiorini et al. has a lot of relevant references.  This is an active research area so I think there is no single book that really covers the area properly.
But if you're instead looking for a general textbook treatment of polyhedral theory in the context of combinatorial optimization, a standard reference is Schrijver's magnum opus Combinatorial Optimization: Polyhedra and Efficiency.
Answer: General references on polytopes are:

Ziegler: Lecture on Polytopes (already mentioned by Joseph O'Rourke in a comment)
Grünbaum: Convex Polytopes
Thomas: Lectures in Geometric Combinatorics
Bronsted: An introduction to convex polytopes
Matousek: Lectures on Discrete Geometry, Chapter 5
Barvinok: A Course in Convexity, Chapter VI

A interesting survey about 0/1 polytopes was written by Ziegler in 2000 and appeared in "Polytopes -- Combinatorics and Computation" published by Birkhäuser (in the DMV Seminar series).
A paper that might be of interest to you is Rothvoß: Some 0/1 polytopes need exponential size extended formulations.
Answer: For me, the classical reference on polyhedral theory is Schrijver's 'Theory of Linear and Integer Programming', together with the Combinatorial Optimization monograph that was mentioned above.
If you have a more specific concern, please specify your question.


How can I get RAM frequency from the OS X low-level terminal?

Question: How can I get RAM frequency from the OS X low-level terminal? Which comand can help in this situation?
Comment: What is a "low-level terminal"? If it's just a "regular" terminal, I would install and use `dmidecode`.
Answer: The system_profiler is your friend,
From within Terminal you can type man system_profiler for more information.  Type q at any time to exit the man page.
To get all your memory information, you can use the following:
system_profiler SPMemoryDataType

If you want something formatted a little better, then you can pipe the output to awk, as seen here:
system_profiler SPMemoryDataType | awk '/Type:/ {type=$2} /Speed:/ {speed=$2; printf "%s-%s\n", type, speed}'

See also awk/sed output from system_profiler on 10.6.8.


Why plutonium and uranium are especially susceptible to do fission?

Question: Why plutonium and uranium are especially susceptible to do fission? Are there any other elements that can also be subject to fission?
Answer: It is not the elements but the isotopes U-235 and Pu-239. Those two have an odd number of neutrons, and can fission by absorbing a thermal neutron. It is the pairing energy (spin-up and spin-down) that is the cause of this.
Answer: All of the nuclei - except the proton - are susceptible to fission.
The typical binding energy of a nucleon (particles of the core of the atoms, i.e. neutron or proton) is around $\mathrm{5MeV}$ in most atoms. Hitting a nucleus with anything sometimes of this energy, it will fissile.
However, not this is what you likely want. The ${}^{235}\mathrm{U}$ and the ${}^{239}\mathrm{Pu}$ are special, that we can do chain reaction with it: the neutrons leaving the fissiled nucleus can fissile other nuclei.
This chain reaction capability is a very special feature:

there are at least 1300 nuclei known (most of them is very short living)
roughly 130 of them are stable
there are capable to do around 10-12 nuclear reactions

Despite that, only these two are usable to make nuclear chain reaction from them.
Comment: @john Ok. Btw, also heavier nuclei would be capable to this reaction. As far I know, roughly from Californium, all of the nuclei would be usable for fission. But they are very costly to produce (typically, from uranium, in nuclear reactors). As far I know, also $U^{233}$ is usable for fission, but it can't be mined (it decayed long ago), rather it has to be produced from $Th^{232}$ in a more complex process. And also $Np^{237}$ is usable in nuclear reactors, but far lesser useful as $U^{235}$.
Answer: The n/p ratio, that is,  neutron to proton ratio is much greater than 1.5.So they are highly fission able. Radioactivity is a nuclear phenomenon. No electrons are responsible for this.
Comment: why is this ratio important?  or rather why is this specific value important?  Why is a ratio $>1$ not enough?
Comment: This does not explain why U-238, with more neutrons, has a lower fission cross-section than U-235, which has fewer neutrons.  Neutron-to-proton ratio is a good predictor for stability against $\beta^-$ or $\beta^+$ decay, but fission has more details involved.


Electric Field at the center of the aperture in this case

Question: A small circular piece of radius b much smaller than a is cut from the surface of a spherical shell of radius a. What's the Electric Field at the center of the aperture (magnitude as well as direction)?
This is not a homework question. But the reason for asking it is -
The electric field at the center of a disk ("of infinitely small width ") is zero . But in the formula for the Electric Field due to disk    as I put L=0
E= p/2e * (1- (L/(R^2 +L^2)^1/2)  , I don't get E=0 ( where p is the charge density and e is epsilon)
I searched about it on net I found something which I didn't understand wholly . I tried to attach the file but it isn't uploading.
Secondly , I couldn't integrate (in my question) over the remaining charge distribution to sum the contribution of all the elements to find the field at the center of the aperture. I wasn't able to do it because the field strength was to be found out at the center of the aperture. The center of the aperture was troubling.
The question also had a hint with it which said " Remembering the superposition principle , you can think about the effect of replacing the piece removed  , which itself is a practically a little disc. "
Does it mean that we simply find out the remaining charge on sphere (after subtracting the charge gone with the disc )? I suppose it shouldn't mean this.
I would like to understand the answer using both the ways because I want to find the mistake in integration as well as understand the hint.
The question figure is-
Answer: I'll only explain a couple of stuff and you'll do the rest. All you need to do here is find the electric field for a disc of radius r, and take the limit as r tends to zero. This limiting field wil NOT be zero because of the field produced by the point charges at a point on the conductor. Next subtract this field from the field of a conductor ($\sigma / \epsilon_0$) This will show you an interesting fact. For the spherical conductor, at any point $P$ of its surface, half the field is produced by the charges at all other points$P' \ne P$ on the surface, and the other half is produced by the charge at P. The superposition of these two contributors gives the familiar field just outside a conductor as $\sigma / \epsilon_0$.
Comment: Thanks for the answer. I carried out the entire integration of the question and then did what you said. By both the ways I got the E =sigma/2*epsilon. The question is would the answer for the E remain the same ie sigma/2*epsilon had the disk taken out be not of a radius very small compared to the radius of the sphere. In other words if b wouldn't have been very small (in the question it is given that b is negligible wrt to a ) , would the answer remain the same ? Because the integration I carried out gives this answer if b is very very small.
Comment: of course they wont be the same. The fact that you cannot neglect it anymore is proof of that alone.
Comment: But what I could get out of books (which I know is wrong but don't know where I am getting it wrong ) is that the field anywhere just on the surface of the conductor is sigma/epsilon half of which is due to the charges at that patch and half due to the rest of the charges (as you said too) . So howsoever big a patch we choose or cut out the field at that patch before cutting was sigma/epsilon and after cutting it reduces to half of its previous value because only the field due to rest of the charges remains which as we know is half. It doesn't depend on the size of the patch cut.
Comment: Is it due to the assumptions taken in integration because the element taken is a ring. ? But we wouldn't be able to take a ring if the patch cut was larger due to curvature effects .
Comment: No, that is absolutely incorrect. The size of the patch has to be infinitesimally small. By the definition i gave, you can see that it will only be true if we consider the field at a point. The patch must also be point sized, denoting the charge at the point in consideration.


When a population is not normal, can F ratio be used for ANOVA analysis?

Question: As it is known a F ratio assumes that the random variables in the numerator and denominator (variances in the case of ANOVA) follow a chi squared distribution, which is true for the sampling distributions of variances of normal distributed populations.
However, if a large sample is taken which is not normally distributed, we cannot make inferences about the distribution of the population and so we cannot state that the variances follow a chi squared distribution.
Is in this case valid to make an ANOVA analysis (assuming the rest assumptions are true)?
(for large sample sizes the normality assumption is not required due to CLT, meaning that the samples means are good estimators of the population mean, but I cant find any information about the variances)
Comment: What do you want to test? The F-test can be used to test the equality of two variances, and this test is not robust to deviations from normality. However, the F-test can be used in a clever way to test the equality of multiple means (the standard use of "ANOVA"), and this test has solid robustness to deviations from normality.
Comment: @Dave I want to test means (ANOVA). I know it is robust to deviations from normality, however no one explains why we use F ratio in the case of deviations from normality. F is the ratio of two chi squared distributions. In the case of non-normal population distributions, the sampling distribution of variances do not follow chi squared so why we use F-distribution to test the null hypothesis?
Comment: The usual F-test comes from the assumption of normality on the errors. If the errors are not normal, one would not expect such a test.
Answer: There are a few senses in which we might say "yes, at least sort of", depending on what you are prepared to modify. For example, the distribution you use for critical values/p-values, what you calculate the statistic on, or modifications to the form of the statistic itself. I don't present an exhaustive list (e.g. I haven't discussed data transformation beyond briefly mentioning the rank transform).
For what follows I'm going to be assuming you're in a one-way ANOVA-like situation (comparing means - or perhaps some other way of assessing location - of $k$ groups, with an interest in testing whether the population means are not all the same). Some of the discussion would carry over more broadly (and I do mention more general situations once or twice in passing).

You could use the usual F-statistic, but it won't generally have an F-distribution, and particularly in smaller samples (a few tens of observations per sample, or fewer say) or with substantial skewness/heavy tails it might not be close enough for your purposes, particularly if you're going well out into the tails (adjusting typical $\alpha$s for many multiple comparisons say). That said, it's reasonably level robust to 'moderate' deviations from normality if $\alpha$ is not too small (in a similar sense to a t-test in the two sample case).
The issue with level can be dealt with in smallish samples by using a permutation test (noting that under the null, the values in different groups should be exchangeable). This should work well as long as sample sizes are not so small that the available significance levels becomes too limited, though usually by that time you have larger concerns. In somewhat largish samples, especially for situations that are more complex, particularly where you don't have exchangeability under the null, you might consider a bootstrap test instead.
However, getting the level close to right with a permutation approach doesn't solve the issue with power; it can easily happen that the F-statistic is not making anywhere near efficient use of the information in the sample about differences in mean.
Where you think you have some other nearly suitable parametric model (as in 2.) but are not quite so confident that it's accurate enough to get the level close enough, some other parametric test statistic can be used in a permutation test. If the model happens to be right (or close to it in the right sense), the test should still have good power when you use such a test, but at least the level will be correct (up to the effect of the discreteness of the permutation distribution of the test statistic) even if the model is not particularly accurate.

If you expect that some particular kind of distribution will be a reasonable model for the conditional distribution of the response variable, you may be able to obtain an efficient test for the differences in mean via a generalized likelihood ratio test type approach (or some asymptotically equivalent test).
This is particularly convenient when the model comes from the exponential dispersion family (including Gamma, Poisson, binomial, inverse Gaussian, etc), where you get generalized linear models.
This will not be an F-ratio as such, but there are corresponding quantities involving the deviance.
However, other models could be used; e.g. some other distributions are conveniently implemented in parametric survival regression packages which would allow testing the hypothesis of interest with little additional effort. Or you could go directly to working with the likelihood, with a little more effort.

You could use an F statistic with a rank based test instead - in particular a Kruskal-Wallis test statistic is equivalent to (/a monotonic function of) an F-statistic computed on the ranks. The difficulty here is that any of the rank based tests will not inherently correspond to a test of means, though under assumptions that give a pure location shift alternative it would be suitable.


Quality Procedure for Integrated PCB

Question: I am working on a Quality Assurance procedure document for PCB integrator. I did some research on the quality standards followed by different companies. But what I could not find was a general and basic procedure by which I (as a client) can evaluate how my PCB manufacturer and integrator have fabricated my PCB post fabrication. P.S. These procedures are just for Visual Inspection. I have a separate procedure for Factory Acceptance Test (FAT) where I check the PCB by applying voltage, uploading code and other procedure.
Comment: IPC-A-600 is a good start for bare PCBs. IPC-A-610 is a good start for assembled PCBs. IPC-D-325 may also be applicable. Without knowing what the PCBs need to withstand in service it is difficult to give further guidance.
Comment: How can anyone visually inspect inner layers?
Comment: @Andyaka  Apparently people use X-rays to get the inner layer designs.
Comment: @ammar.cma then the OP should fully understand this or only concentrate on two layer designs.
Comment: All my PCB's are 2 layers. What I am asking is a standard procedure for evaluating how good/bad my vendor has fabricated my PCB's
Comment: Thanks @PeterSmith this sounds just fine. I will have a look.
Answer: NASA used to require high-rel PCBs to have a test-frisket off to the side, with vias and traces at tight-spacings.
After the PCB was fabbed, the frisket was removed and SLICED OPEN thru the vias, and the vias' internal plating was examined for proper thickness. Also the connection between vias plating and the laminated foils were scoped for integrity.
For ultimate reliability, JPL required tiny "Z" wires soldered into each via. Only 2-layer PCBs were used, and only tiny amounts of solder were used for weight control. With such redundant methods, satellites last for 50+ years.

Quality Procedure for Integrated PCB


Incidental parameter problem for fixed effects OLS regression with logarithmic dependent variable on a short panel

Question: I have panel data over 7 years and 6000 observations in total, on which I am running an OLS regression with around 600 fixed effects dummies. The dependent variable is logarithmic. I have heard about the incidental parameter problem, which biases the regression in short non-linear panels. Is an OLS regression with a logarithmic dependent variable a non-linear panel for which the incidental parameter problem applies, or are only models like logit and probit counted as non-linear panels?
Comment: I think of "non-linear" as referring to the functional form of the model predicting the dependent variable. Probit and logit have a non-linear functional form—a linear model with a logarithmic DV still has a linear function form.
Answer: Do you care about the fixed effects $\alpha_i$ for some reason? Usually they are a kind of a nuisance parameter that you either get rid of (or control for) to get the other common parameters right (the $K$ coefficients on time-varying Xs of interest).
In a short panel, the $N$ FEs will be inconsistent if you estimate them with dummies because with short panels the asymptotics involve adding more panels (growing $N$). The problem is that each time you do that you get a new $\alpha_i$ to estimate, so you never get to learn more about the FEs. You only have T (or fewer) observations to estimate them and that never changes as your data grows. You find yourself in this boat now, with largish N = 600 and small T = 7 (so not entirely sure how you get $600 \cdot 7 < 6K$ observations). In a linear model, you can still estimate the $K$ common parameters consistently, unless $T\rightarrow \infty$ as well as $N$. This was a surprising result for me, and one of the many charms of linear models.
Your model is linear in parameters (which is what really matters) and not growing $T$, so you are safe here. You can use all kinds of variable transformations, include polynomial terms, add interactions and still maintain the linearity.
The problem with nonlinear panel models is that the inconsistency spreads from the FEs to the $K$ coefficients that are common to all $N$, even though those are estimated using $NT \rightarrow \infty$. This is just the standard MLE small-sample bias. There are no general solutions here, though there are special cases that allow you to get consistent $K$ coefficients after getting rid of the nuisance parameters.
To be a bit clearer, this whole idea of adding $N$ is mostly a thought experiment. You are stuck with the data you have, though sometimes you can get more by sampling some new panels and/or waiting longer. And sometimes you can't: if you want to put in US state effects, there is only ~51. But the mathematical recipes for calculating your parameters and their uncertainty try to guarantee how they behave if you were to add more data. And those guarantees make assumptions about how you get more data (more $N$, more $T$, or both). With real, unsimulated data you never know just where on the road to Asymptopia you are for the guarantee of good behavior to be meaningful. But it is still useful to keep in mind which of the three Asymptopias you are heading to when you apply a statistical method.
Comment: No, the reform dummy coefficient is consistent, because as you add more panels, you get more info on the effect of the reform (assuming there is some variation in each panel in the reform over time, which means you see the same unit experience both regimes). The fact that it and the FEs are estimated using dummies does not change that one bit. Also, don't forget to cluster your standard errors (if your software does not take care of it for you with the LSDV estimator).
Comment: The fixed effects dummies are just used as controls. I am just interested in the coefficient of a reform dummy. However, since this is also a dummy variable, and hence mathematically the same as the fixed effects, does this mean the coefficient on the reform dummy might also be inconsistent?


Could the Kernel stack of a process be empty, when a process is swapped out to a disk?

Question: I am just curious to know whether the Kernel stack could be empty when a process is swapped out to a disk or not?
Answer: First of all: What is a process is swapped out to a disk?
process is never swapped out, pages are.
Also: Kernel stack of a process is always empty when the process is not in kernel state.


How to access remote server with local phpMyAdmin client?

Question: Assuming there is a remote server and I have phpMyAdmin client installed localy on my computer. How can I access this server and manage it via phpMyAdmin client? Is that possible?
Comment: you can also install the `phpmyadmin` docker image locally and connect to your remote MySQL server. more details at [here](https://hub.docker.com/r/phpmyadmin/phpmyadmin): `docker run --name myadmin -d -e PMA_HOST= -e PMA_PORT= -p 8080:80 phpmyadmin/phpmyadmin`
Answer: Just add below lines to your /etc/phpmyadmin/config.inc.php file in the bottom:
$i++;
$cfg['Servers'][$i]['host'] = 'HostName:port'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'userName';   //user name for your remote server
$cfg['Servers'][$i]['password'] = 'Password';  //password
$cfg['Servers'][$i]['auth_type'] = 'config';       // keep it as config

You will get  Current Server: drop down  with both 127.0.0.1 and one what you have provided with $cfg['Servers'][$i]['host'] can switch between the servers.
More Details: http://sforsuresh.in/access-remote-mysql-server-using-local-phpmyadmin/
Comment: The `$i++` is an important point as this will not make us lose the database connection with the default `localhost`.
Comment: `/etc/phpmyadmin/config.inc.php` is the correct file to be changed
Comment: If anyone is working on Apple system then the `config.inc.php` file is located at  `Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php` file.
Comment: I also had to follow the steps in [this](https://stackoverflow.com/questions/14779104/how-to-allow-remote-connection-to-mysql) post after setting it up in phpMyAdmin to make it work.
Answer: It is certainly possible to access a remote MySQL server from a local instance of phpMyAdmin, as the other answers have pointed out. And for that to work, you have to configure the remote server's MySQL server to accept remote connections, and allow traffic through the firewall for the port number that MySQL is listening to. I prefer a slightly different solution involving SSH Tunnelling.
The following command will set up an SSH tunnel which will forward all requests made to port 3307 from your local machine to port 3306 on the remote machine:
ssh -NL 3307:localhost:3306 root@REMOTE_HOST

When prompted, you should enter the password for the root user on the remote machine. This will open the tunnel. If you want to run this in the background, you'll need to add the -f argument, and set up Passwordless SSH between your local machine and the remote machine.
After you've got the SSH tunnel working, you can add the remote server to the servers list in your local phpMyAdmin by modifying the /etc/phpmyadmin/config.inc.php file. Add the following to the end of the file:
$cfg['Servers'][$i]['verbose']       = 'Remote Server 1'; // Change this to whatever you like.
$cfg['Servers'][$i]['host']          = '127.0.0.1';
$cfg['Servers'][$i]['port']          = '3307';
$cfg['Servers'][$i]['connect_type']  = 'tcp';
$cfg['Servers'][$i]['extension']     = 'mysqli';
$cfg['Servers'][$i]['compress']      = FALSE;
$cfg['Servers'][$i]['auth_type']     = 'cookie';
$i++;

I wrote a more in-depth blog post about exactly this, in case you need additional help.
Comment: I think this is the secure solution. Opening up mySQL to direct remote access is generally considered a poor security practice if it's not absolutely necessary.
Comment: c.hill's answer is not quite right. Please note: The bind address must be set to the loop back address in the mysql my.cnf file.
Comment: No need to be root on the remote host. the bridge works perfectly, thanks! I'm not so sure about config, though, prefer Suresh Kamrushi's answer. `$++` should definitely be first line, not last, at least for my default phpmyadmin.conf.
Comment: The Best Solution!
Comment: You can access to a databaseServer only accessible from Server, which in turn you need to go through a jumpServer: `ssh -v -N -L 3306:databaseServer:3306 -J jumpUsername@jumpServer usrname@Server`. Test on your host with `nc -zv localhost 3306`. Consider using something like DBeaver instead of phpMyAdmin.
Answer: It can be done, but you need to change the phpMyAdmin configuration, read this post:
http://www.danielmois.com/article/Manage_remote_databases_from_localhost_with_phpMyAdmin
If for any reason the link dies, you can use the following steps:

Find phpMyAdmin's configuration file, called config.inc.php
Find the $cfg['Servers'][$i]['host'] variable, and set it to the IP or hostname of your remote server
Find the $cfg['Servers'][$i]['port'] variable, and set it to the remote mysql port. Usually this is 3306
Find the $cfg['Servers'][$i]['user'] and $cfg['Servers'][$i]['password'] variables and set these to your username and password for the remote server

Without proper server configuration, the connection may be slower than a local connection for example, it's would probably be slightly faster to use IP addresses instead of host names to avoid the server having to look up the IP address from the hostname.
In addition, remember that your remote database's username and password is stored in plain text when you connect like this, so you should take steps to ensure that no one can access this config file. Alternatively, you can leave the username and password variables empty to be prompted to enter them each time you log in, which is a lot more secure.
Comment: You also need to have the firewall on the database instance allow the traffic, and a user on the DB server with privileges for remote access.
Comment: May I ask a question here? As I newbie I am curious what form should the link have I want to enter in browser in order to access a database via phpMyAdmin that is installed on a server of my client who hosts a website himself.
Answer: Follow this blog post. You can do it very easily.
https://wadsashika.wordpress.com/2015/01/06/manage-remote-mysql-database-locally-using-phpmyadmin/
The file config.inc.php contains the configuration settings for your phpMyAdmin installation. It uses an array to store sets of config options for every server it can connect to and by default there is only one, your own machine, or localhost. In order to connect to another server, you would have to add another set of config options to the config array. You have to edit this configuration file.
First open config.inc.php file held in phpMyAdmin folder. In wamp server, you can find it in wamp\apps\phpmyadmin folder. Then add following part to that file.
$i++;
$cfg['Servers'][$i]['host']          = 'hostname/Ip Adress';
$cfg['Servers'][$i]['port']          = '';
$cfg['Servers'][$i]['socket']        = '';
$cfg['Servers'][$i]['connect_type']  = 'tcp';
$cfg['Servers'][$i]['extension']     = 'mysql';
$cfg['Servers'][$i]['compress']      = FALSE;
$cfg['Servers'][$i]['auth_type']     = 'config';
$cfg['Servers'][$i]['user']          = 'username';
$cfg['Servers'][$i]['password']      = 'password';

Let's see what is the meaning of this variables.
$i++ :- Incrementing variable for each server
$cfg['Servers'][$i]['host'] :- Server host name or IP adress
$cfg['Servers'][$i]['port'] :- MySQL port (Leave a blank for default port. Default MySQL port is 3306)
$cfg['Servers'][$i]['socket'] :- Path to the socket (Leave a blank for default socket)
$cfg['Servers'][$i]['connect_type'] :- How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] :- php MySQL extension to use ('mysql' or 'msqli')
$cfg['Servers'][$i]['compress'] :- Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['auth_type'] :- Method of Authentication
$cfg['Servers'][$i]['username'] :- Username to the MySQL database in remote server
$cfg['Servers'][$i]['password'] :- Password to the MySQL database int he remote server

After adding this configuration part, restart you server and now your phpMyAdmin home page will change and it will show a field to select the server.
Now you can select you server and access your remote database by entering username and password for that database.
Comment: could please be more accurate and explain more about your answer. link answers are good but the may be unreachable if the link corrupts for any reason.
Answer: As stated in answer c.hill answer, if you want a secure solution I would advise to open an SSH tunnel to your server.
Here is the way to do it for Windows users:

Download Plink and Putty from the Putty website and place the files in the folder of your choice (In my example C:\Putty)
Open the Windows console and cd to Plink folder:
cd C:\Putty
Open the SSH tunnel and redirect to the port 3307:
plink -L 3307:localhost:3306 username@server_ip -i path_to_your_private_key.ppk

Where:

3307 is the local port you want to redirect to
localhost is the address of the MySQL DB on the remote server (localhost by default)
3306 is the port use for PhpMyAdmin on the remote server (3306 by default)

Finally you can setup PhpMyAdmin:

Add the remote server to your local PhpMyAdmin configuration by adding the following line at the end of config.inc.php

Lines to add:
$i++;
$cfg['Servers'][$i]['verbose']          = 'Remote Dev server';
$cfg['Servers'][$i]['host']             = 'localhost';
$cfg['Servers'][$i]['port']             = '3307';
$cfg['Servers'][$i]['connect_type']     = 'tcp';
$cfg['Servers'][$i]['extension']        = 'mysqli';
$cfg['Servers'][$i]['compress']         = FALSE;
$cfg['Servers'][$i]['auth_type']        = 'cookie';

You should be able to connect now at http://127.0.0.1/phpmyadmin

If you do not want to open the console each time you need to connect to your remote server, just create a batch file (by saving the 2 command lines in a .bat file).
Answer: You can set in the  config.inc.php file of your phpMyAdmin installation.
$cfg['Servers'][$i]['host'] = '';

Answer: I would have added this as a comment, but my reputation is not yet high enough.
Under version 126.96.36.199deb2ubuntu2, and I am guessing any other versions 4.5.x or newer.  There is no need to modify the config.inc.php file at all.  Instead go one more directory down conf.d.
Create a new file with the '.php' extension and add the lines.  This is a better modularized approach and isolates each remote database server access information.
Answer: In Ubuntu
Just you need to modify a single file in PHPMyAdmin folder i.e. "config.inc.php".Just add below lines to your "config.inc.php".
File location : /var/lib/phpmyadmin/config.inc.php OR
                /etc/phpmyadmin/config.inc.php
Maybe you don't have the permission for editing that file, just give the permission using this command
sudo chmod 777 /var/lib/phpmyadmin/config.inc.php

OR (in different systems you may have to check with these two locations)
sudo chmod 777 /etc/phpmyadmin/config.inc.php

Then copy and paste the code in your config.inc.php file
    $i++;
    $cfg['Servers'][$i]['auth_type']     = 'cookie';
    $cfg['Servers'][$i]['verbose'] = 'Database Server 2';
    $cfg['Servers'][$i]['host'] = '184.108.40.206';
    $cfg['Servers'][$i]['connect_type']  = 'tcp';
    $cfg['Servers'][$i]['compress']      = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;

And make the appropriate changes with your server details
Answer: Locate the file libraries/config.default.php
then find  $cfg['AllowArbitraryServer'] = false;
then set It to true
note:
on ubuntu the file in the path /usr/share/phpmyadmin/libraries/config.default.php
then you will find a new filed name SERVER in the main  PHPMyAdmin page, you can add any IP or localhost for the local database.
Answer: Go to file \phpMyAdmin\config.inc.php at the very bottom, change the hosting details such as host, username, password etc.
Answer: Method 1 ( for multiserver )
First , lets make a backup of original config.
sudo cp /etc/phpmyadmin/config.inc.php      ~/

Now in /usr/share/doc/phpmyadmin/examples/ you will see a file config.manyhosts.inc.php. Just copy in to /etc/phpmyadmin/
using command bellow:
sudo cp /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php \
        /etc/phpmyadmin/config.inc.php

Edit the config.inc.php
sudo nano /etc/phpmyadmin/config.inc.php

Search for :
$hosts = array (
    "foo.example.com",
    "bar.example.com",
    "baz.example.com",
    "quux.example.com",
);

And add your ip or hostname array save ( in nano CTRL+X press Y ) and exit . Done
Method 2 ( single server )
Edit the config.inc.php
sudo nano /etc/phpmyadmin/config.inc.php

Search for :
/* Server parameters */
if (empty($dbserver)) $dbserver = 'localhost';
$cfg['Servers'][$i]['host'] = $dbserver;

if (!empty($dbport) || $dbserver != 'localhost') {
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['port'] = $dbport;
}

And replace with:
$cfg['Servers'][$i]['host'] = '192.168.1.100';
$cfg['Servers'][$i]['port'] = '3306';

Remeber to replace 192.168.1.100  with your own mysql ip server.
Sorry for my bad English ( google translate have the blame :D )
Answer: In Windows with Wamp Server Installed you may find the configuration file
C:\wamp64\apps\phpmyadmin4.8.4\config.inc.php

Change the bolow line as appropriate
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = 3306;//$wampConf['mysqlPortUsed'];
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';

Answer: When developing with no password set, you might not get access to the server due to the absence of the AllowNoPassword field. To prevent this, open config.inc.php and add this block with AllowNoPassword set to true right bellow $i = 0 variable:
$i++;

$cfg['Servers'][$i]['host']            = 'your_server_ip';
$cfg['Servers'][$i]['port']            = '3306';
$cfg['Servers'][$i]['socket']          = '';
$cfg['Servers'][$i]['connect_type']    = 'tcp';
$cfg['Servers'][$i]['extension']       = 'mysqli';
$cfg['Servers'][$i]['compress']        = FALSE;
$cfg['Servers'][$i]['auth_type']       = 'config';
$cfg['Servers'][$i]['user']            = 'root';
$cfg['Servers'][$i]['password']        = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

Answer: Delete complete entries of /etc/http/conf.d/phpMyAdmin.conf
And below entires in above file,

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       #ADD following line:
       Require all granted
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     #CHANGE following 2 lines:
     Order Allow,Deny
     Allow from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

Then,
run below command in MySQL prompt,
GRANT ALL ON *.* to root@localhost IDENTIFIED BY 'root@<password>'
GRANT ALL ON *.* to root@'%' IDENTIFIED BY 'root@<password>'
For reference: Allow IP to Access Secured PhpMyAdmin


cocos2d best practices, multithreading vs scheduler

Question: Well, there isn't much example code for this. I'm writing a game loop and I'm running into a snag. At first I attempted to create a schedule for the loop as this was listed under best practices as the way it should be done. My frame rate is 60 fps, and the loop was also running at an interval of 60 fps. I quickly noticed however that the interval time is little more than a suggestion, and the actual rate that the function is updating is highly erratic, ranging between 15 and 65 fps. This led to jumps in objects updating, even when their update distance was regulated as a function of time. Once updating dropped below 20 fps it became highly apparent when it updated and was quite ugly.
I then tried to create my own thread so that I could more closely regulate the update rate. With this method I was able to almost precisely regulate my updating rate. With this all movement and animations were smooth. The issue with this method is that cocos2d clearly doesn't support multithreading well as I periodically see screen tearing. Also, if my update rate doesn't precisely match my draw rate I see jumps. I believe this is due to the draw method firing in in the middle of my update loop, a common problem with multithreading.
The two ways I can think of to solve this problem are to find some way to closely regulate the firing rate of the scheduler, or to find a way to lock the drawing code until I can finish my update. I've been looking for quite some time for any examples on how to do either of these, and have met with no success. If anyone out there has a clearer idea of how to handle this kind of a situation I would be very appreciative of some advice. I'm just too used to C++ and having things happen at the rate I tell them to. If you need me to post any additional information, just ask! Thanks in advance for any assistance.
Answer: Your problem is in your scheduled function. It just can't run as fast as you want. Try running helloWorld scene from cocos2d and you will notice that fps are stable near 60 (59.8 - 60.2)
Comment: It doesn't matter what rate I ask the scheduler to run at, even as low as 20 fps, it's still highly unstable. I'm not sure what cocos2d uses to manage it's refresh, as I suppose I could use the same method


ASP.NET website consuming WCF service error

Question: I get the following error on my asp.net website, while trying to invoke a wcf service method:

A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection
failed because connected host has failed to respond 77.XXX.XX.XX:809

And then more in detail, I get a socketexception, webexception and also this endpointnotfoundexception:

There was no endpoint listening at
http://77.XXX.XX.XX:809/RemoteSyncService/ that could accept the
message. This is often caused by an incorrect address or SOAP action.

The wcf service (RemoteSyncService) is hosted in a .net application on the 77.XXX.XX.XX server. The binding used is basicHttpBinding.
The endpoint address, used in the asp.net site web.config is:
<code>http://77.XXX.XX.XXX:809/RemoteSyncService
// this is the same on the remote server
</code>
The service code for the asp.net website was automatically generated, by using the 'add service reference' feature in VS2010 (on this address: http://77.XXX.XX.XXX:809/RemoteSyncService/mexHttp, as described in the other remote server).
All works perfectly on the dev machine..
What I tried and works:

running/debugging the asp.net locally, and invoking methods
trying to contact the wcf service with wcf test client
the asp.net site can contact the other server, because a ftp transfer from my asp.net site to the remote server was successful
pinging the remote server

Will provide code if needed..
Comment: port 809 is probably blocked.
Comment: Are you sure you need to put a "/" at the end of "http://77.XXX.XX.XX:809/RemoteSyncService/" ?
Answer: make sure your production server isn't firewalling you.


How do I know what iTunes credit is for?

Question: So I have "2 Credits" showing on the top right of the iTunes Store screen. I've purchased music, but that hasn't changed the number of credits. Are the credits specifically to be used for certain items, if so how do I know what items?
Answer: From https://discussions.apple.com/message/11510256#11510256

It means that your next two purchases of that type won't be charged to a credit card or count against a gift card balance. They are sometimes granted by the iTunes Store staff.

Screenshot:

From https://answers.yahoo.com/question/index?qid=20100207142341AA3Kh6k

It means you can get one[in your case 2] song download using that credit.

Screenshot:

From http://forums.macrumors.com/threads/itunes-is-displaying-5-credits-next-to-my-email-address-in-store-what-does-it-mean.1478823/

5[in your case 2] free downloads. Did you report any problems with a purchase to them recently? They give them out for that kind of thing sometimes.

Screenshot:
Comment: This does not tell me how I know what I can use them for... do I just have to go buy every type of media to figure it out?
Comment: @CharlesJohnThompsonIII Try clicking on it. What does it say then?
Comment: Nothing, it's not a button.
Comment: Re: your edit, no it does not mean I can get one song. As I said in the details of my question, I've tried purchasing songs from the iTunes Store and it charges my card, the number of credits does not change.
Answer: I clicked on Account at the bottom of the page and it took me to a page and under Apple ID Summary, it says Apple ID Balance: 1 Movie Rental.
I think this credit is only good for rental maybe?


Process of e-sign live api integration

Question: Can somebody suggest me how to integrate e-sign live to my web app ? After integrating, what are the things that the API will handle and what are the things that it expects me to provide to work appropriately ?
Answer: this is a very broad question.  Trying to be as concise as possible your app would probably need to have the following list of things:
1) documents to be signed
2) who is signing
3) where the signatures and form fields go
The eSignature service would handle the workflow, rendering of the documents and most importantly the audit log making it legally binding that the transaction actually happened. I work for DocuSign so I am very familiar with that eSignature solution.  You can get started with DocuSign API on www.docusign.com/devcenter
Let me know if you have other questions.
-mb

Process of e-sign live api integration


How to update MariaDB if the current version is not in default directory?

Question: I will try to update my MariaDB from 5.5.56-MariaDB to 10.3.9-MariaDB. However my current version was configured or located into another directory. How should i do it?
Answer:
take a backup. either a) a copy of the datadir, or b) a sql dump (preferably both)
install the mariadb-10.3 packages

Normally only a single major upgrade is supported like 5.5 -> 10.0 -> 10.1 -> 10.2 -> 10.3 is supported however you may as well try and having your backup ready, you can install the datadir back.
Run mysql_upgrade after the upgrade.
Or, clear the datadir, run mysql_install_db -u mysql and then load the new version with the mysqldump.
Test on a test server, if downtime or potentially incompatibly is an issue.


Attitude of Bernie and Clinton supporters towards Trump

Question: Is there a comparison of what attitude self-identified Bernie supporters have towards Donald Trump compared to what attitude self-identified Hillary Clinton supporters have towards Donald Trump? Are supporters of one candidate more likely to report a favourable opinion of Trump than the other candidate?
Answer: As it happens FiveThirtyEight just posted an analysis of Sander's endorsement of Clinton, which includes a breakdown of poll results on a closely related question.

I haven't seen any polls which ask Sanders supporters about favorable/unfavorable status, but voting preferences make a good proxy.
The third parties in question are Gary Johnson and Jill Stein for two of the surveys.  Stein was not an option in the Pew poll.
Comment: what's the third party in that scenario?
Comment: @blip - Added that information.  Thanks for asking.


Question regarding powering Arduino through the USB Port

Question: If powering the Arduino (Mega) through the USB port, is a voltage of 5.19VDC acceptable?
Answer: Yes, the ATMEGA328 processor will work without any problem, in fact if you go in the power informations section on the datasheet, you will find that the processor can run from a little less of 3V to a maximum of 5.5V.
Just be careful, because the processor works at that power, but the board will need from 5 to 5.5V.
Answer: That's the approximate expected voltage. The Arduino devices are typically powered at 5V, but the chips themselves are rated to work at values lower and higher than 5V.
Answer: The 5.19V you see, I guess you expect 5.00V, is a combination of power supply tolerance and the tolerance of your voltmeter.
Your voltmeter also has some error, we tend to forget that sometimes.


Xamarin - How to send Push Notifications without using another service

Question: Hi I'm wanting to send push notifications to devices for both iOS and Android. But I am wanting to do it by not using Azure or other Products and services like that. Is this at all possible and if so how would I achieve this.
Comment: Why don't you want to use third party code? I use PushSharp and have had no problems. Simple, easy to use, and open source.
Answer: All push notification architectures require some service, in addition to the platform notification service, to send push notifications. The following diagram (from the Azure docs) shows the basic lifecycle of a notification:

Notice that some backend service has to be there to both keep track of handle assigned to a device by the PNS and also to send the actual notifications. The free tier in Azure Notification Hubs lets you have up to 500 devices and 1 million pushes before you have to move up to a pay tier. Agree with jblair that you should at least take a look at Notification Hubs, and there is a Xamarin quickstart tutorial.
(Full disclosure, I do work at Microsoft on Azure.)
Comment: Hi have been using Azure and was just looking for alternative. I have had a play around with PushSharp but does seem like Azure is the better option.
Answer: To send you push notifications, you will need to have some sort of server to communicate with Apple's and Google's push services. And presumably if you're sending push notifications, you have some sort of content you need to deliver to the mobile device, which implies you are running a web service somewhere to deliver the content.
The server that handles push notifications can be anything from a box running in your closet to an IaaS virtual machine from a commercial cloud provider. However, your most inexpensive option will likely be Azure Notification Hubs or something similar from another provider.


Count the number of elements of ring

Question:
1/ How to count the number of elements of $\mathbb{Z}[i]/(1+2i)^n$?
2/ How to write $\mathbb{Z}[i]/(1+2i)^n$ as direct sum of cyclic groups (in view of the structure theorem of finite abelian groups)?
Comment: Try to show that the number of elements of $\mathbb{Z}[i]/(a + bi)$ is $a^2 + b^2$. As for its decomposition, think about the Chinese remainder theorem.
Answer: Write $(1+2i)^n=u+iv$, $u,v\in\mathbb Z\setminus\{0\}$. Since $\mathbb Z[i]\simeq\mathbb Z\times\mathbb Z$ (as $\mathbb Z$-modules), we have $$\mathbb Z[i]/(u+iv)\simeq \mathbb Z\times\mathbb Z/\langle(u,v),(-v,u)\rangle.$$ The Smith Normal Form of the matrix $\left(\begin{matrix}u&v\\-v&u \end{matrix}\right)$ is $\left(\begin{matrix}1&0\\0&u^2+v^2 \end{matrix}\right)$. (It is not hard to show that $\gcd(u,v)=1$.) Thus we get $$\mathbb Z[i]/(u+iv)\simeq \mathbb Z/(u^2+v^2)\mathbb Z.$$ This shows that $|\mathbb Z[i]/(u+iv)|=u^2+v^2$, and therefore $$u^2+v^2=N(u+iv)=N((1+2i)^n)=N(1+2i)^n=5^n.$$
Answer: Here's one approach you could take.  Note that $(1+2i)^n(1-2i)^n=5^n$ and $(1+2i)^n$ and $(1-2i)^n$ are coprime in $\mathbb{Z}[i]$, so by the Chinese remainder theorem, $$\mathbb{Z}[i]/5^n\cong \mathbb{Z}[i]/(1+2i)^n\times \mathbb{Z}[i]/(1-2i)^n$$ as rings.  But $$\mathbb{Z}[i]/(1+2i)^n\cong \mathbb{Z}[i]/(1-2i)^n$$ as rings (though not as $\mathbb{Z}[i]$-modules) by sending $i$ to $-i$, and it is easy to see that the underlying abelian group of $\mathbb{Z}[i]/5^n$ is $\mathbb{Z}/5^n\times\mathbb{Z}/5^n$ (since an element of $\mathbb{Z}[i]/5^n$ is just a number $a+bi$ where both $a$ and $b$ are taken mod $5^n$).  If you have any decomposition of $\mathbb{Z}/5^n\times\mathbb{Z}/5^n$ as a product of two isomorphic abelian groups, then both factors must be isomorphic to $\mathbb{Z}/5^n$ (this follows easily from the classification of finite abelian groups, for instance).  Thus the additive group of $\mathbb{Z}[i]/(1+2i)^n$ must be isomorphic to $\mathbb{Z}/5^n$.

Count the number of elements of ring


permutation of $9$ digit

Question: How many $9-\text{digit}$ number can be formed by using the digits $1, 2, 3, 4, 5, 6, 7,8, 9$ so that each number has $7$ digits in such place where that digit is less than the next digit?
Example: In number $2314; \; 2, 1$ are two digits such that each of them is less than the next digit.

Source: BDMO 2015 , Dhaka regional
Comment: Right.  So there is only one "downward step".  What can you say about the digits before that downward step, and about the digits after it?
Comment: Exactly seven digits in such a place, or at least seven?  Note that there are only eight digits with a successor, so there is only one nine-digit number where each of its first eight digits are followed by a greater digit.  Thus, this question on its own makes only a small difference, but it might get you thinking down the right path.
Comment: exactly $7$ digit
Comment: I'll let you think about that for a while.  If you haven't got it after some thinking, and no one writes up an answer, I'll sketch out a solution in a bit.
Comment: Possible duplicate of [Number of $n$-digit permutations with exactly $n-2$ digits smaller than the next](http://math.stackexchange.com/questions/1640349/number-of-n-digit-permutations-with-exactly-n-2-digits-smaller-than-the-next)
Answer: Given that the nine-digit number has exactly one point at which a digit's successor is less than itself, it can thus be divided into two parts, both of which are strictly ascending, neither of which is empty.  (That is to say, the entire number isn't as a whole strictly ascending.)
What's more, you can construct the number in exactly this fashion: Select a subset of the nine digits, and let those digits, in ascending order, form the prefix of the number.  Then put the remaining digits in ascending order, and those form the suffix of the number.  There are $2^9 = 512$ different subsets, so there are at most that many ways to generate a satisfactory number.
However, there are a few subsets that won't work—namely, those subsets that are the $k$ smallest digits, for $k = 0$ to $9$.  There are $10$ such non-satisfactory subsets, so the actual result should be $512-10 = 502$.
Answer: Consider the difference between each of the $8$ pair of digits in the $9$ digit number. $7$ digits are in such place where that digit is less than the next digit. So there must be ONLY ONE pair so that the difference is positive.
Now let this positive difference happen between $i^{th}$ and $(i+1)^{th}$ digit in the number. Now we can choose any set of $i$ numbers and arrange them in increasing order, and place other $9-i$ numbers after them, in order.
Since $i$ ranges from $1 \to 9-1 = 8$, so our final answer is -
$$\sum_{i = 1}^{8} \left\{\binom{9}{i}-1\right\} \\
 \sum_{i = 1}^{8}\binom{9}{i} - 8\\
 \sum_{i=0}^{9}\binom{9}{i} - \binom{9}{9} - \binom{9}{0} - 8\\
 2^9 - 10 = \color{red}{\boxed{502}}$$
BTW, I am also Bangladeshi ... This problem repeated in some other regional too, with different constrains. Like we need to make $8$-digit numbers from $\{1,2,\cdots,8\}$ such that $6$ of them are in that such place. Here the answer will be $2^8-9$

permutation of $9$ digit


Does Ros2 Nav2 have a module for "teach and repeat?"

Question: Wouldn't this be a good module to add to Nav2? The rover robot would be driven over a route and "learn" it, then repeat the performance through the navigation stack. Is anyone working on such a module?
Comment: if you thought of it, then other people also thought if it ... from all of those people, you can be certain that at least one of them has decided to work on it ... that is just an opinion in response to an opinion based question ... that is why opinion based questions are off topic here ... they do not produce very useful answers
Comment: your title question is good ... the other two are off topic here
Answer: Not at this very moment, but its something I had planned to have added as part of a larger (but still not really all that large) development effort to provide documented GPS navigation support within Nav2 instead of the more 'wild west, figure it out yourself' that currently exists. Technically nothing about teach & repeat requires GPS, but that was the context I was planning on developing it under and I've not yet had a strong enough reason to work on it yet over more pressing needs.
If that would be something you'd be interested in working on or contributing, feel free to reach out!
Comment: Thanks for that! Yes, I have worked on it, and sampled the "lookahead_collision_arc" topic and attempted to navigate again based on that as input. But the simulation was "rehoming" its twist too much and wasting time instead of moving forward. Is there a setting that can be lowered to reduce this twisting tendency? I was using the "waypoints" module but want to try also the "poses" module for the repeat phase.


What is the significance of Headband of Intellect et al setting the stat to 19?

Question: Besides the psychological effect of the stat raising item being almost but not quite perfect, is there a situation where 19 in an attribute is different from it being set to 18?
Comment: I reworded the question to make it clearer that this is about 19 stat items in general. Headband of Intellect happened to be the one I remembered the name of.
Comment: related: https://rpg.stackexchange.com/q/77741/23970
Comment: Related: [What are the mechanical effects of odd numbers for ability scores in monster stat blocks?](https://rpg.stackexchange.com/q/191902/23547)
Answer: There are occasional benefits of 19 over 18
Interestingly, the only examples I've found involve Strength, but other stackers found some more; here are the benefits:

The long jump

19 Strength gives a slightly longer long jump than 18 Strength:

When you make a long jump, you cover a number of feet up to your Strength score if you move at least 10 feet on foot immediately before the jump. When you make a standing long jump, you can leap only half that distance.

Carrying capacity

19 Strength will let you carry a little but more than 18 Strength:

Your carrying capacity is your Strength score multiplied by 15. This is the weight (in pounds) that you can carry, which is high enough that most characters don't usually have to worry about it.

Strength drain (or other ability score draining features)

19 Strength essentially gives you one more strength that can be drained before dropping to the lower Strength modifier. The shadow has this ability, for example:

...and the target's Strength score is reduced by 1d4. The target dies if this reduces its Strength to 0. Otherwise, the reduction lasts until the target finishes a short or long rest.

Astral Plane movement (credit to Peter Chaplin's answer)

19 Intelligence provides faster movement in the Astral Plane than 18 Intelligence:

A traveler in the Astral Plane can move by simply thinking about moving, but distance has little meaning. In combat, though, a creature's walking speed (in feet) is equal to 3 x its Intelligence score.

Optional Speed Factor initiative (credit to
Kirt noQA4mewhilemodsstrike in the comments)

While there is no magic item that sets Dexterity to 19, I figured I'd add this in for completeness

Break any ties by having the combatant with the highest Dexterity act first.

As you figured, the main reason for the 19 rather than the 18 is to demonstrate the not-quite maxed out nature of the ability score.
Comment: @JoJoYawson The question did request "et al", not just the *Headband of Intellect*. I didn't remember Astral Plane movement, but +1 to Peter Chaplan's answer for sure.
Comment: A 19 Intelligence will make someone immune to the worst part of an intellect devourer's devour intellect ability, whereas an 18 could still be affected
Comment: Speed Factor optional Initiative rules in the DMG use absolute Dex score to resolve ties.
Comment: @T.E.D. Yes, but in 5e none are 19
Comment: You should cover more specifically the benefits of having 19 intelligence.
Comment: See also: [Stat draining monsters like a shadow?](https://rpg.stackexchange.com/q/180813/23547)
Comment: Aren't the requirements for most feats odd numbers?
Comment: I don't think the "Strength drain" et al applies in this situation. Gauntlets of Ogre Power *sets* your Strength to 19. Unless you break or somehow unattune them, the strength cannot go below 19. Although I do believe the point should be there for completeness.
Answer: You're safer from Intellect Devourers
Intellect Devourers (MM, p. 191) have an action that requires you to roll 3d6, and if the total equals or exceeds your INT score, you drop to zero INT and are stunned until that effect is removed.
Having 19 intelligence means that this cannot effect you, regardless of the roll. Of course, even if you "only" had 18 INT, you'd still have to fail a DC12 INT saving throw AND roll the highest possible result of 3d6.
Thus, the one point probably won't really ever make a difference in practice.
See answers from other SE members for other benefits, especially concerning other stats than INT. My answer focuses exclusively on intelligence, since that's the example given in your question. As mentioned by David Coffron, STR is by far the stat for which score differences that don't increase your modifier matter the most.
Other creatures with effects that reduce INT

Dyrrn (Eberron: Rising from the Last War, p. 287) has a lair action that reduces INT

Oh well, maybe "creatures" was a bit optimistic, because apparently that's it. Or at least I can't find anything else on D&D Beyond.

Side note about naturally uneven scores: while not relevant to your answer, since you're only asking about the difference between 18/19 score as granted by the respective magic items, it's worth mentioning that the difference between 12 and 13 in a score (other than CON) is much more impactful (provided you have it naturally, without a magic item), as that is the score threshold that you need to reach for multi-classing into other classes. See PHB, page 163.
Having a naturally uneven score also allows you to level up your modifier for that score by grabbing a feat that increases the score by 1, on top of granting some other benefit. This is especially useful if you can get your primary ability score to 17, as that means you can get to 20 with an ASI and a feat (which may be more helpful than putting another point in some secondary score), instead of 2 ASIs when starting at 16.
Comment: In this case, having 19 INT from the headband does not mean you can take a +1 INT  feat and go to 20. Any ability score increases would affect your original score, and the headband would set you to 19 again, unless you are now over 19.
Comment: @Toddleson I'll admit the paragraph is a bit convoluted, but the entire last section is referring to naturally uneven ability scores, so you're arguing about something that I wasn't saying in the first place. I'll edit to make it clearer that the last paragraph is still referring to naturally uneven scores.
Answer: Movement in the Astral Plane
There may be other cases, but the only one I know of is that a creature's movement speed (while in combat) on the Astral Plane is 3 times it's Intelligence score - so this would give you a 57ft movement instead of only 54.
Answer: These magic items have been around forever.
They started out with items like "Gauntlets of Ogre Power", that set your strength to the exact strength of an Ogre from the Monster Compendium. That is why the strength is 19 and not some arbitrary other number.
Later, items where added that did the same mechanically for each stat, but they did not have the fancy, specific names any more and were more generic.
In earlier editions, stats did not only do something every other level. They had a different progression curve and 19 over 18 was a big improvement.
In D&D 5 it might seem strange. Why 19 when it doesn't do a lot that 18 wouldn't do? Well, because of it's history. Gauntlets of Ogre Power give you the strength of an Ogre, and Ogres aren't min/maxed by character builders. They just exist as the designers wanted them to.
Comment: It must have been on the minds of the designers when they were writing 5e as well. Every monster in an official 5e book that has the word "Ogre" in its name has exactly 19 strength, aside from "Young Ogre" and "Half-Ogre"