Downgrade Debian linux from 10.8 to 10.7

Question: I have installed Debian 10.7 OS on Virtual box.
pra@pra:cat /etc/debian_version
10.7

However, somehow it is upgraded to 10.8
pra@pra:cat /etc/debian_version
10.8

Can I know how to downgrade back to 10.7 safely.
Answer: Short answer: You don't.
10.7 and 10.8 are point releases. They contain nothing but security updates, backported into the current software versions.
From that page:

Point Releases
Even stable is updated once in a while. Those updates are called
"Point Releases". They usually incorporate the security fixes released
until the time of the update and fixes for important bugs in the
current release. They are prepared by the Stable Release Managers
(SRM). As of February 2009 they should happen about every two months.

In fact, the version "upgrade" happens automatically when you update the package cache:
Reading package lists... Done
Building dependency tree
Reading state information... Done
43 packages can be upgraded. Run 'apt list --upgradable' to see them.
N: Repository 'http://ftp.nl.debian.org/debian buster InRelease' changed its 'Version' value from '10.7' to '10.8'

In theory if you still had the archived versions of all the software you installed cached somewhere locally and if you were very careful you could manually downgrade everything back to 10.7, but you'd accomplish absolutely nothing useful and would wind up making your system less secure and stable, not more.
Answer: In addition to Shadur's correct answer, I'd like to point out the suite workflow.
Unlike a rolling distribution, Debian stable is stable.  That doesn't mean it doesn't change, just that the changes are limited.  Specifically, the changes are limited to:

Security updates
Bug fixes of severity "important" or higher.

In both cases, changes to the package are limited to only what's required to solve the problem.  If the original software's author says "it's fixed in the latest version", it's not good enough for a Debian Developer to simply upload the latest version of that package.  That developer figures out which line(s) of source code to change to fix the problem and changes ONLY those lines.  This ensures that the user experiences no change in the behavior of their system other than what's explicitly intended by the update.  The changes are reviewed before they are published.
It's convenient upgrade a bunch of bug fixes at once instead of upgrading one package at a time as they come available and that's what the point-releases represent.
In sources.list, you may have lines which look like this:
(1) deb http://deb.debian.org/debian           buster         main
(2) deb http://deb.debian.org/debian-security/ buster/updates main
(3) deb http://deb.debian.org/debian           buster-updates main

If you only have line (1), then you will only update when the point release happens.
If you have (1) and (2), then you will update when the point release happens, and whenever a new security update is published. This is the configuration I suspect most people use.
If you don't want to wait for the next point release to get the latest bug fixes, you can also add line (3) to get the bug fixes as they are approved.  buster-updates is where fixes are queued for the next point release.  At the release, the packages from buster-updates are migrated to buster.

Note: In Debian 11 (bullseye), the security suite bullseye/updates will be renamed to bullseye-security to improve clarity.

In case you are wondering, there is significant testing done on package updates before they even reach buster-updates.  A maintainer will upload a package to the proposed-updates-new queue, where a release manager will review the change.  If approved, it goes into the proposed-updates suite where it sits for some time.  Users of the proposed-updates suite check packages for errors and if enough time has passed without any problems only then is it moved to the buster-updates.


Horror robot film set in a post-apocalyptic landscape with a killer robot or war against robots

Question: 80s or early 90s film set in a post-apocalyptic landscape with a killer robot or war against robots. In the film a robot comes up behind a woman and squeezes her until blood pops out of her mouth and she is dropped to ground, dead. Any ideas what film this is?
Comment: So are killer robots a known aspect of the landscape (as might be expected in a war) or is it something unexpected? Do you remember whether the woman was caucasian or dark-skinner? Blond or brunette? Long or short hair? Was the robot humanoid?
Comment: I think the robot was humanoid and I have a vague recollection of some kind of war against the robots. I think the woman had dark hair and there was a child involved. I saw this film as a kid or young teenager hence the 80s/early 90s date. It had a very Mad-Max-y-dystopian look about it, very red and junky. It certainly had the visual style of Hardware from what I can tell but not the same context (I think ...).
Answer: This might be Screamers (1995).
The movie is about a long-running war that has deployed automated robots that burrow around and jump out at targets with bladed edges.  The robots have continued to adapt and have started to develop humanoid decoys so as to lure more targets, as well as indiscriminately targeting both human sides in the war.
The burrowing blades are Type-1s.  The main character in the film uncovers evidence of Type-3s, which pose as helpless children that just want hugs.  The reveal of Type-2s ends up being of self-aware humanoid units, one of which is a soldier accompanying him, who does hug and squeeze one of the other characters to death.
Comment: The squeezing death is about an hour twenty four into this version: https://youtu.be/BjN0HYvd5E0?t=1h24m4s


How can I fix panniers that have got holes in

Question: I've got some Crosso panniers that have got quite a few holes in. I once fixed a drybag backpack with patches of leather and industrial strength glue which worked like a treat, but I've forgotten what glue it was (it came in a large tin and I spread it on with a knife)- it was in the textiles department at the uni I was studying in. Any advice / links / tricks would be great.
Comment: Needle and thread.  You can buy those and a small piece of "outdoor" fabric at a fabric store.
Comment: They are made of a plastic material so this method won't work.
Comment: Hard plastic or soft, pliable plastic?
Comment: You could try patches for an inflatable raft. Alternatively, take the bag to an outdoors shop and see what they'd recommend for patching similar materials. You can also duct tape in a patch of similar material as well.
Comment: ask in the DIY (hardware in USA) store for a glue that's suitable for plastic.
Comment: I used this industrial strength glue with large patches of leather which worked brilliantly, so the glue would have to glue leather onto plastic.
Comment: Duct Tape
////////////////////////////////////////////////
Answer: If you have water proof panniers made of soft plastic, patches made for fixing holes in bike tubes are really great (depending on the size of the holes in the panniers of course).
Comment: @AndrewWelch tube patches are 2-component: one is on patch, other is the glue. For pieces of old tubes you will need a special glue.
Comment: what about using old bits of bike tube or tyre?
Comment: Yeah but they vulcanise onto rubber, and the panniers are made of plastic so it would probably be better to use pliobond and innertube.
Answer: You could sew your own patches on using canvas and high-strength thread. They even sell kevlar thread that's useful for this type of thing.
If it were my panniers and I prefer strong-but-ugly, then I would cut up an old inner tube and use those as my patch materials. There's a very strong contact cement called Pliobond that you can use to glue pretty much any flexible material to another one.
You can even make your patches from leather (still using Pliobond) or canvas (ditto). I've bonded leather and rubber to steel/aluminum using Pliobond.
Or you can lame out and go to your local outdoor store that sells a broad variety of patch materials for backpacks and tents: http://www.rei.com/c/gear-repair
Many backpackers, for example, use "Shoe Goo" to not only repair their shoes (you can craft new soles with it) but also patch rather large holes in their backpacks. Sugru is also useful for this type of repair.
Comment: If you want to buy Pliobond in the EU/UK then Microtools is your source: http://www.micro-tools.de/en/Adhesives-Glue/Adhesive-Pliobond-3oz-Bottle.html?listtype=search&searchparam=pliobond
Comment: @Andrew Welch, Woolies also has a variety of contact adhesives: http://www.woolies-trim.co.uk/c-304-adhesive.aspx
Comment: woolies don't have any flexible adhesives.
Comment: Robokaren is Pliobond flexible?
Comment: Yes, you can use it to bond leather to plastic or nylon..
Comment: would this work? http://www.amazon.co.uk/flexible-suitable-glueing-leather-plastic/forum/Fx292N217S6Y5HZ/Tx3R1MY3CUXZK3T/1/ref=cm_cd_naredir?_encoding=UTF8&asin=B00HVG6CBM&cdItems=25&cdNewQuestion=1&store=generic


Waterproofing 1st floor bathroom with original wooden floor boards in a Victorian house

Question: I want to convert a 1st floor room into a bathroom, retaining the original wooden floorboards. There will be no shower, just a bath in the room. What needs to be taken into consideration with regards to waterproofing the floor to prevent splashes, spillages and kiddie bath time from ruining the ceiling below?
Comment: note that kids taking baths can cause WAY more water on a bathroom floor than a shower in heavy use.
Answer: You could sand down the floors, and refinish them with oil based stain and polyurethane. That should be enough protection to keep the floors from rotting. You could do what they did in the old days and put towels down around the tub and wipe up spills immediately. Standing water will leak through the cracks between the floorboards.
You could also good clear polyurethane caulk meant for bathrooms and fill the gaps between the boards around the wet areas, or on the entire floor. This should prevent water from seeping to the room below.
Comment: If you lifted the boards and installed a membrane below it and re-installed them, then the membrane would be destroyed when the floor was nailed back on. You would also need to install a subfloor, and then waterproof that. Doing so would most likely change the height of the finished floor. Then you would have issues with floor heights not matching to the  next room. Membranes are only useful on tile floors since they are 'glued' on by the thinset and don't use mechanical fasteners.
Comment: Am I correct in assuming that it's a lost cause to try put down a waterproof layer below the boards - as it will need to drain somewhere and will likely cause water to collect against the undersides of the boards causing rotting issues?
Comment: @Andrew you would most likely destroy the old boards if you tried to remove them.
Comment: I thought the same, but we've been lifting in other rooms and they've come up surprisingly easily and they're in great shape - which is why we're considering leaving them intact in the bathroom (originally we were just going to tile). the thought process continues...


Why isn't my model moving with my rig?

Question: I'm very new to Blender and I have a rigging question. I imported my model from Zbrush, and built a rig for the character. I select the rig, then the model, and pair them. Now when I move my rig, the model doesn't move. Am I missing a step, or could there be something wrong with my rig? Any suggestion would be great!
Answer: You need to parent the mesh to the rig, so you've selected them in the incorrect order. Once you do that you should get a list of armature deform options in the parenting menu when you apply the parenting.

Why isn't my model moving with my rig?


What should I do with the 50k I have sitting in a European bank?

Question: The interest rates are zilch (in fact the bank fees just about cancel them out). I may need some of the money in the coming year, but definitely not in the short-term. Is there's something smart a novice like myself can do to make that money work for me?
Comment: Country , please !!
Comment: You mean Netherlands, right ?
Comment: It's in Holland
Comment: More facts please, like what is the interest rate?
Comment: Are you a taxable as a US person? If you are its basically impossible to buy securities in Europe as no bank wants to report every transaction to the US as they are required. I'm in the same boat. I just have it sitting in Germany earning 0.3%
Answer: Unfortunately I do not have much experience with European banks. However, I do know of ways to earn interest on bank accounts. CDs (Certificates of Deposit) are a good way to earn interest. Its basically a savings account that you cannot touch for a fixed rate of time. You can set it from an average of 6 months to 12 months. You can pull the money out early if there is an emergency as well. I would also look into different types of bank accounts. If you go with an account other than a free one, the interest rate will be higher and as long as you have the minimum amount required you should not be charged. Hope I was able to help!
Answer: As always with investments, it depends on your risk adversity. I don't want to repeat the content of hundreds of recommendations here, so just the nutshell:
(For qualified investments,) the more risk you are willing to take, the more returns you'll get.
The upper end is the mutual funds and share market, where you have long-term expectations of 8 - 10 % (and corresponding risks of maybe +/- 50% per year),
the lower end is a CD, where you can expect little to no interest, corresponding to little to no risk.
Investing in shares/funds is not 'better' than investing in CDs, it is different. Not everybody likes financial roller-coasters, and some people mainly consider the high risk, which gives them sleepless nights; while others just consider the expected high long-term gains as all that counts.
Find out what your personal risk adversity is, and then pick accordingly.
Comment: "the more returns you'll get." Um ... no, "the more your average returns will be over the long term but this *will* involve periods of low or negative returns and could involve the loss of some or all of your investment."
Answer: You can do many things:
Risk free:

Move your money to a high yield savings accounts, you can get up to 0.65% (http://netherlands.deposits.org/savings-accounts/)
Buy a CD for 12 months, you can get up to 0.1% (http://netherlands.deposits.org/deposits/)

Risk of losing:

Buy individual stocks (you'll need to open an account at a stock broker)
Buy index funds (which is basically a basket of individual stocks)
Buy mutual funds (more expensive than index funds)
Borrow money to private lenders, for Netherlands, check out https://www.bondora.com and https://www.bitbond.com
Comment: Both of those risk free scenarios really offer no incentive. I mean, 0.1% might as well be zero!
Answer: You might want to just keep it in cash.
For one step further you could do an even split of USD, EUR and silver. USD hedges against loss of value in the euro, precious metal hedges against a global financial problem. Silver over gold because of high gold:silver ratio is high. You could lose money this way. There are some bad things that can happen that will make your portfolio fall, but there are also many bad things that can happen that would result in no change or gain.
With careful trades in stocks and even more aggressive assets, you could conceivably see large returns. But since you're novice, you won't be able to make these trades, and you'll just lose your investment. Ordinarily, novices can buy an S&P ETF and enjoy decent return (7-8% annual on average) at reasonable risk, but that only works if you stay invested for many years. In the short term, S&P can crash pretty badly, and stay low for a year or more. If you can just wait it out, great (it has always recovered eventually), but if some emergency forces you to take the money out you'd have to do so at a big loss.
Lately, the index has shown signs of being overvalued. If you buy it now, you could luck out and be 10-15% up in a year, but you could also end up 30% down - not a very favorable risk/reward rate. Which is why I would hold on to my cash until it does crash (or failing that, starts looking more robust again) and then think about investing.
Comment: S&P isn't the only index. There are many, and in fact most diversified investment plans balance them (stock vs bond, most fundamentally) to reduce risk (at some cost in lost potential for gain; that's always a trade-off).


How to liquefy or extract water from superabsorbent polymer?

Question: I am looking for a good way to liquefy or extract water from superabsorbent polymer. From what I remember it was salt that can liquefy it. Since salt when dissolved will have sodium cation and therefore naturalize the polymer chain making it contract. Is that true?
Comment: Yes.Add some salt on the super absorbent polymer gel and salt can break super absorbent polymer's absorption ability.
For more details, google "soco polymer" or visit socochem.com
Answer: This may be true, but I suggest another type of explanation. If a super absorbent polymer absorbs its maximum in distilled water it is called a fully swollen hydrogel. There are two ways of decreasing the amount of water stored without using heat.
The first one is to increase the salt load of additional water and place the hydrogel within this salted water. The salt in the water will decrease the total water absorbed by the hydrogel and the hydrogel will shrink, giving up some of its water.
A more complete and full way to make the hydrogel to give up its water is the addition of an acid.  Lowering the pH of the hydrogel to below 3.5 will convert all the sodium carboxylates to the free acid form which does not absorb water.  These hydrogels are pH-sensitive, and if you plot pH vs absorbed fluid, you would find a bell curve that starts around 4.5 or 5.0, tops out around 7.5 and decreases as you increase the pH until around 10.5 to 11.0.
Comment: Now I understand, so adding acid is the best way. Where do you get the information from, I want to read more about hydro gel but I can't find much information about it. Thank you.


Why is a v3 extension needed for a X.509 certificate to be used to test HTTPS on localhost?

Question: I'm learning how to test HTTPS locally and found that articles written before ca. 2019 (e.g., 1, 2, 3) contain only a few steps, whereas later posts (e.g., 4, 5, 6, 7, 8, 9) always make sure that v3 extensions are also configured.
Why is this?
Comment: See https://security.stackexchange.com/questions/172440/generate-x509-err-cert-common-name-invalid and additional links at https://stackoverflow.com/questions/61125319/node-js-self-signed-certificate-is-still-showing-as-not-trusted-in-my-browser
Answer: As of 8/15/2023, the reasons seem to be specific to Chrome / Chromium as it won't process self-signed certificates without the following X.509 v3 extensions set:

subjectAltName
See Chromium mailing list post Intent to Remove: Support for commonName matching in certificates.

basicConstraints (RFC 5280, section 188.8.131.52 "Basic Constraints")

CA:TRUE
See this Stackoverflow answer. Couldn't find any official report for this one, and the fact that the OpenSSL line below produces a working certificate (at least, in Chrome 115.0.5790.170), this may be wrong - it may just need to be present.

Path Length (pathlen or pathLenConstraint)
Came across the claim that "Chrome now rejects TLS certificates containing a variable known as pathLenConstraint or sometimes displayed as Path Length Constraint" (1/10/2023), but couldn't find any source substantiating it. (Here's a Stackoverflow answer elaborating on what it does.)

I've been using the following one-liner lately to produce a private key and a self-signed certificate for testing HTTPS in Chrome and Safari:
openssl req -x509 -new -nodes                                      \
  -newkey RSA:2048                                                 \
  -days 365                                                        \
  -subj '/C=US/ST=Denial/L=Earth/O=Dis/CN=anything_but_whitespace' \
  -addext 'subjectAltName = DNS:localhost'                         \
  -addext 'authorityKeyIdentifier = keyid,issuer'                  \
  -addext 'basicConstraints = CA:FALSE'                            \
  -addext 'keyUsage = digitalSignature, keyEncipherment'           \
  -addext 'extendedKeyUsage=serverAuth'                            \
  -out self-signed-server-and-root-ca.crt                          \
  -keyout server-and-root-ca-private.key

Firefox is a whole another story though as it has different rules and also uses its own trust store, effectively requiring one to use 2 key-pairs.

Notes on subjectAltName

X.509 Extensions - IBM Documentation

Certificate extensions were introduced in version 3 of the X.509 standard for certificates. These v3 extensions allow certificates to be customized to applications by supporting the addition of arbitrary fields in the certificate. X.509 v3 extensions provide for the association of additional attributes with users or public keys. Each extension, identified by its OID (Object Identifier), is marked as "Critical" or "Non-Critical," and includes the extension-specific data.

RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 18.104.22.168.  Subject

The subject field identifies the entity associated with the public
key stored in the subject public key field.

Excerpts from How do Common Names (CN) and Subject Alternative Names (SAN) work together? - Stack Overflow

RFC 5280, section 18.104.22.168 says "The subject name MAY be carried in the subject field and/or the subjectAltName extension". This means that the domain name must be checked against both SubjectAltName extension and Subject property (namely its common name parameter) of the certificate.

as per RFC 6125, published in 2011, the validator must check SAN first, and if SAN exists, then CN should not be checked.

To be absolutely correct you should put all the names into the SAN field.

CABForum Baseline Requirements[: ] If there are SANs, then CN can be ignored. -- At least if the software that does the checking adheres very strictly to the CABForum's Baseline Requirements.


Remove Storage iOS Apps on Mac

Question: Is it possible to remove the Mac copy (iTunes/Mobile Applications) of all synced iOS applications (they are already installed on my iOS device)? They are currently taking up about 6 GB of space on my hard drive. I'm talking about the .IPA files. Thanks!
Answer: Quit iTunes.  Then you can go into your "~/Music/iTunes/Mobile\ Applications/" directory, and manually delete apps using the Terminal or Finder.  Before the next Sync, in iTunes control-click to hit the "Reset Warnings" menu item for your device.  During the next Sync, iTunes may ask if you want to (re)copy purchased files from the device.  Just say no.  iTunes will be confused, but the apps will remain on the device, and not on your HD.
It would be better to first make a backup copy of your Mobile Applications directory with Time Machine, or to another HD, before messing with iTunes internal data like this.
Answer: If you remove the .ipa files (hopefully not from the OS X Finder, but through iTunes), you'll reclaim the storage space, but iTunes won't be able to alert you if there's a new update for that iOS app (which may be important if you get your updates via iTunes on your desktop/laptop Macs).
Comment: When I try to remove from iTunes it says "These apps will also be removed from any iPod, iPhone, or iPad which synchronizes with your itunes library". Obviously, I don't want that to happen.
Answer: You could try changing the location of your media library's files to an external drive in advanced tab of preferences. Make sure to also uncheck "Copy files to iTunes Media folder when adding to library". This will prevent imported music from duplicating itself in that iTunes folder.

Remove Storage iOS Apps on Mac


Can the Mitzvah of being fruitful be fulfilled through Yibbum?

Question: If one had children from his late brother's wife, fulfilling the Mitzvah of Yibbum, did he also fulfill the Mitzvah of being fruitful, or do we say that for this purpose they are not considered his children, but his late brother's?
Answer: The פסוק's words וְהָיָה הַבְּכוֹר אֲשֶׁר תֵּלֵד יָקוּם עַל־שֵׁם אָחִיו הַמֵּת (דברים כה-ו) is explained by the אבן עזרא that the firstborn of the יבום should be named after the deceased brother. The רמב"ן proves from בועז that there is no need to do so and says that על פי קבלה the פסוק is telling us that the baby will be a גלגול of the deceased brother. רש"י learns that the meaning is that the one who does יבום gets the inheritance in the father's estate that the deceased would have received. According to none of these ראשונים is there any indication that the child is considered to be the deceased child, and as such there is no reason to assume that the מייבם shouldn't have fulfilled פריה ורביה through this child. However, according to the ספורנו the פסוק tells us that through the child, the deceased brother will have fulfilled פריה ורביה. Your question would indeed be a question according to the ספורנו's interpretation.
Comment: Maybe according to the sforno that's the first child only?


Lotus Notes 8.5 Default Inbox

Question: When I close my email it is showing the inbox, but when I open it the next time it opens into one of the folders not the inbox.  How do I get it upon opening to do so in the inbox and not a folder?
Answer: File -> Preferences,
Basic Notes Client Configuration
Additional Options
Retain View Column Sorting
Hope this helps.
http://twitpic.com/e3w8qk

Lotus Notes 8.5 Default Inbox


Are Ajax requests CSRF safe?

Question: If my Ajax requests set a X-Requested-With header, can I just skip the CSRF check if this header is present? Can I be sure it cannot be forged (with the user session)?
Answer: As long as you don't have a wide open crossdomain.xml (you might have this b/c you host flash content on you site?) or your visitors have old browsers; you should be rather safe. Though I would recommend the use of a "crumb"-token (random value in cookie and the same value in the requests). This b/c flash may set the X-Requested-With and I think that old IE versions allow you to do too (not sure on this one though).
With "can I just skip the CSRF check" I assume you refer to this crumb/token? B/c checking X-Requested-With is a way of checking against CSRF.
Since this header is optional browsers may not always send it, and according to this page they seem to not do it over SSL.
Answer: This is how we solved the problem with JQuery
http://mylifewithjava.blogspot.com/2010/11/implicit-csrf-protection-of-ajax_22.html

Are Ajax requests CSRF safe?


Assign ttyACM to USB

Question: I have a partially similar question like this one ttyUSB? No, ttyACM. How can I assign the usb-device to ttyACM, not ttyUSB?
But mine is a little bit more difficult.
I recently bought a Feather RP2040 Prop-Maker device like this
I work for some time with ESP32 and Arduino devices. And I connected this one to my computer and got readings from the Arduino IDE. I therefore know the device and cable are working fine.
However, it also works as a tiny USB device. The manual states one could upload files to it (it plays music and you are supposed to copy the files via USB).
However when I plug the device it is not recognized as USB device.
calling lsusb I see the device is there (obviously since I can read from the serial monitor in the Arduino IDE)
Bus 001 Device 022: ID 239a:8131 Adafruit Feather RP2040 Prop-Maker

Calling ls -l /dev/serial/by-id it states this
lrwxrwxrwx 1 root root 13 Sep 16 16:57 usb-Adafruit_Feather_RP2040_Prop-Maker_DF6260785F590937-if00 -> ../../ttyACM0

So the device is understood as an ACM device. I thought that made sense since I can program it and read from the Serial connection.
However, I have no idea how I might connect it as a USB device for moving files there.
I had a look at the journal and saw this message:
kernel: usb 1-6.2.4: new full-speed USB device number 23 using xhci_hcd
kernel: usb 1-6.2.4: New USB device found, idVendor=239a, idProduct=8131, bcdDevice= 1.00
kernel: usb 1-6.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: usb 1-6.2.4: Product: Feather RP2040 Prop-Maker
kernel: usb 1-6.2.4: Manufacturer: Adafruit
kernel: usb 1-6.2.4: SerialNumber: DF6260785F590937
kernel: cdc_acm 1-6.2.4:1.0: ttyACM0: USB ACM device
mtp-probe[191599]: checking bus 1, device 23: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.2/1-6.2.4"
mtp-probe[191599]: bus: 1, device: 23 was not an MTP device
mtp-probe[191600]: checking bus 1, device 23: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.2/1-6.2.4"
mtp-probe[191600]: bus: 1, device: 23 was not an MTP device

The only solution I could find is to create a udev rule like that one:
#Adafruit RP2040 Prop-Maker Feather
ATTR{idVendor}=="293a", ATTR{idProduct}=="8131", GOTO="libmtp_rules_end"

And it kind of works that I don't get that error any longer. However the device still doesn't show up in lsblk or so. I can't mount anything.
I should note, I bought an Adafruit Soundboard which is the predecessor of that one. And there I can just plug in the cable and copy files. But it is not programmable so I assume it gets difficult when you want to use the device in 2 different ways - programming the ACM device and copy files on the USB device.
I would be fine to "switch" things, copy files and switch back to the programmable connection if that helps. But how can I tell my system to interpret the device as USB drive?
I'm using Manjaro (Arch) Linux. (And I tried the same on Windows with no success).
Any ideas?
Answer: Alright, I found another document that helped actually.
Turns out there is nothing to do on my system. It's not like I needed drivers or so.
In fact the device itself has to ways of connecting. Another manual stated:

To enter the bootloader, hold down the BOOT/BOOTSEL button
(highlighted in red above), and while continuing to hold it (don't let
go!), press and release the reset button (highlighted in blue above).
Continue to hold the BOOT/BOOTSEL button until the RPI-RP2 drive
appears!

So in case anyone has that problem, this is the (easy) solution actually!

Assign ttyACM to USB


3 monitors with 2 video cards not working

Question: I'm trying to get ubuntu working w/ 3 monitors. I have been given 2 video cards
lspci | grep VGA
20:01:00.0 VGA compatible controller: ATI Technologies Inc RV620 LE [Radeon HD 3450]
25:05:00.0 VGA compatible controller: nVidia Corporation NV44A [GeForce 6200] (rev a1)

I have two monitors plugged into my ATI card which is plugged into my primary PCIe slot, and one monitor plugged into my nVidia card
I have had it working correctly w/ two monitors (dvi|vga) plugged into the ATI card and the nVidia monitor blank. Now I have the nVidia monitor working (dvi) and one monitor from the ATI (vga) working, but I can't seem to get the last monitor on the ATI (dvi) to show anything. Both monitors plugged into the ATI cards show the boot screen, while the nVidia monitor is blank, and work up until the point you are presented w/ the login screen for Ubuntu, then the DVI monitor on the ATI card goes blank and the nVidia monitor turns on and works.
So now I have two screens working, one on each card.  At first glance, it appears that my setup "wants" to work - looking how the wallpaper is rendered.  My left screen is only half covered in wallpaper, while my middle monitor is fully covered, and it looks like the missing quarter of my wallpaper should render on the left half of my 3rd monitor on the right....not sure if that actually means anything.
Kinda like this, where X = wallpaper
 1   2   3
[ X][XX][X ]

Currently I'm seeing this error in my Xorg.0.log file, but I'm not sure where to go from here:
[    24.746] (EE) RADEON(2):  reusing fd for second head

Might I have something wrong w/ my xorg.conf or do I need to do something more to get this to work?
/etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 270.29  (firstname.lastname@example.com

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      "Screen1" RightOf "Screen0"
    Screen      "Screen2" RightOf "Screen1"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Module"
    Load    "dbe"       # Double-buffering
    Load    "GLcore"    # OpenGL support
    # Load  "dri"       # Direct rednering infrastructure
    Load    "glx"       # OpenGL X protocol interface
    Load    "extmod"    # Misc. required extensions
    # Load  "v4l"       # Video4Linux
    Load    "record"    # X event recorder
    Load    "freetype"  # TrueType font handler
    Load    "type1"     # Adobe Type 1 font handler
EndSection

Section "ServerFlags"
    Option "Xinerama" "true"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Dell0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 76.0
        Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Dell1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSectiSection "Monitor"
    Identifier     "Dell2"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier  "RD3450"
    Driver      "radeon"
    BusId       "PCI:01:00:0"
    Screen      0
EndSection

Section "Device"
    Identifier  "RD34501"
    Driver      "radeon"
    BusId       "PCI:01:00:0"
    Screen      1
EndSection

Section "Device"
    Identifier     "GF6200"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusId          "PCI:05:00:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "GF6200"
    Monitor        "Dell0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "RD3450"
    Monitor        "Dell1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen2"
    Device         "RD34501"
    Monitor        "Dell2"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "DRI"
    Mode    0666
EndSection

Answer: There is an error in your xorg.conf: EndSectiSection "Monitor"
Answer: Your 2nd "Monitor"section (labeled "Dell1") is broken.  There is a line that says EndSectiSection.


Is it possible to have independent multiple axes in WPF graphs?

Question: Having independent multiple axes for each series in scientific graphs is very common condition.
The requirement is,
The graph can have more than one series. and each series is associated with separate Y axes and one X axis (Time).
E.g. Y1 axis shows temperature and Y2 axis shows pressure against Time on X axis.
Both axes may show different scales (range min - max) like temperature from 0 to 100 Degree kelvin & pressure from 300 to 900 kPa and accordingly the series will be plotted.
I am looking for open source control or freeware which can provide this feature.
I am trying to use WPF for plotting graphs and studying WPF Tookit & Dynamic Data Display for that.
Please look at FLOT example of multiple axes. I want this feature in WPF.
But I am not able to find feature of independent multiple axes in these controls.
Please help otherwise I have to drop the idea of using WPF.
Thanks in advance.
Answer: As far as Dynamic Data Display goes, I know that it is very possible to implement what you are looking for. You can always just make a new axis object and add it to the plotter's children. You can then interact and map each axis freely. The key to manipulation in D3 is the mapping, so if you have two different data sources, you can plot them on the same graph dependent on the axis that you map them to, and how you map them. Dynamic Data Display should fit your requirement.


UK 6 months visa about to expire

Question: I have a UK tourist visa for 6 months. Am currently in the UK and my visa is about to expire.I have decided to stay in the UK for at least year. Can i renew my visa before it expires while in UK?
Answer: No, you may not extend your tourist Visa for any period longer than 6 months.  The maximum allowed is 6 months.  If your original Visa was shorter than 6 months, then you could apply for an extension up to 6 months from your date of arrival.  But in your case, your six months are almost over and your Visa was for 6 months.
See here for more information.
Answer: UK Tourist Visas are a maximum of 6 months stay within the country. You will have to exit the country and apply for a new visa or if you visa hasn't expired then you can re-enter the country. Although they will be pretty suspicious if you stay for the full 6 months then re-enter.

UK 6 months visa about to expire


My chromium decides to start up each time I boot up computer

Question: After installing few games from humble bundle onto my computer, I noticed my Chromium web browser started to act funny by starting up without being clicked. I reinstalled it, but the issue is not fixed. Can anyone suggest on what I can do next?
Update: I looked at Startup Applications settings and I did not find chromium there.
Answer: Type in the dash "Startup applications" and then search for Chromium and deactivate it.
Comment: If you don't see any app or whatever you looking you should unhide all the applications by typing in a terminal `sudo sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*.desktop` then check Startup applications again and your desired app must appear. Good luck!


Does this sentence' That is so incredulous' make sense?

Question: Does this sentence make sense?
That is so incredulous, I am not sure.
Answer: You have the wrong usage for incredulous which is applied to people.
The Oxford Dictionaries has

incredulous
  ADJECTIVE
  (of a person or their manner) unwilling or unable to believe something.
Journalists were even more incredulous when the fishermen said it was a good deal and they were happy about it.

I think the word you want is

incredible
  ADJECTIVE
1 Impossible to believe.
an almost incredible tale of triumph and tragedy

or the informal use given

2.1 informal Very good; wonderful.
I was mesmerized: she looked so incredible
Answer: Welcome to EL&U. It is grammatical but, in the vast majority of cases it is incorrect. Incredulous is defined by the Oxford online dictionary as

(of a person or their manner) unwilling or unable to believe something

so a thing, with the possible exception of an Artificial Intelligence, cannot be described as "incredulous". If you want to say that something is difficult or impossible to believe the word you need is incredible defined by the same dictionary as

1 Impossible to believe.
2 Difficult to believe; extraordinary.

or, informally

Very good; wonderful.

If a person finds something difficult to believe then they are incredulous but that is because the thing they find difficult to believe is, for them, incredible in the first sense quoted above.


Where is the best place to put a light on basement stairs?

Question: The stairs leading to my unfinished basement are a bit dark.  I'd like to add a simple light fixture to brighten them but I don't know the best place to put it to minimize shadows and glare.  Above the door?  In the ceiling?  At the foot of the stairs?  On the wall?  I've searched the web for a while and I can find code about when you need a light and where the switches need to be but can't find a best practice for fixture placement.
Comment: Foot of the stairs is probably worst shadowing.
Comment: You could get creative with LED strips. All you need is a 12V source. You can easily add a motion sensor as well.
Comment: @Chetan Bhargava  a nice modern solution to an old hard to fix problem.  Single point step lights seemed to always be shining in your eyes if not going up then going down.  Today LED strips are so nice for filling in with out be obtrusive.
Answer: A couple of can lights like bib suggests is the most common way.
An alternative idea would be to install LED strip lights, like the ones designed to replace fluorescent tube lights. If you put in two of the 4 foot variety, you could evenly light the entire staircase.
Answer: Why one fixture?
No matter where you put it, a single fixture can result in a range of illumination, from bright glare to dark shadow. Consider at least two fixtures, one slightly down from the very top of the stairs, and one or more between the mid point and the bottom.
If installing on a flat ceiling, use floods or spots rather than conventional bulbs. These point downward and lessen glare at the top of the stairs.
If you are installing in a sloped ceiling, consider using recessed cans with angled trim. This ensures that the light beam points downward, even on a sloped ceiling, and not toward the descending person's eyes.
Answer: You could illuminate the stair treads themselves with recessed step lights: http://www.homedepot.com/p/Halo-9-in-White-Recessed-Lighting-Step-Light-H2920ICT/100137286
Answer: If you want simple, one light at the top of the stairs above the door, whether on the wall ceiling. It will not blind you on the way down and on the way up, the persons eyes are usually focused on the treads in front or the bottom of the opening the stairs lead to. It would take some hard looking up the stare into the light, unless you are a deer.
If you want fancier, 2 wall sconces that are closed at the top so you do not see the bulb on the way down, spread across the wall on the first quarter and the last quarter. That is looking as the wall as if the wall space was divided up into 4 equal sections, about 6 1/2' above the run of the treads if the ceiling allows it.


What takes precedence: the ETag or Last-Modified HTTP header?

Question: For two subsequent requests, which of the following two headers is given more weight by browsers should one of them change: ETag or Last-Modified?
Answer: According to RFC 2616 – section 13.3.4, an HTTP 1.1 Client MUST use the ETag in any cache-conditional requests, and if both an ETag and Last Modified are present, it SHOULD use both.  The ETag header is considered a strong validator (see section 13.3.3), unless explicitly declared weak by the server, whereas the Last Modified header is considered weak unless at least a minute difference exists between it and the Date header.  Note, however that the Server is not required to send either (but it SHOULD, if it can).
Note that the Client does not check the headers to see if they have changed; it just blindly uses them in the next conditional request; it is up to the Server to evaluate whether to send the requested content or a 304 Not Modified response.  If the Server only sends one, then the Client will use that one alone (although, only strong validators are useful for a Range request).  Of course, it is also at the discretion of intermediate caches (unless they have been prevented from caching via Cache Control directives) and the Server as to how they will act upon the headers;  the RFC states that they MUST NOT return a 304 Not Modified if the validators are inconsisent, but since the header values are generated by the server, it has quite a bit of leeway.
In practice, I have noticed that Chrome, FireFox, and IE 7+ all send both headers, if available.  I also tested the behavior when sending modified headers, which I had already suspected from the information in the RFC.  The four clients I tested only sent conditional requests if the page(s) were refreshed or if it was the first time the page had been requested by the current process.
Comment: Great answer, Thomas. Thanks for providing the official spec and discussing current browser implementations.
Comment: Quoting from section 14.26, **the server MUST NOT perform the requested method, unless required to do so because the resource's modification date fails to match that supplied in an If-Modified-Since header field in the request.**

Looks like If-Modified-Since takes precedence.
Answer: Isn't it more like an "OR" expression. In pseudo code:
<code>if ETagFromServer != ETagOnClient || LastModifiedFromServer != LastModifiedOnClient
   GetFromServer
else
   GetFromCache
</code>
Comment: I think the last modified timestamp should be compared differently, as in:
    if ETagFromServer != ETagOnClient || LastModifiedFromServer > LastModifiedOnClient
Comment: It's an AND statement because the ETag may be weak in which case you could have a semantically equivalent entity and then you fall back on the last-modified header.  Consider a situation where a picture could be re-encoded and we want to say the original and re-encoding are the same despite the fact they are not byte-identical. In this case we want to use the last-modified as a fallback and that is why they BOTH must be consistent
Answer: != is the correct comparison operator. The client is required to keep the literal string received from the server, as conversions can create small differences.  You can not assume that 'newer is better'.
Why?  Consider the case where the server operator reverts a bad version of a resource.  The reverted version is OLDER - but correct.
The client must use the version currently offered by the server; it can use a cached version only if it is the same.  Thus the server must check equality, not 'newer'.


How to Convert Array-like String to Array

Question: I have a string that looks like an array: "[918,919]". I would like to convert it to an array, is there an easier way to do this than to split and check if it is a number? Thanks
Comment: I guess no easier way without split and check.
Answer: Use JSON.parse.
var myArray = JSON.parse("[918,919]");

Answer: You can get rid of the brackets at the beginning and the end, then use:
str.split(",")

which will return an array split by the comma character.
EDIT
var temp = new Array();
temp = "[918,919]".slice( 1, -1).split(",");
for (a in temp ) {
temp[a] = parseInt(temp[a]);
}

Answer: If you use JSON.parse the string must have " and not ' otherwise the code will fail.
for example:
let my_safe_string = "['foo','bar',123]";
let myArray = JSON.parse(my_safe_string)

the code will fail with
Uncaught SyntaxError: Unexpected token ' in JSON at position 1

instead if you use " all will work
let my_safe_string = "["foo","bar",123]";
let myArray = JSON.parse(my_safe_string);

so you have two possibility to cast string array like to array:

Replace ' with " my_safe_string.replace("'",'"'); and after do JSON.parse
If you are extremely sure that your string contain only string array you can use eval:

example:
let myArray = eval(my_safe_string );


Loop.php vs looping inside template file

Question: What is best practice for WP with regard to using loop.php (loop-single.php, etc) versus looping inside the template file? Does it matter with regard to efficiency or ?
Answer: Depends on whether you would use that single-loop in more places. If you're only using it in one place and that will remain the case, do it within single.php, if you're going to be reusing it elsewhere, I'd highly suggest using a single-loop template part.
Comment: Ok. The idea being if it's a loop that will be utilized in many places put it in a separate loop file for central access. Thanks brotha!
Comment: JDV, I also just noticed that WP's default TwentyTen theme uses separate loop files, and TwentyEleven does not. This confused me to a degree .. any short idea on what their thinking was with dropping the loop files?
Comment: To be honest, I don't know their thinking. I know I use a system of different custom post types, and I use the snippets to make it easy to make, for instance, search result pages or other custom listings. What I do is use a theme partial that has the post_types name in it, so I do this:

`get_template_part( 'partials/loop' );`

And then in that loop partial, I do this:

`while ( have_posts() ) : the_post();
 get_template_part( '/partials/short', $post->post_type );
endwhile; // End the loop.`

This makes it very easy for me to make changes to the loop and add CPT's...
Answer: No, it's just a Q of organizing your theme files. It's template vs. template part. Later will do some searching inside your parent & child theme and then include your template part, but that doesn't do much perfomanze decrease.


Proof that you can't disentangle two parties if you only operate on one

Question: Let $A$ and $B$ be two entangled systems. Can someone prove or sketch a proof of why you cant unentangle $A$ and $B$ by only acting on $A$ or $B$ alone? i.e. by only applying $\mathbb{I}_A\otimes U_B$, with $U_B$ unitary.
Comment: Possible duplicate: [Is quantum entanglement maintained after measurement?](https://physics.stackexchange.com/q/556755/).
Comment: In the first version of your question, you did not specify $U_B$, so a projection would be a valid choice. BTW the title of your question does not really match the question itself: *can* vs *cant*
Comment: @Jakob Thanks for the feedback, you're right! I edited that as well
Comment: @Jakob isn't that question about measurements?
Comment: Isn't this question tautological? Entanglement is *defined* as a property that cannot increase with LOCC operations, and thus is mono-tone under any reversible LOCC operations.
Comment: @ComptonScattering I'd say it's more common to define entanglement as the property of a state not being a convex mixture of product states, with its relations with LOCC operations derived from that
Comment: @glS I don't know if that is obviously true. Eg. "entanglement may be defined as the sort of
correlations that may not be created by LOCC alone." (Plenio & Virmani 2006), or "Formally [an entanglement measure] is any nonnegative real function of a state which can not increase under LOCC, and is zero for separable states." (Quantiki)
Comment: @ComptonScattering an entanglement measure is defined like that, sure, but that's not the same as the definition of entanglement. And I'd say you don't define entanglement via LOCC for the simple reason that it's not really trivial to define precisely what LOCC channels look like. You need to introduce quantum instruments and all that to be able to write the structure of LOCC operations. But even just the fact that you need to know the formalism of maps and channels to talk about LOCCs, while entanglement can be defined without it
Comment: @glS defining LOCC operations seems preferable to using nebulous phrases like "The entanglement of $|\Psi\rangle$ is encoded in the Schmidt coefficients" without explanation.
Comment: @ComptonScattering indeed, that's not how entanglement is defined. You simply define entanglement as impossibility of writing the state as convex mixture of product states. The relevance of Schmidt coefficients isn't even particularly obvious for non-pure states. Question is, do you know of a good way to define what LOCC operations are? And I mean formally, not just saying in words "operations that can be implemented with such and such", which is intuitive, but cannot be used to characterise such channels in practice
Answer: If there was some unitary operator factorized as $\mathbb I_A \otimes U_B$ that would send the entangled state $|\psi\rangle$ to a factorized state $|\phi_A\rangle\otimes |\phi_B\rangle$, ie :
$$|\phi_A\rangle\otimes |\phi_B\rangle  = (\mathbb I_A\otimes U_B)|\psi\rangle$$
Then, we would have :
$$|\psi\rangle = (\mathbb I_A\otimes U_B^\dagger)(|\phi_A\rangle\otimes |\phi_B\rangle)= |\phi_A\rangle \otimes (U_B^\dagger|\phi_B\rangle)$$
contradicting the fact that $|\psi\rangle $ is entangled.
In short, factorized unitary operators preserve disentangled states, so they must preserve entangled states as well.
Edit : Entanglement is basis independent. A state is unentangled if it can be written as a product state in some basis, and entangled if it cannot be factorized in any basis.
Comment: Why do you think entanglement is basis dependent? [Cf. this PSE thread](https://physics.stackexchange.com/questions/267293/does-the-entanglement-depend-on-the-basis)
Comment: Thanks for the feedback ! I corrected this typo.
Comment: I'm a bit confused because entanglement **is** basis dependent. So in principle if $|\psi\rangle$ is entangled then $$|\psi \rangle = \sum_n |\phi_n\rangle \langle \phi_n | \psi\rangle$$ can be separable in the new basis. But can't we say that $$\mathbb{I} = \sum_n |\phi_n \rangle \langle \phi_n| \ ?$$Which in turn is $$\mathbb{I} = \mathbb{I}_A\otimes \mathbb{I}_B=U_A\otimes U_B$$
Answer: For a "positive" proof (as in, a proof not by contradiction), write the Schmidt decomposition of a generic bipartite pure state $|\Psi\rangle\in\mathcal H_A\otimes\mathcal H_B$ as
$$|\Psi\rangle=\sum_k \sqrt{p_k}(|u_k\rangle\otimes|v_k\rangle),$$
for some positive reals $p_k\ge0$ summing to the identity, and orthonormal bases $|u_k\rangle$ and $|v_k\rangle$. Note that you can always do it: this decomposition amounts to the SVD of $|\Psi\rangle$ when thought of as an operator $\mathcal H_B\to\mathcal H_A$.
The entanglement of $|\Psi\rangle$ is then encoded in the Schmidt coefficients $(\sqrt{p_k})_k$. This statement can be made precise e.g. via the theory of majorization and its relation to entanglement. What we care about here is simply that separable states (which are equal to product ones for pure states) are all and only those with Schmidt coefficients equal to $(1,0,0,...)$, up to permutation of the elements.
Now, observe that local unitary operations do not affect the Schmidt coefficients. This is trivially seen writing
$$(U\otimes V)|\Psi\rangle =
\sum_k \sqrt{p_k} ((U|u_k\rangle)\otimes (V|v_k\rangle)),$$
and remembering that $\{|u_k\rangle\}_k$ is an orthonormal basis if and only if $\{U|u_k\rangle\}_k$ is, for any unitary $U$.
So, not only local unitary operations cannot disentangle states: they cannot affect the entanglement in any way.
It is worth noting that this is not the case for generic local operations: non-unitary local operations can absolutely degrade the entanglement. The standard example of this being entanglement-breaking channels. An entanglement-breaking channel $\Phi$ is such that
$(\Phi\otimes I)\rho$ is separable, for any (possibly entangled) $\rho$. See this answer for a proof of this.


Correction of mistake regarding votes

Question: How can I upvote/undo downvote of a question/answer/comment which I mistakenly downvoted? Similar is the query about a mistakenly upvoted question.
Answer: Find a way to improve it. After you edited the post, you can change the vote.
If there is no way for that, then bookmark the post and watch, maybe others will later edit it.
If there is no change, then your possibilities were depleted. However, the system is driven by the stats and not by the induvidual votes. Thus, if your votes are based on careful consideration, it helps a lot more, as some rare mistake harms.

Correction of mistake regarding votes


Is the DS version of Four Swords, different than the GBA version?

Question: In this edition of Four Swords, is it different than the GBA version? Or is it the same?
Answer: The DSiWare edition of Four Swords is changed to be playable in single-player mode. The original (a feature of the GBA port of A Link to the Past) was multiplayer-only, requiring 2-4 players to play.
Answer: Kai said the main difference in that the DS version (anniversary edition) is playable in single-player. Other differences, most of which are mentioned on the Wiki page:

Not paired with a game (A Link to the Past)
Multiplayer done through DS Wireless Communications instead of link cable
Two new stages: the Realm of Memories and the Hero's Trial, each with three doors. Each door in the Realm of Memories is based on a previous Zelda game and has more challenging puzzles compared to the other levels. The Hero's Trial is considerably more difficult than the other stages, functioning as a "hard mode." Completing these rewards the Master Sword and Hurricane Spin, respectively, which could previously only be unlocked with A Link to the Past.
Some sound effects and tracks were improved


Outlet not working

Question: Yesterday, I was replacing an old outlet didn't notice it was a metal box, and when I was pulling out the outlet, I hit the side, and it sparked; Oops. Anyways I noticed another outlet in the room was off as well. OK, so the breaker has tripped, right? So I replaced the outlet. Once replaced, I went to the breaker panel to flip the breaker, and no breaker was tripped, so I switched off all breakers and turned them all back on. I tried both outlets again, and neither is working. I checked to make sure there were no GFCI, and sure enough, there isn't, so I am stuck. Would anyone know what may have happened? I am at a loss
Comment: Wait, you were changing an outlet on a **live circuit**?
Comment: What K H says... changing receps live is super dumb, even pros don't do it.  But back to your question... do these wires involve jabbing into a hole, or do they use the side screws?
Comment: You should read up on safe procedures before you do any more electrical work. Some conductor in the system may have burnt out or broken, or the breaker for those receptacles is at another location.  It's best to find out what is on the circuit you want to work on ahead of time for this and other reasons.  If you have a 3 light plug tester, you should test the receptacles you just repaired as well as both sockets on every receptacle in the house.  On rare occasion if a breaker doesn't trip fast enough the breakoff tabs that turn duplex receptacles into split duplex receptacles can burn out.
Answer: Ok what probably happened is the overload found a weak point in the wiring that blew open during the short as the breaker was tripping.
I am not going to brow beat you up about working on a live circuit it should not be done but yes sometimes pros do have to work on live circuits. And pulling out a circuit to test it is quite common.
What you need to do is work back towards the breaker panel.
This failure is very common with backstabbed receptacles you are looking for the receptacle that is failed closest to the panel or the one that is working feeding the failed one.
What you are looking for is the black or white wire to be loose or damaged at a connection point. Wire nut, screw terminal or back stab.
If back stabs are used you may pull out the receptacle (power off) and see nothing wrong then put it back together. In many cases the damage is inside the receptacle and you may be able to pull the wires and use the screw terminals to fix the connection.
If you put things back together without fixing and they work that's great and all but it will fail again and Murphy says it will happen at the worst possible time.
So coming from the panel direction away it will be the last working device or first non working with very few exceptions. If none of the receptacles work it could be in the breaker panel at the breaker or neutral rare but it happens.

Outlet not working


VB.net Auto Restart Application

Question: I have a code here that will start a process and when pressed again it will kill the current process and start a new one(restart).
<code> Private Games As New Dictionary(Of String, Process)

Private Sub GS1_Click(sender As Object, e As EventArgs) Handles GS1.Click
    Dim gameservercfg As String = GameServer1.Text
    Dim Key As String = gameservercfg.ToUpper

    If Games.ContainsKey(Key) Then
        If Not Games(Key).HasExited Then
            Games(Key).Kill()
        End If
        Games.Remove(Key)
    End If

    Dim psi As New ProcessStartInfo
    psi.FileName = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "GameServer.exe")
    psi.WorkingDirectory = System.IO.Path.GetDirectoryName(psi.FileName)
    psi.Arguments = gameservercfg
    Games.Add(Key, System.Diagnostics.Process.Start(psi))
End Sub
</code>
What I want to do is, how to make it auto restart when that gameserver.exe crashes by itself?
Answer: The basic idea that could work in such a scenario is that you save any configuration to a file onto the disk. Then restart the application using
<code>System.Windows.Forms.Application.Restart()
</code>
And on application start event load any data from the disk file where you saved your configuration, if any. For more insight into the topic you may also read these SO posts
auto-restart-and-then-continue-the-sub-in-vb-net
application-restart-puzzling-behaviour-in-vb-net
Additionally you may (1) save your configuration, (2) start a new independent instance of the same application and (3) then end the current instance.
Do not forget to load saved/default configurations from the saved file on application start/restart, if required.

VB.net Auto Restart Application


Is CSRF possible if i know the value of the authorization bearer token?

Question: If i know the value of bearer token of the victim, can i generate a get csrf page and set a custom Autorization: Bearer [token] header?
Answer: If you know the Bearer Token, CSRF is not necessary anymore*.
The purpose of a CSRF attack is to get the victim to send a request (and by extension, to cause an effect), including their own autorization. As a result, the attacker can cause autorized effects without ever knowing the autorization credentials.
If you have access to the Bearer Token, which is what is used to autorize a request (any by extension, an effect), then the server can't differentiate between the attacker sending the request and the victim sending the request.
What if I can't reach the server?
Ah, you've seen the little asterisk in the above title. Sometimes, you are in a position where the victim can access a server - perhaps an internal server - and you as the attacker can't. In such a case, even with the Bearer Token, you will not be able to communicate directly with the server, and you will not be able to abuse a CSRF attack to cause your victim to send a request on your behalf...yet.
Why yet?
We rely on this being impossible because forms can't set custom HTTP headers. We don't know how browsers will be like in 10 years. Some people rely on using PUT for "sensitive" information to "protect against CSRF", and while it is true that you can't use a form to send a PUT request right now, we can't guarantee that we will never be able to send PUT requests via forms.
Likewise, if our security depends on the fact that browsers don't enable us to set custom headers, and nothing else, then our security is effectivly defeated as soon as a browser vendor decides that this is the next cool thing they implement.
Answer: The authorization token alone is often sufficient to impersonate the user, so you likely don't need CSRF at all. CSRF is only typically useful when you don't have credentials, but can get an authenticated user to visit your website.
If for some reason you did need to set a header in a CSRF page, you will likely trigger a preflight request which will be denied, due to same-origin-policy and header checks.


Are real numbers a subset of the complex numbers?

Question: I am having an argument with a friend. I think that in a sense, the answer is no. My reasoning is that in linear algebra, a vector $(a, b)$ is not the same as a vector $(a, b, 0)$ because the first one is in $\mathbb{R}^2$, while the second is in $\mathbb{R}^3$. However I am not sure if a similar argument can be made for real vs complex numbers.
Comment: $\mathbb{R}$ is a [subfield of $\mathbb{C}$](https://en.wikipedia.org/wiki/Field_extension)
Comment: Recall that the set of complex numbers $\Bbb C$ is defined as $\Bbb C=\{a+ib\mid a,b\in\Bbb R\}$ where $i$ is the imaginary unit. You may see each $a+ib$ as an ordered pair $(a,b)$. What is the subset of $\Bbb C$ in which $b=0$ for every element?
Comment: But (a,b,0) is in $\mathbb R^2 \times {0}$.  Is $\mathbb R^2 \times {0} \ne \mathbb R^2$.  In what sense can that statement be meaningful and true?  Does $\mathbb C = R^2$?  Not really as as $a = a + 0i \in \mathbb R$ but $a + 0i \in \mathbb C$ so ... yes, $\mathbb R \subset \mathbb C$ be any  definition.
Comment: To understand the natural embedding you need to look at the ring / algebra structure, not only the vector space structure. The [Hamilton pair construction](http://math.stackexchange.com/a/2658/242) is a normalized version of $\Bbb C \cong R[x]/(x^2+1),\,$ i.e take $\,\Bbb R[x] = $ ring of polynomials with real coefficients, then work modulu $\,x^2+1.\,$  The embedding arises as a composition of two natural maps: $\,r\mapsto r\, x^0,\,$ which maps a real into a constant polynomial, then mapping that to its congruence class mod $\,x^2+1.\,$
Comment: @BillDubuque Not sure you need all that. The embedding $a\to (a,0)$ works rather well.
Comment: @zhw. The point is that if you wish to understand the *ring* (sub)structure then you need more.
Answer: Real numbers are just complex numbers with no imaginary part. Linear algebra can get away with saying "a 2-vector is not the same as a 3-vector" because there is no sense of multiplication between vectors. However, real numbers have multiplication, and the complex numbers extend the reals by adding i.
Comment: "No imaginary part"? I think you mean "imaginary part = 0". Anyway, real numbers are not complex numbers with zero imaginary part, because complex numbers are elements of $\mathbb R^2. $ What is true is that  the set of complex numbers of the form $(a,0), a \in \mathbb R,$ is isomorphic to $\mathbb R$ in every important mathematical sense you could bring to the table.


Can your computer/Steam account get hacked by redeeming a Steam wallet code sent to you by another user?

Question: Another Steam user gave me a Steam wallet code. Can my PC/Steam account get hacked by redeeming that code?
Comment: 1. Please don't edit questions to ask a new question, ask a new question instead.
Comment: this doesnt seem in scope, but im not sure
Comment: Whether it is on-topic or not, the premise of the question seems more suited for Steam Support
Comment: Incidentally, that link is a 404. It has either expired, been removed by the author, or been removed by Pastebin staff.
Comment: @JackAidley Well I'm planning to do that but I think adding the new information is necessary for this question as well.
Comment: Please don't add additional parts to your question, or change your question to ask something different. If you have additional questions, please ask a new question.
Comment: @Wondercricket I can't find anything about it on the Steam Support info and I don't know if you can message Steam Support. Can you message Steam Support? If so, how?
Comment: @Unionhawk Yeah, a friend of mine said he opened the link and had the 404 error too.
Comment: 2. You have SteamGuard active, right?
Comment: @JackAidley Yes.
Comment: Quite aside from everything else, you should be aware that if the code was purchased with a stolen card your account might be at risk of suspended. "Never accept a gift from an unknown user. Any accounts tied to a redeemed gift from a fraudulent source may be suspended." https://support.steampowered.com/kb_article.php?ref=5406-WFZC-5519
Comment: @IreneLiberali What does Steam mean by "unknown"? Do they mean the user is not recognized by Steam because the user's account is some sort of a custom-made account, not made from Steam, something like that, or do they mean a user that you do not know?
Comment: @Diecie I think it's the latter.
Answer: It is possible. One of the methods of account recovery is providing to the Steam support team a game key code or wallet funds code that has previously been redeemed on the account (as per here).
If you redeem the code then the scammer can provide that code to Steam support, as well as proof of purchase, and gain access to your account.
Comment: I've moved these comments [to chat](https://chat.stackexchange.com/rooms/124439/discussion-on-answer-by-joseph-richardson-can-your-computer-steam-account-get-ha). This conversation seemed to be getting a little too long and unwieldy for the commenting system.
Comment: Interesting idea, but the article you linked doesn't necessarily say a redeemed wallet code is the _only_ evidence Steam support requires to prove ownership of an account, only that it's _one_ factor they can use in making that determination. Are there any confirmed cases of Steam support performing account recovery based solely on ownership of a redeemed wallet code with no other evidence presented?
Answer: Possible attack scenario:

Evil person creates a game with a very well-hidden malware. Steam's quality control is very lenient, but not non-existent. So it at least needs to look like a game. The malware needs to be a custom made one so it does not get detected by any known virus scanner (Valve does check every submission using virus scanners). So there is considerable development effort involved.
Evil person pays the $100 listing fee to Steam, using a bank account which can not be traced back to them.
Evil person uses personal information acquired by identity theft to complete the Steam paperwork, so the game gets listed.
Evil person sends you a free Steam key for their "game", hoping you install and run it.

In order to pull this off, Evil Person would need to pay $100, wait several weeks for the Steam Direct process to complete and commit identity theft to avoid getting caught. And it does not scale, because when they send keys to too many users and one of them finds out it's malware and reports it, the game gets depublished and they need to start from the beginning. So it would only be worth it if you are a high-value target and they are sure they can convince you to actually run the game.
Comment: @Fredy31 A while ago there was actually a case of a cryptocurrency miner making it to Steam. It was promptly removed. https://www.eurogamer.net/articles/2018-07-30-steam-game-abstractism-turns-pcs-into-cryptocurrency-miners
Comment: Im gonna take the wild guess that Steam at least for Trojans and Bitcoin miners.
Comment: And I guess now that is added to the scan when you add a game to steam.
Answer: If the Steam Wallet Code you received is of the correct format (which, IIRC, Steam prints in the redeem-wallet-code-dialog) and if you enter it manually into Steam then using that code is safe no matter where it comes from. Steam may or may not accept it, but there's no risk of being hacked that way.
You should, however, not copy-and-paste that code into Steam, since a manipulated code could in theory contain a character sequence that is invisible to you but that exploits a weakness in Steam to hack the application (and by extension possibly your Steam account as well). This "attack vector" is not very likely, but it is theoretically possible.
Answer: You can't have any damage for redeeming a Steam code. As the keys are generated by Steam itself, in order to provide an unique and non repeatable key. Imagine that "GTA V" provide to Steam the key "1234" and "Mass Effect" also provides the key "1234"; Steam would enter in a conflict to redeem one game or another, that's why Steam manages the keys.
This means that the worst scenario is that Steam will return to you a message like: "this is not a valid Steam Key" and that's it, no one get hurt.
Regarding the "Pastebin" link it's a public repository to share code. But before clicking, hover the mouse on the link to see in the status bar the real URL, as it might be different.
Comment: Just because *valid* Steam codes are generated by Steam and are not harmful does not mean that something someone else calls a "Steam key" (and asks you to enter into Steam) could not be harmful. For one, it could have been crafted to abuse a vulnerability in Steam's key parser, cause a buffer overflow error and allow arbitrary code execution within the Steam application. This scenario is not very likely, but is not impossible.
Comment: Note that depending on where you are, the link might show as a redirect on that website which is annoying af bc it means you can't actually see where it's going easily without dissecting the redirect URL and finding to where it would probably lead
Comment: Also: for regular accounts, afaik, Pastes are deleted automatically after X time, so it could just be that they pasted it there a couple of days ago


Who was the first person on record who was killed by a Christian or group of Christians for religious disagreements?

Question: I am trying to learn when did things start to go wrong in Christianity and when did it start to change from a peaceful, loving religious group into a movement that engaged in war and physical repression, including executions, in the Middle Ages. Therefore I was wondering who was the first person killed by a Christian, two Christians or a group of Christians due to religious disagreements.
Comment: Maybe you should ask at [history.se] instead.
Comment: The way the question is worded sounds provoking. I think a better way to ask this would be "under what context(s) did killing in the name of Christ first become an acceptable practice, which groups did it, and how was  it sanctioned?" Since I also don't know of any Christian groups that practice this today, I'd think you'd also ask for when it became unsanctioned again. Unless you do know of Christian groups who officially sanction this type of killing today, which would be worth mentioning.
Comment: @PrashanthSams Christians can be sinners. Murder does not make someone an AntiChrist!
Comment: Jesus taught us to LOVE others; if you say if a christian killed someone, he is truly not a Christian and he is clearly an Anti-Christ
Answer: Your question starts with a couple of assumptions that don't hold up.  First, the earliest Christians had plenty of heated disagreements, starting with doctrinal conflicts over the extent to which the Law of Moses was binding (or not) on Gentile believers.  Chapter 15 of Acts, and the whole of Paul's letter to the church at Galatia, record those issues.  Second, even at the peak of the Inquisitions, only a very small percentage of accused heretics were sentenced to death.
(Please note, I bring these up not to justify anything -- even one killing by the church for heresy was one too many.  I just want to correct some common misconceptions, ones that I used to share until I dug more deeply into the facts.)
That said, the specific you're seeking, THE first person to die for heresy, may be a detail lost to history.  Based on my own very limited research, the earliest major, fatal action against a heretical movement was the persecution of the Donatists during the time of Augustine: Donatism.
It seems there were strong political factors involved, not merely the suppression of a heresy.  And according to the article, even though Augustine argued that the use of force was justified, he later protested the extremes that the Roman authorities were going to.
So to sum it up, TL;DR style:  the use of violence against heresy seems to have come about in conjunction with the church becoming a political force rather than a strictly spiritual organization.
Comment: I also found this link, but I don't have an account at that site to look over the whole chapter.  http://www.oxfordscholarship.com/view/10.1093/acprof:oso/9780199278121.001.0001/acprof-9780199278121-chapter-5
Comment: My first assumption that it was a lovely and peaceful religion comes from Jesus teachings on putting the other cheek, give your belongings to those who ask and forgive and love your enemies, I never said there were no heated disagreements. My second assumption, I said killing machine because just at the start of the Inquisition thousands of Cathars were slaughtered, if I remember correctly.
Comment: "Lovely and peaceful religion," ok.  Your wording at first though was "peaceful, loving religious group."  Not the same thing; one refers to the ideals and principles, the other to the actual behavior of the people.
Comment: My mistake, I intended to say "loving" not lovely.
Answer: Who was the first person on record who was killed by a Christian or group of Christians for religious disagreements?
Undoubtedly the answer to this question would seem to be lost to history. Nevertheless we can go back into the first few centuries of Christianity for a glimmer of evidence to make an answer.
The first person who was murdered by some Christian or group of Christians for religious disagreements, may be a detail now lost to history.

Andrew Stephenson describes late antiquity as "one of the darkest periods in the history of Christianity" characterizing as mingling the evils of "worldly ambition, false philosophy, sectarian violence and riotous living." Constantine initially persecuted the Arians but eventually ceased the persecution and declared himself a convert to their theology. Sectarian violence became more frequent and more intense during the reign of Constantius II (7 August 317 – 3 November 361). When Paul, the orthodox bishop of Constantinople, was banished by imperial decree, a riot broke out that resulted in 3000 deaths. Paul was deposed five times before finally being strangled by imperial decree. Monks in Alexandria were the first to gain a reputation for violence and cruelty. Although less frequent than in Antioch and Constantinople, sectarian disturbances also racked Antioch. At Ephesus, a fight broke out in a council of bishops resulting in one of them being murdered. Gibbon's assessment was that "the bonds of civil society were torn asunder by the fury of religious factions." Gregory of Nazianzus (c. 329 – 25 January 390) lamented that the Kingdom of heaven had been converted into the "image of hell" by religious discord. - Sectarian violence among Christians


Before Tor, VPNs and proxy services, how did cybercrimals remain anonymous?

Question: I have read that they used previously breached machines, but to try to gain access to those machines they also needed some kind of protection right? How did they do it then?
Answer: The answer is quite un-exciting: they didn't need to do anything.
You are talking about a time when there were not a lot of cyber laws and fewer people who could understand or enforce them. So law enforcement only spent their resources on the big crimes.
So, if someone wanted to commit a big crime, they would do what you mention: take over a smaller company/service, wipe the logs (no one would notice), then use that as a launchpad. If they were discovered on the smaller location, they would not have committed a crime big enough to warrant investigation. So, they could do it over and over again as much as they needed to.
No need to get fancy with your "detection evasion techniques" when there is no one watching.
Answer: In the late 1990's, remote administration of UNIX based systems was done almost entirely by telnet and HTTPS was just beginning to gain traction. This should tell you a lot about the security posture of the time.

Unauthenticated SOCKS proxies were available in the thousands. Scanning port 1080 across the internet to find them was trivial.
There were free shell services from a bunch of different providers who didn't know who was using them.
Free dialup subscriptions that didn't adequately require user identification were getting mailed to everyone in my country.
Huge numbers of routers had guest account access with standard passwords for other admins to troubleshoot network issues. These accounts could be used to initiate connections and often had no command logging. Cisco guest:guest comes to mind.
Standard default passwords on computer systems were widespread and easy to scan for. IRIX lp:lp comes to mind.
Open access from universities and public libraries was becoming standard without any identification required.
Email accounts which came with shell access were being issued to entire student bodies with a single default password for all. Account username lists being printed and posted on a wall was not uncommon.
Wardialing for modem banks that could be used to bounce a connection was still effective.

The list goes on and on, but these were some of the more common techniques I heard about. Several well known BBSes would trade lists of phone numbers, IP addresses or credentials for any of the issues listed above. Security and evidence preservation were really not widespread concerns in that era. As described by schroeder's answer, enforcement was further encumbered by lacking precedent, rare forensic know-how and juries simply not comprehending the subject.


How many shiny Pokémon can be caught in Pokémon Emerald?

Question: I have recently caught a shiny, golden Pokémon in Pokémon Emerald leading me to ask is there a limit to how many golden, shiny Pokémon I can catch?
Comment: @Sigma6RPU See: http://gaming.stackexchange.com/a/163050/115226
Comment: there shouldnt be a limit at all. shinies just have a low chance of spawning.
Comment: @ShadowZ.How low are we talking 1%, 2%, 3%, and etc.
Answer: There is no limit to the number of Shiny Pokémon you can find
Shiny Pokémon occur very rarely, but the chance of finding them never drops below the default amount. In Generation 3, there's also no way to increase the chance of finding a shiny Pokémon; therefore, it's a constant 1/8192 chance of any particular Pokémon being shiny. Later Generations have various ways to increase one's chances of finding a shiny Pokémon, and many people have quite a large number of them.
For more information on shiny Pokémon in general, see How do I catch a "shiny" Pokemon.
Answer: There Are 386 Pokemon which CAN be caught as shiny in these games
Hi and welcome to too much information. In generation 3, Ruby Sapphire, Emerald, and FireRed and LeafGreen, the chance of finding a shiny pokemon is 1 in 8192 encounters. This is NOT, however, guaranteed, as after 8192 encounters you still have the same exact chance as before. Additionally, in these games, there are no "Shiny Locks", meaning that if you have the patience, balls, time, and endurance, you can and will be able to Soft Reset any legendary encounter into being shiny. This is also the reason why the only Shiny Mew currently legitimate and legal in any pokemon game MUST be japanese, and MUST be from generation 3, transferred upwards, as generation three japanese games received an event called "Old Sea Chart", which gave players a special event island to travel to, where they could soft reset for a shiny mew.
Finally, in generation three, with enough resources and patience and time, 386 pokemon can be obtained (there are only the first three generations available in the code). Your answer is that There are 386 pokemon which have the possibility of being encountered shiny in generation 3 games
Comment: You seem to be answering "Which Pokémon can be shiny?" rather than "How many shiny Pokémon can I get?"


Are MCMC based methods appropriate when Maximum a-posteriori estimation is available?

Question: I have been noticing that in many practical applications, MCMC-based methods are used to estimate a parameter even though the posterior is analytical (for example because the priors were conjugate). To me, it makes more sense to use of MAP-estimators rather than MCMC-based estimators. Could anyone point out why MCMC is still an appropriate method in the presence of an analytical posterior?
Comment: It's unclear what MAP has to do with this as well. The Bayes estimator is the posterior mean, not the posterior mode. Even when the priors are not conjugate, you can often do some optimization to get the MAP estimator - STAN does this for more-or-less any prior. The point of doing MCMC is to estimate the posterior distribution, which has much more information than just the MAP estimator.
Comment: Can you give an example of this in practice? Note that there is a difference from a prior being *conjugate* and *conditionally conjugate*. In many Gibbs sampling applications, the priors chosen are conditionally conjugate, but the prior itself is not conjugate; for example, consider Latent Dirichlet Allocation.
Answer: No need to use MCMC in this case: Markov Chain Monte-Carlo (MCMC) is a method used to generate values from a distribution.  It produces a Markov chain of auto-correlated values with stationary distribution equal to the target distribution.  This method will still work to get you what you want, even in cases where the target distribution has an analytic form.  However, there are simpler and less computationally intensive methods that work in cases like this, where you are dealing with a posterior that has a nice analytic form.
In the case where the posterior distribution has an available analytic form, it is possible to obtain parameter estimates (e.g., MAP) by optimisation from that distribution using standard calculus techniques.  If the target distribution is sufficiently simple you might get a closed form solution for the parameter estimator, but even if it is not, you can usually use simple iterative techniques (e.g., Newton-Raphson, gradient-descent, etc.) to find the optimising parameter estimate for any given input data.  If you have an analytic form for the quantile function of the target distribution, and you need to generate values from the distribution, you can do this via inverse transform sampling, which is less computationally intensive than MCMC, and allows you to generate IID values rather than values with complex auto-correlation patterns.
In view of this, if you were programming from scratch, then there does not seem to be any reason you would use MCMC in the case where the target distribution has an available analytic form.  The only reason you might do so is if you have a generic algorithm for MCMC already written, that can be implemented with minimal effort, and you decide that the efficiency of using the analytic form is outweighed by the effort to do the required math.  In certain practical contexts you will be dealing with problems that are generally intractable, where MCMC algorithms are already set up and can be implemented with minimal effort (e.g., if you do data analysis in RStan).  In these cases it may be easiest to run your existing MCMC methods rather than deriving analytic solutions to problems, though the latter can of course be used as a check on your working.
Comment: Question - how should I determine optimal parameters choices **given** MCMC samples? Say you have an array in the form of `[(xi,yi)]`. Are the optimal x and y values simply the averages of X and Y, respectively? Or is there a trickier process considering their relationship therein.
Answer: It is unclear to me what you call an analytical posterior $\pi(\theta)$ and hence why this analyticity should preclude one from using MCMC. Even for a posterior distribution that is available in closed form, including its normalising constant, which is how I understand analytical in this setting, there is no reason for Bayes estimates to be available in closed form, as solving the minimisation problem$$\min_\delta\int_\Theta \text{L}(\theta,\delta)\,\tilde\pi(\theta)\,f(x|\theta)\,\text{d}\theta$$when $\tilde\pi(\cdot)\propto\pi(\cdot)$ strongly depends on the loss function.
When the normalising constant $$\int \tilde\pi(\theta)\,\text{d}\theta$$is not available, finding a posterior mean or median or even mode [which does not require to know the constant], most often proceeds through an MCMC algorithm. For instance, if I am given the joint density, when $x,y\in(0,1)$,
$$f_\theta(x,y)=\dfrac{1+\theta[(1+x)(1+y)-3]+\theta^2(1-x)(1-y))
}{[1-\theta(1-x)(1-y)]^3}\qquad\theta\in(-1,1)$$inspired by the Ali-Mikhail-Haq copula: it may be properly normalised (and is indeed), but the conditional expectation of $\Phi^{-1}(X)$ given $Y=y$ under this density, when $\Phi(.)$ is the Normal cdf, is not available in closed form. This is however a question of primary interest.
Note also that the maximum a posteriori estimator is not the most natural estimator in a Bayesian setting, since it does not correspond to a loss function and that closed-form representation of the density, even up to a constant, does not make finding the MAP necessarily easy. Or using the MAP relevant.
Answer: As I read it, this question is asking two somewhat orthogonal questions. One is should one use MAP-estimators over posterior means, and the other is whether one should MCMC if the posterior has an analytical form.
In regards to MAP estimators over posterior means, from a theoretical perspective, posterior means are generally preferred, as @Xian notes in his answer. The real advantage to MAP estimators is that, especially in the more typical case where the posterior is not in closed form, they can be calculated much faster (i.e. several orders of magnitude) than an estimate of the posterior mean. If the posterior is approximately symmetric (which often the case in many problems with large sample sizes), then MAP estimate should be very close to the posterior mean. So the attractiveness of the MAP is actually that it can be a very cheap approximation of the posterior mean.
Note that knowing the normalizing constant doesn't help us find the posterior mode, so having a closed form solution for the posterior technically doesn't help us find the MAP estimate, outside the case where we recognize the posterior as a specific distribution for which we know it's mode.
In regards to the second question, if one has a closed form the posterior distribution, generally speaking there's no reason to use MCMC algorithms. Theoretically, if you had a closed form solution for the posterior distribution, but didn't have a closed form for the mean of some function and couldn't take draws directly from this closed form distribution, then one might turn to MCMC algorithms. But I'm not aware of any cases of this situation.
Answer: I would argue that MCMC methods aren't necessarily inappropriate, even when closed-form solutions exist. Obviously, it's nice when an analytical solution exists: they are usually fast, you avoid concerns about convergence (etc).
On the other hand, consistency is also important. Switching from technique to technique complicates your presentation: at best, it's extraneous detail that may confuse or distract the audience away from your substantive result, and at worst it could look like an attempt at biasing the outcomes.  If I had several models, only a few of which admit closed-form solutions, I would strongly consider running them all through the same MCMC pipeline even if it weren't strictly necessary.
I suspect this, plus inertia ("we have this script that works") accounts for most of what you're seeing.


Mounting large mirror on drywall/studs with unknown brackets

Question: We got a large beveled mirror (50-60 lbs) at a garage sale thinking it would be easy to mount. After we got home we noticed the mirror has 2 brackets near one of the longer edges and I am baffled on how to mount with those. Can anyone help me?
Comment: Leaving this as a comment  as it is speculation on my part. This type of bracketry is typically used for a attaching a mirror to a set off drawers either a bureau or chest of drawers
Comment: There was a horizontal metal bar that went under the metal straps. A pair of vertical metal bars attached to these horizontal ones and attached to the back of a dresser or chest.
Comment: There's more than one way to skin a cat and just because those brackets are on the mirror now doesn't mean you have to use them, you can take them off and come up with a better solution such as a French cleat or D rings and picture wire.
Answer: If there are brackets (straps) on both sides about 1/3 of the way down from the top, then you could use S-hooks in the straps (remove the center clamping screw) and string a heavy steel wire between them. Then hook the wire on a heavy nail into a stud or use one of the new stronger hangers like a WingIt into drywall.
Comment: Thanks for the information. The brackets in the picture are way at the top (around 1/10th of the way down). The mirror is actually on it's shorter edge in the picture, the other bracket is on the same edge below the one shown. Can I install new straps on to the back? Do you think it would withstand the mirror's weight?
Comment: My grandmother had a makeup desk that a very large mirror sat on the straps were just like your photo shows the weight of the mirror rested on the desk the straps were just there to keep it from flipping over, I believe both Mike's and Jim are saying the same thing as this. I would not try to suspend the mirror from those brackets I would purchase mirror clips to screw into the studs on the wall or make a frame. You don't want to be picking up glass shards.


Сardinality estimation of partially covering range predicates

Question: At the moment I'm trying to figure out how SQL Server evaluates the cardinality of range predicates that partially cover the histogram step.
On the Internet, at cardinality-estimation-for-and-for-intra-step-statistics-value I came across a similar question and Paul White gave a rather interesting answer to it.
According to Paul's answer, the formulas for estimating cardinality for the predicates >= and > (in this case, I am only interested in the Cardinality estimator model of at least 120) are as follows:
For >:
Cardinality = EQ_ROWS + (AVG_RANGE_ROWS * (F * (DISTINCT_RANGE_ROWS - 1)))

For >=:
Cardinality = EQ_ROWS + (AVG_RANGE_ROWS * ((F * (DISTINCT_RANGE_ROWS - 1)) + 1))

I tested the application of these formulas on the [Production].[TransactionHistory] table of the AdventureWorks2014 database based on the range predicate using the TransactionDate column and datetime range between '20140614' and '20140618'.
The statistics for the histogram step of this range are as follows:

According to the formula, I calculated the cardinality for the following query:
SELECT COUNT(1)
FROM [AdventureWorks2014].[Production].[TransactionHistory]
WHERE [TransactionDate] BETWEEN '20140615 00:00:00.000' AND '20140616 00:00:00.000'

The calculation was performed using the following code:
  DECLARE @predStart DATETIME =  '20140615 00:00:00.000'
  DECLARE @predEnd DATETIME = '20140616 00:00:00.000'

  DECLARE @stepStart DATETIME = '20140614 00:00:00.000'
  DECLARE @stepEnd DATETIME = '20140618 00:00:00.000'

  DECLARE @predRange FLOAT = DATEDIFF(ms, @predStart, @predEnd)
  DECLARE @stepRange FLOAT = DATEDIFF(ms, @stepStart, @stepEnd)

  DECLARE @F FLOAT = @predRange / @stepRange;

  DECLARE @avg_range_rows FLOAT = 100.3333
  DECLARE @distinct_range_rows INT = 3
  DECLARE @EQ_ROWS INT = 0

  SELECT @F AS 'F'

  --for new cardinality estimator

  SELECT @EQ_ROWS + @avg_range_rows * (@F * (@distinct_range_rows - 1) + 1) AS [new_card]

After calculating, I got the following results:

According to the formula, it turned out 150.5, but the optimizer estimates the predicate at 225.75 rows, and if you change the upper border of the predicate to '20140617', the optimizer will already evaluate 250.833 rows, while using the formula we get only 200.6666 rows.
Please tell me, how does Cardinality Estimator evaluate in this case, maybe I made a mistake somewhere in my understanding of the quoted formulas?
Comment: Sql server 2014 12.0.5 SP2
Answer: SQL Server uses different calculations in different situations. Your example is different from the linked Q & A because your range is entirely contained within a step; it does not cross a step boundary. It is also an interval with two ends rather than one. Writing BETWEEN is the same as writing two separate predicates with >= and <=.
Interval with two boundaries, within a single step
The formula is modified to perform linear interpolation within the step for the number of distinct values expected, and reflect that two range endpoints are now specified (and assumed to exist within the histogram step) rather than one.
Using the histogram steps given in the question:

For the query with BETWEEN '20140615' AND '20140616', the calculation is:
DECLARE
    @Q1 float = CONVERT(float, CONVERT(datetime, '2014-06-15')),
    @Q2 float = CONVERT(float, CONVERT(datetime, '2014-06-16')),
    @K1 float = CONVERT(float, CONVERT(datetime, '2014-06-14')),
    @K2 float = CONVERT(float, CONVERT(datetime, '2014-06-18')),
    @RANGE_ROWS float = 301,
    @DISTINCT_RANGE_ROWS float = 3;

DECLARE
    @S1 float = (@Q1 - @K1) / (@K2 - @K1),
    @S2 float = (@Q2 - @K1) / (@K2 - @K1);

DECLARE
    @F float = @S2 - @S1;

DECLARE
    @AVG_RANGE_ROWS float = @RANGE_ROWS / @DISTINCT_RANGE_ROWS;

SELECT
    @AVG_RANGE_ROWS * ((@F * (@DISTINCT_RANGE_ROWS - 2)) + 2);

...giving 225.75. Changing @Q2 from '20140616' to '20140617' gives a result of 250.833.
Both results match those given in the question.