Can you install vanilla Android on any phone?

Question: I have an Samsung Galaxy S3. TouchWiz is great, but I want to use the vanilla Android OS you see on the Nexus 4. Is this possible?
Comment: Possibly covered by [Flash a smartphone with vanilla Android ROM](http://android.stackexchange.com/q/29394)
Answer: In theory, it should be possible to compile Android from source, with proprietary blobs for the specific device.
In practice, however, this is largely impossible, with the exception of Nexus devices and those from community dev-friendly manufacturers like Sony.
Samsung, in particular, is notorious for providing terribly (un)organized sources, and even the talented hackers of Cyanogenmod team are frustrated, and many have sold off their devices and moved to Sony and Nexus devices.
So, your only realistic option is to install a community ROM like CM10.1. Again, it is not bug-free or fully featured as stock firmware.
Comment: CM is biased towards Samsung and that the creator of CM works for Samsung so he gets all the freebies and rolls out CM more orientated towards Samsung. Yes, Samsung has caused frustration because they are not exactly forthcoming, look at the Exynos chipset which Samsung refused to disclose...and thus CM is not the brightest nor stable either, that last comment is my personal bias of dis-like for CM anyway :)
Comment: You may have your reasons to hate CM so much, but at least get your facts right. Only Steve Kondik works for Samsung, but CM is a huge project with dozens of maintainers. The reason CM has releases for Samsung quickly is because it is the no 1 OEM, which means more users who want custom ROMs, and also more devs who have the device to play with. If you follow CM devs on Google+, you'll see that many have sold their Samsung devices and are starting on Sony. Mark my words, Xperia T and newer will get great dev support soon.
Comment: I know Sony are going to come out the underdogs in this! ;) *nuff said*
Answer: Yes, there's two avenues:

Download a vanilla AOSP ROM that targets SGSIII provided

Your handset is rooted and running custom recovery
Flash the update.zip of that AOSP ROM that targets the same.

Build your own from scratch provided

Your desktop computer, have heaps of disk space and running Linux 64bit
Heaps of RAM, 8Gb minimum, and is a quad core or better
Download the android source from the official code repository.
Populate the device tree that matches your device, with proprietary blobs
Have an hour or two of free time as it takes a while to compile and finally spit out a system.img, boot.img and update.zip
Comment: I'm considering building a vanilla android from source for my phone, but I didn't understand this point: "Populate the device tree that matches your device, with proprietary blobs" - can you please clarify? what do you mean by blobs also?!
Comment: I have bought an Alcatel Hero 2 and I want to have vanilla android on it


Fast multiplication of constant symmetric positive-definite matrix and vector.

Question: Consider the matrix $H=H^T$, $H>0$, $H \in R^{n \times n}$, and the vector $v \in R^n$. In a numerical algorithm, I need to compute the product $b = Hv$. Right now I am following the naive approach:
$b_i = \sum_{j=1}^{n} h_{ij} v_j, i=1,...,n$.
Is there a faster way to compute this product? $H$ is non-sparse and constant (i.e. eigenvectors, eigenvalues, etc. of $H$ are available).
Comment: Thank you everyone. In some of the computing platforms on which the algorithm will run (e.g. microcontroller without FPU), there is no BLAS implementation
Answer: If I understand the question right, by "constant" it is meant that $H$ is a fixed, but arbitrary positive definite matrix.
In general, I don't think that you can compute the matrix-vector product $Hv$ faster than $O(n^2)$. But if $H$ has structure (Toeplitz, Circulant, Strictly diagonally dominant, etc.), or if you are willing to settle for approximate answers, you can compute the product faster ("randomized linear algebra" is a good search term).
A very naive approach is the following: Suppose that $v$ is some vector, and instead of using $H$, you use $H_k$, the top-$k$ rank approximation to $H$. Then, $H_kv$ can be computed in time $O(nk)$. The error of this computation is $\|Hv-H_kv\| \le \|H-H_k\|\times\|v\|$, which is fairly easy to characterize.
Comment: $H$ is fixed and has no special structure. Thanks for the search term.
Answer: In fact, $O(n^2)$ arithmetic operations is not avoidable, in general.
A general result by Winograd (see "Algebraic complexity theory" by Buergisser, Clausen, and Shokrollahi, Sect. 13.2) shows that the for a generic $m\times n$ matrix (all the entries are algebraically independent) and a generic vector one will need $O(mn)$ multiplications and additions (there is a precise formula too, but $O(mn)$ would do for our purposes).
PSD matrices are symmetric, so directly it won't apply t $H$. However, you can cut $H$ into blocks: $H=\begin{pmatrix} H_{11}&H_{12}\\ H_{12}^\top&H_{22}\end{pmatrix}$. Then $H_{12}$ is generic, in general, and, writing $v$ as a block vector $v=(v^1,v^2)$ one has $b=(b^1,b^2)=(H_{11}v^1+H_{12}v^2, H_{12}^\top v^1+H_{22}v^2)$. Now Winograd's result is applicable to $H_{12}$, so you still get $O(n^2)$, as you cannot avoid computing $H_{12}v^2$ when you try to get $b$.
Answer: In practice no, unless $H$ has some additional structure that you haven't told us about (low rank blocks, displacement structure, or similar stuff).
There are some results on faster-than-$O(n^3)$ matrix multiplication (by the way, the exponent has recently been lowered to $O(n^{2.373})$), but as far as I know none of them is actually viable in practice.
Grab the fastest BLAS implementation that you can find for your machine, and use it.
Comment: Actually, as far as I know the Strassen algorithm IS viable in practice for reasonably large sized matrices (how large is "reasonably large" depends on how vectorized your FPU is, historically 100x100 was big enough). This will help the OP, since he can perform $n$ of his multiplications in time $(O(n^{2.7}),$ so $O(n^{1.7})$ per multiplication.
Comment: Federico: isn't the OP asking for BLAS2?
Comment: @Suvrit: I have always heard and used $\text{BLAS}=\{\text{BLAS level 1}, \text{BLAS level 2}, \text{BLAS level 3}\}$. Or am I misunderstanding what you're saying?
Comment: @Federico: I meant that the OP is asking for a matrix-vector multiplication, not matrix-matrix. But as Igor also notes, as do you, if the OP requires $Hv$ for several $v$'s then, yes, it makes sense to start thinking about matrix-mult. algos.
Answer: In practice, on typical desktop computers and server class machines using the x86-64 architecture, matrix-vector multiplication is limited more by memory bandwidth than floating point operations.  This happens because there are no opportunities in matrix-vector multiplication for bringing data in from memory to cache and reusing it before flushing it out of the cache.  Getting a matrix-vector multiply to run at full memory bandwidth is generally quite easy.
As others have pointed out, you might be able to go faster if the matrix has specialized structure (e.g. if it's a Toeplitz matrix you can do the multiplications in O(n*log(n)) time.)
Comment: You can use the symmetry of your matrix to cut the memory traffic in half, but it takes careful coding to get that efficiency in practice.


Part of virtual machine's screen is not visible when resolution changes with SPICE

Question: A virtual machine with Windows 10 as the guest's OS is set up using KVM/QEMU.
Without SPICE, it worked perfectly fine but for clipboard sharing, I followed Arch Linux's Guide. But then it's super annoying since everytime virt-viewer's window size changes, the guest's resolution becomes unexpected and I cannot see all content on the screen.
My qemu parameters:
<code>#!/bin/bash
qemu-system-x86_64 -boot c -m 4.5G \
-drive file=win10.img,format=raw,index=0,media=disk,if=virtio,aio=native,cache=none \
-enable-kvm \
-machine q35 \
-device intel-iommu \
-cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
-smp 4 \
-net nic,model=virtio \
-net user,smb=/home/tek/data \
-soundhw hda \
-usb -device usb-tablet \
-vga qxl \
-device virtio-serial-pci \
-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
-chardev spicevmc,id=spicechannel0,name=vdagent \
-spice unix,addr=/tmp/vm_spice.socket,disable-ticketing \
-display spice-app
</code>
Is there a way to disable SPICE's dynamic screen resolution since I don't find it useful but still retain the ability to share clipboard or fix this weird phenomenon?
The lower right part of the screen is not visible (especially the clock), and my screen's native resolution is only 1920x1080
Comment: Replacing "-vga qxl" with "-device qxl-vga,max_outputs=1" solved the problem for me. https://wiki.archlinux.org/index.php/QEMU#QXL_video_causes_low_resolution
Answer: Adding a comment as an answer:
Replacing "-vga qxl" with "-device qxl-vga,max_outputs=1" solved the problem for me. https://wiki.archlinux.org/index.php/QEMU#QXL_video_causes_low_resolution


Can I use images from the manufacturer's website or other retailers for my eCommerce site?

Question: I run a retail home appliances and cookware store, I want to create an online platform/eCommerce store to expand my business.
So can I use images from the manufacturer's website or from other eCommerce giants?
This shouldn't be a problem because I'm only promoting their product and since I run a retail shop there shouldn't be any legal/copyright issues.
Comment: Where are you located?  Where is your server located?   What country(s) are your customers in?   Copyright laws are not completely uniform around the world and there could be some local quirks.
Comment: Hi and welcome to Stack Exchange! You might also be interested in our sister site [law.se] for Q&A sites more on general law and legal issues, including copyright and trademark.
Answer: No. You cannot. Copyright and trademark law applies no matter what you are using it for or for whom.
But just ask for permission. This removes all ambiguity. Promoting their product that you are selling is in their best interests, too, so marketing may help you.
That said, some companies still want to protect how their product is presented and may not want you doing that if they feel you won't show it in the best light.
Answer: Many manufacturers offer media packages or licenses to their product pictures with specific terms. These can include special contracts, partner status, usage restrictions and so on.
Without expressive permission you would violate IPR rights in almost all juristications. (However the Risk might be low to actually be prosecuted, but that's nothing you want to build a business on)


Is it possible to create an Android Wear app with react native

Question: I have had a play with react native creating ios apps but have not tried android yet. With android you also get 'android wear' for watches etc, will react native work creating apps for those devices?
Answer: React Native does not run on Android Wear at the current time, so you would have to do that code native.
Comment: is it still not possible ? what about android tv, applce tv and apple watch with react-native ?
Comment: More info [can be found here](https://www.quora.com/Will-React-Native-be-capable-of-Apple-Watch-apps)
Comment: Thanks Marcus for confirming that, I had a feeling that was the case since I could find no documentation to support that it would but wanted to make sure.
Comment: more information about react native for TV decices (android tv and apple tv) can be found [here](https://reactnative.dev/docs/building-for-tv)
Answer: Actually, you can try React native vanilla
Comment: I am unable to get it working using Renative(React native Vanilla). The app keeps crashing. If you have used it, can you share a running sample project?
Comment: @vijaykrishna I didnt used Renative before. I plan to use it for hobby project and I wasnt able to find any alternatives actually :(
Answer: Github Project: https://github.com/fabOnReact/react-native-wear-connectivity
Installation
yarn add react-native-wear-connectivity

How to create a WearOS app using react-native

Create a new react-native app using the same name as your Mobile app.
It is important to use the same name because both apps need to share the same package name (AndroidManifest, build.gradle, the project files) and applicationId (build.gradle).

npx react-native@latest init YourMobileAppName

Add the following line to the new project AndroidManifest (file ):

<uses-feature android:name="android.hardware.type.watch" />

Create a new emulator of type WearOS Large round.
Pair the Android emulator with the Wear OS emulator. Follow this instructions.
Start the metro server on port 8082 with yarn start --port=8082
Build the project with yarn android, open the react native dev menu and change the bundle location to your-ip:8082 (for ex. 192.168.18.2:8082).
Repeat the same steps for the Android Phone Emulator and use a different port (for ex. 8081).
Important Note: Before publishing to Google Play, make sure that both apps are signed using the same key (instructions here)

You can now build the app with yarn android. JS fast-refresh and the other metro functionalities work without problem.
API Documentation
Send Messages
import { sendMessage } from 'react-native-wear-connectivity';

sendMessage({ text: 'Hello watch!' });

Receive Messages
import { watchEvents } from 'react-native-wear-connectivity';

const unsubscribe = watchEvents.on('message', (message) => {
  console.log('received message from watch', message);
});


По??? How many meanings does this word have?

Question: So, this word has caused many problems for me. I just can't find any good explanation of this very vague word. Some same that it means moving across the surface of an objects, others say it's like a "distributive" property preposition????? If someone could just provide a detailed explanation on this would, that would be great!
Answer:
Some same that it means moving across the surface of an objects, others say it's like a "distributive" property preposition

It means both of these things, and a number of others. What's more, depending on the meaning, it can agree with dative, accusative, or (very rarely) prepositional. The other meanings include:

"as far as"/"all the way up to" (accusative)

с пятого по восьмое апреля "from 5th till 8th April"
вода была по колено "the water stood knee-high"

"in" (of disciplines and areas of expertise) (dative):

специалист по сумчатым "an expert in marsupials"
чемпионат по хоккею "ice hockey championship"

"after" (residually; this meaning is more pronounced in several other Slavic languages), and hence "based on" (mostly dative):

по роману М. А. Булгакова "based on the novel by M. A. Bulgakov"
оговорка по Фрейду "Freudian slip"
по зрелом размышлении "on serious ('mature') reflection" — this is one of those rare prepositional usages
The по of потом reflects this older meaning of "after".
The list goes on — you also get highly idiomatic things like ночевать по друзьям or ходить по грибы — but the ones above are the most common, in addition to the two you mentioned (which I presume you've already got the hang of.)
Prepositions generally tend to stray far from their original and literal meanings and develop quite a number of secondary ones, but по probably holds the record as Russian prepositions go. It's okay to be baffled by it. And I'm afraid there's really no single meaning of по that could give you an "aha!" moment about all the others.
Comment: Not to forget the famous example "по барабану".
Answer: It's hard to give a short answer concerning meaning of any common preposition. For example, my dictionary states that there are 28 specific usage cases of "по".
Yet quite often "по" is used along with the Dative case to denote that some action takes place on the surface of an object. "По" has no direct counterpart in English since it means both "on" and "over" (like bread and butter).
Note also: "Я мажу масло на хлеб" - "I make bread and a butter"; "Я мажу масло по хлебу" - "I spread butter over bread".


Is Bitcoin Cash more secure?

Question: I found in https://www.bitcoincash.org/index.html that this technology is
the world's most robust blockchain but searching for the details that explains why it is so secure I don't find any information. Some one knows a source that probes why this technology is secure and some technical information about the security implemented on it ?
Comment: Statements like "the world's most robust blockchain" are meaningless marketing fluff and should be ignored.  But you can certainly read about how the currency works and draw your own conclusions about its security.  The main ideas are the same as for Bitcoin, about which much more has been written.  You can browse questions on this site, for instance.
Answer: Bitcoin is secured through proof-of-work mining using SHA256 as the mining algorithm. Bitcoin Cash uses the same algorithm, so the specialized ASIC hardware used to mine one coin, could also be used to mine the other.
PoW coins are susceptible to '51% attacks', which are possible when a bad actor controls a majority of the network's hashpower.
So generally, when considering 'how secure' a blockchain is, we consider how possible, or likely, it is for a single entity (or a group of colluding entities) to gain control of a majority of the hash power available for a coin. The more hashpower a coin has pointed at it, the more secure we can consider it to be. This is because an attacker would need a larger amount of hashpower under their control in order to enact an attack.
From fork.lol, we can see that over the last 7 days, the BTC hashrate has been approx 47.3 exahashes/second, while the BCH hashrate has been approx 1.6 exahashes/second.
By this measure, Bitcoin Cash is most certainly not 'more secure'.
Answer: I disagree with Chytrik: The hashrate and the number of miners are not the only factors that affect security. Here are some other factors:

Frequency of code review of nodes/wallets
Reputation of the companies who create wallet
The number of nodes in the network
Formal verification of software
How well-documented the protocol is (in long term)
Frequency of breaking changes (and other changes)
Code readability and simplicity
Whether software is signed before signed

Which means security is hard to measure.
If you had 1 BTC a year before, and today you open the wallet for the second time and that 1 BTC is still there, miners are not whom to thank.
Comment: Good points, I agree with this, but I think that for coins that share a mining algorithm, the proportion of hashrate pointed at each network is still quite important. But in any case, even if security is hard to measure in an absolute sense, I think that BTC outdoes BCH for every point you mentioned. Ergo, BCH is not the 'most secure blockchain', as per OP's question.
Answer: As Nate mentioned, this is just a marketing statement. Any sane coin would try and promote themselves in this manner. Most are incorrect.
The most basic counter example being that many Bitcoin mining pools have enough hash power to perform a 51% attack on the Bitcoin cash chain. That alone is enough to not qualify it as the "World's most robust" chain.

Is Bitcoin Cash more secure?


240v in with 240 and 120 out of a timer?

Question: We just got our pool up. Opened the salt generator packaging and it is a 220/240v appliance, our pump is 115v with a pre installed plug. They need to be on the same timer. I have read until my head hurts… Does anyone know if I can run 240 into a timer and have one output run to the salt generator from the timer at 220/240 and another to a 120v outlet for the pump to plug into? What model timer? their diagrams are awful for merely semi handy people
Comment: What is the amp draw (or VA) of each of the appliances in question?
Comment: 12 for the pump and the salt generator company said it only uses 3 I was going to do a double pole 20A
Comment: If you can't find a timer designed for 120-0-120 volt service, use a 120 V **AC** relay. A common 120 volt timer could control a power relay for the 240 V circuit, with the coil of the relay in parallel with the 120 V pump.
Comment: Is the pump **only** plug-in? Or can it be hardwired? Many devices (e.g., disposals, dishwashers) can be set up either way.
Answer: Assuming the amps you state are accurate, that should be fine... almost.
You will have 15A load on one pole and 12A load on the other.
Despite totaling 15A, you will need a 20A circuit, breaker and wire.  That is because you are only allowed to plan to load circuits to 80% with some exception. 80% of 20A is 16A, which is fine.
You will need 4-wire hot-hot-neutral-ground wiring from the panel through the timer to the 120V appliance.  The neutral bypasses a 240V timer.
There is only one snag.   You are not allowed to have this specific combination: "the 12A load is hardwired, yet the 3A load uses a cord-and-plug connection".   That is because receptacles are not allowed on circuits where the hardwired load speaks for >50% of the circuit ampacity (20A).
All of this needs GFCI protection, the farther from the pool the better. It might be fed out of a pool panel that has GFCI protection already.  If not, the only way to protect this split-phase combination of loads is with a GFCI circuit breaker in the supplying panel.
Comment: *"the 12A load is hardwired, yet the 3A load uses a cord-and-plug connection"* Actually, it is the reverse. OP stated **our pump is 115v with a pre installed plug** + **12 for the pump**. So that's 3A hard-wired, 12A receptacle. Of course, it may be possible to hard-wire the pump - which may be preferable for a bunch of reasons. Though plug-in has the advantage of getting a "free" convenience receptacle out of the deal.


What is the difference between shareholders' equity, equity, and book value?

Question: I have been doing some reading and I have found that shareholders' equity is equal to the company's total assets minus its total liabilities. Equity is apparently defined in much the same way. Book value is equal to the total assets minus intangible assets minus liabilities. So what is the actual difference between all of them?

Intangible assets seem rather hard to quantify, if I bought a house in a good neighborhood, its location could be called an intangible asset, right? But how do I measure this asset with a monetary value so that I can subtract it from its actual value?
Answer: Equity is defined as

The value of an asset less the value of all liabilities on that asset. [source]

This is a rather broad definition and equity can take on different forms. E.g., for a house, it is the difference between the market value of the house and the mortgage still owned by the owner.
In the context of a company balance sheet, we usually talk about Shareholder's equity, which, as Wikipedia puts it

represents the equity of a company as divided among individual shareholders of common or preferred stock

Contrary to the house example, the market value of a company, is the sum of all shares. And the shareholder's equity is that value (asset) subtracted from liabilities (creditors, etc.). See also this page.
The book value is the value of an asset. But the difference with the Shareholder's equity is illustrated as

To find a company's book value, you need to take the shareholders' equity and exclude all intangible items. This leaves you with the theoretical value of all of the company's tangible assets which are those assets that can be touched, seen, and felt as opposed to things such as patents, trademarks, copyrights, and customer relationships. [source]
Answer: Book value of an asset is the carrying value of an asset in the books i.e. balance sheet of the company. I think you are confusing the definitions of net asset value and book value.
Equity and shareholders' equity are referring to the same thing. Shares are recorded in balance sheet at book value, any additional payments are recorded as paid in capital to account for the difference between market and book value.
So you have a book value for shares and a market value.
Comment: Could you provide an example to hit the point home?


Draw with canvas.draw() a custom class

Question: Im using Canvas to draw what i call a "label" in my app. This "label" has a round shape, an icon and text. I'm currently calling the method canvas.draw() and I just put the params to draw this.
Since my app needs to handle a lot of those labels, i need to create a Class to handle the icon and the text of the label instead of calling the method canvas.draw(Text, Bitmap, paint...).
Is there a way I can do that?
I will post some of the code:
public void onDraw(Canvas canvas){
canvas.draw(Bitmap myBitmap);
canvas.draw(String myText);

And so on.
What i need to do is to use a class as a param to draw with canvas.
canvas.draw(MyCustomClass labelBathroom);

Assuming that MyCustomClass has all the properties and methods required.
Answer: You could wrap this up in either a View or a Drawable.

Draw with canvas.draw() a custom class


Google Android account without Gmail

Question: Recently my grandmother got my uncle's old cellphone, and today I've been trying to set it up for her. It's an LG-P990, running on Android 2.2.2, which can't be further upgraded. In order to have everything run smoothly, but trying to not overcomplicate things, I set up a Google account for her, without Gmail, using her provider based email address. That worked out just fine, and I have been able to get her entire addressbook mishmash into her new Google Contacts.
However, I am not able to get the cellphone to log in to Google, as it simply responds that her account is not a Gmail account. As such, it's unable to sync her contacts etc. I'm guessing that it's due to the device running on an older version of Android, dating from prior to when Non-Gmail Google accounts were an option.
Does anyone know a way to get around this and make the device connect to her Google account, or am I forced to set up a bogus Gmail address for her as well? If so, is there a way to attach the bogus Gmail address to be made to her current Google account, and keep her provider based email address (the one she actually uses) as the main address?
Any help is much appreciated,
Answer: If you setup a gmail account and associate the phone with that, you can simply forward the gmail email to her main email address.
I'm not sure about using the current Google account.

Google Android account without Gmail


Software for getting all files under a web address/directory for Windows

Question: Is there software for getting all files under a web address/directory for Windows?
Does this kind of software exist?
Answer: HTTrack allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer.
Answer: For websites, the hosting server must allow browsing in that directory (so that you can get the list of files). If that feature is turned off, you won't be able to list the files.
You can also connect with FTP using something like Filezilla.
Answer: pretty sure there is a firefox extension that will do what you want. Cant remember what its called unfortunately but it may be worth having a look!
Answer: The Firefox addon ScrapBook might help you.

ScrapBook is a Firefox extension, which helps you to save Web pages and easily manage collections. Key features are lightness, speed, accuracy and multi-language support. Major features are:

Save Web page
Save snippet of Web page
Save Web site
Organize the collection in the same way as Bookmarks
Full text search and quick filtering search of the collection
Editing of the collected Web page
Text/HTML edit feature resembling Opera's Notes


Is there an electric field near the surface of a AC current carrying wire?

Question: Is there an electric field near the surface of a AC current carrying wire ?
I thought that due to varying current the magnetic field will change thus this may induce an electric field in proximity of a wire ( or even not in proximity)
Please corrwct me if i am wrong anywhere
Comment: Can you specify what the current is doing exactly? "A current carrying wire" is too broad.
Answer: Yes when the magnetic field is changing, it will induce an electric field, which will induce a magnetic field, which will induce an electric field, and so on... An electromagnetic wave will be created, which radiates energy outwards into space.


iOS app Cannot connect to Metamask by using WalletConnect protocol

Question: I am using WalletConnectSwift Sdk to connect to MetaMask app and Trust wallet.
But I can rarely see the connection permission popup from MetaMask. Once connect successfully and back to our dapp, I see connection failed from WalletConnect delegate. How can I overcome this issue? Any suggestion or workaround?
Answer: Note that latest iOS made it really buggy to connect from wss:// websocket bridge relay. Use the HTTP version of the bridge relay. Also when your Dapp is on the web, iOS needs the url to be HTTPS for the relay to work.
This might be the case with your Dapp, check once.


HSTS enabled site and Penetration test

Question: I setup our .NET web application so that it has HSTS enabled.  I verfied this by going to https://gf.dev/hsts-test and put in our URL and it shows that HSTS protection is there.
The result shows:

Strict-Transport-Security  max-age=31536000; includeSubDomains

However, our client comes back saying it is still not the case.  They told us while our main URL is HSTS enabled, the test vector URL is not.
For example:

Go to https://gf.dev/hsts-test
Put in https://nvisium.com and click Test Header
Result shows it is HSTS enabled.
Do the test again but put in https://nvisium.com/test.xml  (test.xml does not exist)
Result shows it is not HSTS enabled.

If I put the URL to an existed resource that it passes the HSTS test.
My question is do they have a point? or is this a false positive test in one of the Penetration test software they use?
Playing devil's advocate, I can only argue that if you request a non-existence resource, the web site still sends a response back and that it does not force the client to use hsts.
Comment: You might have better luck asking this question here: https://security.stackexchange.com/
Answer: This same question is posted on security stackexchange and Esa Jokinen answers it here.

HSTS enabled site and Penetration test


Not Working: Allow Guest Checkout = No

Question: I'm using Magento 2.4.3. For some reason, guest checkout is still allowed, even after selecting the Allow Guest Checkout = No setting in the backend. It doesn't show the "Guest checkout is disabled" message anymore. It was working for a while, and then, it seemed to randomly stop working. I have tried changing the setting to Yes and then back to No and then re-indexing and clearing the cache, but guest checkout is still allowed. Any ideas?
Comment: Hi, Try checking the configurations in all store views scope as that field has that feasibility for store views, and try checking in browsers incognito mode also one time.Thanks
Comment: The configuration for all store views has also been changed between the different options without success. Incognito mode still has the same result.
Answer: still no answer to this?  Finding myself in a similar situation at the moment.

Not Working: Allow Guest Checkout = No


Cache Issue, configuration cache is always showing invalidate in the admin panel

Question: Configuration cache is always showing invalidate in the admin panel, even after I clear the cache, it will invalidate again shortly. I'm not exactly sure which error log files to look for this problem.
Comment: I think you should try to disable third party extension and see which extension causing the issue. Still, you are facing any issue. Please let me know.
Comment: is there a way to find out which extension invalidate the configuration cache all the time, without disable them? perhaps from some log files? i have too many extensions installed. Thanks
Answer:
Reasons for Magento page cache invalidated error Based on our
experience dealing with Magento problems, we've seen 2 cases where
Magento invalidates Page cache and users see this warning.

Magento website owners often make changes or updates to products, categories, catalog price rules, static blocks, 3rd party extensions,
etc.
Website owners use cron jobs in their Magento application to update catalog price rules, currency rates, etc.

So, when you make changes to your website, Magento will trigger
events.
There are listeners for these events and they identify that the data
in the database no longer matches the data in the cache.
As a result, this invalidates the cache and displays the warning "One
or more of the Cache Types are invalidated".

Source: https://bobcares.com/blog/magento-page-cache-invalidated/
Comment: @YadhuBabu it can be reindex or cache issue
Comment: Thank you for the info. I'm pretty sure it's the theme setting (infortis/ultimo theme) cause the "configuration" cache always invalid, but not sure how to diagnose or fix the issue. Do you know which database table to look into versus the theme file? Thanks.
Comment: In my website Update any prices on the backend it will not update on the front end. Is this because of this issue?


sp3 hybridisation in carbon

Question: Before $\ce{sp^3}$ hybridisation, does the $\ce{C}$ -atom get excited to $\ce{1s^2~2s^1~2p^3}$ state, as it happens before $\ce{sp^2}$ hybridisation?
What is the energy of the $\ce{sp^3}$ hybridised orbital?
Comment: No it does not just like it does not in the other case. Hybridization is mumbo-jumbo that makes absolutely wrong assumptions, but somehow get correct result in some cases.
Comment: @permeakra hybridization "gets the answer right" because it is applied once the geometry is known. I find it useless for prediction.
Answer: To follow up on Swedish Architect's answer (and Martin's comment):
The energy of an orbital is a poorly defined concept, but what can be measured is the energy it takes to excite an electron from a molecular orbital (or an atomic orbital in some cases-- but that is not relevant for hybridization).  In the case of an sp3 hybridized carbon one may infer something about the 'energy' of the orbital from the bond dissociation energy of of the bond formed by such an orbital (as previously mentioned this is a fairly imprecise use of language, but the concept does have some instructional value).
This reference (http://web.chem.ucsb.edu/~zakariangroup/11---bonddissociationenergy.pdf) provides some of these.  In particular on p4.46 of that reference in the chart, CH3CH3 (sp3) is listed at 410 kJ/mol, while CH2CH2 (sp2) is listed at 427 kJ/mol, and HCCH (sp) is listed at 523 kJ/mol.  this is the amount of energy required to abstract a hydrogen atom from that systems, which is a reflect of how 'strong' the bond is, which is a reflection of how low in energy the 'orbital' is.  In essence, the higher the bond dissociation energy, the lower the energy of the corresponding orbital is.  Since all of the molecules in question here from combinations of the hydrogen orbital with the carbon orbital, as a crude approximation, you can assign a relative energy.
Please be advised, this analysis really only has meaning for trying to teach the concept.  The actual molecular orbital includes contributions from all atoms in a molecule, and the fact that the ethane has more hydrogens than ethene or ethyne is perturbing this analysis slightly.
Answer: sp3 hybridisation is what we call the formation of hybrid atomic orbitals, by the combination of an s orbital and 3 p orbitals on the carbon atom. I think you understand this. However, like in a dative bond, even though one of p orbitals is empty before the carbon becomes hybridized, it can still combine with the other atomic orbitals, to create new hybrid atomic orbitals. So no, the atom doesn't have to get excited to 1s2 2s1 2p3 before hybridization.
Another way of thinking about sp3 hybridization, a more advanced view, is that they are merely a nice simple way of describing the bonding in atoms. If we were to use the molecular orbital approach we would have to keep going back to our computers to work out the MO's. This isn't really needed, unless we want exact energies and a detailed description of the bonding. In the case of sp3 hybridization, say in methane, the carbon s orbital interacts with ALL of the hydrogen orbitals to form a MO. Then the carbon p-orbitals interact with the hydrogen 1s orbitals. Here the case is that several AO are interacting to form one MO. Then the sp3 model can just be said to be a simplification of a more complex interaction of AOs. This hasn't directly answered your question, yet. The carbon atom doesn't have to be excited to the 1s2 2s1 2p3 state to interact like described above.
Your next question. The energy of the sp3 hybridised orbital is not one, but 4 orbitals. The energy cannot really be found because they don't really exist. After they bond, however, the energy changes based on the bond, as they form a new MO, so it may be more useful to know the energy of each MO in the individual case.
Comment: Hybridisation is not an interaction, it is only a linear combination of functions. It can therefore only be a description of a bonding situation and will always be a result of a geometric arrangement. As an hybrid orbital is only a mathematical concept, it does not have a physical meaning and therefore it does not have an energy that may be assigned to it.
Comment: @Martin, yeah I think I badly worded it in the top paragraph, so I've edited it. I also said in my original answer that hybrid orbitals don't have energies, because they don't really exist.

sp3 hybridisation in carbon


Default login credentials are not working Ubuntu 20.04 on Raspberry Pi 4

Question: I installed ubuntu 20.04 64 bit on my Raspberry Pi 4, after boot process at the login screen, username and password won't work. what to do? I am unable to login.
Answer: If you installed the correct Ubuntu version from here and followed the tutorial here, and you are sure that installation is not corrupted, you could try to reset the password.

mount the sd in rw mode on a linux system
chroot to the mounted sd
use the passwd command to change the user password
reboot

OR

mount the sd in rw mode on a linux system
edit the password file i.e.: /mnt/etc/shadow

Editing the password file:
You'll find a row containig
<your_user>:<hashed_password>:14589::::::

like
pippo:$1$9fsdljkel!nFDSfdfasL.blablabla1!54M:14589::::::

just remove "$1$9fsdljkel!nFDSfdfasL.blablabla1!54M" and obtain
pippo::14589::::::

This way user "pippo" will have a blank password.
Don't try to modify root user because he can't login directly on Ubuntu OS.
Once logged on the system just set the password for that user and check if it is set correctly.
Comment: Solved. Thankyou very much. changed passwd file and it worked.
Answer: Directly after 1st boot the username and password (ubuntu/ubuntu) won't work, even though the login screen is shown. After waiting until the cloud-init + SSH-key creation messages are shown it will be possible to log in with the default credentials (ubuntu/ubuntu). This may take a few minutes depending on what model of Pi is being used.
Answer: ubuntu 20.04.2 or greater installed in Raspberry Pi
login > ubuntu
password > ubuntu
documentation > https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#4-boot-ubuntu-server


How can we see the Sun if it is made up of only gas?

Question: So I'm researching if the sun is transparent or not and have found that it is made up of gases. From what I know the gases the sun is made from are transparent. So why can we see the sun if it's made of transparent things.
Comment: Why can you see a candle flame if it's made of transparent things? Because it's hot and glowing.
Comment: @SamuelWeir It is the soot particles in a candle flame that are glowing. And the flame is still transparent - a laser will shine through it.
Comment: @Pieter The flame is essentially plasma - ionised molecules and atoms. There may be particulates (soot) in the flame, but that is not what's making it glow. As for transparency - the ions and free electrons react to the electromagnetic waves so there is absorption and attenuation. It's not very transparent.
Comment: @OscarBravo Have you tried to shine a laser through a candle flame or not? And it really is the soot that glows. Compare the candle flame with the much hotter bluish flame of a Bunsen burner.
Comment: @Pieter The OP was asking about the Sun, not candles. The Sun is largely plasma. Plasma is electrically conducting and so attenuates EM radiation.
Comment: How can you see lightning if it's only gas?
Answer: This has an answer on several levels.
As others have indicated, the physics reason is because the Sun itself is opaque to light; it isn't transparent.
There are many sources of opacity in the gases that make up the Sun. These arise in processes that can be classified as: bound-bound (radiative transitions between bound states in ions and atoms that occur at discrete energies); bound-free (transitions of electrons from bound to free, or ionised, states and vice-versa - e.g. photoelectric effect); or free-free (involving the acceleration of free electrons - e.g. inverse bremsstrahlung).
Bound-free and free-free processes produce absorption over a continuum and if you have enough gas, then it becomes "optically thick" (has an optical depth much greater than unity) to radiation. That is, a photon has no chance of passing unabsorbed through the Sun.
Now the next part is determining what the Sun looks like. Because it is roughly in thermal equilibrium and opaque, the sun emits (roughly) blackbody radiation. The temperature of the blackbody is the temperature of the upper layer of the Sun's gas where photons are able to escape (the Sun gets hotter as you move inwards). This is somewhat wavelength dependent, which is why the spectrum of the Sun is not a perfect Planck function. The opacity source that is mostly important here is continuum opacity due to bound-free transitions with H$^{-}$ ions (Wildt 1939). In the Sun this leads to a relationship between temperature and optical depth such that photons escape the "surface" from gas that is at around 5800K. The escaping blackbody radiation peaks (by Wien's law) in the visible part of the spectrum. This layer is what we refer to as the Sun's photosphere or visible "surface".
Why can we see this radiation? Well that's down to the development of the eye and evolution.
Comment: Is it really important that the sun is opaque? For example, is glowing heated glass opaque? I would think that opaque or not, we see the glow. (As an aside it's quite good that (at least the outer layer of ) the sun is opaque so that we are not exposed to the radiation produced in the core.) As another aside, almost everything besides the vacuum is opaque when it's hundreds of thousands of kilometers thick.
Comment: @PeterA.Schneider It is a truism that you cannot see things if they are transparent. An "optically thin" gas is almost transparent. The spectrum is entirely different and nothing like a blackbody.
Comment: With all due respect -- I thought "transparent" means "does not absorb nor reflect", so it won't heat up from absorption and it won't be visible *by means of reflecting ambient light*. It may well *emit* light and hence become visible, may it not? Take a laser, gas or solid: The material must be pretty transparent (at least at the given wavelength)  because the light must be able to travel between the mirrors many times without too much absorption, but the laser is still pretty well visible. (Though it's not exactly blackbody radiation, granted.)
Comment: @PeterA.Schneider we are talking about things (stars) that are in thermodynamic equilibrium. What you propose is not feasible for such an object and indeed the example of a laser is as far from a thermal equilibrium/blackbody situation as it could be.
Comment: I see; because of reciprocity only matter which absorbs at a given wavelength emits radiation from heat at that wavelength... that should indeed mean that glass becomes intransparent (or glows only faintly) when heated to, say, 1300K. Interesting. I would *still* say that opacity is not a reason but a consequence of being in a state which leads to heat radiation emission, but one may argue that the two are inextricably linked.
Answer: when electrically neutral, gases are transparent. the gases that form the sun are so hot that their outermost electrons have been torn loose (this is called ionization), rendering the gas electrically conductive. light cannot travel through anything that is electrically conductive, so you cannot "see" through the sun even though it is made of gas.
to clarify: I meant transparent at wavelengths your eye uses to observe the sun.
Comment: Neutral gases (I assume you mean un-ionised) are not necessarily transparent. Certainly not at all wavelengths. Pedantically, it is also not possible to arrange for a gas to have exactly zero ionisation unless it has zero density and zero temperature. So all gases have some opacity and then it is simply a question of how much of the gas there is. The Earth's atmosphere is mostly "neutral" but we can see that.
Answer: It is actually made up of plasma. Plasma means ionized gas. The Sun is a big ball of hot ionized gas and we can see it because it emits light. As Samuel said, we can see a candle flame because it is hot and it is glowing.
The main process that happens in the Sun is proton-proton fusion. There is a chain of processes in which the protons inside the Sun collide and fuse into Helium. In these processes there is a release of energy in the form of charged particles, neutrinos and light.
Comment: And significantly plasmas are opaque to light!
Comment: Well, it becomes irrelevant whether or not the plasma is opaque to light if itself emits light.
Comment: @pathintegral The Sun emits a black-body spectrum because it is opaque. Kirchoff's law.


How tall should I build my minecraft mob farm?

Question: My first attempt at a mob farm seems to have been too close to the ground. I wasn't getting very many mobs. When I killed mobs at ground level, more mobs would spawn in the mob farm. How tall should I build the next one so that it isn't affected by mobs on ground level?
Answer: For an exp farm your mobs will have to fall 24 blocks to be killable on one hit. That way you get the xp and the special drops.
For mobs to spawn very efficiently you want to be 128 blocks away from any other potential spawning points for them (blocks with block light lower than 8), so you should be 128 blocks above the highest block in an 128 x 128 area around your spawner.
Answer: I think the best would be around 24 blocks for the floor. This way you can one hit them and get the exp. you can also add more levels on top of that.
Comment: Not looking for a xp farm, I already have that going with a zombie spawner I found. Trying to find the minimum distance from sea level.
Comment: Okay. Than increase the highly by one or two and have the lowest point where the die as a hopper directed to a chest.
Comment: Sorry I missed some info. For the mod to die it should be 25 blocks I believe. You can make the spawn part larger as well either spawning pads. I think 6x6 is the usual. With half slabs cover the whole pad.
Answer: After finding a couple other related discussions it looks like building up 128+ blocks might do the trick.


Traditional firms vs. Computer managed firms for investing

Question: What are the  short term (3-5 years) and long term (5-15years) advantages/disadvantages traditional vs. Computer managed investment firm.
Comment: by computer managed to you mean a index tracker vs a fund that makes active choices - all investment companies use computers these days
Comment: What do you mean by "investment firm?"  I interpret it as broker (so you are asking about discount vs traditional brokerages) but others seem to be interpreting it as an index fund vs mutual fund question.  I wouldn't say index funds are necessarily more "computer controlled" than mutual funds.
Comment: Are you asking about so called Robo-advisors like Wealthfront/Bettermint?
Answer: If by "computer" you mean index: traditional funds charge much higher fees. That means they have to do that much better than the index funds just to be equivalent, and preferably better.  In many cases they really don't, making the index fund the winner.
BUT that's a generality, which may not aply to any specific fund or funds. Do your homework.
Comment: Thanks. I will do my homework. Index funds us what I was referring to


I don't know what the green player is in warthunder

Question: what is the green player? I am new really enjoying the game but it can be confusing.
Answer: As @Jcraft153 was saying in the comments above.  The green players are in your Squad that you are (as of the Patch 1 year'ish ago) automatically assigned to at the beginning of each match.  This is all according to Good Ol' Reddit.  It can be toggled on and off in the settings.  BUT it is a good feature to keep on because you receive a "Teamwork" bonus if in close proximity of your Squad mates during a firefight.  I hope this helped!  Happy Hunting!
Answer: They are your squadmates. You are suppose to work together with them. And when you do, you share some of the reward points. There is also a reward for the best team in the match.
Comment: you can also squad up with your friend(s) before spawning if you wish


Reserved word in XML parsing?

Question: I have the following:
<?php

#Load in File
$xmlUrl ="http://sports.espn.go.com/espn/rss/mlb/news";
$ConvertToXml = simplexml_load_file($xmlUrl);

# -> Setup XML
$newsStory = $ConvertToXml->channel;

# -----> Load News Stories
for($i = 0;$i<sizeof($newsStory); $i++){

    // Source of Article Info-->
    $SrcTitle=$newsStory[$i]->title;
    $SrcLink=$newsStory[$i]->link;

    // Actual News Article Info -->
    $title=$newsStory[$i]->item->title;
    $desc=$newsStory[$i]->item->description;

    echo '
';
    echo ''.'Title:'.$title.''.'(via: '.$SrcTitle.''.'
';
    //echo 'Link:'.$link.'
';
    echo 'Description'.$desc.'
';
    echo '
';
}

It outputs just 1 result when it should output about 10 results...
This line: $SrcLink=$newsStory[$i]->link; the "link" word appears to possibly be a 'reserved' word here since its purple on my editor as shown in the image below:

What am I doing wrong here?
Comment: It's not reserved, your editor just thinks you're invoking [`link()`](http://php.net/link).
Answer: Not sure why your IDE is highlighting that purple, but here is the problem:
$newsStory = $ConvertToXml->channel;

needs to be changed to:
$newsStory = $ConvertToXml->channel->item;

Each entry in the RSS feed is in an <item> tag so you need to be looping over those for the actual feed entries.
Comment: Great help! Appreciate it Drew!
Comment: You're welcome.  Meant to add it earlier but, the `channel` data is feed specific information.  So the `title` and `link` you were printing were the feed title and feed URL.  Beyond that, each `item` is an entry in the feed.  That's why you were seeing 1 thing get printed out before.
Answer: Colour-coding often suffers from this problem. Since the word is being used as a property name (as shown by the ->), it can be literally anything - there are no reserved words in this case.
I would suggest var_dump(count($newsStory)) so you can see exactly how many elements there are to loop through. If it's 1, then you probably have an issue with your $newsStory variable - you can var_dump that too.

Reserved word in XML parsing?


Booting Windows from HDD, apps from SSD

Question: My question is that, if my OS is on HDD and I install something on SSD, for example a game, will the game start&load faster or i need to install my OS on the SSD?
Answer: Basically from what I know:
Games installed on an SSD, means all the files from the Game are located on your SSD, load faster, yes.
But there are a few more things to think of. For example, if you install a game with steam, some files are still located on the disk, where the OS is installed, means the difference is not that big.
Comment: The problem is that my OS is burnt on my motherboard. I can't reinstall it. So i guess my best option is that I install my games on SSD and it may load up faster.
Comment: @Deddj since you can't change anything related to your OS, this would be the simpliest and best option you could go with... there's not really more that you could do...

Booting Windows from HDD, apps from SSD


How to calculate node voltage in this circuit

Question: I came across this circuit snippet as part of a larger schematic.  It's intended to adjust the trip point of the comparator as a means of testing the overall circuit.  My question is: how does one calculate the value of R3 to achieve a specific voltage at node A when switch S1 is closed?  It looks like a combination of parallel resistance and resistor divider analysis, but I can't solve it.  Thanks!
Comment: Step 1: replace the 14 V source, R1, and R2 with a thevenin equivalent circuit.
Comment: Please post a link or citation to the original document.. Folks here are more willing to answer then,
Comment: Eric, discussing that circuit as a comparator (it's not, really, as there's no hysteresis present) when all you are really asking about is how to compute the Thevenin equivalent in two cases: switch closed and switch open. What are you really on about here?
Comment: Need a resistor at the output ...
Comment: @ThePhoton, thank you very much for your comment.  It was exactly what I needed.  You gave me just enough information to know what to search for.  That search led me to learn something new, and that knowledge answered my question.  Much appreciated!
Answer: From the datasheet ... Outputs are "Open Collector".

So, if you wire a resistor at output, it will respond ...
If my R2 = 22 kOhm (max), it will be ok.
Comment: I probably shouldn't have included the comparator in my schematic at all, as it's not really the focus of my question.  In the larger schematic, the comparator's output has no connection to its inputs (no feedback); it simply switches the next portion of the circuit.  I'm sorry if including it caused confusion about what I was asking.  All I really wanted to know was how to calculate R3 to achieve a desired voltage at node A.  The comparator isn't involved.
Answer: Thanks to a comment posted by @ThePhoton, I found a tutorial at All About Circuits on how to use Thevenin's Theorem to perform a DC network analysis.  To do that, I re-drew my circuit (below) to eliminate the comparator (it was an unnecessary distraction from my question in the first place), then went through the steps in the tutorial.  Luckily, my re-drawn circuit was a very close match for the circuit used in the tutorial.


Android Service notification

Question: I got a problem with a service: I'd like to create a notification that say to the user that there's no location provider, this is my code:
Notification notificationNoProvider = new Notification(R.drawable.icon, message, System.currentTimeMillis());

Intent notificationIntent = new Intent();

PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, 0);

notificationNoProvider.setLatestEventInfo(this,message,message, pendingIntent);

notificationManager.notify(message.hashCode(), notificationNoProvider);

The application gives me a NullPointerException in the getActivity method of PendingIntent.
I tryed also with getApplicationContext instead of geBasecontext but the application still explode.
I've found that the problem is at this line of getActivity:
public static PendingIntent  [Search] getActivity(Context context, int requestCode,Intent intent, int flags) {
    String packageName = context.getPackageName();//here the application explodes

How can I solve this problem?
Thanks
Answer: How about calling:
startForeground(id, notification);

from your service?

Android Service notification


VHDL language IDE

Question:
Possible Duplicate:
Professionnal VHDL IDE ?

can anybody tell me IDE where i can write VHDL codes?
Comment: What platform do you want to use it on? Windows, Unix, MAC OS?
Comment: I suggest Emacs with electric-mode, it is definitely designed for VHDL.
Answer: Xilinx and Altera both have IDES available for free download.
At least as of a few years ago when I was using it regularly, the Xilinx software didn't handle updates well at all -- to the point that if you decide to use it, I'd recommend installing it in a virtual machine, and if you ever decide to update it, do a clean install into a fresh VM image.
Answer: Your simulator software should have a primitive ID. Xilinx, Altera, Cadence, ModelSim all have primitive VHDL and Verilog IDEs.
Actually, most HDL developers I've worked with don't use the IDEs except for non-HDL related tasks like top-level schematic capture, routing, and analysis.  On the teams I've worked on, Notepadd++ was popular, as well as Vi and Emacs.  I never had a license for it, but one partner company used Visual SlickEdit for all of its editing.  It seemed like a nice tool.
Answer: We used Cadence when I was doing my EE undergrad. No complaints (which is rare for university-provided software).

VHDL language IDE


Archive manager which has integration into Nemo except File Roller (Archive Manager)?

Question: I mean something like "Extract Here" and "Compress..." menus on right-click.
Answer: Actually, Nemo can be integrated with the default archive manager shipped with Unity. Webup8 provides Nemo with a series of extensions that integrates it tightly with Unity. The steps are:
<code>sudo add-apt-repository ppa:webupd8team/nemo
sudo apt-get update
sudo apt-get install nemo nemo-fileroller
sudo apt-get install nemo-compare nemo-dropbox nemo-media-columns nemo-pastebin nemo-seahorse nemo-share nemo-emblems nemo-image-converter nemo-rabbitvcs
</code>
After this, among many other improvements, you should have the "Extract Here" and "Compress..." options in the context menu.
Comment: https://imgur.com/RW46TKW


How would roads and buildings be constructed if universe does not allow parallel lines?

Question: Imagine we are living in a parallel universe where the parallel lines can only exists as imaginary lines just not in the real physical world, how would road and skyscrapers work in such a universe?
Comment: It all depends on what you mean by "parallel lines cannot exist in the real physical world". For that matter, how do straight lines (which are an abstract mathematical concept) exist in *our* universe?
Comment: depending on how you define "parallel lines", any curve could be fair game. So... are we talking about [Non-Euclidean geometry](https://en.wikipedia.org/wiki/Non-Euclidean_geometry)?
Comment: They wouldn't, because life wouldn't exist.
Comment: I love this question, but it needs a lot of clarification to be answerable. Specifically: What constitutes a line? Are we talking different geometry space (so just non-Euclidean parallel lines are banned) or are we talking Euclidean geometry where no two edges of any object can run parallel? If the latter, what constitutes an object? How does physics resolve this? Please fill in these details so the community can help you flesh out this interesting idea.
Comment: 1) Look at a globe: Lines of longititude always intersect.  2) Roads & buildings don't have to have (and in practice don't have) lines that are perfectly parallel out to infinity, they just need to be approximately parallel for some distance, whether it's meters or hundreds of km.
Comment: Do parallel lines converge or diverge?
Comment: @BMF: to make it more interesting the lines would never meets.
Comment: Note, in particular, that there are no parallel lines on a sphere. We seem to be doing alright so far.
Answer: Almost nothing on Earth is perfectly parallel.
Let's explore why with a few thought experiments.
Two people start on Earth's equator, facing the North pole. They are separated by 90 degrees of longitude - perhaps one person is in a boat on the Atlantic, the other on the Pacific. Since North is exactly perpendicular to each person, their lines of sight are perfectly parallel. They continue forward until meeting at the North Pole. Fascinatingly, their parallel paths of travel converged - because spherical geometry is non-Euclidean. This is true of any two "parallel" roads on Earth: they are not parallel in the traditional sense because they will meet at a finite distance - yet they are still geometrically parallel. If you really want to keep roads equidistant, you have to curve them and cut out some distance, which is why lines of latitude can appear "parallel".
Two carbon-nanotube skyscrapers of infinite structural strength are built next to each other. Their bases are congruent and parallel. They are expanded upward, all the way to the moon's orbit. As height increases, the distance between them increases, because they are perpendicular to the Earth's surface - which is curved, not flat. Even the two sides of each individual structure would begin to diverge, if not artificially curved inward - and this is true on Earth.
As long as your universe has spherical planets, these phenomena will operate in the same way. This is one characteristic of manifolds: they appear Euclidean (flat) locally, so you can draw parallel lines that appear to stay equidistant from each other to infinity. That doesn't mean parallel lines act "parallel" forever in our universe.
There are countless more examples; consider that light bent around black holes travels in a "straight line" despite being guided along the curved path of space-time. Everywhere in our universe has some amount of gravity; no path, nor any set of two lines, can be straight or equidistant forever even here.
Comment: @Kepotx Although Earth is curved, the universe is not. Things not dependent on the surface of the earth for its structure (e.g. a book) could still have parallel lines. Likewise precise levels could be used to build a flat foundation so support beams in a single building can be parallel. This is why the example used two skyscrapers instead of the support beams in a single skyscraper.
Comment: "Almost nothing on Earth is perfectly parallel." Why this `almost`? If I undesrtand well enough the body of your answer, there are no structure on earth that isn't curved
Answer: Lots of Curves
Rather than assuming your parallel universe cannot have parallel lines, I'm going to assume it's in this universe, but parallel lines are a major cultural taboo and people go to great lengths to avoid them. (so physics works)
Architecture would likely use curves to avoid parallel lines. Skyscrapers could be built as cones or domes, and if necessary the floors could be slightly angled. Elevators would need to ascend on a curved path, possibly just attached to the outside of the building, with spiraled ramps leading up between levels.
Your city grid would likely be concentric circles with interconnecting lines. As long as the lines are (roughly) perpendicular when they connect to the rings, they will never be parallel no matter how many are added.
Comment: Well... a line is a circle with a radius of infinite... At some point, the circles are so large that for all means and purposes, the rings could be considered parallel rectangles.
Answer: There's a chance that our own Universe doesn't accept parallel lines
Lastest astronomical findings may point to the fact that our Universe is not flat, but actually curved on itself, and is a matter of heated debate. On a small, human scale, it means nothing, but in the big scheme of things it changes the development and eventually death of the Universe (a "Big Crunch" in this case). So, if the Universe is curved on itself, parallel lines are actually impossible, they will eventually collide on one point, they only appear parallel because the scales are short.
Your Universe can be also curved, maybe even more than ours making this effect measurable in relatively shorter distances.
Comment: I saw the articles about this. This is from the author's initial post - a discovery should reach an accuracy of at least five "sigmas" to be accepted by the community. Here we are slightly above three sigmas, so we are clearly below this acceptance level. - Keep in mind it is contradicting several studies that are above the 5 sigma level, so don't update your textbook yet.


How does Magento 2 Inventory work when an order is placed?

Question: I am confused about how Magento 2 inventory works when an order is placed. What if I have only one qty stock for a product and there are two people who make an order for this product at the same time. What happens when the product is added to the cart? Will the stock get reduced?
Answer: The deafult behavior is that the stock is reserved when the order is placed (not when the product is added to the cart).  Only the first customer will be able to finish checkout process. Right after order placement quantity remains the same BUT saleable quantity decreases (in your case qty = 1 and saleable qty = 0). When you ship the order the qty decreases. When you cancel the order, saleable qty increases back to 1.
Answer: Salabel quantity work flow :

Let's assume that product is : 24-MB01

There are 2 warehouse : 1) India 2) USA

Now we have 20 products in stock and 20 salable products where, India warehouse has 12 qty and USA warehouse has 8 qty.

1 customer bought 5 items of the 24-MB01 product. So, there are 5 items will be reserve to be deliver. That's why now salable qty will be 15 (20 – 5 = 15) & qty will be 20

Before invoice create, That customer return 3 items from 5 items which they order items. The salable qty is the sum of all reservation of that product. That's why now salable qty will be 18 (20 – 5 + 3 = 18) where 20 is total qty, 5 is order items and 3 is return order items.

After invoice create and shipment create, you need to reindex and then, 2 qty will be decrease from qty column. Now, qty will be 18 and salable qty will be 18.

Reference : Click Here


Is it possible to enact legislation eliminating life without parole without first repealing an existing truth in sentencing statute?

Question: I would like to advocate for legislation within my home state of New Hampshire which would allow for a parole hearing for anyone having served 25+ years.  Such a law would eliminate life without parole for present and future such convictions.  Is such legislation that effectively overrules a court imposed sentence even allowable?  (I realize there have been supreme court actions to constrain the death penalty but perhaps that's different because it's a constitutional matter(??)) To complicate matters further, an existing NH truth in sentencing statute would seem to conflict with the notion that any such change is possible.
Comment: We cannot advise what you should do, or how you should present such a proposal to a legislator., The politics stack might have some advice on that.  We can answer on the effect of the various legal provisions involved.
Comment: Legislatures have legal experts on staff to help them draft legislation.  If they can be convinced that this is good policy and politically acceptable, they should have no trouble drafting legislation to implement it, and resolving conflicts with existing legislation.  If it turns out that the truth in sentencing law would need to be repealed or amended, well, the legislature certainly has the power to do that.
Answer:
Is such legislation that effectively overrules a court imposed
sentence even allowable?

Yes. Amnesty legislation is allowed.
For example, the U.S. Congress recently passed such legislation with regard to crack cocaine sentences. Legislation changing sentences for crimes is presumed to be prospective only, but this presumption can be overcome with clear statutory language to the contrary.
As a political matter, however, district attorneys usually lobby strenuously against amnesty legislation, feeling that it sets a bad (political) precedent.

an existing NH truth in sentencing statute would seem to conflict with
the notion that any such change is possible.

In the event of a direct conflict between an older statute and a newer statute that can't be resolved by any other interpretive method, the newer statute prevails over the older one, even if this result isn't expressly identified in the legislation.


Prove that $n$th cyclotomic polynomial has no roots modulo $p$

Question: If $p$ is a prime, $p \nmid n$ and $n \nmid (p - 1)$, how can I prove that the $n$th cyclotomic polynomial $\Phi_n(x)$ has no roots modulo $p$? I know that $n \nmid (p - 1)$ implies that there are no elements of order $n$ modulo $p$, and I also know that $x^n - 1 = \prod_{d \mid n}\Phi_d(x)$, which means that if we suppose by contradiction there was a root $a$, it would satisfy $a^n - 1 \equiv 0 \pmod p$ which means it has order $d$ for some divisor $d$ of $n$ and therefore it is also a root of $\Phi_d(x)$. Can I somehow derive a contradiction here?
Comment: I think you more or less already derived a contradiction. It may be easier to think as follows. If $a$ where a root modulo $p$ of $\Phi_n(x)$, then $a^n-1\equiv0\pmod p$. Therefore the order $\ell$ of $a$ mod $p$ has to be a factor of $n$. Thus $\ell$ is a factor of $\gcd(n,p-1)=1$. So $\ell=1$. So $a=1$. But $p\nmid\Phi_n(1)$ unless $n$ is a power of $p$, which case was excluded.
Comment: @JyrkiLahtonen Thanks, but why can it not be the case that $n$ is a multiple of $p - 1$? In that case we would just get $(n, p-1) = p-1$ which doesn't help much since the order of any element divides $p-1 = \phi(p)$
Answer: Trying to fix my incorrect argument in the comments.
We know that we have the factorization
$$
P(x):=x^n-1=\prod_{d\mid n}\Phi_d(x).\qquad(*)
$$
This factorization holds over both $\Bbb{Q}$ and $\Bbb{Z}_p$, but we are only interested in it over $\Bbb{Z}_p$.
Because $p\nmid n$, the derivative $P'(x)=nx^{n-1}$ has no common factors with $P(x)$ in the ring $\Bbb{Z}_p[x]$. Therefore all the zeros of $P(x)$ (in any extension field of $\Bbb{Z}_p$) are simple.
Assume that $a\in \Bbb{Z}_p$ is a zero of $\Phi_n(x)$. Necessarily $a\neq0$, so
$a$ is also a zero of $x^{p-1}-1$. If the order of $a$ is $\ell$, then $\ell\mid p-1$. Furthermore, $a$ is then also a zero of
$$x^\ell-1=\prod_{m\mid \ell}\Phi_\ell(x),$$
so $a$ is also a zero of some factor $\Phi_m(x), m\mid\ell$.
So unless $\ell=n=m$ the element $a$ will be a zero of two factors on the right hand side of $(*)$, contradicting the fact that all the zeros of $P(x)$ are simple.
Therefore $\ell=n$. But this implies that $n=\ell\mid p-1$, which was ruled out in the assumptions.
Comment: Actually maybe it is clear; If a root has multiplicity greater than $1$, after taking derivative it has multiplicity at least $1$? Can you confirm?
Comment: Thank you, I knew it had to be exactly that contradiction but I had no idea how to show it was a contradiction. Can you provide reference for the statement in your third paragraph? I am not familiar with ring theory (even though in this case it appears to be just terminology), but either way it is not immediately clear to me why the fact that $P'(x)$ has no common factors with $P(x)$ implies that the roots are simple.
Comment: If $(x-a)^2\mid P(x)$, then $(x-a)\mid P'(x)$ (think: product rule of derivatives). Therefore $x-a$ would be a common factor of both $P(x)$ and $P'(x)$.
Comment: Right, that is what I was trying to say. Thanks!
Comment: @JyrkiLahtonen I wonder why $P'(x)$ has no common factors with $P(x)$? Can we conclude it from the form of $P'(x)$ and $P(x)$ directly?
Comment: @Gangmen Absolutely. $P'(x)=nx^n$, so its only irreducible factor is $x$. But $x\nmid P(x)$.
Comment: @JyrkiLahtonen Maybe you mean $P'(x)=nx^{n-1}$ and its only reducible factor is x, and I get it now, thank you so much!
Answer: We consider the following theorem

Theorem. Let $P(x)$ be a polynomial over either $\mathbb{R}[x], \mathbb{Q}[x], \mathbb{Z}[x]$ or $\mathbb{Z}_p[x]$. Then there exists a non constant polynomial $m(x)$ so that $m(x)^2 \mid P(x)$ if $\gcd (P(x),P'(x)) \ne 1$.

Proof. Let $g(x) \mid \gcd (P(x),P'(x))$ with all root of $g(x)$ are zeros with multiplicity $1$, or this means $\gcd (g(x),g'(x))=1$.
Then $P'(x)=g(x)h(x)$, we also have $P(x)=g(x)H(x)$ so $P'(x)= g'(x)H(x)+g(x)H'(x)$. This implies $g(x) \mid g'(x)H(x)$. Since $\gcd (g(x),g'(x))=1$ so $g(x) \mid H(x)$. Hence, $g(x)^2 \mid P(x)$.  $\square$
From this lemma, we can prove the following proposition.

Proposition. Let $m,n$ be two positive integers and $p$ be a prime so that $p \nmid nm$. Then $\gcd (\Phi_m(x),\Phi_n(x))=1$ over $\mathbb{Z}_p[x]$.

Proof. By applying the theorem over $\mathbb{Z}_p[x]$ we find $x^{mn}-1$ has no repeated factors. Now suppose $\gcd (\Phi_m(x),\Phi_n(x))=g(x) \ne 1$ then $g(x)^2 \mid x^{mn}-1$, a contradiction.   $\square$
From this proposition, we can say that for such $m,n,p$, $\Phi_m(x)$ and $\Phi_n(x)$ cannot be both divisible by $p$ for the same value of $x$.
Now, back to the problem. From what you found, $a$ is root modulo $p$ of $\Phi_n(x)$ and $\Phi_d(x)$, or $\Phi_n(a) \equiv \Phi_d(a) \equiv 0 \pmod{p}$, a contradiction since $p \nmid nd$.
In fact, your statement can be rephrase as

Let $p$ be a prime. For all positive integer $n$ and integer $a$ so that $\gcd (n,p)=1$ we have $$p \mid \Phi_n(a) \iff \text{ord}_p(a)=n.$$
Comment: Could you explain more about the gcd between two phynomial because I only know the gcd between two integers? Thank you so much.


Right Joycon buttons aren't working

Question: My right joycon buttons (specifically a,b,x,y, home, +, R and ZR buttons) haven't been working for a few months now. I have tried two different joycons, both of them don't work. I have all the recent system and controller updates. The left joycon works fine. The right one doesn't work both attached and not attached. What is the problem?
Comment: Since this issue has affected two different joycons, you should check that the buttons are not unassigned. From the Switch Home menu select System Settings, Controllers and Sensors, and then Change Button Mapping, and make sure each button is assigned to something. (This is unlikely to be the issue as you can't remap the Home button, but it's worth a check).
Comment: It sounds like a standard joycon issue to me. If the methods described above by Showsni don't work, I would send them to repair, get a refund, or buy new ones, depending on where you are and how easy it is to do so. Sorry to hear about this.
Answer: Nintendo Switch Joycons have been notoriously inconsistent in their quality. Many players, including myself, have experienced Joycon drift. While I haven't heard of buttons failing to work I would believe it.
There are guides online of how to send your Joycons back to Nintendo for repair, or you could look at their repair page directly, which is an option if you prefer to use Joycons.
I, however, bought a compatible controller for my Switch and haven't had any issues with that yet. Because I both prefer the feel of the controller, and it seems more durable I would recommend purchasing that instead.

Right Joycon buttons aren’t working


Which menu/status icons' guidelines should I follow for an app that will support Android 2.2 and later?

Question: In the guidelines found in http://developer.android.com/guide/practices/ui_guidelines/index.html for menu and status icons, we have distinctive design approach for Android 2.2 and earlier and Android 2.3 and later.
My app is going to support Android 2.2 and later. I was thinking that i should follow the 2.3 and later guidelines.
Do you agree?
Answer: You can follow multiple styles by creating subfolders with the correct android version specifiers inside your res/ folder (e.g. drawable-v11 for API 11 - check the official documentation here). So I suggest supporting multiple styles.
This is obviously a bit more work. To make this easy for standard icons like notifications, check out the Android Asset Studio. This is a small webapp that creates these icons to your specifications and builds a zip with the multiple styles, already sorted into the different res/ subfolders.
Comment: Thx alex! Love the Android Asset Studio.
Answer: On thing you could do is include assets for both builds, and at run time, figure out if you're on 2.2 or 2.3, and show the appropriate assets.  This can be done with build.version or this method for earlier releases.
Of course, if you want multiple icons, I don't believe this method would work, as that needs to be build into the android manifest.


Where can I find a map of songthaew lines in Yangon?

Question: There exist some detailed maps for buses in Yangon (example  (mirror)). Where can I find similar maps for songthaews in Yangon? I saw many songthaews in Yangon (video example taken near Danyingon railway station), so they seem to be a common means of transportation used by locals in that area.
Comment: Are you sure they have set routes, or do they act more like taxis?  (I have no idea, just asking)
Comment: yeah, while I didn't use them, there were some buses in Bolivia that seemed to basically pick up people going roughly to suburb x, where they'd be dropped off.  So sorta pooling for a direction.  And in uzbekistan you'd hire a seat in a taxi between cities, and then get dropped off at your hotel/destination once there (sometimes. /shakes fist at Khujand drivers ).
Comment: If it's the same as in say Bombay, there are indeed NO such formal lines, it's just an informal thing.  All the drivers know that at about Xpm about X many folks want to go to X location.  But then, I don't even know where or what a "Yangon" is  :-O
Comment: FWIW, "songthaew" is Thai and not a word that will be used or understood in Yangon.  The local term appears to be "bus kaa", but don't quote me on that...
Comment: @MarkMayoSupportsMonica same here, no idea! Given the number of passengers I have seen on some of them (> 15), that'd be some serious carpooling if they operate like taxis.
Answer: NOTE: I am not an expert in Myanmar or Yangon, and am writing this answer under the assumption that Songthaews are a form of informal transit operated independently by local people. [Additional note: The word seems to be Thai when googled, not Burmese. The local term may be different.]
There is almost certainly no unified map of the system, and the locals using them most likely know the routes by word of mouth. It is likely that many follow the same route driven exclusively by passenger demand, but the actual routes have no individual identification. To use the system effectively, you will need to speak the language or travel with someone who is native to Yangon, as they will know which routes will take them to specific destinations.
Takeaway: If you're looking for public transportation maps in Yangon, I'd stick with the existing bus maps and bus network since it is likely that no map of informal transportation exists. Buses will most likely be the easier way to get around the city.
General reading on mapping informal transit: https://www.citylab.com/transportation/2014/02/what-informal-transit-looks-when-you-actually-map-it/8283/


Vehicle-to-grid technology

Question: As I understand, vehicle-to-grid technology is about using the battery of your electric car to give electricity for the microgrid. How would this be useful as we are just moving electricity from place to another, and the battery of the car will need to be recharged?
Answer: Moving electricity from one place to another sounds pointless if you omit the purpose, which is to provide power where it is needed from a location where it is not.
Consider for example these points on the Wikipedia page about vehicle-to-grid:

A hybrid or Fuel cell vehicle, which generates power from storable fuel, uses its generator to produce power for a utility at peak electricity usage times. Here the vehicles serve as a distributed generation system, producing power from conventional fossil fuels, biofuels or hydrogen.
A battery-powered or plug-in hybrid vehicle which uses its excess rechargeable battery capacity to provide power to the electric grid in response to peak load demands. These vehicles can then be recharged during off-peak hours at cheaper rates while helping to absorb excess night time generation. Here the vehicles serve as a distributed battery storage system to buffer power.
A solar vehicle which uses its excess charging capacity to provide power to the electric grid when the battery is fully charged. Here the vehicle effectively becomes a small renewable energy power station. Such systems have been in use since the 1990s and are routinely used in the case of large vehicles, especially solar-powered boats.

The whole purpose is to put power back into the grid where it can be used, instead of just wasted (or not realized).
Consider a simple example: A solar panel on a vehicle that is not in use and fully charged, is being underutilized. If your neighbor has just returned from a drive, power that your panel produces can be sold back to the utility and delivered to the neighbor.
Comment: Thanks for editing the post and answering my question.The answer was really helpful!
Comment: Note that the cost per cycle of a vehicle battery may be high compared to the stored energy value. Leading edge battery technology is just starting to be cost effective for load levelling & time shifting grid energy supply and demand. Chances are that the $ impact on your car battery
exceeds                                                               the value you gain.

Vehicle-to-grid technology


What does it mean when we say most of the points in a hypercube are at the boundary?

Question: If I have a 50 dimensional hypercube. And I define it's boundary by $0<x_j<0.05$ or $0.95<x_j<1$ where $x_j$ is dimension of the hypercube. Then calculating the proportion of points on the boundary of the hypercube will be $0.995$. What does it mean? Does it mean that rest of the space is empty? If $99\%$ of the points are  at the boundary then the points inside the cube must not be uniformly distributed?
Comment: No, it means the periphery is more spacious, and the effect is commensurate with the dimensionality. It is somewhat counterintuitive. This phenomenon has consequences on the distribution of the distance between random pairs of nodes that become relevant when you want to cluster or calculate nearest neighbors in high-dimensional spaces.
Comment: Calculate what proportion of the points on a line segment are near its boundary. Then points in a square. Then points in a cube. What can you say about them?
Comment: Also, tangentially, relevant, https://hastie.su.domains/ElemStatLearn/printings/ESLII_print12_toc.pdf You can refer page 22 of this book (Elements of Statistical Learning), where a similar hypothesis is presented to explain the curse of dimensionality.
Answer: Speaking of '$99\%$ of the points in a hypercube' is a bit misleading since a hypercube contains infinitely many points. Let's talk about volume instead.
The volume of a hypercube is the product of its side lengths.
For the 50-dimensional unit hypercube we get $$\text{Total volume} = \underbrace{1 \times 1 \times \dots \times 1}_{50 \text{ times}} = 1^{50} = 1.$$
Now let us exclude the boundaries of the hypercube and look at the 'interior' (I put this in quotation marks because the mathematical term interior has a very different meaning). We only keep the points $x = (x_1, x_2, \dots, x_{50})$ that satisfy
$$
0.05 < x_1 < 0.95 \,\text{ and }\, 0.05 < x_2 < 0.95 \,\text{ and }\, \dots
\,\text{ and }\, 0.05 < x_{50} < 0.95.
$$
What is the volume of this 'interior'? Well, the 'interior' is again a hypercube, and the length of each side is $0.9$ ($=0.95 - 0.05$ ... it helps to imagine this in two and three dimensions).
So the volume is $$\text{Interior volume} = \underbrace{0.9 \times 0.9 \times \dots \times 0.9}_{50 \text{ times}} = 0.9^{50} \approx 0.005.$$
Conclude that the volume of the 'boundary' (defined as the unit hypercube without the 'interior') is $1 - 0.9^{50} \approx 0.995.$
This shows that $99.5\%$ of the volume of a 50-dimensional hypercube is concentrated on its 'boundary'.

Follow-up: ignatius raised an interesting question on how this is connected to probability. Here is an example.
Say you came up with a (machine learning) model that predicts housing prices based on 50 input parameters. All 50 input parameters are independent and uniformly distributed between $0$ and $1$.
Let us say that your model works very well if none of the input parameters is extreme: As long as every input parameter stays between $0.05$ and $0.95$, your model predicts the housing price almost perfectly.
But if one or more input parameters are extreme (smaller than $0.05$ or larger than $0.95$), the predictions of your model are absolutely terrible.
Any given input parameter is extreme with a probability of only $10\%$. So clearly this is a good model, right?
No! The probability that at least one of the $50$ parameters is extreme is $1 - 0.9^{50} \approx 0.995.$
So in $99.5\%$ of the cases, your model's prediction is terrible.
Rule of thumb: In high dimensions, extreme observations are the rule and not the exception.
Comment: Worth using the OP's quote "Does it mean that rest of the space is empty?" and answering: _No, it means that the rest of the space is relatively **small**_  . . . Or similar in your own words . . .
Comment: Really nice explanation of the term "curse of dimensionality"
Comment: Wondering if the following is correct: taking this example, if a set of features are evenly distributed along [0,1] in each of the 50 dimensions, the (99.5% -0.5%) = 99% of the the volume (hypercube feature space) captures only the 10% values of each feature
Comment: "Any given input parameter is extreme with a probability of only 5%." I think this probability is 10%.
Comment: @Rodvi: You are right of course, thanks! Fixed it.
Comment: What a great answer... Wish I could give it two upvotes.
Answer: You can see the pattern clearly even in lower dimensions.
1st dimension. Take a line of length 10 and a boundary of 1. The length of the boundary is 2 and the interior 8, 1:4 ratio.
2nd dimension. Take a square of side 10, and boundary 1 again. The area of the boundary is 36, the interior 64, 9:16 ratio.
3rd dimension. Same length and boundary. The volume of the boundary is 488, the interior is 512, 61:64 - already the boundary occupies almost as much space as the interior.
4th dimension, now the boundary is 5904 and the interior 4096 - the boundary is now larger.
Even for smaller and smaller boundary lengths, as the dimension increases the boundary volume will always overtake the interior.
Comment: What I am a little confused by is by the definition of the boundary ( I am probably  missing something) but in one dimension,we  would have two points x0 and x1 with a distance of 10 units in between them. What  is the boundary  here exactly?
Comment: The boundary is an arbitrary narrow region around the edge, same dimension as the hypercube. Doesn't matter if for the 10 unit example the boundary is 1 unit, 0.1 unit or less, as the dimension increases the ratio of boundary to not-boundary increases until it becomes the larger of the two. Another way to think of it is points inside the cube but nearer the edge than the centre, which would correspond to a boundary width of 2.5 units. As the dimension goes up, the proportion of points nearer the edge than the centre goes up.
Answer: The best way to "understand" it (though it is IMHO impossible for a human) is to compare the volumes of a n-dimensional ball and a n-dimensional cube. With the growth of n (dimensionality) all the volume of the ball "leaks out" and concentrates in the corners of the cube. This is a useful general principle to remember in the coding theory and its applications.
The best textbook explanation of it is in the Richard W. Hamming's book "Coding and Information Theory" (3.6 Geometric Approach, p 44).
The short article in Wikipedia will give you a brief summary of the same if you keep in mind that the volume of a n-dimensional unit cube is always 1^n.
I hope it will help.


Is there any need of digital currency given online payments through bank balance

Question: Given talk about launch of retail digital rupee by RBI in India, is there any need for digital currency given online payments through bank balances of individuals/firms already serve the purpose?
Answer: There is probably no need for individuals and firms. However, central banks would benefit from this.
There is good overview of this topic in this the Economist article. You can also see more academic overview of this in Sinelnikova-Muryleva 2020, Panetta 2018 or Achord et al (2017). Summary of the main points:
First, CBDC's will allow central banks to implement negative interest rates in the future once they are not just alternative to cash but cash is outright abolished.
Second, CBDC's will give greater control over the economy to the government. Most of illegal activity is cash based. Once cash will be abolished this should in theory hamper illegal activities.
Third once all money is online government will have real time overview of all your transactions which should help with clamping down on any tax evasion.
Fourth, since CBDC wallets can be viewed as a deposits at CB, an argument can be made that it will make traditional banking obsolete, and thus CB will have to worry less about financial sector stability.
This will however not happen immediately, currently CBDC's are being introduced as an alternative to cash or regular transactions, however the ultimate goal is to move to cashless society.
However, I do not think there is much if any direct benefit to regular individuals or firms. I suppose this could reduce costs of banking to individuals which would be beneficial. There will be indirect benefits to the extent that this will make nefarious illegal activities harder and to an extent that negative interest rates will help CBs better combat recessions. On other hand, people living under dictatorship or corrupt governments (such as China) will find it harder to oppose such regimes because it increases the ability for state to do surveillance, and would give officials power not just to freeze your account but all money you have.
Comment: Although the question asked about the benefits of digital currency, you answered about the drawbacks of cashless society, which is a different question.
Comment: @user253751 1. Question did not asked about benefits of DC why are you making up false claims? Question does not even have the word benefit in it. 2. my answer is literally, and I calculated it, 85% only about benefits of DC and there is one sentence about potential drawbacks. So how can you honestly claim that my answer is about drawbacks of cashless society.


switch and relays

Question: I have a small Wayne 12 volt  battery backup pump. The wires coming from the switch had a float which I removed. When those 2 wires are touched together it activates the pump. I would like to wire the wires from the switch  and the 12 volt charger to a relay or solenoid so that when power is off from the charger the circuit completes. and activates the pump. Can you help me?
Comment: Hmm, the only way I can think off would be a 12-5v regulator, to a simple micro controller, a small bit of C, when the pin connected to the charger is low, I.E off, another pin connected to the gate of a Mosfet/relay is High, connecting the circuit and enabling the pump, I personally use micro controllers for almost every thing, I'm sure a better answer is here somewhere.
Answer: This is quite straightforward, and requires a 12-volt, SPDT relay with contacts adequate to handle the pump current.

simulate this circuit – Schematic created using CircuitLab
As long as the charger is providing voltage, the common (the upper in the diagram) lead contacts the NO (normally open, on the left) contact, while the NC (normally closed) is not connected. When the charger shuts off, the relay relaxes, and the common connects to the NC contact, turning on the pump.
Comment: you might want to add a diode across that coil.
Comment: This sounds like the answer I'm looking for but have yet to try it; I will forward the results.
Thanks

switch and relays


Will changing windows shell affect my ability to run windows programs?

Question: I have recently started using Linux on my laptop and I really like it. Especially I am overwhelmed by the ability to customize the desktop environment in Linux. I start reading about it and I learned that you can replace the Windows shell in Windows 7 which I use on my desktop computer. However I was wondering would it affect my ability to run windows programs in any way? At the moment I use some Windows only programs that I need to run. Are there any downfalls of using custom shell on Windows?
Comment: Of course it will, any programs that specifically implement Windows shell functions, will cease to work.
Comment: @Ramhound , please see my comment to Gerard Kean's answer.
Answer: Nope it won't because when you replace the "shell" in windows you're actually only replacing the UI and the user interface has nothing to do with the programmes you run.
I haven't done it since XP but the principle is the same, it's just a visual tweak.
It's not like Linux where the shell is like Windows over DOS and much more involved.
Comment: Exactly. Yes, there are underlying DLLs that Explorer depends on, and yes, some of those (like shell32.dll) do provide functions that are called by application programs - such as in the file open and save dialogs. But that doesn't matter, because "replacing the shell" doesn't remove those DLLs. It doesn't even remove explorer.exe! It just changes what program happens to be launched by userinit.exe when someone logs in. Programs that call on "shell functions" will still find those functions just as always.
Comment: I see, Thank you for extensive response. I will keep the question open for another day, in case somebody would like to add something to the topic. Also I was wondering would you recommend trying the Windows shell in Virtual Machine first before applying it to live system, in case something go wrong?
Comment: You can use a virtual machine and it's usually a wise move when testing any software.
When you do decide to jump in and give it a try never install the shell replacement itself without making sure to also install a shell switcher or know the location in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\  (where it used to be)
so you have a manual way to change your mind and take it from me, once you get started with this you will change your mind often.

Many years ago I used to spend a hell of a lot of time here
http://www.shellcity.net/
Answer: I expect that a replacement shell could cause problems, although most likely it will not cause many problems (and might not cause any noticeable problems).  As an example, 4DOS was a new shell for the MS-DOS platform that pre-dated Windows 95.  Compatibility was very high, but not absolute.  For anything important, be sure to back up important data first and perform careful tests until you are satisfied that things keep working as expected.
Note that the "shell" in Windows refers to the user interface that interacts with the user, and so involves graphics.  If you simply want an alternate command line prompt, you can install it and make an icon for it, and that is unlikely to affect many programs that are heavily graphical in nature.
Years ago, one reason to use an alternate shell was that an alternate shell may have fewer requirements of system resources.  Since then, computers have become more powerful, enough that the system requirements of Microsoft's shell are typically met easily.
You may wish to consider whether shell replacement is needed.
Back in the DOS days, it was a good idea because the default COMMAND.COM shell was pretty limited.  With a new Windows shell, many of the changes can be done using add-ons rather than replacing Microsoft's shell.  Such an approach may be less likely to break as Microsoft changes how Windows works (with newer releases of Windows).  Even if you do decide to use a third party program which could be used as a shell, you may wish to check whether much of its functionality can be achieved by running the software from within the Windows shell, rather than replacing the Windows shell.