Is there any difference between 'valid xml' and 'well formed xml'?

Question: I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any?
Answer: There is a difference, yes.
XML that adheres to the XML standard is considered well formed, while xml that adheres to a DTD is considered valid.
Comment: Probably worth pointing out that well-formedness is a prerequisite for validity.
Comment: Or an XML Schema, or RelaxNG, or Schematron, for that matter.
Comment: @Quentin: that's an important point, and one that recognized XML experts agree on (http://lists.w3.org/Archives/Public/www-xml-linking-comments/2000JanMar/0058.html "The spec explicitly says ..."); but it's not entirely obvious from the XML spec. Do you have a citation for it? Are you basing it on http://www.w3.org/TR/REC-xml/#dt-valid ?
Comment: @LarsH, the [spec reference](http://www.w3.org/TR/REC-xml/#sec-documents) you seek (confirming Quentin's correct assertion that well-formedness is a prerequisite for validity) is: *Definition: A data object is an **XML document** if it is well-formed, as defined in this specification. In addition, the XML document is valid if it meets certain further constraints.*  [**See my answer below for further valid XML vs well-formed XML considerations.**](http://stackoverflow.com/a/25830482/290085)  Thanks.
Comment: @LarsH By definition, if an XML document isn't well-formed it can't be checked against a DTD or schema.
Comment: @LegoStormtroopr: I agree with you, but my question was, where does the spec say so? Where is the definition you refer to? http://www.w3.org/TR/REC-xml/#dt-valid tells what is sufficient - but not what is required - for a document to be "valid". E.g. an XML document checked against an XML Schema can be valid without having a DTD. As such, this definition doesn't exclude the possibility of other ways for a document to be valid.
Comment: @kjhughes: Thanks for answering. That's probably the best spec reference we'll find, but it's not very clear. "In addition" seems to mean that an XML document must be well-formed in order to be valid, but it could be a lot more explicit. Moreover, the link there for "valid" (pointing to http://www.w3.org/TR/REC-xml/#dt-valid) makes it clear that the "if" in the spec definitions does **not** mean "if and **only** if". (Otherwise, no document could be valid without a DTD.) That further weakens the interpretation that a document can be valid **only** if it is well-formed.
Answer: Well-formed vs Valid XML
Well-formed means that a textual object meets the W3C requirements for being XML.
Valid means that well-formed XML meets additional requirements given by a specified schema.

Official Definitions
Per the W3C Recommendation for XML:

[Definition: A data object is an XML document if it is
well-formed, as defined in this specification. In addition, the
XML document is valid if it meets certain further constraints.]

Observations:

A document that is not well-formed is not XML.  (Well-formed XML is commonly used but technically redundant.)
Being valid implies being well-formed.
Being well-formed does not imply being valid.
Although the W3C Recommendation for XML defines validity to be against a DTD, conventional use allows the term to be applied for conformance to XML schemas specified via XSD, RELAX NG, Schematron, or other methods.

Examples of what causes a document to be...
Not well-formed:

An element lacks a closing tag (and is not self-closing).
Elements overlap without proper nesting:
An attribute value is missing a closing quote that matches the
opening quote.
< or & are used in content rather than &lt or &.
Multiple root elements exist.
Multiple XML declarations exist, or an XML declaration appears other than at the top of the document.

Invalid

An element or attribute is missing but required by the XML schema.
An element or attribute is used but undefined by the XML schema.
The content of an element does not match the content specified by the XML schema.
The value of an attribute does not match the type specified by the XML schema.

Namespace-Well-Formed
Technically, colon characters are permitted in component names in XML.  However, colons should only be used in names for namespace purposes:

Note:
The Namespaces in XML Recommendation [XML Names] assigns a
meaning to names containing colon characters. Therefore, authors
should not use the colon in XML names except for namespace purposes,
but XML processors must accept the colon as a name character.

Therefore, another term, namespace-well-formed, is defined in the Namespaces in XML 1.0 W3C Recommendation that implies all of the XML rules for well-formedness plus those governing namespaces and namespace prefixes.
Colloquially, the term well-formed is often used where namespace-well-formed would be more precise.  However, this is a minor technical manner of less practical consequence than the distinction between well-formed vs valid XML described in this answer.
Comment: This is already a wonderful answer, but perhaps it would help to add a note about namespaces, i.e. about the property of being [namespace-well-formed](https://www.w3.org/TR/xml-names/#Conformance)? As you know, namespaces are a common pitfall for beginners and many people would describe a document with namespace problems as "not well-formed".
Comment: Thanks, @MathiasMüller.  I've added an explanation of ***namespace-well-formed*** per your request.
Answer: Valid XML is XML that succeeds validation against a DTD.
Well formed XML is XML that has all tags closed in the proper order and, if it has a declaration, it has it first thing in the file with the proper attributes.
In other words, validity refers to semantics, well-formedness refers to syntax.
So you can have invalid well formed XML.
Comment: I would disagree with the third paragraph. Neither term says anything about semantics (the meaning of something). DTDs have no way to indicate what a particular element or attribute *means*. That would be the goal of efforts like Web Ontology Language. Rather, well-formedness refers to a low level of syntax (maybe better referred to as lexical correctness), while validity refers to a higher level of syntax (call it "structural" if you like).
Answer: As others have said, well-formed XML conforms to the XML spec, and valid XML conforms to a given schema.
Another way to put it is that well-formed XML is lexically correct (it can be parsed), while valid XML is grammatically correct (it can be matched to a known vocabulary and grammar).
An XML document cannot be valid until it is well-formed.  All XML documents are held to the same standard for well-formedness (an RFC put out by the W3).  One XML document can be valid against some schemas, and invalid against others.  There are a number of schema languages, many of which are themselves XML-based.
Answer: Well-Formed XML is XML that meets the syntactic requirements of the language.  Not missing any closing tags, having all your singleton tags use <whatever /> instead of just <whatever>, and having your closing tags in the right order.
Valid XML is XML that uses a DTD and complies with all its requirements.  So if you use an attribute improperly, you violate the DTD and aren't valid.
All valid XML is well-formed, but not all well-formed XML is valid.
Answer: XML is well-formed if meets the requirements for all XML documents set out by the standards - so things like having a single root node, having nodes correctly nested, all nodes having a closing tag (or using the empty node shorthand of a slash before the closing angle bracket), attributes being quoted etc. Being well-formed just means it adheres to the rules of XML and can therefore be parsed properly.
XML is valid if it will validate against a DTD or schema. This obviously differs from case to case - XML that is valid against one schema won't be valid against another schema, even though it is still well-formed.
If XML isn't well-formed it can't be properly parsed - parsers will simply throw an exception or report an error. This is generic and it doesn't matter what your XML contains. Only once it is parsed can it be checked for validity. This domain or context dependent and requires a DTD or schema to validate against. For simple XML documents, you may not have a DTD or schema, in which case you can't know if the XML is valid - the concept or validity simply doesn't apply in this case. Of course, this doesn't mean you can't use it, it just means you can't tell whether or not it's valid.
Answer: W3C, in the XML specification, has defined certain rules that needs to be followed while creating XML documents. The examples of such rules include having exactly one root element, having end-tag for each start-tag, using single/double quotes for attribute values, and so on. If an XML document follows all these rules, it is said to be well-formed document and XML parsers can be used to parse and process such documents.
Document Type Definitions (DTDs) or XML Schemas can be used to define the structure and content of a specific class of XML documents. This includes the parent-child relationship details, attribute lists, data type information, value restrictions, etc. In addition to the well-formedness rules, if an XML document also follows the rules specified in the associated DTD/Schema, it is said to be a valid XML document.
All valid XML documents are well-formed, but the reverse is not always true. Well-formed XML documents do not necessarily have to be valid.
Answer: I'll add that valid XML also implies that it's well-formed, but well-formed XML is not necessarily valid.
Answer: If XML is confirming to DTD rules then it's a valid XML.
If a XML document is conforming to XML rules (all tags
started are closed,there is a root element etc)then it's a
well formed XML.
Answer: Taken from Extensible Markup Language (XML) 1.0 (Fifth Edition) - W3C Recommendation 26 November 2008 :

[Definition: A data object is an XML document if it is well-formed, as
  defined in this specification. In addition, the XML document is valid
  if it meets certain further constraints.]

For those who prefer psuedo-code to paragraphs upon paragraphs of text... :)
IF is_well_formed(<XML_doc>) THEN
    # It is well-formed, and can be parsed
    IF is_valid(<XML_doc>) THEN
        # Well-formed and ALSO valid. Hurray!
        # **A valid XML doc, is a well-formed doc!**
    ELSE
        # Only well-formed, NOT valid
    END IF
ELSE
    # Not well-formed, or valid!
END IF

FUNCTION is_well_formed
    IF <does_not_contain_syntax,_spelling,_punctuation,_grammar_errors,_etc._errors> THEN
        RETURN TRUE
    ELSE
        RETURN FALSE
    END IF
END FUNCTION

FUNCTION is_valid
    IF <markup_of_the_XML_document_matches_"some"_defined_standard> THEN
        # Standards used to validate XML could be a DTDs or XML Schemas, referenced within the XML document
        RETURN TRUE
    ELSE
        RETURN FALSE
    END IF
END FUNCTION

Based on the theory: "Well Formed" vs. Valid
Answer: Well, XML that isn't well formed, sort of by definition, isn't XML.  Poeple usually refer to valid XML as XML that adheres to a certain schema (XSD or DTD).
Answer: DTD is the acronym for Document Type Definition. This is a description of the content for a family of XML files. This is part of the XML 1.0 specification, and allows one to describe and verify that a given document instance conforms to the set of rules detailing its structure and content.
Validation is the process of checking a document against a DTD (more generally against a set of construction rules).
The validation process and building DTDs are the two most difficult parts of the XML life cycle. Briefly a DTD defines all the possible elements to be found within your document, what is the formal shape of your document tree (by defining the allowed content of an element; either text, a regular expression for the allowed list of children, or mixed content i.e. both text and children). The DTD also defines the valid attributes for all elements and the types of those attributes.
Comment: Hello @Rachna.  This explains the validation part quite well, but doesn't explain when we can call a XML file "well-formed"...
Answer: See XML DTD on W3 Schools:

An XML document with correct syntax is called "Well Formed".
An XML document validated against a DTD is both "Well Formed" and
  "Valid".


Is it safe to open darknet websites on chrome?

Question: Yes, we can open darknet sites on latest chrome without appending any strings like .to.
But my concern is risk of losing annonimity. Is their any such issues in accessing darknet via Chrome?
Answer: yes, it is very likely that you are track-able and depending on your settings and usage you may sooner or later reveal you identity.
there are reasons why Tor Browser is based on Firefox and not on Chromium... (and Chrome is even by far more worse!)

if you want anonymity and you are not sure what you are doing, please do the things and use the things as they are intended to work.
Additionally read the instructions (like at least Want Tor to really work?) AND follow them!


How does a thermoelectric generator at equilibrium get started?

Question: Considering only the secondary steam turbine stage of a thermoelectric plant, if the system is shut down, and the pressure is at equilibrium throughout the system, how is a pressure differential initially created across the vanes to begin rotation? Or is it jump started somehow? Does it have to be decoupled from a load first?
Answer: first you start the boiler, which makes steam. you shut the steam valve to the turbine until the boiler reaches its operating pressure, then you open the valve. Now you have hot steam flowing through the turbine, and it begins speeding up. When it reaches its normal operating speed, you then apply the generator load by ramping up the field coil excitation until the rated voltage output is achieved.
This is a simplified picture. In actual practice there are automatic control systems that modulate the output of the whole plant by simultaneously varying boiler fuel flow, steam pressure, steam flow rate, and generator output. And the process of bringing a generating plant fully on-line from a cold start takes many hours.


Recess and Drupal Friend or Not?

Question: I want to develop back-end of iphone app using recess for services layer component. This app will also have web app using same services layer component. I want to develop wep app using some CMS(Drupal) . I m confuse about databases . Since services layer will have its own database and drupal will have its own. But it is never a good idea to use two databases for same application.
Kindly suggest alternatives.
Thanks in advance
Answer: Recess allows you to specify which database server to connect to. To accomplish your goal of a shared database, configure Recess to use the same database as Drupal. I recommend at least using a different user account to store your Recess data. That will still allow you to merge/migrate data down the road, should you need it. (Although to me, that sounds highly unlikely.)
Alternatively, consider Recess and Drupal to be different applications, which they are.

Recess and Drupal Friend or Not?


Steam Resolution Problem in Ubuntu 12.04

Question: first of all I m noob.
I would like to know why since I have Steam and installed games, Steam is messing around with my Pc resolution. When i reboot and dont use Steam, some min later sometimes my resolution restores. Whenever I use steam the problem get back again, is annoying! I ve Nvidia driver 304.108, Ubuntu 12.04 64bits Gnome3.4.2
The resolution should be 1440x900.
Please Help
Answer: Please attempt to do the following:

Press Alt+F2 and type in gnome-terminal.
Type in the following:
sudo apt-get install --yes lubuntu-desktop

and then type in your password.
When it's finished, log out and click the ubuntu logo on the logon screen. Choose LXDE. Login with your username and password and launch Steam. Does the problem still occur?
If yes, go back and click the white circle next to your user name and click Ubuntu. Log in again and press Alt-F2 and type in gnome-terminal again.
Type in:
<code>sudo apt-get autoremove --purge --yes lxde lubuntu-desktop openbox
</code>
and your password. Look in settings for Propiertary Drivers and choose to install them. If the problem still occurs after a reboot, I can't help you. And if it works in LXDE, play in LXDE and do other stuff in Ubuntu.


I would like to add a battery to my Raspberry Pi 4. Can i do this by soldering to tp7, tp12, or tp1 on the underside of the board?

Question: I would like to add a battery to my Raspberry Pi 4. I am building a tablet that can be turned on and off by a switch that brings power from the usb port from a power bank to power the pi, can i tie this to one of those solder points or would it be better to use the gpio header pins? Note the battery is connect to the power bank module still and then the leads come of the usb side of the power bank to a switch in turn would power the pi.
Answer: You can power any Raspberry Pi via the 5V pins on the pinheader (Pin 2 + 4) or by soldering to the testpads (Tp1/Tp2/Tp3). Be aware that the pinheader is unfused and that you need to provide regulated 5V at up to 3A to the RPi4. You should use minimum 24AWG/0.2mm2, preferably thicker gauge wire, especially if wires are long.
I have soldered wires directly to the bottom of the board under the USB-C connector to connected to an external 5V power supply and it works great.
Comment: RPi 4 doesn't seem to have a polyfuse, so USB-C is unfused too.


How to remove bulb from ceiling fan fixture

Question: I can't figure out how to get into the light fixture on this fan. There don't appear to be any screws or tabs. I tried pulling it down gently. I also tried twisting it gently. It is possible that it twists or pulls down, but I don't want to damage the fan by applying too much pressure. How do I change the bulb on this fan?
Answer: There should be little metal pressure tabs holding in place, it's just a matter of applying a little more downward force. How? Pry it around the edges, gently and carefully, with a screw driver or dinner knife, don't mar it. Or use tape like in the picture below. More information in this video


Single Sign-On When Using PowerBI REST API

Question: I created a test asp.net mvc application to display PowerBI reports using the PowerBI REST API. I'm using Azure Active Directory authentication as the authentication mechanism for the site. Is there any way to re-use credentials from MVC Azure AD authentication framework to get access to the Power BI API? Currently, when the app makes the request to get the access token for the application, the user needs to log in again.
Answer: I was able to resolve this issue by following the example in: https://github.com/Azure-Samples/active-directory-dotnet-graphapi-web. They show code to authenticate against AAD and then use the token to access the graphAPI. I used their approach and used the token to access the PowerBI API.
Answer: When authenticating with Azure AD you should be getting a token back, you can use a Token Cache to store the users token for later.  When you need to get an access token for the powerbi api you can use the refresh token from the initial token you got back.
<code>public JsonResult GetPowerBiToken()
{
    var clientId = ConfigurationManager.AppSettings["ida:ClientId"];
    var appKey = ConfigurationManager.AppSettings["ida:ClientSecret"];
    var aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
    var tenantId = ConfigurationManager.AppSettings["ida:TenantId"];

    string Authority = aadInstance + tenantId;
    var claim = CurrentUserClaims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier);
    AuthenticationContext authContext = new AuthenticationContext(Authority, new AdalTokenCache(claim.Value));
    var refresh_token = authContext.TokenCache.ReadItems().FirstOrDefault().RefreshToken;
    ClientCredential credential = new ClientCredential(clientId, appKey);
    var resp = authContext.AcquireTokenByRefreshToken(refresh_token, credential, "https://analysis.windows.net/powerbi/api");

    return Json(new { Token = resp.AccessToken }, JsonRequestBehavior.AllowGet);
}
</code>
Hope this helps.
Comment: Thanks, @JustLogic. I tried implementing your approach and found that the RefreshToken property didn't exist on authContext.TokenCache.ReadItems().FirstOrDefault(). I subsequently used a different approach (see my answer, below).


What is the resolution of airport ground radars?

Question: In largest airport a ground radar is used to handle safely aircrafts on taxiways and on runways, which should be the characteristics of this kind of radar ? What about its range and bearing resolution ?
Answer: For surface movement radars (SMR) operating in the 9 - 9,5 GHz band, the pulse length is typically in the order of 40ns. This is equivalent to 12 meters. That would bring the theoretical minimum range to 6 if we ignore transmitter / receiver switching overhead time.
In practice there is no need for such a short range. Instead a pulse train is transmitted before the antenna is switched from the transmitter to the receiver. This allows the radar to increase the accuracy by averaging multiple reflections, at the price of an increase in minimum range. Typical minimal range will be in the order of 100 meters.
Other SMR systems use continuous wave radar and have a transmitter and receiver antenna in the radar head. These systems don't require to switch between transmitting and receiving and don't have a minimum range.
The range resolution is in the order of 3 meters, equivalent to the pulse rise time of about 10ns.
The azimuth resolution of a typical SMR is in the order of 0.25 degrees, which is equivalent to 10 meters at 2 km distance.

Apart from primary radar there are other classes of surveillance systems in use for airport surface detection.

Secondary surveillance radar (SSR) lacks the accuracy of the SMR and
can only see transponders. But combined with the primary radar allows
for identification of aircraft on the airport surface (i.e. putting
identification labels on the aircraft's primary radar reflection).
Multilateration (MLAT) systems also rely on transponders but are more
accurate than SSR for surface monitoring. These systems require a large number of receivers and are susceptible for radio reflections from buildings.
ADS-B relies on the aircraft (or airport vehicle) transmitting its
position, speed and heading.
Comment: Don't ground radar systems use secondary radar instead  of primary radar for their use?  I believe that this is why the AIM now says to have the transponder on while taxiing and many large airports require it.
Comment: @Lnafziger SMR is primary radar, but often there is a SSR at/near the airport which is used for flight id / label correlation. The SSR alone is typically not able to provide the accuracy required for low visibility procedures on the surface.  Multilateration systems (like ASDE-X in the USA) depend on the transponder as well but can be much more accurate than a SSR.
Comment: @DeltaLima Would you expand on the meaning of the term "multilateration" in the context of your comment?  Is that the term for the multiple pulses you mentioned in the answer, or something else? Thanks
Comment: @RalphJ Multilateration is a surveillance technology that relies on the time difference of arrival of a radio signal at different positions. It consists of a number of radio receivers positioned carefully over the area under surveillance. The receivers listen to transmissions from the aircraft's transponder.  At a minimum there are 4 receivers, multilateration systems for airport surface surveillance typically have 20 or more.
Comment: @DeltaLima Interesting -- had no idea ASDE X did that.  So with all those receivers, it has a really precise location of the transponder antenna; is there also the radar as well to see other, non-transponder, vehicles on the airport surface?
Comment: @RalphJ ASDE-X combines several sensor systems, including SMR (which is primary radar) that can see non-transponder objects.
Answer: It's been a while since my last lessons on radars, but..
The pulse length and the pulse repetition frequency play key roles in radar min and max ranges. The pulse the radar sends must be short enough to end (and the radar switch to detection mode) before the reflection returns.
To give a rough example, if the pulse length is 2 ms, the theoretical minimum range would be equal to pulse distance in 1 ms (1 there and 1 back).  The pulse travels at light speed, so you can calculate the distance there.
Note that the pulse lengths differ a lot depending on radars, and presumably none of the are 1 ms long.
Free quote from the book Understanding Radar Systems:

Pulse length of 3 µs, which is a fairly typical pulse length for a
  long-range airborne surveillance radar, would give a theoretical range
  resolution of 450 m. However, other factors such as signal processing
  degrade the resoution, and in the given case the resolution would be around 750 m.

Note again, that radars are designed to serve a specific purpose, for example a long-range surveillance radar emphasizes range over resolution.
What it comes to fighters, most modern fighters have AESA radars instead of pulse radars, which work continuously and handle the signal differently.
Comment: Some things I just can't Google while driving. Expect an edit later..
Comment: 1 ms would be absurdly long. Such pulse would be 300 km long
Comment: I know. That's why i said "none of the are 1ms". That was given as an example, could have just as easily chosen "x".


Optics and Scattering of Light

Question: From my childhood till now, I have been wondering about the "pink", or sometimes "magenta" color of the evening sky. According to the scattering of light phenomenon, the colors pink/magenta do not directly appear in the spectrum. Moreover, it is said that pink appears as a result of red+white. Do these colors mix somewhere in the sky? Please explain the appearance of sky colors other than blue, red, yellow.
Comment: The pink I see at sunset is typically a mixture of red and blue, rather than a tinted red.
Answer: The misconception that pink isn't technically a colour is absurd, really. Pink is just as much a colour as any other colour in the visible spectrum (not that your perception of the colour validates it, but that it can be measured and that measurement is reliable and repeatable).
The mixing of the colours happens in the atmosphere. The colour pink arises when the necessary components to make the pink light are simultaneously scattered by the molecules in the upper atmosphere. By mixing, I mean the superposition of multiple wavelengths that combine to create the wavelength perceived by our brains as pink light.
Comment: The point is that it isn't a pure color formed by a single wavelength of light.  It's a composite color (multiple wavelengths needed).
Answer: You are right, magenta doesn't exist as a wavelength: it's a result of mixing violet (the shortest wavelengths of visible light) and red (the longest) - in theory the colour we should see should be somewhere around green but for some reason our brain mixes the two and sees magenta.

Optics and Scattering of Light


Extension Fields and Quotients

Question: In the Dummit and Foote 3ed chapter on field extensions (ch. 13), it is stated as a theorem (6) that $ F(\alpha) \cong F[x]/(p(x))$ where $\alpha$ is a root of $p(x)$ and goes on to state that any field over $F$ which contains a root contains a subfield isomorphic to the extension of $F$ constructed in an earlier theorem. The earlier theorem (3), however, refers to a quotient $K$ such that once again $ K \cong F(x) / (p(x))$, it does not refer to $K$ as an extension, which is slightly confusing.
Is it legitimate then to consider the quotient $F(x) / (p(x))$ in order to construct elements of the extension $F(\alpha)$ so that, for example if $F = \mathbb{Q}$ and $p(x) = x^2 -2$ then the elements of the extension would be of form $a + b \sqrt{2}$ with $ \{a,b \in \mathbb{Q}\} $ ?
Comment: @FireGarden whoops: $x^2+1$ right? :)
Comment: Yes. In fact, that very procedure is a common exercise which is to show $\mathbb{C} \cong \mathbb{R}[X]/(X^2-1)$.
Comment: From a notation standpoint, then, is the notation for the extension $K/F$ ($K$ over $F$) which contains $\alpha$ the same as the notation $F(\alpha)$?
Comment: Well, not necessarily; $K/F$ could have a different root of $p(X)$ adjoined, but it would be isomorphic. They would be the *same* if you knew $K$ contained specifically $\alpha$.
Comment: @rschwieb Indeed! Silly mistake.
Answer: Notice that the polynomials of degree less than one form an isomorphic copy of F. In this way, F is embedded in K so that it's an extension of F.
Furthermore, this did not come up in the discussion so far, but the polynomial must be irreducible over F, or else the quotient won't be a field, hence certainly not an extension field.

Extension Fields and Quotients


Make a glass cup look like it's full of water

Question: I've been struggling to figure out a way to make a glass cup full of water, and since the cup is made of glass a plane on the top of the glasse won't really do it, so how can i go around making the glass looks like it's full of water?
Comment: I think in order to answer this question properly we would need to know how well you want this to look. You could go really far out here by adding a fluid physics simulation and even simulate realistic light diffraction. Or you could go the quick and dirty route and just put a transparent cylinder into the glass. If the glass does not appear in a very prominent location, then that would likely be the best solution.
Comment: Those last three words "and water spilling" take this from a simple visual effect we can accomplish with a number of graphics tricks straight into a non-trivial fluid simulation problem. :( Is that really a necessary part of "make a glass cup look like it's full of water," or is that a new problem you might want to ask about separately?
Comment: I want it to be simple but not as simple as putting a transparent cylinder inside, in terms of how it looks just a blue color is enough for now no need for diffraction or transparency but i'll need to have fluid physics like slosh(nothing advanced just water rotating in the opposite direction of the cup or something like that) and water spilling
Comment: It's a new problem that i havent given many thoughts to it yet since i want to tackle it after i'm done with this making the glass look like it's full of water with not close to reality physics because that will take a lot of effort but i also want it to look like water of course ^^
Answer: Actually recreating the effect would probably require raytracing, but you can fake it with a blur effect and a distortion that "blows up" the pixels behind your glass. It is especially convincing if you have a few simple shapes that use the effect (a glass, for example, is usually a cylinder or a truncated cone).
Comment: @Saad raytracing isn't really an option here, since it's slow, but basically, that would simulate the light going through the water, so it's easier to fake it
Comment: The shapes i'm going to use are going to be simple, i didnt understand how raytracing would help in this case, i'm not very familiar with it so can you explain more pleas
Comment: Sorry I didn't reply, meatspace got in the way, but basically what Balint says - water affects light going through it (and by extension the image you see through it), and it depends on the exact shape of the "border" between water and air or a third transparent medium (such as glass). Flat borders tend to be easiset to sumulate because no distortion occurs. It is possible to achieve specific kinds of distortion with a bump map, see Riemers series on water shaders https://web.archive.org/web/20091008171244/http://www.riemers.net:80/eng/Tutorials/XNA/Csharp/Series4/The_Fresnel_term.php
Comment: (2/2) The specific chapter linked has a good example of doing some real-world light-related calculations without really raytracing anything, not sure how to put this in my answer though.


Show OneNote page name in preview

Question: I have an OneNote file that can be found by SharePoint if I search for a keyword. Is it possible to show the name of the OneNote page, where the keyword is located, in the preview?
Answer: The location of OneNote Notebook in SharePoint Online environment is SiteAssets.
Example: https://xxxxx.sharepoint.com/xxxx/SiteAssets/Forms/AllItems.aspx
We can't display The OneNote page, which is similar to a redirect feature.

Show OneNote page name in preview


Why do mortgage affordability recommendations use gross income?

Question: Whenever I see someone ask how to calculate how big a mortgage he can afford, the answer almost always comes back as a percentage of gross income.
Why use gross income as the baseline?  Why not net income?
Answer: You can choose to pay your mortgage instead of another bill, or vice versa.  Your net will change from month to month while your gross is relatively static.
I can make a bunch of promises to my load officer about my expenses, but it is very difficult to verify.  Moreover, it is pretty hard to give your net income and plan for emergencies.
So for the sake of reliability, verifiability, and general ease a lender will look at your gross.
YOU should definitely look at your net when deciding if you can afford a loan.
Answer: The percentage of gross income is a quick and easy way to arrive at the rough ballpark figure of the mortgage one can afford.
The net income is something which one does not know offhand.
If you want to seriously evaluate then most of the standard mortgage calculators will ask you to enter your gross income, your other liabilities like Auto Loan, Student Loan, personal Loan, Card Payments, Any other regular payments like Child Support etc.
After factoring all these one arrives at the actual mortgage one can afford.
As is evident, the above requires a good amount of calculation and hence the preffered method becomes on the basis of gross income.
Comment: "The net income is something which one does not know offhand."  Unfortunate, but true.
Answer: People typically present themselves to be as wealthy as possible to banks and as poor as possible to the government at tax time.
Gross income is really the most reliable number for most folks. Your and your employer are required by law to report an accurate gross income figure annually. Anything else is totally situational.
All they are doing anyway is computing your total debt-to-income ratio and mortgage-to-income ratio. The government agencies that buy mortgages, the big bank that buys the mortgage or the self-underwriting bank has differing standards for different products.
Answer: I would ignore the bank completely when they use gross income. Decide, based upon your current living situation, what your MAX limit on a monthly payment is.
Then from that determine the size and cost of the house you can buy. My husband and I decided on a $2000 monthly payment max, but also agreed $1500 was more reasonable.
When using those numbers in the calculators it is way less than when using gross income. When we used our gross pay the calculators all said we could afford double what we were looking for. Since they don't know what our take home pay is (after all the deductions including 401k, healthcare, etc), the estimates on gross income are way higher than what we can comfortably afford.
Set a budget based on your current living situation and what you want your future to look like. Do you want to scrimp and coupon clip or would you rather live comfortably in a smaller home? Do the online calculators based on take home pay and on gross pay to get a sense of the range you could be looking at.
Comment: Welcome to [Money.SE]!  Please check out the [Help Center](http://money.stackexchange.com/help) for some useful resources, such as the guide to [writing great answers](http://money.stackexchange.com/help/how-to-answer).  One good tip there reminds folks to answer the question being asked -- in this case that would be why sources of affordability recommendations use gross income.  This guideline is especially apropos when answering old questions that already have accepted answers.
Answer: Gross income is used because there are a lot of variables inherent in the calculation of a "net income", including a lot of things under your direct control that you could use to game the system.
"Net Income", as others have inferred, is a very flexible term. For the average individual, the definition that would most easily come to mind is likely post-deduction, post-tax earnings; "take-home pay". It sounds reasonable, too, as the amount you take home each month can be easily demonstrated with your two most recent pay stubs (which you need to bring in anyway to verify gross earnings). However, even that simplistic definition is fraught with possibility. You have the ability to modify your pre-tax deductions, such as for retirement or healthcare, and that in turn affects your taxes and thus your net take-home pay. To assume that you won't do that is foolish for the loan officer.
Other definitions of "net income", such as, in the case of shopping for a house, "disposable income plus current rent", are the result of even longer lists of deductions from gross pay. Many are also dependent on your current home; your electric bill is a function of the size, location and construction of your current home, all of which will change as soon as you move in. Your other bills, such as telecom (TV/phone/internet) are also more or less location-dependent, as even within a single city or metro area, your choice of services and service providers is dictated by the home's physical location. You may have to pay through the nose right now because your current home isn't serviced by anyone's fiber-optic network, while the home you're moving into could be in a hotly-contested area with access to multiple fiber-optic trunks.
So, to simplify all this, mortgage companies simply ask for gross income, then apply a metric that makes relatively conservative assumptions about your spending habits to arrive at a final amount. The upside is simplicity, the downside being that two people both making $60,000/yr may have two completely different financial pictures behind that single number.
Answer: Cynical answer:
Real Estate agents make money on commission from sale of houses, so their compensation is tied to the home price.
Banks make money off loans, so it is in their interest to make larger loans (as long as the loan gets paid).  So their is a tension at the bank between selling a larger mortgage, and ensuring that their customer can pay the mortgage.
Gross income is easier to check, and the taxes at a given income are fairly predictable.  And banks realized that people can change their medical and retirement deductions.
Answer: As a former consumer credit counselor, who worked with struggling homeowners and first time homebuyers I would argue that it is a mistake for lenders to rely on gross income and assumptions on what an applicant spends their income on. I think lenders do this because they believe it is efficient and may not understand the long term ramifications for the stakeholders, e.g. the borrower, the lender, the servicer, the investor, the broker, the taxpayer, the marshall, the foreclosure lawyers etc. Or lenders do know the impact of a superficial mortgage screening, and intentionally want to enrich themselves in the short term while harming other stakeholders in the long term.
Developing a budget that reflects what a person can realistically spend on their mortgage takes much longer than signing up for a Rocket mortgage. I would say an hour minimum for the first appointment to get a baseline, and at least two follow up appointments to make adustments soon after or whenever a borrower's financial situation changes dramatically. Credit counselors factor in all of the factors mentioned above, i.e. take home pay, future pay vs current pay, the ability to adjust deductions, seasonal expenses, multiple sources of income and their frequency, debt load etc. Budgets are always fluctuating, but when it is done right by a qualified professional the result is a much more accurate financial picture.
The consequences for not doing this type of old-school due diligence, or for willfully choosing to skip it, are varied. First off, mortgages will be given to homeowners who should never have qualified in the first place, and likewise denied to homeowners who should qualify. This will result in market distortion and this distortion was a primary contributor to the 2008 subprime mortgage crisis and the wave of foreclosures that came with it. Another consequence is the stripping of wealth from minority communities since they are often targeted by the most unscrupulous of lenders. Additionally, the securitization of mortgages based on poor diligence at the loan officer level means loan portfolio ratings are questionable, investors will lose money, and small banks who are heavily invested will fail as they did in the past. Depending on the federal enforcement of Dodd Frank Act, the taxpayers may or
may not have to pick up the bill from a bailout of a big mortgage bank that was "too big to fail," via higher taxes, lost jobs, lost homes, and other negative externalities that were not accounted for by the loan officer, or willfully ignored.
Lastly, borrowers also have a responsibility to provide accurate financial information, which they don't always do. Unfortunately, in a capitalistic society where property is commoditized instead of communal, there is always mistrust, competition, the fear that you will be left behind, or the desire to get ahead. This could incentivize cheating by either the, borrower, the broker/lender, or both in this example e.g. no-doc negative amatorizing loans. This is just one of many other negative externalities. So the only true fix would be a switch to communal land ownership. In the interim, I would push for universal borrower access to low cost consumer credit counselors and a change in loan officer training and incentive structure.
Comment: I think the value of this answer could be improved if it was more directed at the personal transaction level, rather than the macro-economic level of the consequences of looking at gross vs net income.
Comment: You were going so well until "*in a capitalistic society where property is commoditized instead of communal, there is always mistrust*".


Apparently systematic nozzle clogging

Question: A Monoprice Maker Select V2, upgraded incrementally with a Micro Swiss all metal hot-end, machined lever, and D4 extruder gear, systematically fails to produce complete prints, as seen below:

The following observations can be made.

The nozzle clog appears at different heights/elapsed times, so it does not seem to be because of heat creep, which ought to take the same time to take effect, each time.
All the clogs so far have been easy to clear manually, once the hotend has been made accessible.
The filament (1.75 mm PLA) is quite new, has only been sitting on the spool at the top of the printer, seems regular in density, is not visibly damaged etc.
In the original configuration, before the upgrading, the printer worked fine for some months.

One possible explanation might be inconsistent temperature in the extruder, but the display does not show any great variation.
Any other theories? These latest prints were made at 210 °C.

The nozzle clogging was verified, each time, by trying to extrude using the printer controls; and then cleaned manually by taking off the "cold end" part, heating the extruder, and pressing the remaining filament out by hand.
Not so long ago the nozzle was cleaned with ethyl acetate and a needle, so I do not believe carbon build-up is the explanation.
Cura settings:
Comment: Did you by any chance disassembled nozzle from heat block? There is a chance that the nozzle is not (or was not) adhering to the throat and that creates deposit which blocks filament. The best way will be to clean the block, nozzle and throat, especially thread.
Comment: Possibly the same question as ["Extruder prints fine up until further down the print"](/q/5968/5740)
Comment: Now you have your print settings added, I've updated the answer. Basically, you print too hot, too slow and have a far too high retraction length. This causes heat to affect the filament before it enters the nozzle, with high retractions (retracting hot/flexible of heat filament) you then quickly cause a blockage to develop.
Answer: The Micro Swiss hotend uses an all metal hotend. These type of hotends are more difficult to operate considering they do not have a Teflon liner that shields the filament from heat exchange from the cold end (the Teflon/PTFE tube acts as an insulator). From this article:

Jams and clogs are often from a combination of excessive heat and
non-optimal material flow. This effect is worsened by poorly cooled
all-metal hot ends, high torque extruder gears, small nozzles/layers,
slow printing speeds, too thin first layer, and excessive retraction.

The bold faced text in the quote sums up what is causing this. A smaller gear requires more force/torque as the arm i.e. the radius is smaller.
The article describes what steps you could do to alleviate the problem. Of all the suggestions, "Minimize retraction", seems a possible candidate for you to look into considering the posted print settings. As this is a heat related problem it is advised to also increase your printing speeds, these are pretty low (30 mm/s for slow and 60 mm/s for normal printing) and also check the cooling of the "cold end" (the fan that cools the radiator fins). Also reduce the printing temperature, 210 °C is pretty high for PLA filament, personally I don't go over 200 °C (note that this depends on your filament, but most PLA brands can be printed in the 185 - 195 °C range).
You have a pretty large retraction specified. The Ultimaker default is 6.5 mm is considered to be large, but works perfectly for Ultimaker machines (read Bowden tube setup). In my Ultimaker 3E which uses all metal hotends, or, in my custom HyperCube Evolution, also Bowden, but with a lined hotend, 6.5 mm retraction works perfectly.
Please look into this answer and this answer. Both describe that the retraction performance is worse with all metal hotends. My experiences are exactly the same with metal hotends, at least the cheaper production ones (I tested cheap all metal hotends, but also ran into problems because of production and design errors, I have not tried the better quality heat breaks/throats yet).
Please lower the retraction setting considerably to see if it has an effect. The Monoprice Maker Select uses a direct drive. Direct drive extruders do not need a large retraction length setting. If the filament is hot in the throat (as there is no PTFE lining that in fact acts as an insulator), too large of a retraction may not be reversed when the filament cooles during the retraction.

I think you might be experiencing what is described in this question: "Extruder prints fine up until further down the print". This answer describes issues of the metal heat breaks.
To comment on your statement in comments above, I am not suggesting you should use a liner in your current extruder. I'm pointing out the differences. Metal hotends are just more tricky to operate regarding retraction and heat management.
Comment: @TomasBy You should increase the speeds, current values are way too low. Only for the first layer you could do a 20/30 mm/s (don't go under 20). If it was my problem I would revert to default Ultimaker Cura settings and start over by first reducing retraction.
Comment: @Oscar: there are quite a few differences between the default settings in the sw and the suggested values in the manual. I have now tried several different combinations of speeds, with low retraction and 200 deg. print temp., and am getting the same results all the time, with some minor variations. Under-extrusion apparently in the form of some temporary clogging (the filament spool does not move) but no actual clogging of the nozzle. I can extrude fine using the control panel.
Comment: @TomasBy That is the pain with those all-metal hotends (please confirm in the question that it is an all-metal hotend, so no PTFE lining in the heat break). It could be that when you extrude from the panel, the extrusion rate is higher than when you actually print, too low print speed cause heat to creep up.
Comment: Well, I have tried 30, 40, 50, 60 even 70 I believe. In the manual it says 70 mm/s is the max speed. It does not really seem to make any difference.
Answer: There are several reasons why the nozzles can clog.
Temperature:
If you set the temperature too low, the force to push the filament through the nozzle gets up. This can lead to filament grinding and this can lead to clogging. If you set the temperature too high while not extruding, the filament can degrade, which may lead to clogging. So always test the temperature and viscosity by manual pushing filament through the nozzle.
Nozzle Size:
Many users do not like to change the nozzle but for many filaments 0.4 mm is not advisable. Try 0.6 mm. The print quality is nearly the same @ similar layer sizes, print time goes down a bit and the likelyhood for clogging is close to zero. Reason is that the flow resistance is proportional to r^4.
Grind dust/traction force -> Retraction:
I suggest a max of 2 mm to 2.5 mm for direct extruders. Higher values bring no benefit and lead to filament grinding. Bowden Extruders can use values > 5 mm due to bending sometimes.
Feeder Spring
Sometimes the spring of the feeder loses tension over time, thus the filement is not pushed forward and instead, grinded down.
Feeder Gear
Another problem can be related with the pushing gear of the feeder (which you mount on the motor). I use gears with fewer theeth. They produce traction force and stay clean from grinding dust. Gears with many small teeth become dusty and produce less traction force.

Apparently systematic nozzle clogging


Does this GFCI need a sticker for code-compliance?

Question: I replaced a 2-prong outlet with a GFCI, wired as shown (connected ground wire coming into the box to the metal box as well as the ground screw of the GFCI, black wire to brass terminal & white to silver). The box has no separate grounding wire and wires are only in Romex, not metal conduit. Multimeter shows hot and neutral are correct. Later, I realized I never checked whether the ground wire was actually grounded at the service box. To be code compliant, do I need to apply the "no equipment ground" sticker regardless, or only if the bare copper wire coming in is not grounded at the service box?
Comment: Can you turn the breaker for the circuit OFF and use a multimeter to check for continuity from ground to neutral?
Comment: Yes, but later in the day. Other people in the house are using that circuit now. A simple lighted circuit tester shows "no ground").
Comment: You need to run the ground wire to the metal box *first*.  By the way, you see the funny thing on the lower mounting screw on the GFCI?  That is called a "self-grounding" feature.  That means you don't need to run a ground *wire* to the recep, it will pick it up off the metal box.
Comment: Thanks. When I was installing, I connected the "ground" wire from the 12/3 romex. Later, I realized I hadn't verified that the bare wire was actually grounded. A circuit tester indicates it is not. I will use the "no equipment ground" sticker to comply with code.
Answer: The NEC in 250.130(C) now requires extending an Equipment Ground Conductor to the grounding system when making an extension of a two-wire circuit that does not have an EGC.
If your circuit was extended before the current requirement or was extended by local exception then the receptacle needs to be marked " No Equipment Ground" and the ground should be left disconnected.

406.4 General Installation Requirements (D) Replacements
406.4(D)(2) Non–Grounding-Type Receptacles. Where attachment to an equipment grounding conductor does not exist in the receptacle
enclosure, the installation shall comply with (D)(2)(a), (D)(2)(b), or
(D)(2)(c).
(a) A non–grounding-type receptacle(s) shall be permitted to be
replaced with another non–grounding-type receptacle(s).
(b) A non–grounding-type receptacle(s) shall be permitted to be
replaced with a ground-fault circuit interrupter-type of
receptacle(s). These receptacles or their cover plates shall be marked
"No Equipment Ground." An equipment grounding conductor shall not be
connected from the ground-fault circuit-interrupter-type receptacle to
any outlet supplied from the ground-fault circuit-interrupter
receptacle.
(c) A non–grounding-type receptacle(s) shall be permitted to be
replaced with a grounding-type receptacle(s) where supplied through a
ground-fault circuit interrupter. Where grounding-type receptacles are
supplied through the ground-fault circuit interrupter, grounding-type
receptacles or their cover plates shall be marked "GFCI Protected" and
"No Equipment Ground," visible after installation. An equipment
grounding conductor shall not be connected between the grounding-type
receptacles.
Informational Note No. 1: Some equipment or appliance manufacturers
require that the branch circuit to the equipment or appliance includes
an equipment grounding conductor.
Informational Note No. 2: See 250.114 for a list of a cord-and-plug-
connected equipment or appliances that require an equipment grounding
conductor.
Comment: So, if I find the bare copper wire coming in is NOT GROUNDED at the service box, I'll disconnect that wire from the receptacle and mark the outlet "No Equipment Ground."  But what if I find that it is GROUNDED at the service box? Leave the wiring as is and no sticker required?
Comment: Any ungrounded 3 wire receptacle must be labelled. Something is missing if the tester shows no ground. If it is a cable in the panel that has a ground but isn't connected it needs to be corrected. A cable connected in the panel but the ground not being complete to the receptacle the circuit needs to be repaired, a GFCI is not an acceptable alternative to repairing damage or fixing an incomplete or poorly installed splice.
Comment: Thanks. I wasn't sure whether to trust the simple 3-light tester. Posters elsewhere indicated GFCI's "always" show as ungrounded with these testers, but it was unclear whether they assumed two wire/ungrounded wiring.


Map Layout Elements In New Layer Automated Using Python

Question: I was wondering if there was a way to put a title and integer data from an attribute table in a new layer created in Python. I was able to create a new layer using copy features, zoom to the selected features, and export the zoomed features in a map as a PNG all using arcpy, but I also wanted a title at the top and data from the attribute table of that specific layer in the map layout before it was exported. Is it possible to get all this automated using Python?
Answer: Yes, just do a search cursor to get the specific field/record value and update layout default title text (you set this within a template map document), see sample code below.
<code>import arcpy

# run search cursor here

mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
    if elm.text == "default title text":
        elm.text = myFieldValue # variable grabed from search cursor
mxd.save()
del mxd
</code>
If you want to export the map layout to png you may use ExportToPNG
Comment: Would I be able to do this from a new layer in the same arcpy process? I created a new feature layer and I wanted that layer to be edited with title and density data from the attribute table and then exported to PNG all within the same script. Is that possible with the search cursor?
Comment: @Victor, Yes it should be possible.  If you post your script within your question I may be able to further assist.


node.js module/export system: is it possible to export a module as a function

Question: I want to do something like this in Dispatch.js
function handle(msg) {
    ....
}
exports = handle;

and this in the calling index.js
var dispatch = require("./Dispatch);
dispatch("data");

Any ideas?
Answer: exports = handle
This creates a local variable called exports. This is different from overwriting module.exports.
module.exports = handle
This overwrites the exports variable that lives in module scope, this will then be read by require.
In the browser window["foo"] and foo are the same, however in node module["foo"] and foo behave subtly different.
The local variable scope context and module are not the same thing.
Answer: Do:
function handle(msg) {
    ....
}
module.exports = handle;

and it works the way you want.
Comment: or module.exports = function(msg) { }
Answer: The problem behind this issue (exports vs module.exports vs exports.something) is best described in this article:
http://www.alistapart.com/articles/getoutbindingsituations
The first version (exports = handle) is exactly the problem: the missing binding that is mandatory in javascript:
exports = handle means window.exports = handle (or whatever node.js has as the global object)
Answer: Another way of seeing the problem is thinking about how node could load your module:
function loadModule(module, exports) {
inside here comes your module code
}
If your code overwrites the exports parameter (exports = handle), this change is not visible from the outside of this function. And for this overwriting one can use the module object.
The problem would not occur if exports would be a variable visible in the scope where the function body is.


Why is a hydrocarbon tail non-polar?

Question:
Here it says that the hydrocarbon tail is non-polar. I understand that the $\ce{H}$ on top of the $\ce{C}$ and on the bottom have dipoles that cancel, but at the very end, with the $\ce{CH3}$ group, there is no opposing vector to cancel with that dipole. Why then is the hydrocarbon tail still non-polar?
Comment: This is a 3-dimensional structure - so the dipoles do NOT cancel anywhere... Rather, the dipoles created by C and H are weak, as the electronegativity difference is low - which is considered unpolar.
Answer: The hydrocarbon tail is considered nonpolar mainly due to

The Pauling electronegativity of Carbon is 2.55 and Hydrogen is 2.2. Due to the small difference, .35, and the definition of a polar bond, C-H bonds are considered nonpolar.

Indeed, the molecule methane, $\ce{CH4}$ has a dipole moment of 0 D (debyes). I think part of your confusion arises from the picture you provided. Skeletal drawings are 2-d in nature and do not convey information about 3-d. For instance, each carbon has it's hydrogens arranged in a tetrahedral structure, with bond angles 109.5 degrees. The symmetry of this cancels all the vectors contributing to polarity.

If you look at the picture of methane above, and consider the top most hydrogen as the next carbon in the hydrocarbon tail, you can see that in reality, the bottom 3 hydrogens do experience a net dipole moment towards the carbon, and this increased by having another carbon further up in the tail. Relatively speaking, this distance is rather large from carbon 1 to carbon 2. We can say that the vector that arises from this is negligible, and indeed, there is a net dipole moment anyways towards the oxygen at the polar head.
Comment: methane is CH4. Did you mean methyl?
Comment: @pikachu Oh, thanks for pointing that out. Edited.
Answer: The hydrocarbon that you have depicted (decanoic acid) does indeed have a polar head and a non-polar head, though it is not apparent in the form it is presented to you in. When viewing decanoic acid as a 3-dimensional, ball-and-stick model, it becomes more obvious:

The hydrogen on C-10 of this chain that sticks out in the plane of the rest of the carbon chain is balanced by C-9. Most importantly, it should be noted that there are no unbonded electron pairs in this region. Because the electron density along the chain remains consistent, the carbon chain is non-polar.
Each of the two oxygens in the carboxylic acid groups have two electron clouds that give these regions around the molecule a negative charge. The space around the hydrogen bonded to oxygen, and the space around C-1 that is oriented away from the oxygens are both more positive. These opposing charges result in the polarity of the carboxylic acid group.
Source: http://upload.wikimedia.org/wikipedia/commons/9/98/Decanoic-acid-3D-balls.png

Why is a hydrocarbon tail non-polar?


Connection problem between PC and PBX machine

Question: I encountered the error message "Error Opening Com Port" on PC. That PC is used for PBX System and PBX (Panasonic Digital Super Hybrid System KX-TD500 version 2.5) uses RS 232 serial interface for the connection with that PC.I already checked both 25-contact and 9-contact connectors and all are good conditions.
And I use Win Tariff Software for recording telephone calls and this software cannot record telephone calls since the above error appeared.
How do I solve this problem?
Anybody help me, please.
Thanks in advanced for your help.
Comment: I may be wrong -- I *hope* I am actually -- but I suspect this is one occasion where you might be better off asking the software vendor (Panasonic in this case?) for help. I think that the software you're talking about may be a little too obscure to get much help here.
Comment: Try contacting the person/company that did the installation for you. They will generally have the required expertise.
Answer: The first steps in troubleshooting that problem are:

Make sure the cable is connected to the SMDR port on the KX-TD500 and the correct COM port on the PC
Turn the PC off and back on
Try a different cable
Try a different COM port on the PC (you will need to set the COM port in the software, too)
Try a different PC
Try connecting the cable to the PROG port on the KX-TD500 and see if you can communicate using the Maintenance Console software (e.g. download the system data report or view traffic information or system status)
Reset the KX-TD500
Power off the KX-TD500, remove and re-install the CPU card, power the system back on

Perform each of those steps in that order. After each step, try to see if communications is restored. The steps are ranked (approximately) by ease. Don't omit any of them even if you try them in a different order (stop, of course, if one reveals the source of the problem). I'm assuming that you've had this setup working properly before.
If those steps don't narrow down the source of the problem, then you may have a defective CPU card.
I have some experience with smaller Panasonic Hybrid systems, but no current access. I don't have any experience with Win Tariff.


Mathematics of computation

Question: What is a good introduction to turing machines, complexity classes, P=NP etc from a purely mathematical viewpoint?
I want to know how computation relates to provability in mathematics, I need the details of how one relates arithemtical statements to turing machines.
I am not interested in practical computing or programming.
Also I want to know how to prove that some system is turing complete.
Comment: Maybe this question is too broad, in which caase eliminate complexity classes and P=np from above. But I would like a general overview of mathematics of computation aswell.
Answer: You might try Michael Sipser's Introduction to the Theory of Computation.
Comment: Sipser's book is an excellent read if you ever plan on writing a textbook; it is the best mathematics textbook I have ever read, and I would maintain this even if you convinced me that it isn't a mathematics textbook.
Comment: Sipser's book is more focused on CS, and uses some nonstandard terminology like "mapping reducibility". It's not a bad book, but I would recommend something else for someone interested in mathematics.
Answer: Try Computational Complexity by Papadimitriou.
Answer: A good place to start for the relationship between computability and provability is Computability and Logic by Boolos, Burgess, and Jeffrey. But it's not for the faint of heart - the content is dense, and the book has a lot more content than its thickness suggests.
For something more CS focused that will discuss Turing completeness and complexity, another great text is Introduction to Automata Theory, Languages, and Computation by Hopcroft and Ullman. Just skip chapters 2-7 which cover regular and context-free languages. Again, this book has a lot of content and is very well regarded.
Comment: +1 I'm reading Hopcroft's book right now and it's extremely clear.
Answer: Another very good book is Computational Complexity: A Modern Approach, by Sanjeev Arora. See http://www.cs.princeton.edu/theory/complexity/. It is a very good book and not very expensive compared to Sipser's and Papadimitriou's book. The topics of the book cover a variety of topics in complexity theory.
Also, there is a draft online, so you can check that if you want to see how the book is like.

Mathematics of computation


How do I disable automatic screen locking in Xubuntu?

Question: After about 10 minutes, Xubuntu 14.04 goes to sleep all by itself. I've set up the shuffle on the music player and it only gets through 3 songs before I have to sign in again. There is no screensaver installed and the power setting for AC is set to never shut down. So, what do I need to do?
Comment: `sudo apt-get purge light-locker`?
Comment: Related: http://askubuntu.com/q/516523/18612
Answer: light-locker is the new screen locking program in Xubuntu 14.04. If you disable light-locker, it should stop locking your screen.
How to disable lightlocker

Go to settings manager > session and startup > application autostart and disable light-locker, which is titled "Screen Locker (Launch screen locker program)."
Reboot your machine and it should stop locking. Alternatively, start up Terminal with Ctrl+Alt+T and run killall light-locker.

Source: Disabling screen lock is not possible
Comment: Remark: in Xubuntu 20.04.3 LTS (as of 2021), it is called 'Screensaver' rather than 'light-locker'
Answer: There is an easy way:
Go to Settings -> Screensaver. In the "Lock Screen" tab, disable the lock screen.
Comment: This is the correct solution as of 2021, Xubuntu 20.04.3 LTS. (lightlocker is gone by now.)

Alternatively, one can run xfce4-screensaver-preferences and disable the screen lock therein, as I right below. Thank you for the updated answer!
Answer: One more solution - start a program below:
/usr/bin/light-locker-settings&

and shift the Enable light-Locking slider to the OFF position, then hit Close.
This panel contains two Screensaver sliders as well.
Comment: On Xubuntu 20.04, `light-locker-settings` is not installed by default, but can be installed with `sudo apt update && sudo apt install light-locker-settings`.
Answer: On my Xubuntu 14.04 install, even when I had Light Locker completely disabled, my screen still blanked after about ten minutes. The solution to my problem was to run the following command:
sudo xset s 0 0

Make sure you run this command from your desktop session and not through an ssh session, or the DISPLAY variable will not be set and this command will not work.
more info: http://ubuntuforums.org/showthread.php?t=1346567
a bug report has been filed: https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/498366
even more info: http://www.shallowsky.com/linux/x-screen-blanking.html
Comment: most annoying thing I've ever dealt with... I'm on Xubutu 16.04, and completely nuked light-locker and gnome-screensaver, and the screen still blanks after 10 minutes while the power manager and greeter settings are set to never blank. I use nvidia xorg drivers and good lord, manually editing xorg.conf finally saved me from this ridiculous issue, as you can't even set this in nvidia-settings.
Answer: This worked for me:
sudo mv /etc/xdg/autostart/light-locker.desktop /etc/xdg/autostart/light-locker.desktop.bak

It was based on some info in this bug report:
https://bugs.launchpad.net/ubuntu/+source/light-locker/+bug/1287255
Answer: As of 2021, (Xubuntu 20.04.3 LTS), it has moved to the 'Screensaver' options.
Thus, one can run $ xfce4-screensaver-preferences and disable the screen lock therein. (One gets the same menu as the one posted by Kaaveh Mohamedi).
Answer: You can edit the file at /etc/xdg/autostart/light-locker.desktop and add the line
Hidden=true

as documented here. This will disable light-locker globally, which is nice if your family starts complaining that they cannot unlock their desktops. You can copy the file to ~/.config/autostart first to disable it for a specific user only.
Answer: Provided more intuitively from the resource in Nacht's answer.
If you use nvidia xorg drivers and have gone as far as to nuke light-locker and gnome-screensaver from your system,
and sudo xset s 0 0 doesn't work for you (your screen still blanks),
edit xorg.conf wherever you saved it (typically saved in /etc/X11/) like so:
Section "ServerLayout"

...
    Option          "BlankTime"     "0"
    Option          "StandbyTime"   "0"
    Option          "SuspendTime"   "0"
    Option          "OffTime"       "0"

EndSection

save, and reboot
your screen should no longer blank after 10 minutes
Comment: Please clarify: Did you actually try `sudo xset s 0 0` correctly? You said `sudo xset 0 0` didn't work, which is not correct and should not work. Please revert your changes to xorg.conf and test the correct command, then rephrase your post if needed. If the command still doesn't work, please mention your version of Xubuntu to help track down the issue.
Comment: Yes I did, thank you, I should probably correct that, I wrote this answer from my phone and couldn't view the previous answers while writing it, so I did my best to recall it from memory as I couldn't find the command I tried (probably got overwritten by other terminals I had running)... After finishing I was too stressed and got sidetracked by other stuff in Xubuntu, sorry I never looked back at it sooner.


Is it possible to iterate a function transfinite times?

Question: Let $f:A\rightarrow A$ be a function. We can simply define $f\circ f$, $f\circ f\circ f$, etc., for each given natural number inductively.
$f^{(0)}=id_A$
$\forall n\in\omega \qquad f^{(n+1)}=f\circ f^{(n)}$
How to define $f^{(\omega)}$ such that it be a function from $A$ to $A$? Is it possible to define $f^{(\alpha)}$ for arbitrary large ordinal number $\alpha$?
Comment: Related: http://math.stackexchange.com/questions/816749
Answer: Yes, and no. Essentially, sometimes.
Consider the function $f(x)=-x$ for $x\in\Bbb R$. Then what would $f^{(\omega)}(x)$ be? It should be a limit of $f^{(n)}(x)$. But there is no limit.
Or consider the function $f(x)=x+1$ for $x\in\Bbb N$. Then $f^{(\omega)}(0)$ is what?
But consider the function $f(x)=x+1$ for $x\in\omega_1$, then $f^{(\omega)}(x)=x+\omega$ which is perfectly defined. But then $f^{(\omega_1)}$ causes the same issues as before.

You can sometimes talk about infinite iterations, but you need to have some mechanism to handle the limit steps. This usually requires topology, and convergence. And even then you may have to end up changing the domain a little bit.
So under additional assumptions (e.g. the function is surjective, and there is a way to assign values at limit points), yes. In general no.
Answer: One case, relatively simple and general, where you probably can do this sort of thing would seem to be given by Theorem 7.25 in Y. Moschovakis, Notes on Set Theory (2nd edition, Springer 2006).
I'll paraphrase the statement of the theorem a little, because on the one hand, it doesn't use your suggestive $f^{(\alpha)}$ notation, and on the other hand, it is couched in terms defined earlier in the book.
I have also extended the statement of the theorem, because as it stands, it only determines (in your notation) $f^{(\alpha)}(\bot)$ for one particular element $\bot$ of a particular kind of ordered set, whereas it seems clear that this special case can immediately be generalised by working in a subset of the ordered set.
(Caveat emptor! I may be talking rubbish, but if so, someone will surely correct me.)
Let $P$ be any partially ordered set which is chain-complete, i.e. every totally ordered subset $S \subseteq P$ has a least upper bound, $\sup S$.
Let $f: P \to P$ be any function which, while it might not necessarily preserve the order relation on $P$, is nevertheless "expansive" [I don't know if this is a standard term, but it is the one used in the book], meaning that it satisfies the condition $f(x) \geqslant x$ for all $x \in P$.
Let $U$ be any well-ordered set, for example an ordinal $\beta$, considered as the set of all ordinals $\alpha < \beta$.
Then there is a unique definition of an expansive mapping $f^{(\alpha)}: P \to P$, for all $\alpha \in U$, such that:
$$
f^{(0)}(x) = x, \\
f^{(\alpha + 1)}(x) = f\big(f^{(\alpha)}(x)\big), \\
f^{(\lambda)}(x) = \sup_{\kappa < \lambda} f^{(\kappa)}(x)
$$
where $x$ is any element of $P$, $\alpha$ is any element of $U$, and $\lambda$ is a any limit element of $U$, i.e. $\lambda \ne 0$, and for all $\kappa < \lambda$, there exists $\mu$ such that $\kappa < \mu < \lambda$.
Moreover, if $\alpha \leqslant \gamma$, then $f^{(\alpha)}(x) \leqslant f^{(\gamma)}(x)$ (generalisation of the "expansive" property).
Finally, note that if $V$ is any other well-ordered set, then either $U$ or $V$ is (uniquely) isomorphic to an initial segment (not necessarily proper, of course) of the other; and if for example (w.l.o.g.) $\Psi: V \to U$ is an order-preserving injection, then $f^{(\delta)} = f^{(\Psi(\delta))}$, for all $\delta \in V$, by the uniqueness clause of the theorem.
In particular (the most important case, presumably), if both $U$ and $V$ are ordinals, then one of them is greater than or equal to the other, and it doesn't matter whether you consider a smaller ordinal $\alpha$ as an element of $U$ or as an element of $V$: $f^{(\alpha)}$ is uniquely defined, for any ordinal $\alpha$.
I imagine one also has:
$$
f^{(\alpha + \beta)}(x) = f^{(\beta)}\big(f^{(\alpha)}(x)\big), \\
f^{(\alpha\beta)}(x) = \big(f^{(\alpha)}\big)^{(\beta)}(x),
$$
for all ordinals $\alpha$, $\beta$, all $x \in P$, and all expansive $f: P \to P$ (but I'm only guessing).
I also imagine this is pretty close to what started old Cantor off on the whole ordinal number thing!
(See e.g. P. E. B. Jourdain's introduction to his translation of Cantor, Contributions to the Founding of the Theory of Transfinite Numbers, Dover reprint, p.35f. - Cantor was interested in transfinite iterations of a "derived set" operation, defined on a class of subsets of the real line.)


PoE Lower Signal Voltage

Question: I'm currently working on a little project using a Raspberry Pi and an Ag9000-S. I've got it working using Mode A (phantom power over the data pairs) and Mode B (direct power over unused pairs), but when using Mode A I can't use the data pins for Ethernet communication because they're cranked up to ~48V, and Mode B isn't implemented on some of the switches I have around. Is there a way to bring the voltage back down to a normal ~2.4V for Ethernet communications? I know I'm not exactly an electrical engineer, but any information would be useful!
Comment: Don't the magnetics remove the DC offset for you?
Comment: What connections are you making between the Raspberry Pi and Ag9000-S module ? Because PoE work at the magnetics "outside" level and as magnetics are integrated into the RJ45 connector, I'm afraid you're doing it wrong.
Comment: I'm basically splicing into pins 1&2, 3&6 from the Ethernet itself. I'm getting power from both Mode A and Mode B just fine. Is it safe to connect the Pi while the switch is pushing the ~48v down the line?
Answer: I don't know how it works but it works even if it is clearly not safe.
Here is a capture from the Raspberry Pi Schematic v2.1 as on the official website. You can see the Ethernet RJ45 jack with the integrated magnetics and terminations:

I'm assuming you haven't connected anything on the left side as this is the components side and 48V will break everything.
Mode B should work more or less because there is no transformer on the pairs, but you are lacking serial capacitors before termination resistors. These capacitors are used to block DC part between each pairs.
But you use only mode A and putting the DC voltage directly on the wires of each pair is not the same as putting it on the center tap of the transformer (red circles). And as you don't have access to the center tap of the integrated magnetics, you won't be able to use Power over Ethernet with the RJ45 port of the Raspberry Pi.
At the beginning of this Application Note from TI, you have some information about Power over Ethernet and Ethernet magnetics which are PoE capable.
Also on this schematic you have an example of Power over Ethernet with the same type of magnetics design as the Raspberry Pi one (but in a discrete kind and not integrated in a RJ45 port) : http://media.digikey.com/photos/rdl/tps23754evm_420_schematic.jpg
Answer: Both the Ethernet switch and the device (your RPi in this case) have a transformer at every input & output wire pair. This transformer is normally a 1:1 signal transformer providing galvanic separation.
Power over Ethernet in mode B works by connecting the power supply DC to the unused wire pairs:

In mode A, it works by connecting the power supply DC to the transformer center taps:

This way the signal and the power are mixed onto the wires at one side by the transformer, and separated at the other side by the other transformer. The common mode DC voltage level of a single pair represents the power transmission, and the differential voltage level represents the data. Since the data is mixed onto the wires with the power, you cannot simply connect your power consuming module to the individual wires, as that would interfere with the communication. To decouple the power without disturbing the data communication, you have to use a center tapped transformer. The standards-compliant solution is to connect the power module input to the transformer of the device. However, this may not be a trivial task if the device is a product containing an RJ45 socket with integrated magnetics, not prepared for PoE, as those center taps are normally not present externally in this case.
Replacing the RJ45 socket on your device with a different one (prepared for PoE) is most probably not the way to go. What you could do instead is put another set of transformers in between the device and the Ethernet switch, and decouple the power from the center taps of those transformers. Such a device is usually sold under the name PoE splitter, sometimes with a DC-DC converter included (for example).
These pictures show only the power connections, and several details are omitted (the different EMI chokes, the termination resistors, etc). Those should also be present in an actual implementation.

PoE Lower Signal Voltage


C# Web Server Connection Problem

Question: I'm trying to make a simple C# web server that, at this stage, you can access via your browser and will just do a "Hello World".
The problem I'm having is that the server can receive data fine - I get the browser's header information - but the browser doesn't receive anything I send. Furthermore, I can only connect to the server by going to localhost (or 127.0.0.1). I can't get to it by going to my IP and it's not a network setting because Apache works fine if I run that instead. Also, I'm using a port monitoring program and after I attempt a connection from a browser, the process's port gets stuck in a TIME_WAIT state even though I told the connection to close and it should be back to LISTEN.
Here's the relevant code. A couple calls might not make sense but this is a piece of a larger program.
class ConnectionHandler
{
    private Server server;

    private TcpListener tcp;

    private ArrayList connections;

    private bool listening;

    private Thread listeningThread;

    public Server getServer()
    {
        return server;
    }

    private void log(String s, bool e)
    {
        server.log("Connection Manager: " + s, e);
    }

    private void threadedListen()
    {
        while (listening)
        {
            try
            {
                TcpClient t = tcp.AcceptTcpClient();
                Connection conn = new Connection(this, t);
            }
            catch (NullReferenceException)
            {
                log("unable to accept connections!", true);
            }
        }
        log("Stopped listening", false);
    }

    public void listen()
    {
        log("Listening for new connections", false);
        tcp.Start();
        listening = true;
        if (listeningThread != null && listeningThread.IsAlive)
        {
            listeningThread.Abort();
        }
        listeningThread = new Thread(new ThreadStart(
            this.threadedListen));
        listeningThread.Start();
    }

    public void stop()
    {
        listening = false;
        if (listeningThread != null)
        {
            listeningThread.Abort();
            log("Forced stop", false);
        }
        log("Stopped listening", false);
    }

    public ConnectionHandler(Server server)
    {
        this.server = server;
        tcp = new TcpListener(new IPEndPoint(
            IPAddress.Parse("127.0.0.1"), 80));
        connections = new ArrayList();
    }
}

class Connection
{
    private Socket socket;
    private TcpClient tcp;

    private ConnectionHandler ch;

    public Connection(ConnectionHandler ch, TcpClient t)
    {
        try
        {
            this.ch = ch;
            this.tcp = t;
            ch.getServer().log("new tcp connection to "
                + this.tcp.Client.RemoteEndPoint.ToString(), false);
            NetworkStream ns = t.GetStream();

            String responseString;
            Byte[] response;
            Int32 bytes;
            responseString = String.Empty;
            response = new Byte[512];
            bytes = ns.Read(response, 0, response.Length);
            responseString =
                System.Text.Encoding.ASCII.GetString(response, 0, bytes);
            ch.getServer().log("Received: " + responseString);

            String msg = "Hello World";
            String fullMsg = "HTTP/1.x 200 OK\r\n"
                    + "Server: Test Server\r\n"
                    + "Content-Type: text/html; "
                        + "charset=UTF-8\r\n"
                    + "Content-Length: " + msg.Length + "\r\n"
                    + "Date: Sun, 10 Aug 2008 22:59:59 GMT"
                        + "\r\n";
            nsSend(fullMsg, ns);
            nsSend(msg, ns);

            ns.Close();
            tcp.Close();
        }
        catch (ArgumentNullException e)
        {
            ch.getServer().log("connection error: argument null exception: " + e);
        }
        catch (SocketException e)
        {
            ch.getServer().log("connection error: socket exception: " + e);
        }
    }

    private void nsSend(String s, NetworkStream ns)
    {
        Byte[] data = System.Text.Encoding.ASCII.GetBytes(s);
        ns.Write(data, 0, data.Length);
        ns.Flush();
        ch.getServer().log("Sent: " + s);
    }
}

Does anyone have any ideas? It feels like it's gotta be something stupid on my part but I just don't know what. I'd really appreciate any insight
Answer: One thing which isn't a problem at the moment but might be later on is that your content length is based on the Unicode length of the message string, not the binary length.
There's also rather a lot going on in the Connection constructor - stuff that really doesn't belong in a constructor at all, IMO. It also doesn't close things if exceptions occur.
Have you looked at what's going on in a network tracer like WireShark? That would be the easiest way of seeing whether any data is getting sent back to the client.
Alternatively, post a short but complete version of your code which we can compile and run ourselves.
Answer: You might like to know that you can use HttpListener to write a basic web-server very easily - this deals with most of the painful bits, letting you concentrate on writing the actual code. The MSDN page gives an example.
Note that this uses HTTP.SYS, which is good - but means that non-admins need to be explicitly given access to open ports; on xp you can do this with httpcfg; on vista you can use netsh. See here for more.
Comment: Well if you're going to take all the fun out of it... ;)
Comment: I'm still kind of curious what was wrong with my original code by HttpListener works great. I think rather than waste any more time, I'm just going to go with that for now.

Thanks!
Answer: Maybe I'm just missing something but the reason you can only connect on localhost is because the IP you are listening on is 127.0.0.1, this makes the TCPListener only listen on that IP address. And I don't see anywhere you are calling any client disconnect, the TCPListener is a blocking call, so it sits there forever until a connection is made. In my past experience with TCP/IP and the TCPListener, TCPClient classes there is not much of a way to force the listener to drop it's connection until you drop the client connection. Calling TCPListener.Abort() doesn't drop the client connection which keeps the port blocked up.
Answer: For anyone in similar situation where you want to access you C# server from the local network ip address then you will need to listen to address 0.0.0.0 meaning listen on all ip addresses not a specific one like 127.0.0.1 etc.

C# Web Server Connection Problem


What is the adverb "probably" modifying in this sentence?

Question: In this sentence, what does probably modify? "I am probably not going to the party." Also, do adverbs modify verb phrases or just the main verb? For example, in, "I am walking quickly." Does quickly modify "am walking" or "walking?"
Comment: I'd say that "probably" is a matrix clause adjunct, not a subordinate clause adjunct, on the grounds that it can be moved to the left of the auxiliary verb "am". In your other example, "quickly" cannot be moved to the left of "am" and hence is a subordinate clause adjunct.
Comment: I see you're asking a lot of questions like this---first on Garmmarly Answers and now here on English SE. Thanks for doing that---I'm learning a lot trying to answer them! Just one overall thought: perhaps it would help if you clarified what you mean by _modify_: are you asking principally about semantics (the meaning) or principally about syntax (the grammar)? The two are of course not independent, but they are nevertheless quite distinct.
Answer: There is a consensus among linguists that "probably" is a sentence adverb.  In your example, it modifies the sentence "I am not going to the party." The best reference I know is the chapter on adverbs in McCawley's book The Syntactic Phenomena of English.
Here is an interesting paper from 1970 by George Lakoff on the logic of adverbs: Adverbs and modal operators.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/56431/discussion-on-answer-by-greg-lee-what-is-the-adverb-probably-modifying-in-this).
Answer: This is an example of how the grammar that people have been taught makes them look at a very simple phenomenon in an unnecessarily complicated way. Your question comes from a way of thinking about grammar that is akin to assuming that you have to study knives before you can remove the skin from an apple, and that you also have to be fully aware of all the different types of apple that there are before you can be sure that you are actually removing the skin.
Look at the sentence in terms of "pieces of meaning."  Sentences are made up of small pieces of meaning that are combined together into a whole.
What is a "piece of meaning?" Common sense will tell you that "to" on its own has no  meaning. The word "not" carries a little more meaning, and "am" none without "I." But "party" on its own does have more meaning or "lexical content."
Individual words combine together into meaningful groups which themselves form parts of the larger, meaningful "whole" that we call a sentence.
There are many different ways we could divide this particular sentence into meaningful word groups.  We could say that the following, just for example, are all meaningful:
party  /  the party  / to the party,
But for the purpose of answering your question we do not need to define  all the possible meaningful units in this sentence. This is because by simply removing the single word "probably" you are left with a single meaningful "whole" that is composed of all the other words: "I am not going to the party tonight."  It is definitely this piece of meaning that "probably" is modifying.
Can you see what "definitely" is modifying in the previous statement?
Comment: Your reasoning tells us that "probably" is a modifier, but it doesn't tell us what it modifies (which is what was asked).
Comment: @Greg Lee  Thanks. I moved  "It is definitely this piece of meaning that "probably" is modifying." so that it is now at the end of the preceding paragraph.  Can you see what I am saying now? In the process I noticed that I had, in the last sentence, mistakenly written "question" instead of "statement."
Answer: In the case of your second sentence, I am walking quickly, I think the answer is quite clear: quickly modifies walking. The reason is that in your sentence, walking quickly is a syntactic constituent, so that am walking is not one. And it makes little sense to talk about modifying something that is not a constituent.
The arguments that walking quickly is a constituent are as follows:

It can be fronted:
I say I am walking quickly, and walking quickly I am.
It can be coordinated with like word sequences:
I am walking quickly and singing loudly.
It can be extracted by right node raising:
John knows that I am, but doubts that Sue is, walking quickly.
It can stand alone as a short answer:
'What are you doing?' 'Walking quickly.'
It can be replaced by the pro-form doing so:
I am walking quickly and Sue is doing so, too.

More generally, CGEL has a long defense of 'an analysis of the modal, tense, aspectual and voice auxiliaries as catenative verbs taking non-finite complementation' (p. 1214). For example, according to that analysis,
[6] He was writing a letter.
consists of a VP was writing a letter, which itself has another VP as a constituent, writing a letter (CGEL, p. 1218). This 'inner' VP, moreover, is a non-finite clause, of the 'gerund-participial' type (p. 1173).
Traditional analysis, which CGEL calls 'the dependent-auxiliary analysis' (pp. 1210-1214), would say that in [6], was writing is a constituent. As I said, CGEL dedicates a lot of space to explaining why they favor 'the catenative-auxiliary analysis' instead (pp. 1214-1220). And one of the arguments for the latter analysis is that writing a letter in [6]  passes a lot of constituenthood tests. Thus it probably indeed is a constituent. But if it is, then was writing is not a constituent, contrary to what the dependent-auxiliary analysis would say. Note that in [6], either was writing is a constituent, or else writing a letter is a constituent, but they can't possibly both be constituents---constituents are either disjoint or else one wholly contains the other; they cannot only partially overlap.
I am not yet sure what to say about your first example, but I hope to have an exchange with Greg Lee (in the comments following his answer to your question) that may clarify things for me. (This is why I couldn't answer your question over on Grammarly Answers.)
Answer: An adverb modifies a verb, an adjective or another adverb.
In the sentence "I am probably not going to the party" there is nothing for the adverb "probably" to modify other than the verb phrase "am not going".
In the sentence "I am walking quickly", the adverb quickly modifies the verb phrase "am walking". If 'am' is not included and only "walking" is modified, the sentence will become ungrammatical and meaningless  like I am a/the (walking quickly).
Comment: So you would say that in *I am not walking quickly*, the adverb *quickly* modifies *am not walking*? If you're not walking, how can I tell whether you're not doing it quickly or slowly?
Comment: If "am not walking" is the verb (phrase) and the adverb "quickly" modifies it, it means "am not walking quickly". Then you can tell the walking is slowly and not quickly, cant' you?
Comment: So despite the fact that the meaning clearly parses as *am not (walking quickly)*  – or maybe *not (am walking quickly)* – the grammar actually parses as *(am not walking) quickly*? Do you have a reference for this?
Comment: Reference for what? I would like know from you, in the OP's sentence "I am walking quickly", what is the verb? Is it am walking or only walking? I believe 'walking' is the present participle form of the verb 'walk' and a verb 'be' form with a present participle form can create a progressive tense. Here it's 'am walking', a present progressive tense which is modified by the adverb 'quickly'. I do believe 'quickly' is modifying the present progressive verb 'am walking' in this sentence.  If it's otherwise, you may please cite references.
Comment: @PeterShor I agree with you. In _I am walking quickly_, the word sequence _walking quickly_ is a constituent. From this it follows that _am walking_ is not a constituent. So in that sentence, _am walking_ is not a VP at all, so it makes no sense to say that it is modified by anything. In other sentences (e.g. _I am walking_, it (_am walking_) is indeed a VP. Nevertheless, in our sentence of interest, it just isn't one. (Continued below)
Comment: In _I am walking quickly_, the sequence _walking quickly_ is a constituent:
1. It can be fronted:
    _I say I am walking quickly, and walking quickly I am._

    2. It can be coordinated with like word sequences:
    _I am walking quickly and singing loudly._

    3. It can be extracted by right node raising:
    _John knows that I am, but doubts that Sue is, walking quickly._

    4. It can stand alone as a short answer:
    _'What are you doing?' 'Walking quickly.'_

    5. It can be replaced by the pro-form doing so:
    _I am walking quickly and Sue is doing so, too._
Comment: @mahmudkoya Please see my comment to Peter Shor, above. More generally,  [CGEL](https://www.amazon.com/dp/0521431468/) has a long defense of 'an analysis of the modal, tense, aspectual and voice auxiliaries as catenative verbs taking non-finite complementation' (p. 1214). Here is an example  (p. 1218):  _He was writing a letter_ contains the VP _was writing a letter_. But this VP itself contains another VP, _writing a letter_; this inner VP is a non-finite clause---a gerund-participial one (CGEL, p. 1173). Note that if _writing a letter_ is a constituent, then _was writing_ cannot be one.