Can someone explain how this makes sense electrically?

Question: The wiring in my house is... odd. Nearly every pair of outlets has one of the outlets connected to a light switch. Sometimes that switch is quite far from the outlet even when there are other closer switches that seem to control nothing at all. Sometimes that switch also controls overhead lighting, which makes no sense to me from a design standpoint. Sometimes that switch is a dimmer switch, which is a really horrible idea as if you plug anything other than a light bulb into it, like some electronics, the dimmer switch could do them a lot of damage. One such dimmer switch is also connected to a ceiling fan, and setting the switch to anything less than full does not change the speed of the fan, it just makes it a lot noisier (AC induction motor, obviously).
There are light fixtures that don't seem to have any power to them and aren't controlled by any switch, though I could believe the switch might just be hiding somewhere. There are also switches that seem to control absolutely nothing, though I could believe I just haven't found what they're connected to.
The oddest thing I have found though has to do with the circuit breakers around overhead lighting. I have a chandelier in my dining room that is connected to a dimmer switch. When I moved in, all of the bulbs were incandescents, and I wanted to be more energy efficient, so I replaced them all with dimmable LED bulbs. Now however, I could not turn the chandelier fully off, with the dimmer switch all the way down, the lights still dimly shone. This had never been an issue before, but I thought it probably meant the dimmer switch was faulty, and it was just the different voltage response curves of the incandescents versus the LEDs that meant it had never been noticed before, so I set out to replace the switch.
Now there are two circuit breakers that are relevant to this chandelier. One is labeled "dining room," the other is labeled "lights." As far as I can tell, the dining room breaker controls all of the outlets in the dining room area, while the lights breaker controls all of the overhead lighting in the house.
Here's where the odd part comes in. If I turn off the dining room breaker, the lights stay lit. I have turn off the lights breaker to switch off the lights. However, if I only turn off the lights breaker, and go into the switch panel with my voltmeter, I am still detecting 100V AC across the switch (with it off), even though the lights stay off when I turn the switch on. In order to remove the power I was detecting, I have to also turn off the dining room breaker, even though the lights were staying on when I switched that off.
This conforms to no type of electrical theory with which I am familiar, though there might be some peculiarity of household wiring I don't know about that explains this. Can anyone tell me what might be going on?
Update 3/24/19: After replacing the dining room dimmer switch with one specifically designed for LEDs, those lights are now working quite well. Based on several people's advice in this question, I have now set out to replace the bedroom dimmer switches that are connected to outlets with toggle switches. Have run into additional issues detailed here.
Comment: How old is the house? Any idea about it's electrical history? Some old houses just had switches controlling outlets, with no overhead light at all, (expecting lamps to be used). I'd guess overhead lights & dimmers were installed at some later point, but still leaving the outlets essentially untouched. (Are the outlets even grounded, verified with a tester, not just seeing the right type of outlet?)
Comment: Could you please add the mains voltage? (The difference of the 100 V to the mains voltage is relevant.) Also, the location - there are different local "traditions" of messing up wiring. In Germany, we have no wall switches at all. It can be messed up anyway. I have wall sockets in all rooms, and breakers in a central box, with labels on the breakers. But there is not much correlation between labels and socket locations.
Comment: My place has the same set up, lots of outlets connected to dimmer switches. its a huge pain, you have to make sure to never actually adjust the dimmers or it screws up what is plugged in.
Comment: In many cases, the performance of LED or dimmable CFL lamps with a dimmer may be greatly improved by having a single incandescent, of essentially any wattage (even a 3W night-light bulb), in parallel with the LEDs.  A similar situation applies with neon-lit switches (which are designed to glow when "off").  Figuring out a good place to put such a light may sometimes be tricky, but it can make some kinds of switches work better with LEDs.
Comment: @VolkerSiegel The house is in the US, in California, line voltage is 110V.
Comment: @Xen2050 the house was built in 1973.
Comment: Re switches and sockets, I once lived in a place (Italy, built in the early 1970s) that had no overhead lights at all, only outlets controlled by switches. These were to be used for table or floor lamps (and nothing else). Switches were near the doors (and one next to the bed), the outlets were wherever the architect thought a lamp would be needed. In your case, you might want to test each outlet by pluggin a lamp into it, then flicking every switch in the room—maybe there are some switched outlets you've missed so far. You might want to mark those, or label them "LAMPS ONLY".
Comment: Do note that when you measure the voltage on a wire with a sensitive voltmeter, you can measure on the order of 100V on a circuit that is not powered, due to what is known as "phantom voltage" -- capacitance from adjacent circuits.  Actually, less sensitive voltmeters are less apt to be bothered by this and may be the better choice in your case.
Comment: I suspect the wiring needs to be carefully studied and a map drawn of how it's all connected.  Someone who didn't know what they were doing obviously got in and mucked with things, and you need to see if you (or a knowledgeable buddy) can figure out whatever "scheme" they thought they had.  Then invest in getting the worst of it fixed.
Answer:
However, if I only turn off the lights breaker, and go into the switch panel with my voltmeter, I am still detecting 100V AC across the switch (with it off), even though the lights stay off when I turn the switch on. … Can anyone tell me what might be going on?

Coupling between wires (inductance and capacitance in parallel wires).
You say you have strange long runs between outlets and switches — if any of these extra lengths run in parallel, this is a great environment for the voltage from one to be induced in the other if it's disconnected.
If you try putting a load, like a small light bulb, across that 100 V, it will vanish (read 0 V), because there is no significant current capacity in this coupling. It might even go away if you were to attach an analog voltmeter (which is more of a load because current from the line to move the needle) instead of a digital one (which typically has a 1 MΩ input impedance that presents almost no load).
Comment: In other words - it's acting as an *antenna*.
Comment: Note that even the induced voltage can still give you a noticeable electric shock, better not touch any wires where you are getting a 100 V reading.
Comment: It also could be due to a high resistance electrical connection between the wires.
Answer: Rundown in layman's terms:

Light switch to outlet. You will see a lot of these in older homes. By code for a long time in a lot of areas you had to be able to turn on a light from a switch accessible when entering a room. Easiest and most cost-effective way to do this is put switch to outlet. I had six rooms in my house like this.
Dimmer to outlet. For sure not code compliant. You are correct that it could damage electronics and could be a huge fire/safety issue. Please replace this with a regular switch ASAP - $5 for a quick fix while you work things out.
Dimmer to ceiling fan. Can't do this. If the ceiling fan has two hots coming into the box from fan you can buy a fan control + dimmer. If there is only one hot then you just install a switch and it is off/on for both.
Light switches doing nothing. You must do a complete mapping assessment of your house. With a house like this it might take 3-6 hours. But you have to turn off one circuit at a time and figure out what doesn't work. You must also for 100% sure make sure that each switch is tested for working on every light and outlet (have a known working bulb). Write down every outlet and switch in a spreadsheet marking room, location, what it controls, and circuit.
You cannot expect to plug LED bulbs into old dimmers and expect them to work. You need to put in a dimmer that is suitable for the type of LED you are installing.
The dining room lights - need more info.
Comment: There are three bedrooms with dimmer switches connected to outlets and fans. I am just replacing them all with toggle switches. There are only the two wires coming into the switch box, so no way I can use any fancier switches without heavy rewiring.
Answer: Switch switching outlets.  That's normal enough.  Often the outlet(s) switched are far from the switch, because that is where the installer thought you would want to put the light.  The installer was wrong.   They always are.  Because of that some of them switch more than one receptacle.
Split receptacles.  That is normal.  That's what the "tab" between the brass screws is for.  Leave the tab on, the 2 screws are an easy way to splice.  Break it off, you control each socket with a separate hot.   There's also a tab on the neutral side if you want the sockets on 2 separate circuits.
Dimmers on receptacles.  No no no! For the reasons you stated and worse.  You know what to do.  If you were super attached to dimmable receptacles, they make specially keyed receptacles just for lamps.
Mystery lamps.  Fair possibility the bulbs are burnt out (back in the old days, bulbs burned out, true fact) or there is something wrong with the fixture.  They make wire tracing devices if you really want to dive into the mysteries.
Mystery switches.  Aside from that they may control a broken lamp, sometimes that just happens as wiring gets revised.  They may also control receptacles that you have not checked, outside lights you do not see (optionally: with burned out bulbs) etc.  They may also be half of a miswired 3-way circuit that is miswired in a way only the other switch works.  **3-way switches do not have the words "on" or "off" on them.
Glowing LEDs on dimmers. Actually, the incandescents also glowed, but only in infrared, so you would have needed to be an elf to see it. LEDs are so much more efficient (and glow only in the visible range) that it's much more obvious.   The reason is many switch loops do not have neutral wires. That means dimmers cannot power themselves between supply and neutral; they must place themselves in series with the lamps.  That works slick on incandescents.
By the way, some dimmers actually have a "hard off" or even "hard on" setting.  It's not in the smooth working range of the dimmer.  You have to push the knob harder past a detent to reach that position.  Most people, it never occurs to them to push it that hard, so they never know it's there.   The "hard off" is important so you can change the bulb safely.  The "hard on" is nice because it stops the bulb from buzzing.  Dimmers aren't variacs, and their waveform is real sawtoothey.
Grouping of lamp circuits.  It is common and wise for lamps to be powered from a different circuit than receptacles.  That way if you trip a breaker you are not also in the pitch black.  It is extremely unusual for lighting to trip a breaker (especially if LED), however they need to be provisioned with a worst case scenario (all oversized incandescents) in mind, and 125% of that.
Crosstalk.  This is plain old capacitive coupling.  Lay two wires alongside each other, one energized with AC, one disconencted, this will "antenna" some microscopic current onto the other wire.  Cheap DVMs are so sensitive they can see this.  Use a traditional analog voltmeter and that it will extinguish that phantom voltage; there's not enough current behind the phantom voltage to move the jeweled meter movement.
Multi-wire branch circuits (MWBC).  This is a pair of half-circuits wired using a common neutral.  The two half-circuits must be 240V across the hots, with neutral in the middle. That way the neutral carries the difference in currents, and you can trust it won't exceed breaker value.  Done wrong, neutral carries the sum of currents, which overloads it!
In any circuit, all wires must be carried in the same cable or conduit so currents in each direction cancel each other out. This is AC power: any gap will induce vibration and fatigue failure.  All that is relevant because the phantom-voltage wire may well be half of an MWBC, which would explain the strong capacitive coupling.
There are additional rules with MWBCs.  Neutrals must be pigtailed, not use a device like a receptacle as a splice point.  The breakers must be handle-tied so they shut off together, but normally a 2-pole breaker is used.
I expect your double circuit (the one with the phantom voltage) is a MWBC, and the work was done back before handle ties were required.
MWBCs have fallen out of favor because they are difficult to use with AFCI or GFCI protection, which is now required on almost all circuits.
Comment: you are so right. In Gygax's original AD&D they *did* have infravision. In subsequent iterations, alas, the doughty halflings seem to have lost this trait...
Comment: Nerd disclaimer. "you would have needed to be an elf or halfling to see it"; halflings, while perceptive, sneaky, sure-footed, and good with thrown missiles, are not known for extraordinary vision like elves are.
Comment: @JimmyFix-it The trait I was thinking of is *infravision*, or "not needing to buy a FLIR".  It's been a long time but I thought I recalled in D&D lore, pretty much everyone but humans seems to have it lol.
Comment: @harper re the original dining room dimmer switch, it actually had a detente at the bottom of the switch range, but even below that, the lights were still glowing. If I pushed down on the switch when it was at the bottom of Its range, I could force the lights off, but as soon as I took my finger off, they would come back on. That's why I said I thought it was a faulty switch.


Styles are not applied immediately after a

Question: I have a 3 step process:

Insert widget's HTML into the page.
Insert widget's style into the page.
Read some CSS properties from some elements, and based on values set some other properties.

And everything works fine. Except in some rare cases at step 3 the styles (inserted at step 2) may not be applied yet. This usually happens when a lot of stuff loading and gets initialized on the page in parallel with my code.
I can't extract a simple reproducing example (codebase is very very complex).
My question is: is it guaranteed that after styles are inserted they are immediately applied? If not, are there any APIs that would allow me to run some code after styles applied?
I couldn't find anything about this online. So I would very appreciate if someone could direct me to anything on the subject.

The style insertion looks something like this:
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.appendChild(document.createTextNode(css));
document.getElementsByTagName('head')[0].appendChild(style);

Comment: I can't reproduce this. http://jsbin.com/torali/edit?html,js,output What are the "rare cases" you're referring to? We need enough information to reliably reproduce your issue.
Comment: What does the `css` look like you're appending in your code?
Comment: Switch around the logic, insert widget styles first, then insert widgets HTML, so the styles are always available. Style recalculations are done during the repaint or reflow step of browser rendering. This is triggered every time the DOM changes. If you insert the html, it triggers a reflow due to elements being added to the body. But if the styles aren't available yet, they won't be applied until after the next repaint. Depending on the size of the stylesheet, I usually just add all widget styles into the main stylesheet so everythings always available when it comes to styling.
Comment: For reference: This is the same reasoning why styles usually should be as high up in the header as possible and scripts usually as low down in the body. By having styles in the header, you assure all styles are available when the DOM gets created from the HTML code. By inserting script as the last aprt of the body, you assure the full DOM is loaded by the time the scripts arrive and get executed.
Comment: Thanks, @Shilly! I'll try that.
Comment: I got it wrong at first, we actually do insert CSS _before_ HTML.
Answer: Seems like


Error in creating Maven project in Intellij (Linux - VM)

Question: I was trying to create a Maven project in Intellij in Linux 16. It keeps throwing me an error. Trying the solutions available on the net but nothing worked.
This is the error I am getting:
<code>/usr/lib/jvm/java-7-oracle-cloudera/bin/java
-Dmaven.multiModuleProjectDirectory=/tmp/archetypetmp
-Dmaven.multiModuleProjectDirectory -Dmaven.home=/usr/share/maven
-Dclassworlds.conf=/usr/share/maven/bin/m2.conf -Dfile.encoding=UTF-8
-classpath /usr/share/maven/boot/plexus-classworlds-2.x.jar
org.codehaus.classworlds.Launcher -Didea.version=2018.3.5
-DinteractiveMode=false -DgroupId=com.test.java "-DartifactId=Java Proj"
-Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=RELEASE org.apache.maven.plugins:maven-archetype-
plugin:RELEASE:generate
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins
/maven-archetype-plugin/maven-metadata.xml

[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-
archetype-plugin/maven-metadata.xml from/to central
(https://repo.maven.apache.org/maven2): Received fatal alert:
protocol_version
[INFO]

------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.460 s
[INFO] Finished at: 2019-03-08T01:41:55-05:00
[INFO] Final Memory: 7M/146M
[INFO]
------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or
one of its dependencies could not be resolved: Failed to read artifact
descriptor for org.apache.maven.plugins:maven-archetype-
plugin:jar:RELEASE: Failed to resolve version for
org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Could not
find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-
metadata.xml in local (/home/vishnu/.m2/repository) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN
/PluginResolutionException
[ERROR] Maven execution terminated abnormally (exit code 1)
</code>
Comment: What maven command leads to this error? What does your pom.xml look like?
Comment: Thanks Ruslan. I have posted the answer below.
Comment: The Intellij does not choose the jre by default in the runner settings.
Comment: To use central repository with Java 7 you need to define `-Dhttps.protocols=TLSv1.2` cause Central has changed that a longer time ago...
Answer: Okay, so I solved it. I did not change the JRE, so just dont forget the JRE. Posting the answer so that it will be useful for somebody in the future. Attaching an image for reference.
Also use this for the VM options.
<code> -Dmaven.multiModuleProjectDirectory
</code>
Snapshot of the solution


Impact of "Hide [x]" versus "Show [y]" to achieve the same goal

Question: We're working on a filter interface. Most options can be represented by two options, one using "hide" as the primary verb, and the inverse formulation using "show" as the primary verb.
Discussion on the team and with users has been largely based on personal preference. I'm wondering if there are any UX studies or behavioral economics principles that demonstrate quantifiable effects from using one versus the other. "Show", to me, sounds more active and positive, while "hide" sort of implies that the tools is failing me by showing me irrelevant things...but I don't know if this is my own opinion or representative of an actual UX principle at play. There's also been an argument that we're showing you a set of items by default, and the "hide" terminology more accurately reflects that we're taking out some of what was previously included in that list.
I'm aware of the framing effect, but I'm having trouble figuring out whether using the verb "hide" will frame these options as a loss and therefore contribute to a sub-par experience.
Here's what the filter looks like. (We've decided that to make parsing the options easier, we're probably going to start them all off with the same verb.)

Taking the last option as an example, should I expect any difference in behavior if I use "Hide questions with score < X" rather than using "Show questions with score > 0", even though they mean the same thing?
Comment: Personal anecdote, vs. hard numbers: I always prefer to frame checkbox options positively, instead of negatively, to avoid confirming a negative. I'd be hard pressed to successfully argue that "hide" is truly negative, but it just sounds more negative to me. Provided the action's verbage allowed for it, I would always lean towards "show" as a first reaction.
Comment: My answer isn't UX based, so I'm listing here as a comment.  From a programming standpoint, I favor show buttons in a situation like this, because it empowers the user to add to the report, rather than reduce it.  This allows the initial, pre-filtered version of the report to contain fewer-lines/less-data which usually equates to a shorter rendering time.  A report which shows up instantly with some of the desired data, which then invites the user to add more detail as need,...  now that is a positive user experience to me.
Comment: Imagine the words "Hide" and "Show" were not there. The rest being unchanged, what would a checked box mean? The last two entries in your example should probably not have checkboxes at all because the conditional takes care of that.
Answer: Looking around there are not any studies I can see as such. Something I would rely on from experience would be consistency. The majority of interfaces use this terminology to describe the action and users understand this.
Alternatively you could follow this approach:

You do not explicitly say the word hide, but the checkboxes imply it.
It would largely come down to preference in this case, studies do show that it is preferable to use positive language. In this case however, the user may see the action of hiding 'unimportant/irrelevant' information to be positive and may not even register any negative connotations from this.
Also using the sign '>' is requiring a user to think more than they need to. People who are not familiar with this notation may be confused and it would be advisable to use natural language instead.


How to remove old facuet?

Question: Although I watched a few youtube videos to replace old facuet, but I still have no idea to deal with my case.
See the images.

From the bottom

And you can see the cold water and hot water connector are in the left and right. The middle one white plastic is for side spray.

I am not sure how to take off the set. Should I deal with the plastic one?
If I buy a new one, what should I buy?
Answer: To remove the faucet (looking at the center photo) there is a brass hex nut (just above the braided plastic hose connector) that is tightened to hold the "C" shaped spacer and the faucet securely to the sink basin. You can use a Basin wrench (it has a swiveling head on a long handle) or an adjustable crescent wrench with a short  handle. Either way loosening the nut will enable the faucet to be removed from the sink. You will also want to shut the water supply off on the hot and cold lines first.
Comment: Should I buy a 4 holes faucet?
Comment: The configuration of the new faucet will need to be shaped so that the supply lines will fit through the sink openings. When you remove the original single handled faucet count the opening on the sink edge. If you count 3 evenly spaced openings the two outer most openings should be spaced 8 inches on each openings center (O/C). The 8" spacing is commonly used for a dual handled faucet. You also have the option of installing a post mounted faucet in the center opening and capping the un-used openings with caps made for this purpose.

How to remove old facuet?


How to find which protocol is used by lower layers?

Question: When we type https://stackoverflow.com/ all the data which is sent to this server would be using HTTPS protocol in transport level
So is it possible for me to know which error detection, flow control or protocols, in general, are used by lower ( physical, data link, network ) layers by my machine and intermediate nodes which lie in path from my machine to the destination server (Assuming there are few intermediate nodes) .
Comment: *"...how does one know..."* - who is "one"? At which position in the network is "one"? What data can "one" access? And what is the actual problem "one" wants to solve?
Comment: I have edited the question, sorry for ambiguity
Comment: May have better luck posting at https://networkengineering.stackexchange.com
Comment: Thanks for the suggestion
Answer: To figure out what kind of lower layers are used, I always use WireShark.
Start the Wireshark, type "tls" as the filter(because this is no "https" filter in WireShark),  you will get a lot of network traffic, just looks like this:

Check the details of the "Application Data" network packet,

You will see the network stack(From top to down):

Transport Layer Security (TLS): It's used to securely transmit data above TCP connection
Transmission Control Protocol (TCP): It's used to reliably transmit data between two network applications running on two different hosts connected by the internet. [Transport Layer]
Internet Protocol (IP): It's used to transmit data between hosts connected by the internet. [Network Layer]
Ethernet II:  it's used to transmit data on the underlying Ethernet physical layer transport. [Data Link Layer]

You can check the details by selecting any one of them.
For "error detection", "flow control", you may filter the network traffic by the TCP filter provided by Wireshark,
such as:
<code>"tcp.analysis.retransmission",

"tcp.analysis.window_full",

"tcp.analysis.window_update",

and so on.
</code>
If you have a good understanding of TCP, you can read them easily.:)
Comment: But wireshark will just give the information about  my machine.....what about intermediate devices like routers, switches, etc....also could we know what physical layer protocol is used ... Thanks in advance
Comment: That is really beyond what I know, but interesting;). Let me know if you got any real answers to that. Maybe you need to learn some router protocols likes OSPF,RIP .... Logs produced by the intermediate devices may be helpful.
Answer: You usually cannot get such low level information from other devices in the path of the data. You can get some layer 2 information inside the local network but from devices after the router (i.e. outside the LAN) such data are no longer accessible.
Sometimes one can make some assumptions based on detected MTU in the path (PMTU), latency issues, buffering behavior or based on strange issues caused by known behavior anomalies or peculiarities of some devices, but there is no generic way to access such lower level information.
Comment: Does intermediate nodes like router, switches, etc mutually decide what protocol to use in a a particular layer.
Comment: IP traffic is done at OSI layer 3 and is kept at this layer. The devices don't "decide" about the lower layers, this is simply the hardware they have, i.e. Ethernet, serial line, ...


How do I insulate interior basement walls that are not against the exterior walls?

Question: I'm in the process of building an office and family room in my basement and need some help with the walls and insulation.
There is a perimeter drain in the slab around the exterior walls that collects a small amount of water that weeps through the walls during the wet season. This perimeter drain will require me to place the studs about 4" from the wall.
In this scenario, with an airgap between the interior/exterior wall, should I use rigid foam insulation attached to the block wall, or traditional fiberglass insulation within the studs? Also, if fiberglass is used, should I include a vapor-barrier and on which side of the wall should it be placed?
Comment: You need to fix the moisture problem before you build anything.
Comment: I probably should have provided more detail - the moisture is being addressed according to approach #4 here: http://www.extension.umn.edu/distribution/housingandclothing/components/7051-04.html
Comment: Even with an interior drainage system, you should not have any water on the inside of the wall.  Moisture in walls = mold.
Comment: The only place the walls are wet, is at the very bottom where the holes drain into the channel. The rest of the walls are dry to the touch and are coated with a very old drylock-type substance which is flaking off in some areas. Do you think this is an acceptable situation to move forward with, or should I take additional steps first?
Comment: I don't think anyone can answer this right without knowing the climate.  If he is in Texas you don't insulate a basement (I know there are few basements in Texas)  Also metal framing is a bad mix with water.  I would use PT lumber to frame everything if water is that big of an issue.
Comment: Climate region is northern NY state. We see annual extremes from -20 to 90 F. Also, the top 1.5 layers of block are above grade.
Answer: I think based on the comments I better understand your scenario now.
Building Science has a lot of great information on basement insulation and the suggested method is to use XPS foam against the walls, optionally bats between the studs and no vapor barrier (since the XPS foam is the vapor barrier).
I would suggest that you use 1 1/2 - 2" XPS foam against the walls, and then space your studs another inch or so away from the wall (to allow your water to drain). If you need higher R values then the XPS provides you can use bats between the studs and I would suggest something like Roxul insulation which is stone wool instead of fiberglass since it is not affected by moisture like fiberglass is.
It would also be advisable to use steel studs so that they don't rot should they come in contact with moisture. You might also opt to put the bottom plate on top of a piece of XPS foam so that there is a less likelihood of the metal studs rusting.
Comment: This is all great info and I appreciate everyone's input. I was referencing an old Building Science pdf, but the link you sent is more up to date and detailed - thanks.
Comment: Based on the info, it looks like unfaced XPS is probably the way to go. I was thinking of using spray foam on the top of the open blocks, sill and band boards, but now I am wondering if I might use the XPS there as well?
Comment: You can cut the XPS and use it to insulate joists and other areas - typically you seal it with caulking or great stuff.  all of the XPS seams should be sealed with tape
Comment: Great, that sounds like a good idea. Can the XPS be attached with construction adhesive, or should furring strips be used?

Also, as for the base of the stud wall, I'm going between a couple of options:
- treated for the base, with a sill gasket and regular wood for the rest,
- Or, 1" XPS on the floor with 1/2 plywood then regular wood for wall. The question here is can the wall sit on top of the XPS & plywood, or should it be anchored direction to the slab? Laminate flooring will be going on top if that makes a difference.

Thanks for all the info!
Comment: There is a special adhesive needed to attach XPS - "PL 300".  Furring strips can also be used provided that you use XPS that has channels for them already built in. You can use PTE with sill gasket if you wish - you could even use a piece of composite decking. But the plate should be anchored through it all to the slab
Comment: Gotcha. One last question - can the wall base sit on top of the XPS (anchored thru to slab), or should it sit directly on the slab?
Comment: You can use put XPS under it.  Depends what you are using - if PTE, then just a gasket is needed.
Answer: Rigid foam is going to handle the moisture issue way better than fiberglass.  Just the humidity of the area will stick to fiberglass and eventually the fiberglass will sag.  If I were you I would get some rolled plastic sheating and put it on the interior part of the wall.  I would then either spray foam, rock wool the walls, or put nothing in them.  The need for insulation in a basement system is dependent on your climate.  In a warmer climate insulation in a basement could bring negative energy returns.


How to prove a function is strictly increasing?

Question: Let $f(x)$ be a continuous strictly increasing smooth function on $[0,1]$ with $f(0)=0$ and $f(1)=1$. In addition, $F(t)=\int_0^t f(x)dx$ and $\phi>1$. Prove that the following function $h(t)$ is strictly increasing with respect to $t$ on $(0,1)$, where
$$h(t)=\frac{1-t+F(t)+t(1-f(t))}{(\phi-t)(1-f(t))}-\frac{F(1)}{1-t+F(t)-F(1)+(\phi-t)(1-f(t))}.$$
The numerator of the derivative of $h(t)$ is
$$
\left((1-t+F(t))(\phi-t)f'(t)+(1-f(t))(1-t+F(t)+t(1-f(t)))\right)\left(1-t+F(t)+(\phi-t)(1-f(t))-F(1)\right)^2-
F(1)((\phi-t)f'(t)+2(1-f(t)))(\phi-t)^2(1-f(t))^2,
$$
and the denominator of the derivative of $h(t)$ is
$$(\phi-t)^2(1-f(t))^2(1-t+F(t)+(\phi-t)(1-f(t))-F(1))^2,$$
where $f'$ is the first order derivative of $f$.
I tried to prove the numerator of the derivative is positive. To do so, I relaxed some of the terms to make it comparable. However, numerically all those relaxation methods failed. The lower bound $0$ seems to be too tight.
By the way, it can be shown both $\frac{1-t+F(t)+t(1-f(t))}{(\phi-t)(1-f(t))}$ and $\frac{F(1)}{1-t+F(t)+(\phi-t)(1-f(t))-F(1)}$ in $h$ are increasing convex functions.
Does anyone have any suggestions on how to approach this problem? Thank you so much!
Newly Edited:
I can show that $h'(t)>0$ when $\phi$ is large for certain function $f$ satisfying $1-t+F(t)>t(1-f(t))$ (It can be easily checked that all $f$ above $f(t)=t^2$ satisfies this condition).
To see this, rearrange the numerator of the derivative, we get $$(\phi-t)f'(t)\bigg((1-t+F(t))(1-t+F(t)+(\phi-t)(1-f(t)))^2-F(1)(\phi-t)^2(1-f(t))^2\bigg)+2(1-f(t))\bigg(\frac{1-t+F(t)+t(1-f(t))}{2}(1-t+F(t)+(\phi-t)(1-f(t)))^2-F(1)(\phi-t)^2(1-f(t))^2\bigg).$$
The first term is positive while the second term might be not. To simplify the notation, let $A(t)=1-t+F(t)$, $A'(t)=-(1-f(t))$, and $B(t)=(\phi-t)(1-f(t))$. If the second term is negative, then we show
$$(\phi-t)f'(t)\bigg(A(A+B-F(1))^2-F(1)B^2\bigg)+2(1-f(t))\bigg(\frac{A-tA'}{2}(A+B-F(1))^2-F(1)B^2\bigg)$$
is positive.
It is equivalent to show
$$(\phi-t)f'(t)\left(\sqrt{A}(A-F(1))+\left(\sqrt{A}-\sqrt{F(1)}\right)B\right)\left(\sqrt{A}(A-F(1))+\left(\sqrt{A}+\sqrt{F(1)}\right)B\right)
>-2(1-f(t))
\left(\sqrt{\frac{A-tA'}{2}}(A-F(1))+\left(\sqrt{\frac{A-tA'}{2}}-\sqrt{F(1)}\right)B\right)\\
\left(\sqrt{\frac{A-tA'}{2}}(A-F(1))
+\left(\sqrt{\frac{A-tA'}{2}}+\sqrt{F(1)}\right)B\right).$$
Because $\sqrt{A}(A-F(1))+\left(\sqrt{A}+\sqrt{F(1)}\right)B>\sqrt{\frac{A-tA'}{2}}(A-F(1))
+\left(\sqrt{\frac{A-tA'}{2}}+\sqrt{F(1)}\right)B>0$ by the provided condition, it is enough to show
$$(\phi-t)f'(t)\left(\sqrt{A}(A-F(1))+\left(\sqrt{A}-\sqrt{F(1)}\right)B\right)
>-2(1-f(t))
\left(\sqrt{\frac{A-tA'}{2}}(A-F(1))+\left(\sqrt{\frac{A-tA'}{2}}-\sqrt{F(1)}\right)B\right),$$
which is equivalent to show
$$\left((\phi-t)f'(t)\sqrt{A}+2(1-f(t))\sqrt{\frac{A-tA'}{2}}\right)(A-F(1))>\left(2(1-f(t))\left(\sqrt{F(1)}-\sqrt{\frac{A-tA'}{2}}\right)-(\phi-t)f'(t)\left(\sqrt{A}-\sqrt{F(1)}\right)\right)B.$$
The LHS is always positive, while on the RHS, the coefficient of $B$ is negative when $\phi$ is large enough, thus $h'(t)>0$.
Answer: Do you have a probabilistic interpretation of this monster? If $Y$ is a random variable with density $g(y)=f'(y)$ I found that
$$h(t)=\frac{1-\int_0^tyg(y)dy}{(\phi-t)\int^1_tg(y)dy}-\frac{1-E(Y)}{\int^1_t(y-t)g(y)dy + (\phi-t)\int^1_tg(y)dy}.$$ This suggests to check the property when $g(y)dy$ is replaced by the Dirac measure $\delta_{y_0}$ and to compute explicitely $h(t)$ in this case, namely for $t<y_0$ and for $t>y_0.$
Edit. Keeping the above idea, for $t<y_0$ and denoting for simplicity $u=\phi -t$ and $v=y_0-t$ I have found that the sign of $h'$ is the sign of
$$ u^2(3y_0-1)+uv(2-y_0)+v^2$$ which is negative if $y_0<1/3$ and $\phi$ is large. Unfortunately, I think that your conjecture is false in general.
Comment: Thank you for the help! Yes, you can regard $f$ as a cumulative distribution function on $[0,1]$. But could you illustrate a bit more why to do so? Because it seems all denominators equal $0$ if $t>y_0$.
Comment: Correct. But the same phenomena occurs when $f'(y)=0 $ for $y>y_0$  which is also a limiting case of your hypothesis. It would help if you could describe the source of your  interesting question.
Comment: Sure. The problem comes from comparing the waiting time of two queueing systems in the stationary state.
Comment: I think your method is wrong because I can show the derivative of the numerator is positive when $\phi$ is large. Please see my new edition.
Comment: may be I have done some mistake in my computation...


How can i get ActionBar items without dropdown and with icons?

Question: i'm just thinking of designing my app a little bit more intuitive and came to this question. At this moment i have my actionBar with the logo of the app and the activity name on the left side and this three vertical dots (dropdown menu) on the other side.
I only got three items in the dropdown.
Can i have them with only icon in one row rather than in the dropdown menu?
Got my layout xml file like this:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="jollocks.bierbrunnen.Bierbrunnen" >

<item
android:id="@+id/hauptmenu"
android:title="@string/hauptmenu"
android:showAsAction="always"
android:icon="@drawable/startseite">
</item>

<item
android:id="@+id/neustart"
android:title="@string/neustart"
android:showAsAction="always"
android:icon="@drawable/nochmal">
</item>
</menu>

Still the same.
Comment: [Yes](http://developer.android.com/guide/topics/ui/actionbar.html)
Comment: Post your entire menu.xml @Jolle
Comment: Check my updated answer @Jolle
Answer: For learning different types of menu items you should refer
http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems
and
https://developer.android.com/training/basics/actionbar/adding-buttons.html
3 options available for displaying menus

always (Your requirement i.e it will display on actionbar)
ifRoom
never (Your current situation i.e display under dropdown)

For your updated question
Change
android:showAsAction="always"
to
app:showAsAction="always"
Comment: Thank you very much! :) this is great!


Thick border for rounded button in blackberry

Question:
   I am getting this... I want the below image
I am newbee in Blackberry.
I want to give thick border to the rounded button field in my application.
Below is my code.
I have created a CustomBasicEditField class.
protected void paint(Graphics graphics)
{

    int x = (this.getWidth() - getFont().getAdvance(text)) >> 1;
    int y = (this.getHeight() - getFont().getHeight()) >> 1;

    graphics.setColor(backgroundColour);
    graphics.fillRoundRect(0, 0, fieldWidth, fieldHeight, 40, 40);
    graphics.setColor(border_color);
    graphics.setStrokeWidth(5);
    graphics.drawRoundRect(0, 0, fieldWidth, fieldHeight, 40, 40);
    graphics.setColor(0x2bb1ff);
    graphics.setFont(myFont);
    graphics.drawText(text, x, y);

    super.paint(graphics);
}

If I make drawRoundRect(0,0,fieldWidth, fieldHeight, 0, 0), then it prints a square with thick border.
But I don't want a square. When I keep the above code, it does create a rounded edit box but a thin border.
Thanks in advance.
Answer: Try this code:
public class LoadingScreen extends MainScreen
{
ButtonField save;
public LoadingScreen()
{
    setTitle("Loading Screen");
    createGUI();
}

private void createGUI()
{
    VerticalFieldManager vr=new VerticalFieldManager();
    Border border=BorderFactory.createRoundedBorder(new XYEdges(5,5,5,5),Color.RED,Border.STYLE_FILLED);
    // give XYEdges(10,10,10,10) and see the difference;
    save=new ButtonField("Save");
    save.setBorder(border);
    vr.add(save);
    vr.setPadding(5, 5, 5, 5);
    add(vr);
}

public boolean onMenu(int instance)
{
    return true;
}
}

I got like this:
Comment: I am getting like this... but the problem is... I need somethin like the image I have uploaded...
Comment: I am able to achieve it... but then.. m not gettin that thickness
Answer:     Bitmap borderBitmap = //a ![your image]
    VerticalFieldManager vfm_email = new VerticalFieldManager();
    vfm_email.setBorder(BorderFactory.createBitmapBorder(new XYEdges(5, 5,
            5, 5), borderBitmap));
    vfm_email.setMargin(m, 30, 0, 30);
    email = new EmailAddressEditField(" ", "", 50, Field.FOCUSABLE);
    vfm_email.add(email);
    vfm_.add(vfm_email);

Answer: Try this, it work fine.
 Border myBorder = BorderFactory.createBitmapBorder(new XYEdges(10, 10, 10, 10),
                    Bitmap.getBitmapResource("border.png"));

        BasicEditField edt_searchText = new BasicEditField(TextField.NO_NEWLINE)
                {
                    protected void paint(Graphics g)
                    {
                        if (getTextLength() == 0)
                        {
                            g.setColor(Color.LIGHTGRAY);
                            g.drawText("Search weeds", 0, 0);
                        }

                        g.setColor(Color.BLACK);
                        super.paint(g);
                    }
                };
                edt_searchText.setBorder(myBorder);


Can I have the PC version display a PS3 controller layout?

Question: The only reason I even considered picking up Kingdoms of Amalur for the PC was the fact that the game still supports a gamepad.
Since I own a PS3, my gamepad of choice is one of my PS3 controllers hooked up to the PC, while using MotionInJoy to have it emulate an Xbox controller (seeing how there is no way to connect a PS3 controller to a PC and have it function properly out of the box). This causes the game to assume I have an Xbox controller, so when I want to see the control layout, and when the game gives me visual keypress prompts or tries to tell me which key is assigned to what, it uses Xbox button names and visuals.
This is naturally quite confusing.
Is there any way to have the game show me a PS3 controller's button names and visuals? I wouldn't even know if those visuals are buried somewhere inside the PC version or not.
Comment: 1. Print out an Xbox Controller photo. 2. Cut it out. 3. Glue it to your controller. 4. ??? 5. Success
Comment: @Marcelo Step 5 should be Profit :D
Comment: @Adanion That's very right, in my case, Step 5 is Total Failage then.
Answer: Because the PS3 game controller never was designed to be used with a computer, there have never been any computer games that has visualized the PS3 game controller button mapping layout.
Microsoft's close relationship to PCgaming (also through enabling it with extra accessory) has enabled the company to integrate the layout of the Xbox controller in most games. Sony's PlayStation division never wanted anything to do with PC gaming, Microsoft enabled it out of the box with their 360 Wired controller.
Your request is not possible without serious modding (in which case basically anything can be done).
Comment: I definitely follow your reasoning, but I was hoping that since the game was also playable on the PS3, that it would actually require relatively light modding.

Regardless, I'm pretty sure you are correct in saying this is not possible in any sensible manner.


How do I tell if I'm in the 20 main chunks?

Question: The 20 chunks around the origin of the world are always loaded, whether you are there or not. This makes them a great place to build farms. Is there a way to tell if you are in those 20 chunks or not?
I'm fine with using the debug menu but I'd prefer to avoid having to count chunk borders or something if possible.
Answer: The spawn chunks usually consist of an area of 16×16 chunks centered as close as possible to the world spawn point.
A compass will point to the spawn point.
For players not connected to a bed, in Creative and Survival mode, players spawn on a random block in a 20×20 box centered on the spawn point. The spawn point can be inferred by repeatedly respawning and keeping track of the smallest rectangle encompassing all blocks players have spawned on so far.
And since chunks are 16 × 16 segments of the Minecraft worlds, once you know the spawn point coordinates you can easily find the spawn chunks bounds with math.
Source, Minecraft wiki.
Comment: The spawn point tends to be around 0/0, but can be quite far off, especially if 0/0 is in an ocean biome. As you have 16x16 spawn chunks around the spawn point, it's 8 chunks - 128 blocks - in each direction, which will make z=130 *just* outside. But your spawn point could easily be at z=200, or z=-200, and without tracking the spawn point (by using F3 when you die without a bed, or a mod, or checking level.dat with mcedit, or ...), you can't know if a particular coordinate is in your spawn blocks. Break your bed, die, and if you're less then 100 blocks from your farm, you're ok.
Comment: I built a farm in -68, 130.  Is that inside the spawn chunks?
Comment: As an example, seed -2017017060667713728 has its spawn point at 49,-527 - far away from 0/0. You can check this on https://www.chunkbase.com/apps/seed-map#-2017017060667713728, and also upload the level.dat from your own save game there to see your own spawn point.
Comment: the compass goes to .8, 1.7


Is it bad to run a long-running process on a server in a Gnu Screen session?

Question: I have a long running process that currently logs output to stderr, and I'm just starting it up and leaving it running on the server within a gnu screen session on the server, which I just detach when I logout of the server and reattach after I log in, if I want to see what the process is doing.
Are there any drawbacks to running a long-running process this way?
Comment: Sounds fine to me, but this question is probably best suited for http://superuser.com/
Answer: Screen is designed for this.  So no, there are no real drawbacks this way.


Custom house in Freecol

Question: How does the custom house work in Freecol? I built custom house but nothing happens. Previously I played Colonization a lot where custom houses worked automatically, they sold available goods.
Answer: Have you set it up in the warehouse dialog? I don't think the custom houses automatically start exporting goods; they just allow you to set up automatic export. See here (search "custom house", it's a long guide) for more information.
Here's a short summary:

If you have already built a Custom House in the colony, you can export goods to Europe automatically. Goods marked to be exported are printed in green. Open the warehouse dialog (see below) in order to change export settings.
Answer: In the settlement view, you need to click on the "Warehouse" button at the bottom.  This will give you a list of all your goods, and you can check "Export" for any that you want to sell automatically.  It also lets you set the threshold below which they won't be exported.

Custom house in Freecol


Exception running application sample.Main

Question: I am making a ToDo App in JavaFX but it says this error (even without the database, login system just want to run it plainly):
I like to code but not when errors come up Thats why i am called ErrorLane
Main.java:
package sample;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception{
        Parent root = FXMLLoader.load(getClass().getResource("C:\\Users\\arhaan\\eclipse-workspace\\ToDoApp\\src\\sample\\viewlogin.fxml"));
        primaryStage.setTitle("Hello World");
        primaryStage.setScene(new Scene(root, 300, 275));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

login.fxml:
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<GridPane fx:controller="sample.Controller"
          xmlns:fx="http://javafx.com/fxml" fx:controller="application.FXMLDocumentController" alignment="center" hgap="10" vgap="10">
</GridPane>

It is in Eclipse not IntelliJ IDEA with JRE 1.8.0
This is the error:
Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Location is required.
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3207)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    at sample.Main.start(Main.java:13)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
    ... 1 more
Exception running application sample.Main

Comment: Does this answer your question? [JavaFX "Location is required." even though it is in the same package](https://stackoverflow.com/questions/20507591/javafx-location-is-required-even-though-it-is-in-the-same-package)
Comment: @JCWasmx86: No i move it into sample.view but it still had the same error but only with sample.view
Answer: The "error" is the NPE caused by trying to use an absolute path as argument to FXMLLoader.  FXMLLoader takes a URL, so to convert your absolute path to a URL that can be passed to FXMLLoader, either use a FileInputStream, or convert to a URL:
FileInputStream:
 Parent root = FXMLLoader.load(new FileInputStream("C:\\Users\\arhaan\\eclipse-workspace\\ToDoApp\\src\\sample\\login.fxml"));

Converting to URL:
Parent root = FXMLLoader.load(Paths.get("C:\\Users\\arhaan\\eclipse-workspace\\ToDoApp\\src\\sample\\login.fxml").toUri().toURL());

This answers your question, but this is bad design.  Use proper structure for your source, and have the .fxml in the class path in the same package, either directly with the controller, or in a dedicated resource directory contains same package layout.  With a hardcoded absolute path, your code is not portable, and will require anyone else to have the same exact path on their system to run your code.
Comment: No dosen't work
Comment: sorry, I copy pasted too soon, edited to remove unneeded getClass().getResource()
Comment: That too dosen't work
Comment: Do you have an actual file at that path location called viewlogin.fxml ?
Comment: that is called login.fxml because i forgot the \\ but that when i tried your code with the \\ it dosen't work too.
Comment: you are trying to load a file called `viewlogin.fxml`. but your file is `login.fxml` ?  then simply either change the filename to match what you want to load, or edit my answers and remove the `view`
Comment: no i did full path but without it it also did not work
Comment: what is the name of your .fxml file? and where is it located?  If the file name is `login.fxml` and it is located on your C: drive at `C:\Users\arhaan\eclipse-workspace\ToDoApp\src\sample` then check my last edit of the answer.  If you still have issues, then something else is going on, I will delete my answer and comments to clean up this post


How do I open Access-Your-Private-Data.desktop?

Question: Help how do I open this. the README file says
THIS DIRECTORY HAS BEEN UNMOUNTED TO PROTECT YOUR DATA.

From the graphical desktop, click on:
 "Access Your Private Data"

or

From the command line, run:
 ecryptfs-mount-private

How do I run this so that I can get my data?
Answer: You are trying to access data from an encrypted directory. To do this, log in as the user owning the data in question (eg sally for /home/sally). If the home directory itself is encrypted, logging in will automatically decrypt the data. If it is a Private directory, there should be a launcher in that folder to click (which may again prompt you for the user password).
If the "Access Your Private Data" launcher fails for some reason, use this command and follow instructions:
ecryptfs-mount-private

If, for some reason, you have the data in question independent of the system it was used in, you will need the private key that Ubuntu's encryption wizard asked you to save on installation.
If you have neither the password for user with that encrypted directory, nor the private key, I'm afraid there is no way to recover the data.
Comment: What if the owner of the home directory does not exist? I installed over the previous installation with a different user name leaving only the old home directory.
Comment: seems to require root's password and not the users?
Comment: Does it need reboot? I executed `ecryptfs-mount-private` but no difference. It came back to normal operation after reboot! I don't know which one caused this.
Comment: @Jjed : My situation is different. Please be kind enough to go through this:  http://askubuntu.com/questions/681019/cannot-read-files-from-a-crashed-ubuntu-partition-using-running-ubuntu-on-anoth?noredirect=1#comment989046_681019
Answer: Try logging into as the "USER" whose directory you are trying to access. I faced similar problem when accessing information of that of "user" logging in as a "root" user.
Answer: This bug happens quite frequently for me on Mint 19.1 Cinnamon for some reason, and without any obvious cause (except time). I find that running the command in an already open terminal does not work. However this works for me:

Open a new terminal windows (don't use an old one)
Run ecryptfs-mount-private without sudo. If it worked, there is no output in the console (no error, no asking for password).
Refresh the files in file browser (nemo) to ensure it worked.


Print a specific row and column element from a Dataframe

Question: I have imported 4 csv files using a loop through pandas. Now I want to check where in the 'Channel' columns, the response is exceeding a certain threshold and print the time from 'Time' column and value of voltage from 'Channel' columns. I want only the first instance the value in each of the four channels, exceed threshold. So I want to do the following operations on it.

I want to cut the threshold in half if the maximum in any of the channel is smaller than the threshold.

After finding 'where the values of each of the columns' is crossing threshold, how do I print the 'Time' and value where this occurs?

Below is the code and how dfs looks like. Any help or suggestion would be great ! Thanks.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path

global df
df = pd.DataFrame([])

def function_plot(*xyzv, Plot_ShareY=True):    #x, y, z, v is filename

    # data paths
    dps = [Path(f) for f in xyzv]

    for dp in dps:
        print(dp)

    #dataframes - loads the csv file from the paths created above
    dfs = [pd.read_csv(dp, delimiter=";", skiprows=(1, 2), decimal=",", na_values=['no info', '.']) for dp in dps]
    times = [df['Time'] for df in dfs]
    y_labels = ['A', 'B', 'C', 'D']
    ch = [('Channel A', 'r'), ('Channel B', 'g'), ('Channel C', 'b'), ('Channel D', 'y')]
    ch_vals = [('Channel A'), ('Channel B'), ('Channel C'), ('Channel D')]

    threshold_abs = 0.003

    for df in dfs:
        if threshold_abs > np.max(ch_vals):
            threshold_abs = threshold_abs / 2
            print(threshold_abs)

        location = [df[ch_vals]>threshold_abs]
        print(location)

    fig, *axes = plt.subplots(len(dfs), 1, figsize=(12, 8))
    fig.suptitle('Drops')

    for x, ax, df, y_label in zip(times, axes[0], dfs, y_labels):
        for channel, colour in ch:
            ax.plot(x, df[channel], colour)
        ax.set_ylabel(y_label)
        ax.set_xlabel('Time [ms]')

    plt.show()

I want the output for question 2 to be like following:
['Time': 0.2, 'Channel A': 0.445, 'Time': 0.1, 'Channel B': 0.4385, 'Time': 0.2, 'Channel C': 0.425, 'Time': 0.4, 'Channel D': 0.4145, ]
Answer: Here you perform operation to calculate Boolean value:
location = [df[ch_vals]>threshold_abs]

that is why it returns true/false.
If you want to filter DataFrame to show only rows that are true in location variable, you can apply it like this:
df.loc[location]

ch_vals in your code is just a list of strings, when you use it to query DataFrame "df[ch_vals]" - it returns list of columns that are listed in the array from the DataFrame.
Comment: Thank you. first question is clear. 2 and 3 are not. np.max() is still giving an error and using df.loc as you suggested is giving an error like : 'PandasArray must be 1-dimensional.' When df.iloc is used it says: 'Boolean index has wrong length: 1 instead of 200004'
Comment: Correct. For loc to work you need 1-dimentional array/DataFrame. df[ch_vals] gives you DataFrame of 4 columns. Please provide additional logic of what you are trying to do.
Comment: I have a threshold value of 0.003 and I want to check in all these 4 columns, where the value exceeds the threshold. I want only the first time this happens. So when the first instance is detected, I want to print those values (along with the time value where this happens) and finally plot them on an existing graph.
Comment: This question is too broad. Please try to split it into smaller questions and provide more information like code samples, sample data as text (not pic), desired output as text, etc. for each question.
Comment: I changed it as much as I could understand.


Get the difference for a column value by all its previous rows data

Question: Please consider these two tables:

Vault

id BIGSERIAL PRIMARY KEY
name VARCHAR(30) NOT NULL

Transaction

id BIGSERIAL PRIMARY KEY
transaction_type VARCHAR(6) NOT NULL -- Choice between "credit" or "debit"
amount NUMERIC(15,6) NOT NULL
vault_id BIGINT REFERENCES Vault (id)

When getting Transaction row/s, I would like to get an extra column for the remaining vault balance after the transaction is done.
Example of Transaction:
id      transaction_type        amount      vault_id        vault_balance
1       credit                  100         1               100 // since there was no prev transaction for this vault
5       credit                  400         1               500
12      debit                   200         1               300
20      credit                  100         1               400

I can add a column to hold the vault balance and use that for the next transaction. But suppose the user deletes a row, for example row id 5 which has credit amount of 400 is deleted. Then its following transactions vault balance should change accordingly. So for row 12 the vault balance would be -100, and row id 20's vault balance would be 0.
id      transaction_type        amount      vault_id        vault_balance
1       credit                  100         1               100 // since there was no prev transaction for this vault
12      debit                   200         1               -100
20      credit                  100         1               0

The way I see it I have two ways:

Add a column to store the vault balance in a transaction, and if there is a change, all of its following transaction's vault balance should be updated accordingly.
Maybe there's a way to get the difference of credit and debit between all of its previous and the current transaction amount.

But I am hoping there is a much better way? Could you please help me what would be most efficient way to handle such situation?
Update
Link to the Table fiddle.
Comment: You can add a trigger on delete and update the next with `vault = vault - old.amount`
Answer: There is a better way, at least IMHO. Do not change your table definition, instead create a view on transactions which has the running balance and that column is derived in the view.
    create view transactions_with_bal as
    select id
         , transaction_type
         , amount
         , vault_id
         , sum(amount * case when transaction_type = 'credit' then 1 else -1 end )
               over (partition by vault_id order by id) balance
       from transactions;

Now you do not need any additional processing for DML (delete, insert, update) against the table; no trigger, no additional code, nothing. Also you avoid race conditions when multiple users issue DML against it at the same time. It even handles the case where the column vault_id changes.
Comment: Thank you! I am just learning about window functions. Could you also help me how can I get the vault balance for just one row, i.e. by ID?
Comment: Just add a where clause when selecting from the view.  So `Select * from  transactions_with_bal where id = ;`


Already complete scraping scrapes everything on the page. I would like to limit the scraping to only a certain section

Question: I placed the code of a complete and properly functioning scraping that I own. Successfully scrapes all elements on the page.
However, I would like to scrape only a small limited section of the page with the same elements as scraping. This limited section is already scraped correctly along with all elements of the page, but I would like to scrape only it and not "all + it". The link is here
There are 4 tables on the page, but I would like to scrape just one, that is the table called "Programma", ie the html section "event-summary event" or "leagues-static event-summary-leagues ". But of this section only the elements of the last round (Matchday 14). Matchday 14 only. No round 15. So obviously that with each update of the page rounds, the last round is always scraped as well.
So I would need to insert something that makes scraping understand to download only the elements (which it already owns and scrapes) of of that section and the last round.
The code is already complete and works fine, so I'm not looking for code services, but for a little hint to tell me how to limit the scraping to just the section mentioned above. Scraping is in Selenium. I would like to stick with Selenium and my code as it is already functional and complete. Thanks

import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()
driver.get("url")
driver.implicitly_wait(12)
#driver.minimize_window()

wait = WebDriverWait(driver, 10)

all_rows = driver.find_elements(By.CSS_SELECTOR, "div[class^='event__round'],div[class^='event__match']")

current_round = '?'

for bundesliga in all_rows:
    classes = bundesliga.get_attribute('class')
    #print(classes)

    if 'event__round' in classes:
        #round = row.find_elements(By.CSS_SELECTOR, "[class^='event__round event__round--static']")
        #current_round = row.text  # full text `Round 20`

        current_round = bundesliga.text.split(" ")[-1]  # only `20` without `Round`

    else:
        datetime = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__time']")

        #Divide la data e l'ora
        date, time = datetime.text.split(" ")
        date = date.rstrip('.')  # right-strip to remove `.` at the end of date

        team_home = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__participant event__participant--home']")
        team_away = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__participant event__participant--away']")
        score_home = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__score event__score--home']")
        score_away = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__score event__score--away']")

        bundesliga = [current_round, date, time, team_home.text, team_away.text, score_home.text, score_away.text]
        bundesliga.append(bundesliga)
        print(bundesliga)

Comment: Still can't find the _the html section "event-summary event" or "leagues-static event-summary-leagues "_
Comment: @DebanjanB  Go where it says "Programma". The table where it says Programma and Giornata 14. Look my screenshot https://pasteboard.co/Fj4qU7AMmZnk.jpg
Comment: Yeah, now can find `event event--summary` class. So you only want to scrape the last rounds.
Comment: @DebanjanB  Yes, the last round in the "Programma" (the one with no results, therefore the one still to be played). But it also says Round 15, I don't want 15. Only the 14. So obviously with every round update on the page, I would just scrape the last round. The elements are the same as I have in scraping. Thanks :)
Comment: Let's discuss the issue in [Selenium](https://chat.stackoverflow.com/rooms/223360/selenium) room in a few minutes.
Comment: @DebanjanB  Why do we have to talk about it elsewhere? If you can help me you can write me here, otherwise it doesn't matter :) Thanks anyway :)
Answer: I think all you need to do is limit all_rows variable. One way to do this is finding the tab you are looking for with text and then getting the parent elements.
import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElementException

driver = webdriver.Firefox()
driver.get("https://www.someurl/some/other/page")
driver.implicitly_wait(12)
#driver.minimize_window()

wait = WebDriverWait(driver, 10)

# all_rows = driver.find_elements(By.CSS_SELECTOR, "div[class^='event__round'],div[class^='event__match']")
############### UPDATE ####################
def parent_element(element):
    return element.find_element(By.XPATH, './..')
programma_element = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.XPATH, "//div[text()='Programma']")))

programma_element_p1 = parent_element(programma_element)
programma_element_p2 = parent_element(programma_element_p1)
programma_element_p3 = parent_element(programma_element_p2)

all_rows = programma_element_p3.find_elements(By.CSS_SELECTOR, "div[class^='event__round'],div[class^='event__match']")
filter_rows = []

for row in all_rows:
    if "event__match--last" in row.get_attribute('class'):
        filter_rows.append(row)
        break
    else:
        filter_rows.append(row)

############### UPDATE ####################
current_round = '?'

for bundesliga in filter_rows:
    classes = bundesliga.get_attribute('class')
    #print(classes)

    if 'event__round' in classes:
        #round = row.find_elements(By.CSS_SELECTOR, "[class^='event__round event__round--static']")
        #current_round = row.text  # full text `Round 20`

        current_round = bundesliga.text.split(" ")[-1]  # only `20` without `Round`

    else:
        datetime = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__time']")

        #Divide la data e l'ora
        date, time = datetime.text.split(" ")
        date = date.rstrip('.')  # right-strip to remove `.` at the end of date

        team_home = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__participant event__participant--home']")
        team_away = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__participant event__participant--away']")
        # score_home = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__score event__score--home']")
        # score_away = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__score event__score--away']")

        try:
            score_home = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__score event__score--home']")
        except (TimeoutException, NoSuchElementException):
            MyObject = type('MyObject', (object,), {})
            score_home = MyObject()
            score_home.text = "-"
        try:
            score_away = bundesliga.find_element(By.CSS_SELECTOR, "[class^='event__score event__score--away']")
        except (TimeoutException, NoSuchElementException):
            MyObject = type('MyObject', (object,), {})
            score_away = MyObject()
            score_away.text = "-"

        bundesliga = [current_round, date, time, team_home.text, team_away.text, score_home.text, score_away.text]
        bundesliga.append(bundesliga)
        print(bundesliga)

Comment: @Johan.D. added some more updates
Comment: I have found that your code, extraordinary as it is, scrapes both round 14 and round 15. In fact, I noticed the Cologne-Augusta match which is in 15. Yours was probably a distraction. As you saw in the question I highlight with the red color that I would like to scrape only round 14. I would like to solve it by myself, but I am not able to do it since I am a beginner in Python. Could you correct your answer please? You are great!
Comment: @Johan.D. just to confirm you want to exclude round 15 temporarily and then include it when round 15 and round 16 are in the table?
Comment: I get an error: except TimeoutException: NameError: TimeoutException is not defined. I confirm that I want to exclude round 15. I don't understand what you mean by "and then include it when round 15 and round 16 are in the table". After a few days the web page will be updated and round 14 will be gone, so then I would like to scrape the next round which will be 15 (only 15, but not round 16).Now I would like to scrape only the 14 but not the 15. After update,next week I would like to scrape only the 15 but not the 16. Then again I would like to scrape the 16 but not the 17, and so on.
Comment: @Johan.D. thanks for confirming, I updated the answer to include the import for the `TimeoutException`.
Comment: Thanks to you, but now I get another error. Also I had tried to import TimeoutException. Now with your code I get this: raise exception_class (message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [class ^ = 'event__score event__score - home']
Stacktrace:
WebDriverError @ chrome: //remote/content/shared/webdriver/Errors.jsm: 181: 5
NoSuchElementError @ chrome: //remote/content/shared/webdriver/Errors.jsm: 393: 5
element.find / </ <@chrome: //remote/content/marionette/element.js: 299: 16
Comment: The  Try/Except section lets the variable "score_home" and "score_away" set  the ".text" to a value of "-" when the css selector is not found.  Which turns out to be all the places where a "Preview" link is found.
Comment: Voted and set the question as resolved thanks to you. Thanks.


Apache CXF Documentation Capability

Question: Enunciate has a documentation mode and when you compile your code you get a documentation page for your web services (it is generated automatically and no need to write any other documentation annotations to add a documentation comment. I know Apache CXF has something like it. I need an automatic documentation generator, something like the Enunciate project).
Does Apache CXF has same capability?
PS: I use Spring at my application.
Answer: December 2015 update:
There are a few options to generate documentation , enunciate being the best OSS option by far. CXF doesn't have any plugins for this feature.
However the best documentation feature , also has a Maven plugin is a commercial offering : http://www.filigris.com/docflex-xml/wsdldoc/.

Apache CXF Documentation Capability


how to navigate in OnAppearing() method?

Question: I want to avoid putting my OnBoarding view in navigation stack to fix the problem of pressing the back button. In my MainPage I check if OnBoarding should appear or not. If true, I call PushModalAsync method in OnAppearing method. But the App crash with the following exception:
Objective-C exception thrown.  Name: System.InvalidOperationException Reason: Window should have a UIWindow set. (System.InvalidOperationException)
   at Microsoft.Maui.Controls.Window.get_NativeWindow()
   at Microsoft.Maui.Controls.Platform.ModalNavigationManager.EndEditing()
   at Microsoft.Maui.Controls.Platform.ModalNavigationManager.PushModalAsync(Page modal, Boolean animated)
   at Microsoft.Maui.Controls.Window.NavigationImpl.OnPushModal(Page modal, Boolean animated)
   at BytePesaApp.MainPage.OnAppearing() in MainPage.xaml.cs:line 18
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Foundation.NSAsyncSynchronizationContextDispatcher.Apply()

Here is the code implementation:
public partial class MainPage : ContentPage
{

    public MainPage()
    {
        InitializeComponent();
    }

    protected override async void OnAppearing()
    {
        base.OnAppearing();

        if (ShouldShowOnBoardingPage() == true)
        {
            await Navigation.PushModalAsync(new OnBoardingPage(), false);
        }
    }

    private bool ShouldShowOnBoardingPage()
    {
        return VersionTracking.IsFirstLaunchEver;
    }
}

Answer: It sounds like Maui is not in a good state to navigate, until OnAppearing finishes. DEFER the navigation like this:
Dispatcher.Dispatch(async() =>
    await Navigation.PushModalAsync(new OnBoardingPage(), false);
);

This code will be queued, and will run after OnAppearing returns.

An ALTERNATIVE is to replace the MainPage during OnBoarding.
In App.xaml.cs:
if (ShouldShowOnBoardingPage() == true)
    MainPage = new OnBoardingPage();
else
    MainPage = new MainPage();

Then when OnBoarding is complete:
    Application.Current.MainPage = new MainPage();

I prefer the latter approach, if possible.
Answer: The Loaded-Event is fired after OnAppearing(); unfortunately, there is no OnLoad() to override, so you have to use the event:
public partial class MainPage : ContentPage
{

    public MainPage()
    {
        InitializeComponent();

        this.Loaded += MainPage_Loaded;
    }

    protected async void MainPage_Loaded(object sender, EventArgs e)
    {
        if (ShouldShowOnBoardingPage() == true)
        {
            await Navigation.PushModalAsync(new OnBoardingPage(), false);
        }
    }

    private bool ShouldShowOnBoardingPage()
    {
        return VersionTracking.IsFirstLaunchEver;
    }
}

Answer: one of the decisions is to use task:
protected override async void OnAppearing()
{
    base.OnAppearing();

    if (ShouldShowOnBoardingPage() == true)
    {
        Task.Run(async () =>
        {
             await Navigation.PushModalAsync(new OnBoardingPage(), false);
        });

    }
}


Bootstrap Form- unable to get full width on input & button when collapsed

Question: Question background:
I have a product details page that allows users to add a quantity of the item to their cart using a button. This is in a inline-form to allow the input and button to be placed next to each other, as shown:

The issue:
When the website has collapsed to be viewed on a small screen device I can't get the input and button to span the full width of the container. The following image shows how the site looks collapsed, note the black arrows are pointing to the red lines I want the input and button to span to:

The HTML:

                <form class="form-inline">

                            <input id="productQty" type="text" value="1" name="demo1" class="form-control">

                    <button type="submit" class="btn btn-primary" id="myLink">Add To Cart</button>
                </form>

Comment: Please provide a fiddle
Answer: If you want to have width of those element 100% you have to remove
 and add class btn-block to your button
  <form class="form-inline">

        <input id="productQty" type="text" value="1" name="demo1" class="form-control">

     <button type="submit" class="btn btn-primary btn-block" id="myLink">Add To Cart</button>
  </form>


Is the Mazur swindle a supertask?

Question: The Mazur swindle can be used to show that any knot with an inverse under connected sum must be isotopic to the unknot. The isotopy, as I understand it, involves instantiating a pair of the knot and its inverse, canceling the first two knots, and repeating the process ad infinitum until there are no knots left. While this is perfectly fine using the given definitions, it seems to fit under the definition of a supertask, which seems like a bit of a cheat. The overall question is, how inherent is a supertask to this proof?
To make this more concrete, let us instead define the equivalence of knots by saying that they are related by a finite sequence of Reidemeister moves.
1) Can the proof by swindle be done under this definition?
2) Since the swindle involves a wild knot, does Reidemeister's theorem apply?
3) If so, how does Reidemeister's theorem reduce the supertask above to a finite task?
Answer: Here's a description of the Mazur swindle as I understand it (see https://math.stackexchange.com/a/3348047/172988):
You take the $x$-axis in $\mathbb{R}^3$ and tie into it $K_1$ in the intervals $[2n,2n+1]$ and $K_2$ into $[2n+1,2n+2]$ for $n\geq 0$ an integer.  Then, since we assume $K_1\mathbin{\#} K_2$ is isotopic to the unknot, we can take intervals $I_n=[2n,2n+2]$ and $J_n=[2n+1,2n+3]$ and individually isotope $I_n$ or $J_n$ back to the $x$-axis for a fixed $n$.  Then, the idea is that you can simultaneously do all the $I_n$ isotopies to get the $x$-axis itself; similarly you can simultaneously do all the $J_n$ isotopies to get just $K_1$ tied into $[0,1]$.  One can then conclude $K_1$ is isotopic to the unknot.  I am only sketching things out here, and there are various topological details to check.  Also, this infinite knotted object is not a knot; perhaps one might call it a "longer knot."  The key is that everything can be done with piecewise linear topology, which makes the usual 3-manifold arguments work out.
This version of the argument constructs an actual isotopy of $\mathbb{R}^3$, but it can be turned into diagrammatic manipulations by Reidemeister moves, in a certain sense.  The only complication is that infinitely many non-conflicting Reidemeister moves are performed in parallel.  But, it will complete after only finitely many such parallel moves.
I would expect it cannot in general require only finitely many Reidemeister moves.  At least, the Reidemeister moves suggested above must be infinite in number since there are steps going from a diagram with infinitely many crossings to one with only finitely many.  I doubt it's possible to use only finitely many Reidemeister moves except if $K_1$ is already known to be the unknot.
1) While the proof requires infinitely many Reidemeister moves to be performed, it's a bit different from a supertask because it's possible to do all of them in finite time by doing them in parallel.  The diagram is split into countably many regions, at at each moment in time at most one Reidemeister move is performed in any given region.
2) Reidemeister's theorem does not apply since the object being isotoped is not a knot.  However, all Reidemeister's theorem says is that if $D_1$ and $D_2$ are respectively diagrams for knots $K_1$ and $K_2$, then if $K_1$ is isotopic to $K_2$ there is a sequence of Reidemeister moves that transform $D_1$ into $D_2$.  The swindle (when done diagrammatically) only needs the converse, that Reidemeister moves correspond to isotopies, which is true even in this setting.  Furthermore, we don't need any theorems about existence of diagrams for wild knots since we provide the diagram ourselves.
3) Just to make what I said a bit clearer: Reidemeister's theorem is only used for converting isotopies into sequences of moves, but we can do the swindle by producing the program to perform infinitely many Reidemeister moves in finite time ourselves.

By the way, Mazur's swindle isn't necessary to prove that only the unknot has an inverse under connect sum.  The reason is that Seifert genus satisfies
$$g(K_1\mathbin{\#}K_2) = g(K_1) + g(K_2)$$
and one can prove rather easily that $g(K)=0$ iff $K$ is the unknot.

There are some possible examples of "supertasks" in topology that rely on the way certain limits converge.  One is in things like mapping telescopes for CW complexes (see Hatcher's book on algebraic topology).  The weak topology lets you push problems away into higher dimensions, so to speak.
You might be able to consider Alexander's trick as a sort of supertask, but this is a stretch.
Comment: Thank you. I believe this contains the answers to my question, but I disagree that what you say isn't a supertask. Doing two Reidemeister moves in parallel isn't a Reidemeister move; it's two. As I read what you've written, it is not possible to prove that a knot with an inverse is equivalent to the unknot using the swindle, when the definition of equivalence is "related by a finite sequence of Reidemeister moves". So, I would say that the swindle really is a swindle.... But, as you say, other proofs exist, so it doesn't really change anything.
Comment: @user60338 I missed the part where you defined knot equivalence through Reidemeister moves.  Be aware that this is a somewhat arbitrary restriction because Reidemeister's theorem is for tame knots; but I don't want to discourage you from studying the ramifications here.  From my point of view, the fundamental definition for knot equivalence is whether there is an ambient isotopy carrying the first knot to the second.  There truly is an isotopy $[0,1]\times \mathbb{R}^3\to \mathbb{R}^3$ that carries the first "longer knot" to the second.
Comment: @user60338 I think the generalized Reidemeister theorem for these "longer knots" would be that every isotopy corresponds to finite sequences of parallel Reidemeister moves.  It just seems different from the usual sorts of supertasks because the causal chain is only finitely long for any given part of the transformed knot.
Comment: @user60338 When I said "Reidemeister's theorem is for tame knots," I misspoke.  I meant it's for tame $S^1$ knots.  The "longer knots" are tame, but they aren't $S^1$ knots since they are a certain kind of embedded $\mathbb{R}$.
Comment: Sure, it's clear that there's a perfectly clear isotopy involved. But no one unties knots using an isotopy. The Reidemeister theorem (in my mind) tells us that isotopy for nice knots is equivalent to one way to thinking about the usual way people untie knots. The fact that this equivalence no longer follows through the swindle was the point of the question: from the point of view of Reidemeister moves, the swindle only proves that you can perform the unknot as a supertask.
Comment: The statement "no one unties knots using an isotopy" seems off to me. A single Reidemeister move is an example of an isotopy, a sequence of Reidemeister moves performed one after another is an example of an isotopy, and what I do when I untangle a particularly yucky knot is an example of an isotopy. It seems more to me that you cannot escape the concept of isotopy no matter how you think about knot equivalence. It is a utilitarian generalization of special moves like Reidemeister moves.
Comment: @LeeMosher I don't disagree with that, but it also seems to me that isotopy goes beyond the naive notion of tying and untying knots. You could put restrictions on the types of isotopy allowed to make the correspondence better. I think those restrictions are probably going to be the hypotheses of the Reidemeister theorem, but I'd love to hear a different viewpoint.
Comment: Well, for example, one trouble with Reidemeister moves is that it excludes from the discussion anything except knots that are depicted so that their projection to the plane has simple crossings. There are many other ways knots are studied which are not consistent with that depiction.
Comment: Maybe this is a separate question, then. What is a good definition of knot equivalence that excludes supertasks? It's unavoidable vague, but I think it makes intuitive sense.

Is the Mazur swindle a supertask?


Facebook login failed: "fbauth2:/" - error: "This app is not allowed to query for scheme fbauth2 iOS 13, Xcode 11

Question: I recently came across an issue with Facebook Login after updating to iOS 13 and Xcode11. Login worked fine, all doc configuration is correct but two of my apps have this error now.
-canOpenURL: failed for URL: "fbauth2:/" - error: "This app is not allowed to query for scheme fbauth2
There is a similar question but it relates to iOS 10, and the issue clearly states that the info.plist configuration was incorrect, which is not the case here.
-canOpenURL: failed for URL: "fbauth2:/" - error: "This app is not allowed to query for scheme fbauth2" (OSStatus error -10814.)
Comment: This was just asked a few hours ago by another user: https://stackoverflow.com/questions/58273459/facebook-login-kit-with-ios-13-canopenurl-failed-for-url-fbauth2
Answer: Upgrading to the current FBSDK should resolve the problem. iOS 13 requires the implementation of ASWebAuthenticationPresentationContextProviding, which was not available until FBSDKCoreKit 5.4.
FBSDKCoreKit/FBSDKCoreKit/Internal/BridgeAPI/FBSDKBridgeAPI.m was modified to support iOS 13's requirement to implement ASWebAuthenticationPresentationContextProviding in FBSDKCoreKit 5.4. (The current version is 5.8.) Versions prior will no longer work.
The needed change is posted here: https://github.com/facebook/facebook-ios-sdk/commit/6b061099f339ef0e8bde2e2c2163ef5a3c1b8340#diff-72593591275d63edfb1bfad837e4c32f
I was unable to upgrade due to a dependency with AWS, but I was able to patch the 4.42 version of the file based on the differences in the diff above.
The error -canOpenURL: failed for URL: "fbauth2:/" - error: "This app is not allowed to query for scheme fbauth2 was a symptom of the FBSDK attempting to open Facebook, which was not installed, so it was just a warning before it would fall back to browser-based FB auth.
Comment: You are genius.


Node.js - Why does my project says can't find module when it is installed globally

Question: I installed express globally using the command "npm install -g express". I verified express is present in my /usr/local/bin/" directory.
However every time i create a new project and execute it says "Can't find module express".
When i install express locally using the command "npm install express" it works. Is this correct ?
Answer: According to the npm FAQ, globally-installed packages are only used for runnung the executables; they're not used in your projects, for projects to be self-contained entities not depending on the environment.
Also, if you have express installed globally, you can create a new express-based project using express command (see the "Quick Start" section of the express guide), it will save you from doing npm install express manually.
Comment: Thanks for the clarification. I thought i was making a mistake by installing the dependencies every time.
Comment: Theoretically, framework authors have only two options: to force every application to carry all its dependencies and configurations with it (with only core being shared between the projects), or to allow applications to use some global (yet machine-specific) libraries pool. The latter has a lot of disadvantages related to versions management and custom libraries (not enlisted in npmjs.org) usage. The former allows you to run your application on any machine that has an appropriate (or not so appropriate) Node.js version installed, no matter what libraries do you use.


Apply External CSS gives no Styles

Question: Hello there I am new to ASP.NET and learning to my own! The problem is that I want to add External CSS Styles to my web page. For this I have created an external CSS and dragged it on my page to import it to my web page! like:
   <link href="file:///D:\C#%20Work%20Space\Login%20Demo\mystyler.css" rel="stylesheet"
    type="text/css" />

Then, I added a class into my CSS as:
   .container
   {
   background:red;
   margin-top:100px;
   margin-left:100px;
   width:200px;
   height:200px;
   }

and I am using in for a simple div element as:
   <!html xmlns="http://www.w3.org/1999/xhtml">
   <!head runat="server">
   <!title>Untitled Page</title>
   <!link href="file:///D:\C#%20Work%20Space\Login%20Demo\mystyler.css" rel="stylesheet"
    type="text/css" />

   <!body>
   <!form id="form1" runat="server">

 Here I want to add External CSS Class
    <!h1>Hello

   </form>

So, The problem is my External CSS is not giving any styles to my web page! Is it me doing something wrong Please can somebody help me!
Thanks in advance
Comment: that doesn't look like a good file path to me. Try dragging the css file from your solution explorer onto your header section.
Comment: I have done it in the same way
Comment: it might look something like: **~/Content/Styles/mystyler.css** if you've placed your css sheet in your content -> styles folder
Comment: The thing is it shows the styles in my VS Design View but not in the Web Browser!
Answer: Change
   <link href="file:///D:\C#%20Work%20Space\Login%20Demo\mystyler.css" rel="stylesheet"
type="text/css" />

to
   <link rel="stylesheet" type="text/css" href="mystyler.css" />

Where Login%20Demo is the root of your app
Comment: if `Login%20Demo` it shall work then change it to `loginDemo` avoid space in folderName while creating the folder. You may want to try `href="/mystyler.css"` too or `href="../mystyler.css"`
Answer: I dont know why you use '!'symbol inside the link tag. Remove it and check whether your external css styles works or not.

Apply External CSS gives no Styles


What do I do against the infamous "gank squad"?

Question: In League of Legends, a "gank squad" can loosely be defined as:

a team of highly coordinate players who focus on demoralizing and map control as opposed to traditional tower pushing and lane control.

These are usually teams of 3 with bursty and/or stun-loaded champions (such as Singed, Vayne, Poppy etc), who sneak around picking off loan champions trying to jungle or hold a tower. This naturally causes a change in behavior for the opposing team to be more paranoid and lose ground as a result (usually due to their ally's doing the dirty work and failing pushes). This tactic has proven highly effective and difficult to coordinate against.
What strategies are effective to counter these "gank squads" to prevent them from demoralizing a team and preventing effective jungling?
Comment: Ward, farm, and don't get picked off. These teams snowball if they get kills but otherwise they're spending time running around while your team freefarms and gains a quick lead.
Answer: Gank squads have three primary advantages: High-burst damage, coordination, and numbers. They rely on the fact that they're better prepared than their victims, at least at the outset of the engagement.
If you can catch them attempting this early, an aggressive warding policy and a decision to shut them down can go a long way. However, this level of coordination is hard to pull off in a non-premade game. Individually in your lane, however, something similar can be accomplished: Aggressively ward the entrances to your jungle, where they're likely to come from and play conservatively. Since they aren't farming, they must get kills in order to scale. If you are premade, and you notice multiple members often missing from lane, aggressively ward jungle entrances and try to catch that squad unprepared.
Obviously, the other problem is their burst. Because burst damage is typically magic damage (at least, until the game gets out of control), a Hex Drinker can go a long way. Any magic resist, however, is a big plus. Since they have to be aggressive, having sufficient magic resist can bait them into overextending into a tower dive. Assuming you have an equal number of teammates, that plus the tower damage can turn the fight in your favor.
Even if you die, your team should try to use the fact that they saw 3 enemies in your lane and try to make the most of it, be it being aggressive in lane knowing the jungler can't gank right now, taking a dragon/their blue or pushing down a tower.
So if your are absolutely positive you are going to die, try to spend as much of their time as possible, giving your team more time to do something else elsewhere.
The ultimate point being that after a few failed attempts, the gank squad won't be strong enough to be as big of a threat.
Comment: This is a gorgeous answer. +1 for sure.
Answer: A gank squad is a noob tactic that might get first blood and it may be annoying, but ultimately, don't lose morale.  League of Legends at every ELO/skill level is a game where players make mistake and those that can capitalize can give themselves the advantage to win.  Most important thing every player of LoL should understand is how to communicate with your team, even if you are all randoms.  Keep morale up for yourself and your team and don't get into a rage war.  Just move past it, maintain good team morale with lots of useful communication, and farm safely.
Answer: Basically as it has been said aggressive warding everytime someone goes back have them buy a ward before they buy an item,ward jungle entrances and the river. Be sure to call Mia's and ping if you think someone is near always have an eye on the mini map.