Can Fused heal with Voidlight?

Question: Book three in The Stormlight Archives introduces new creatures called Fused, who can use Voidlight (the opposite of Stormlight) to accomplish similar things as one using Stormlight might do - like Lashings etc. Presumably Fused should be able to use this Voidlight to heal just like Kaladin can do.
My question is, when Moash killed one of the Fused, (who later comes back to life) by stabbing it with a dagger - which is not even close to a Shardblade wound, it should have been very easy for it to heal using Voidlight?
Comment: Fused are somewhat weaker then surgebinders. It's quite possible that voidlight doesn't have as pronounced healing effect.
Comment: They may have no reason to rely on it, being that they seem to be able to come back during a desolation.
Answer: They can heal mortal wounds but not Shardblade wounds. see the Coppermind here. It also seems to work more slowly than Stormlight, being that

Shallan survives an arrow to the head, and Jasnah surives a knife to the chest.
Whereas, Moash kills a fused by stabbing it in the chest.
Comment: Shouldn't you put "spoiler" instead of "citation"? BTW It's quite possible that healing would be from equivalent of Progression not Voidlight itself.
Comment: Cant be progression the same Coppermind article says that they each only have one power and all of those fused flew

Can Fused heal with Voidlight?


Why do we connect a battery to ground when jumping a car?

Question: This may seem like a very simple question, but I've searched all over the place and haven't found an answer.
When jumping a car, we connect the + end of the charged battery to the + end of the dead battery, and the - end of the charged battery to the chassis or other metal part of the car.
I always thought that you need a closed circuit for current to flow. But this circuit appears to be open: we are connecting the - end of the charged battery to the ground! Thus, how can any circuit connected to ground have a current?
I believe another way to ask this question is: will jump starting a car still work if I connect the - end of the charged battery to a third (powered-off) car, instead of to the chassis of the car with the dead battery? If so, why? (I've heard people say that jump starting a car only works because the chassis is connected to the electrical components of the vehicle, thus providing a closed circuit since the battery is also connected to the electrical components of the vehicle).
Comment: One reason for making the final connection to the dead car's chassis that a discharged battery can outgas Hydrogen. Since there is likely to be a brief arc as you complete the circuit to the live car's battery, you'd *really* rather this happened away from the dead battery! It would be safer yet to make the final connection at the live car, that much further away from the dead battery.
Comment: You are confusing circuit ground, chassis ground, and earth ground. An automobile is isolated from "earth ground" by the rubber tires, but the 12V battery negative terminal is connected to the car chassis forming the "chassis ground". The circuitry in the car is also grounded to the chassis, albeit with some other protection in between, but this has nothing to do with the current flowing from one car to another during a "jump." If anything, this circuitry can be destroyed from spikes in the battery voltage.
Comment: @Spoon: The bare essentials includes the fuel pump which is probably the most power-hungry device in the car. In the days of carburetors and mechanical fuel pumps, you could drive quite a lot longer (hours) than you can today with a total-loss electrical system.
Comment: Almost 2 years on :-) : Note that the vehicle body is ALMOST at -ve battery potential. Of most importance is the B+ - starter relay - starter motor - B- circuit. The starter motor almost invariably bolts onto the engine block and makes ohmic contact via this path and a large low resistance strap extends from battery minus to the engine block and through the block to the starter. Sometimes the strap attached near the starter motor sometimes not. The block is not usually made of especially high conductivity material BUT the conductor (= the block) is VERY thick so resistance is low.
Comment: When you jump a car, you are using the second car's battery to provide the necessary current to turn over the engine's starter. Once the car is running, the alternator will (usually) recharge the battery enough to allow you to start the car on its own a time or two before it is dead again. The alternator is also what is really powering all of the electronics in the car while it is running by keeping the battery charged. If that fails, you will notice your lights get dim or your radio go out as the battery dies while your are driving, but the engine will continue to run.
Comment: I did drive home on battery alone one night when my alternator failed. It was over 20 miles with the headlights on. Yes the lights were starting to dim by the end of the journey. I feel I have a better understanding of how much power a car battery contains and how much it takes to run the bare essentials on a car now.
Comment: Just don't hook it up to your head light though or even close, I think it can blow the ballast or bulbs even. Sorry for the short answer but I'm new to the SE site.
Comment: Traditionally English and US cars and many European ones used the body as the earth/ground/negative return lead for lights and similar. Japanese car makers tended to add an earth return wire and nowadays that's industry practice.
Comment: The part I don't understand: why connect to the negative terminal on the donor car at all either? Why not the donor chassis?
Answer: "Ground" is just a code word which, in this case, refers to the "current return common" circuit node. There is a complete circuit because everything electrical in the car, such as the starter motor, also connects to ground in order to return current to the minus terminal of the battery through the ground. The car's chassis is used for this return network, and so the entire chassis is an extension of the minus terminal of the battery.
During jump-starting, we connect the boosting battery to ground rather than to the dead battery's - terminal for the simple reason that this provides a more direct return path to the good battery which is powering the dead car: the return current does not have to travel through the dead battery's minus terminal hookup cable and then to the jumper cable, but can go directly from the chassis ground to the jumper cable.
A more direct return path allows for better current flow and less voltage drop, like plugging a big appliance directly into an outlet, rather than via an extension cord.
In case you're also wondering why the plus jumper connections are made first, then the minuses. This is because there is no harm done if you leave the minus jumper dangling in the chassis of the car. Anything it accidentally touches is likely to be ground.  If you connect both alligator clips on one end before connecting the other end, the other end is now live and you can accidentally touch the clips together to create a short circuit. If you connect the minuses/grounds first and then go to connect one of the pluses, you can create a short circuit, because the opposite side plus is probably dangling and touching something that is grounded.
Comment: @JoshBeam It's essentially for the same reason that you don't feel anything if you touch your tongue to just one terminal of a 9V battery: you have not completed an electric circuit. To be shocked, you have to touch two points that are connected to opposite terminals of the battery. (And the voltage *is* low, yes).
Comment: If the entire chassis is just an extension of the minus terminal of the battery (given the simple model that everything is connected in parallel to the battery), wouldn't the lower resistance be negligible? I am guessing that the difference would probably be less than 10 milliohm.
Comment: Thank you! You got right down to my core misunderstanding. My epiphany occurred on the idea that **"the entire chassis is an extension of the minus terminal of the battery"**. I'm still wondering _why_ cars are designed this way, but that wasn't in my original question. Job well done.
Comment: @Kaz, if the entire chassis is an extension of the negative terminal, what is the reason that we don't get shocked when we touch a car that is turned on? Is the voltage/current not enough for us to feel anything?
Comment: See, I knew that the chassis is an extension of the '-' terminal, but it never occurred to me that the chassis might be a lower-resistance connection to the starter etc., and I was always like"what's the difference?"  On a related note: I had a car once where the chassis was painted--I had to scratch the paint if I wanted to make electrical contact.  If it's contact resistance we're worried about, maybe it would have been better to clip to the terminal?
Answer: The - end of the charged battery is already connected to the chassis, the engine, and, particularly, the starter motor.  The whole car is designed to work that way. Everything use earth return. All the lights have one wire, and one connection to the chassis. The spark plugs have one wire, and one connection to the engine block. And so on.
OK, on a modern car you use a second wire for the starter motor, because it draws a lot of current and you would get a significant voltage drop and power dissipation in the earth return path. And diesel engines don't have spark plugs. And high power driving lights are driven through a relay like the starter motor is. And lights mounted in plastic fittings need 2 wires.
Given that the -ve end of the battery is connected to the chassis and the shell and the engine, where is the best place to connect the return wire?
Traditionally, you connected it to the chassis or the shell or the engine, so that you didn't have to lean, with a live wire, into the engine compartment, across the engine (hot moving machinery), on to the battery (hydrogen explosion risk, with sulphuric acid as well). But this assumed that the battery was difficult to reach, and that the engine and chassis had a very good connection to the battery (required for the starter motor earth return).
Nowadays, some people make the return connection direct to the battery, if they can reach it easily.
Even if you connect one end of the return wire to the chassis, you normally connect the first end direct to the first battery. This because until the wire is connected to the first battery, it is not a live wire, will not spark when you touch it to something, is not particularly dangerous. After the return wire is connected to the first battery, it is live, and is dangerous. So you connect it to something safe that is easy to reach.
No, you can not connect the return wire to a third car. Cars sit on rubber tires, and the tires insulate each car from other cars. You need a complete circuit from your battery to the other battery.
Comment: Hey David! Thanks for your answer. I was a little overwhelmed with the details because I don't think I know enough about electronics in order to appreciate your answer. Nevertheless, I'm sure that it'll be useful in the future once I've studied a little more into the area.
Answer: The main reason for connecting to the positive terminal on the battery first is to do with volatile gases possibly being emitted from the battery. If you connect to both terminals at the battery terminal this will usually cause some kind of spark as you first touch the cable to the terminal, whether you do positive or negative first is irrelevant. Connect the positive at the battery terminal first(no danger of a spark as a complete circuit is not formed), then connect the negative cable to a point on the chassis away from the battery, so the resulting spark is not in the area likely to be affected by any gases. that way you have ruled out the possibility of igniting the gas and have avoided any chance, however small. of an explosion.


WhatsApp could access SMS without having permission to it

Question: I have not granted SMS permission to WhatsApp on my device HonorView10 running on EMUI9. Recently I changed the number registered with WhatsApp and it send the verification code to new number (the sim is on same device as it is dual SIM). WhatsApp read the SMS and completed the verification process. Is it possible in Android to read SMS without permission? Or it is bug in EMUI9? I am just curious.
Comment: Woah!!. Cross Check by going to settings>whatsapp>app permissions>here check if you have granted read sms permission.
Comment: Definitely doesn't seem like it's using the normal approach. Reading any SMS requires the permission, which you've clearly not given it.
Comment: There might be something wrong with your custom UI, because as an android developer and after checking in 2-3 android devices available with me this is not the case for me. Please cross check the same scenario in some other android device. May be we can have some idea on this. By the way nice question, I'm getting curious too.
Comment: @DeepPatel, there seems no issue in UI. The other permissions (granted/not granted to WhatsApp) are working perfectly fine. Just additional info - its Android Pie and latest version of WhatsApp. Also, the following answer by NileshRathod seems plausible as it is standard Android provision.
Answer:
WhatsApp could access SMS without having permission to it

I think  whats app is using  SMS Retriever API

SMS Retriever API

With the SMS Retriever API, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions. When you implement automatic SMS verification in your app, the verification flow looks like this
Answer: Watssap does access messages in other apps, my phone set up with signal as messaging app and signal is locked, but when setting up watssap it asked me if I want to allow watssap to read messages for verification I clicked no and entered pin manually, after 2min when setting up clone app for dual sim it suddenly read sms message that came to signal app without even asking to unlock app
Answer: One of the ways the spyware Pegasus is installed is through having WhatsApp read sms's in the background
Answer: In some circumstances, you want to help the user understand why your app needs a permission. For example, if a user launches a photography app, the user probably won't be surprised that the app asks for permission to use the camera, but the user might not understand why the app wants access to the user's location or contacts. Before your app requests a permission, you should consider providing an explanation to the user. Keep in mind that you don't want to overwhelm the user with explanations; if you provide too many explanations, the user might find the app frustrating and remove it.
read this
https://developer.android.com/training/permissions/requesting
Comment: user can understood the use of devices hardware and access the device predefined services  , so in new version devices we needs run time permission


chown in docker not changing user to root

Question: I am fairly new to Docker and have been setting up a Dockerfile and compose file to start up a server for testing.
When running a centos:6.6 image with a volume mapped to my user directory in OSX and installing httpd, my user for var/www/html is 1000:ftp instead of root:root.
I need to change a folder to user apache:apache in order to be able to upload files to it and cannot get chown or chmod to make any changes in any folder under var/www/html.
I know this has to do with me mapping my volume to a location on my OS drive.
So, my question is..
Is there anyway to set it up so that I can change ownership of var/www/html?
Answer: The newly released Docker for Mac has a different behavior regarding ownership:

Initially, any containerized process that requests ownership metadata of an object is told that its uid and gid own the object. When any containerized process changes the ownership of a shared file system object, e.g. with chown, the new ownership information is persisted in the com.docker.owner extended attribute of the object. [...]

Michael's start_safe_perms script can be adapted like the following to work consistently across platforms:
if [[ -n $(mount -t fuse.osxfs) ]]; then
    chown -R www-data:www-data . 2> /dev/null
    # ...
else
    read owner group owner_id group_id < <(stat -c '%U %G %u %g' .)
    adduser --system --uid=$(stat -c %u .) "$owner"
    # ...
fi

It basically detects if the mounted volume if of the type fuse.osxfs.
You can checkout API Platform's start_safe_perms script for a fully working example: https://github.com/api-platform/api-platform/blob/master/docker/apache/start_safe_perms
Answer: Issues 587 or 581 show that you can not change the ownership of a host mounted directory.
Change instead your Apache start script in order to start it with the right id (1000) instead of apache:apache.
See "apache/start_safe_perms" from Michael A. Smith
Mainly:
read owner group owner_id group_id < <(stat -c '%U %G %u %g' .)
adduser --system --uid=$(stat -c %u .) "$owner"

Comment: Thanks! I think this is exactly what I needed.  Much appreciated.


Install SharePoint 2013 in home laptop

Question: I want to download and install SharePoint 2013 on my laptop for my personal use. What are the links to get prerequisites to install SharePoint 2013 server and SharePoint 2013 server?
Answer: Just wondering,  what is your purpose on setting up SharePoint on your local machine.  If you just want to play around with SharePoint sites I would suggest you to get a free trial on Office 365 account,
This gives you access to create your SharePoint sites and you can learn basic administrative tasks on SharePoint.
Setting up Share Point locally is good only if you are an advanced user/developer/admin and want to build something custom.
http://office.microsoft.com/en-in/business/what-is-office-365-for-business-FX102997580.aspx
Another option for you would be to get onto www.cloudshare.com and provision a pre-configured SharePoint VM,  this will save you from long installation process and slowing down your machines.
Hope this helps you in some ways.
Comment: This is the best answer so far because it asks "why" and provides alternatives.  Because let's face it, unless you know what you're doing installing SharePoint properly is a daunting task.
Comment: Thanks Derek, I had installed it on my laptop and realized it doesn't really makes sense unless we want to experience installing it .  It slowed down my laptop like anything. It's much better to ho with alternatives ;-)... Just trying to save someone from that pain
Answer: What specs does your laptop have? You need at least I would say 12 GB RAM for SharePoint dev environment.
Also, you should consider running SharePoint virtual in an Virtual box machine on Windows Server 2012, since this is where it is designed to run.
Here are the specs: http://technet.microsoft.com/en-us/library/cc262485%28v=office.15%29.aspx
Answer: The least amount of RAM you will need is 8 GB, otherwise it will be a PITA. When using only on a laptop, disable Distributed cache which consumes some RAM and in most cases in the development environment there are more issues with RAM than with CPU (disabling Distributed cache will increase CPU load). Do NOT disable Distributed cache on production.
Also consider using VMware or any virtualization software, because it is better to not mess with your main operating system on the laptop. Also you can later easily transfer your image to another machine.
Prerequisites are installed automatically. Especially if you use stand-alone installation there is nothing to worry about.
You can download an evaluation version of SharePoint Server at http://technet.microsoft.com/en-us/evalcenter/hh973397.aspx or click on the right to get Foundation for free. There is also a link provided with system requirements.

Install SharePoint 2013 in home laptop


Does guile have a package manager?

Question: I'd like to discover the guile ecosystem. I looked at how to install a library and I didn't find a package manager, like python's pip. Does such a thing exist for guile ?
Answer: Looks like guildhall is the closest thing to pip out there.  There has been some discussion on the Guile mailing lists recently around it. The posts by Wingo, Boubekki, Zaretskii, and a few others who are heavily involved with Guile development indicate a push towards making guildhall an upstream source for something called Guix that is a more general package manager intended to be independent of platform.
If you consult the Guix list of packages you will see guile there and a number of other guile related items (e.g. guile-json, guile-ncurses, etc..).  I'd give that a shot.  Otherwise you're on your own and you'll have to either fall back to the OS package manager or pull down the source yourself, build, and install.
Full disclosure: I haven't tried Guix myself but I've been meaning to.  I'd be very interested to see how it turns out for you so if you do go this route it'd be awesome if you could provide an update with your Guix experience.
There's also been a recent call to update the libraries page and from a quick inspection there's been some small number of updates that you may find useful.
Comment: Good point about trying guix. I had read about it and had seen the list of packages, but I thought it would be a full replacement of `apt` and I didn't think about looking the available guile libraries. I'll try that and keep you informed !
Comment: My experiment quickly aborted. Getting `guile` is easy (`guile-2.0` on debian), getting `guix` isn't possible ATM: 404 to the ftp http://ftp.gnu.org/gnu/guix/ from the dowload page at savannah https://savannah.gnu.org/forum/forum.php?forum_id=8147
Comment: @Ehvince: Hrmmmm... Sorry to hear that.  I'll give guix a shot on my system (OpenBSD) and report back.
Comment: Guix is alpha software and is available here: http://alpha.gnu.org/gnu/guix/ An astute reader would have seen it on the documentation at https://gnu.org/software/guix/#download …
Answer: @unclejamil This is an update of my attempt to install the guix package manager.
Documentation
First of all, the links:

the official page: https://www.gnu.org/software/guix/
the download page: http://alpha.gnu.org/gnu/guix/ (guix-the-system and guix the package manager are listed together)

Installation (Debian)
Guix needs Guile-2.0-dev and more dependencies, which are present in Debian's repositories:
apt-get install guile-2.0-dev guile-2.0 libgcrypt20-dev libbz2-dev libsqlite3-dev autopoint

Download guix. See the above links to download a binary. Or get the sources:
git clone git://git.savannah.gnu.org/guix.git

The installation goes with a classical ./configure && make && make install.
make will take several minutes and make install needs root access. If you install from source, make will build guile objects of the 346 base packages (python, zsh, abiword,…) so it'll take a long time (the database is included into guix-the-program, so we must do that. You can still tweak this list in the Makefile, at MODULES) .
Note: Your current directory must not contain non ascii characters.
Note: see also this complete tutorial, with the focus on how to install guix locally, i.e. not to run make install: http://dustycloud.org/blog/guix-package-manager-without-make-install/
Usage
To install packages with guix, we need a running server.
The first method, for testing purposes, is simply to run the server in a terminal:
sudo guix-daemon

and the client in another one:
guix package -s "guile.*curses"    # search with regexps
sudo guix package -i guile-ncurses # install. All start with the "package" command.

For the proper method, see  https://www.gnu.org/software/guix/manual/html_node/Build-Environment-Setup.html#Build-Environment-Setup
To be continued.
This answer is a community wiki, feel free to complete it, thanks !
Comment: Unfortunately Guix is unsupported OpenBSD.  However, one can check out the Guix repo, run ./bootstrap to create configure, and run $ ./configure --with-courage if you're feeling frisky.  :)
Answer: I am building Guix right now and encountered the same error about not finding guile-2.0. I managed to fix it by installing the development files for guile-2.0
sudo apt-get install guile-2.0-dev

I encountered some more errors later on and it just meant I needed to install the development files for it.
Comment: Does not appear to answer the question
Comment: That helped me going further, and thanks to him I understood I similarly need `libgcrypt20-dev`.
Comment: but it could have been a comment to my answer.

Does guile have a package manager?


"didn't need to have done" or "needn't have done"

Question: The sentence, "The examination has been cancelled. You needn't have done all the revison, after all."means that the student didn't have to do the revision, but he has done that. Can "need't have done" be changed into "didn't need to have done", by all means, "didn't need to have done" seems grammatical-corret.
Answer: In my dialect, need may pattern as an auxiliary, giving forms such as

You need not do it.
He needn't have gone.

It may also take do support:

You don't need to do it.
He didn't need to go/have gone.

and it nearly always does so for questions:

Do you need to go?

(Need you go? is grammatical but old fashioned for me, and I probably wouldn't say it.)
I believe that in some dialects of English, the auxiliary patterning (need not) is obsolete, and people will always say don't need to.


Coloured Locks on The Escapists

Question: What do the different colours of locks all mean? There are green ones purple ones and I am really confused what they all mean! There is nothing in the help section or anywhere online, am I just a bit stupid?
Answer: There are 7 different door lock colours : green, yellow, orange, red, purple, blue, white. The different colours don't show any characteristics about the door (strength, width) except that if you have an orange key it can unlock an orange door and if you have a purple key it can unlock a purple door, etc.
All doors locks obey this rule apart from the blue and white door locks. The white door locks cannot be opened unless in a Prison Takeover scenario. For more info on Prison Takeovers: http://theescapists.gamepedia.com/Prison_Takeover. And the blue doors can simply be passed by wearing a guard outfit.
There are no ways of crafting, receiving, trading, etc. white or blue keys. Each guard holds one of the five different keys (green, yellow, orange, red, purple). If you manage to knock them out, you can steal their key and make a fake key with a wad of putty and return the key to the guard. If the guard wakes up and finds his key missing, you will receive a note from the warden saying 'We have realised a key is missing and we have traced it back to you. As a result of this your penalty is 4 days in solitary.'
Answer:
Green ones unlock doors which are lead to work areas (Laundry Machine place, Gardening Shed etc.)
Orange (cyan in Mobile/Console) ones unlock those spaces behind the wall, doors in the vents etc.
Purple ones unlock doors that lead into the facility (I don't think outdoor prisons like San Pancho and Stalag Flucht have purple keys)
Red ones unlock doors that prisoners can't normally access (Generator room, guard's office)
Yellow ones unlock your cell door
White locks lead out of the facility (yes, even San Pancho and Stalag Flucht have them)
I don't know what blue locks lead to
Comment: blue go's to ladders on console
Answer: They are door locks!They mean that you can only unlock the doors with the same color of keys/key cards. But the white one can only be opened by a prison takeover. You may get keys or key cards dropped by certain guards when you knock them out. Don't be caught attacking the guard or having the key cards though. They are counterfeit items and  you will be confined in solitary for 4 days.
Comment: This doesn't seem to add anything that the current year and a half old answer doesn't already have in it.

Coloured Locks on The Escapists


How do change the RBS Threshold?

Question: We are using SQL Server 2014 and SharePoint 2013
Answer: You can modify the minimum BLOB storage size for each content database from the default size of 5 MB:
Start the SharePoint Management Shell.
At the Windows PowerShell command prompt, type the following commands to modify the minimum BLOB storage size to 1MB.
<code>$cdb=get-SPContentDatabase ContentDatabaseName
$cdb.RemoteBlobStorageSettings.MinimumBlobStorageSize=1048576
$cdb.Update()

iisreset -noforce
</code>
Reference: Modifying the Minimum BLOB Storage Size
You also need to have a look at Shredded Storage Chunk Size (also known as FileWriteChunkSize). The FileWriteChunkSize must always be greater than MinimumBlobStorageSize. If this rule is broken, no content will get externalized!
FileWriteChunkSize gets configured at WebApplication level (example: 2MB):
<code>$webapp = Get-SPWebApplication http://yourwebappurl
$webapp.WebService.FileWriteChunkSize = 2097152
$webapp.webservice.Update()
</code>
Reference: SharePoint Storage Optimization: Why Shredded Storage and Remote Blob Storage are Better Together

How do change the RBS Threshold?


make image of existing Ubuntu installation for VirtualBox

Question: On my work computer, I have Ubuntu with so much stuff installed on it.
Is there a way to make an image of it and boot it up on my PC at home on VirtualBox?
Answer: Use Remastersys.  Using it, you can create a custom Live CD of your Ubuntu installation and install it other places...

It can make a full system backup including personal data to a live cd or dvd that you can use anywhere and install.
It can make a distributable copy you can share with friends.  This will not have any of your personal user data in it.

I have used this myself, recently, and it took some figuring out, but once you install it, everything else is a breeze...highly recommend!
In fact, see this answer here: Linux Live CD: Flash preinstalled? - the 2nd tutorial in the answer (by BloodPhilia) I linked is the best one...Since you are using Ubuntu 10.10, it is pretty easy...do the step where you add the Remastersys to the repository, then go to the Ubuntu Software Center and search for Remastersys.  Next install it, then proceed to open Remastersys and follow the instructions regarding backing up your system...
Any questions, just ask!
Comment: this answer is from another question...I would write it more specifically to your question, except I don't have enough details...
Answer: You have several options, ranging from installing the same set of packages to making an exact replica of your existing installation.
The following command generates a list of all installed packages, excluding the ones that were pulled in automatically because of a dependency.
aptitude search -F %p '?installed !?automatic' >package-list.txt

(aptitude documentation, in particular search patterns) You can grab a copy of that list and install the same set of packages on another machine (after doing a basic installation of the same release of Ubuntu) with
aptitude install $(cat package-list.txt)

The topic has come up on the Ubuntu Stack Exchange site: Is it possible to tell what packages I've installed that aren't in the vanilla install?, How do I duplicate a server's packages and configuration to another machine?.
Your personal settings are in your home directory, you can copy it from one machine to another. System settings are under /etc. See also How can I most easily migrate all my apps and settings from one Ubuntu install to another?.
It's also possible to clone the whole installation; there are just a couple of files you'll have to change under /etc. Here's an Ubuntu installation cloning guide (also: Linux installation cloning thread with a generic Linux cloning guide). However that guide assumes that the clone disk size is the same as the original disk size, and doesn't deal with the VirtualBox angle. These are not insurmountable obstacles, but they do complicate matters enough that I recommend replicating the package set and copying your home directory over.


Transformer vector group

Question: Given the transformer connection of the primary and secondary winding, in example: Yd11, how do I connect the LV side so I get the correct phase-shift?
I understand what clock vector groups represent, and I can draw the vector diagram, but I find it quite hard to connect the LV side to get the correct phase-shift.
Comment: what phase shift do you want? if Yd11 is your input and it is a star connection, you must know what your required output phase shift it.
Comment: I just want to know how to connect both Y and delta, so the phase shift between the primary and secondary voltage is 11 hours, or 330 degrees.
Answer:

simulate this circuit – Schematic created using CircuitLab
Figure 1. Phasor diagrams for the Y-Δ transformer.
The original diagram is badly drawn with inconsistent use of colour.

Since the each primary and secondary pair share a leg of the transformer core the voltages in each winding have to be in phase. This is indicated on Figure 1a where the connected phasors represent the primaries.
Figure 1c shows the result when the secondaries are connected in delta.

simulate this circuit
Figure 2. (a) shows both the P-N and P-P phasors.
In Figure 2 we can see that if we were to analyse using the phase to phase (P-P) phasors that there is a phase shift between (a) and (c).

in example: Yd11, how do I connect the LV side so I get the correct phase-shift?

You just connect them up in Y and D and the phase shift will be automatic. I think you should look for a better text book than your image came from.

Transformer vector group


'These umbrellas are boomerangs' means 'they have to be returned'?

Question: This afternoon, my manager bought some umbrellas for our office, saying: 'These umbrellas are boomerangs'.
I was puzzled as I only knew this word as a weapon originated in Australia, or in the noun phrase 'boomerang effect', or likewise in the verb phrase 'to boomerang against'.
So, my manager explained that he meant that we should always return those umbrellas to the office after using them.
Have you, as a native speaker, ever heard of this usage?
Comment: Smile at your boss to let him think that you think he's clever. A boomerang by design returns to the thrower when it fails to hit something. If umbrellas were like boomerangs, they would automatically return to the umbrella stand when someone took one but it didn't rain.
Comment: I have heard this before (not with umbrellas, but other communal objects). To an Australian this meaning is pretty obvious and I personally would have understood what was meant straight away. The bit that I don't understand is why your manager thought this was an appropriate or effective phrase to use in another country. It doesn't really work in your context, I don't think.
Comment: @Danny I would say so. I wouldn't describe it as being a **common** idiom though, but it is fairly easily understood in an Australasian context.
Comment: @deadrat So you haven't heard such expression of his before?
Comment: @Danny As applied to umbrellas? No.  As applied to something that returns to you upon your launching it, sure. And it's not hard to understand what the manager meant. It's just inapt enough to be a ridiculous analogy. You have to consciously remember to bring back a borrowed umbrella, whether it rains or not.
Comment: @GoatsWearHats I'm in NZ. My boss is a Kiwi. So it seems that it's a common idiom in Australasia?
Comment: @deadrat Just out of curiosity, what country are you in?
Comment: @Danny The US of A
Answer: It's not a common usage, but one of the marvellous things about language is that it is extensible and flexible. This kind of creative use of language is frequently found in poetry. If poets didn't do this, we would find their use of metaphor tired and hackneyed.
When Robert Burns wrote "My love is like a red red rose", he didn't mean it as an analogy. Love isn't red, scented, with thorny stems. He meant it as a metaphor: that the effect of love on him was similar to the effect of looking at a beautiful rose (or something like that).
Saying that the office umbrellas are boomerangs is a poor analogy, but it's OK as a metaphor - we know what he means.
Analogies should have several features that can be mapped from the analogy to the thing being described (e.g. an explanation of an atom containing a nucleus with electrons orbiting round it as being a bit like planets orbiting around the sun - though actually this isn't really how electrons behave).
A metaphor can have only a vague resemblance to the thing being described.
As to whether a boomerang is a good metaphor for an umbrella that must be returned to the office: it may not be great poetry, but it's at least memorable.


If a PC is rendered unconscious in the ethereal plane while they were midair what happens to their body?

Question: If a PC has entered the ethereal plane via some magic e.g. Oil of Etherealness or the Etherealness spell, and then is knocked unconscious while they were midair, what happens to their body? Does it fall? Do they go prone but remain aloft?
Answer: They go prone but do not fall

The Ethereal Plane also disobeys the laws
of gravity; a creature there can move up and down as easily as walking. (DMG)

No gravity means no falling.
Prone is a feature of being unconscious:

The creature drops whatever it's holding and falls prone. (PHB)

I imagine the Ethereal plane as being in deep space.
Comment: Thanks for the answer, that's what I figured but I wasn't sure.
Answer: You do not fall, go prone, or gain the prone condition
Going prone (falling down so as to be flat on the ground) is the effect of gravity when going limp from being unconscious.
But there's no gravity in the Ethereal Plane.

The Ethereal Plane also disobeys the laws of gravity; a creature there can move up and down as easily as walking.

There is nothing to cause a creature to move when it goes unconscious, and the very concept of "down" is subjective in a place without gravity. So a creature doesn't fall down when they go unconscious.
But does the creature gain the prone condition anyway? Gaining the prone condition has three effects.

A prone creature must stand up before moving (crawling excepted). This makes no sense here.

A prone creature has disadvantage on Attack rolls. This is ostensibly because the creature's movements are restricted by the ground its lying on. This makes no sense here.

Creatures have advantage or disadvantage on Attack rolls against a prone creature. This is ostensibly because a creature lying down takes less space and might have some form of cover. This makes no sense here.

None of the effects of the prone condition make sense for a creature that isn't prone. Without anything independently causing the creature to actually become prone (lying on the ground), a creature going unconscious in a place without gravity does not gain the prone condition.


Should web servers be run by a special user?

Question: I'm pretty beginner-level at Linux, and one thing I've always wondered was whether things like Nginx / uWSGI (for a Django project) should be run under a user that was created for that purpose, or whether my normal login that I use to SSH to the server should be used.
Answer:
whether things ... should be run under a user that was created for that purpose

Yes, they must run under special user, because, as widely-announced processes in wild, if they (and only they) will be someway compromised (memory-injection as example) they can perform actions on system only with permissions|possibilities of such user (which usually have minimal rights outside own area)
Comment: "Must" is a bit strong.  A special account is prudent for sure - but his account will work.
Answer: Apache will have the same privileges as the user it runs as.  For security reasons, you want to limit the access Apache has to only the particular files it needs to serve the pages you want.  Whereas your user account will generally have a broader set of rights.


Cutting output of program running in loop

Question: What I'd Like to do
I'd like to cut the output of the program xkb-switch -W, which infinitely waits for layout group change, and prints group names to stdout. I'm only really interested in the first two characters of the output, so id like to cut it with cut -c1-2.
What I'm trying to accomplish
What I'm really trying to accomplish here is showing my current keyboard layout in my i3 bar with i3blocks, but I don't want the length of the line changing, since xkb-switch outputs not only the layout language (the first two characters), but also the layout variant, which I'm not interested in seeing. At the moment, this is what my block looks like:
[keymap]
label=
command=bash -c 'xkb-switch;xkb-switch -W'
interval=persist

What I've tried
xkb-switch -W > foo & while inotifywait -qe modify foo; do cut -c1-2 foo; done
I tried hacking together this oneliner, where the output of xkb-switch is redirected to a file, and by using inotifywait to wait for modifications to the file, cut is called to output the two characters I want to get.
This doesn't work however, because the file isn't clobbered by xkb-switch the way I'd initially intended (I understand why this wouldn't work), and also inotifywait outputs "foo MODIFY" when the file is modified, which I do not want. I guess the latter could be amended by redirection of some sort. But I suspect what I've tried is not the best approach.
Answer: Either I'm missing something important here or the simplest solution seems a bit too obvious: why not use a normal pipe?
xkb-switch -W | cut -c1-2

This will print the first two characters of each line xkb-switch outputs as soon as the line break is output.
Comment: That doesn't seem to work within the i3block configuration, although it does work just fine a terminal. So it seems I'm missing something how i3 or i3blocks works with the commands


ToolStripComboBox.SelectedItem change does not propagate to binding source

Question: My binding is set up as this:
<code>        _selectXAxisUnitViewModelBindingSource = new BindingSource();
        _selectXAxisUnitViewModelBindingSource.DataSource = typeof(SelectXAxisUnitViewModel);

        _selectedUnitComboBoxBindingSource = new BindingSource();
        _selectedUnitComboBoxBindingSource.DataSource = _selectXAxisUnitViewModelBindingSource;
        _selectedUnitComboBoxBindingSource.DataMember = "AvailableUnits";

        _selectedUnitComboBox.ComboBox.DataSource = _selectedUnitComboBoxBindingSource;
        _selectedUnitComboBox.ComboBox.DisplayMember = String.Empty;
        _selectedUnitComboBox.ComboBox.ValueMember = String.Empty;
        _selectedUnitComboBox.ComboBox.DataBindings.Add("SelectedItem",
                                                        _selectXAxisUnitViewModelBindingSource,
                                                        "SelectedUnit", true, DataSourceUpdateMode.OnPropertyChanged);

        // this is a bug in the .Net framework: http://connect.microsoft.com/VisualStudio/feedback/details/473777/toolstripcombobox-nested-on-toolstripdropdownbutton-not-getting-bindingcontext
        _selectedUnitComboBox.ComboBox.BindingContext = this.BindingContext;
</code>
The property "AvailableUnits" is a collection of strings and the "SelectedUnit" is a string-property. Now the dropdown list is populated as expected, but when I select and item in the list, the change is not propagated to the binding source. Any idea what I am doing wrong?
Update:
I Created a little test project and this problem occurs when I add a ToolStripComboBox as a subitem of another ToolStripItem. If I add the ToolStripItem directly to the MenuStrip everything works fine. The BindingContext is not assigned to the ToolStripComboBox when added as a sub item (see my code-comment) and my fix doesn't seem to do whats necessary to get this to work.
Answer: Can you change
<code> _selectXAxisUnitViewModelBindingSource.DataSource = typeof(SelectXAxisUnitViewModel);
</code>
To
<code> _selectXAxisUnitViewModelBindingSource.DataSource = new SelectXAxisUnitViewModel();
</code>
Comment: No, the actual instance is assigned later and I want to set up the binding schema first.


Water leak behind shower joint

Question: I need some quick help here. I think it should be fairly easy but want to check before tackle it. In my shower there is separate valve for handheld shower like in the pictures. Whenever I use it I would notice a small stream of water come out behind the "knob", not on the shower line. The stream come down along the tile wall. I am guessing there is a small leak in the pipe screw and just need a fresh teflon. But I am not familiar with this type yet. Do I just scrape of the caulk and turn the whole knob? This seem to me the knob is actually the joint and it is leaking at the joint as behind the wall seem fine.
Answer: Just like faucets these handhelds have a few variations on how you dismantle them. Since the water is leaking down the wall and not from the top of the hose it's important that you stop using it to prevent possible water damage inside the wall.
First, disconnect the hose from the wall mount so it can be removed. Although there might be other methods, there are only two ways that I've seen to remove the wall mount - either a set screw and/or by turning it counter-clockwise. Usually it's a set screw located under the wall mount. Once the set screw is loose, grip the wall mount, turn it counter-clockwise - it should unscrew.
If it's stubborn spray some WD40 between the wall and the mount.
I know you think it only needs some new teflon tape but there is a reasonable chance that the wall mount has simply cracked over time. You may need a replacement.
Comment: Might slide on to a shaft with an o-ring and then set screw holds it in place. A photo of the bottom might show a set screw.

Water leak behind shower joint


How to Fetch Dynamic URL Path within Next.js File

Question: I'm trying to find exactly what page the user is on. I'm creating a search bar such that when the user hits enter, they are led to another page with their query. For this, I am using a dynamic path. When the user types "abc" for example and searches it, they get led to a page "localhost:3000/search/abc".
I do this through a dynamic path, where I have a Next.js page rendered called search and a folder inside it called [searchText] which has an index.tsx file. I want to know what searchText is so I can query it against my database. However, I can't use window.location.href even inside a useEffect (useEffect seems to not be working on any of my pages) and using the React-Dom Router just gives me:

ServerRouter { route: '/search/[searchText]', pathname:
'/search/[searchText]', query: {}, asPath: '/search/[searchText]',
isFallback: false,   basePath: '', locale: undefined,   locales:
undefined,   defaultLocale: undefined,   isReady: false,
domainLocales: undefined,   isPreview: false,   isLocaleDomain: false
}

This prevents me from using asPath and actually getting meaningful information.
Does anyone know of any workarounds to this problem?
I tried the window.location.href which didn't work because window was not defined. useEffect is not working at all even when I import it (maybe this has something to do with how my React/TypeScript/Next app is set up) and the router when initialized in /search/[searchText]/index.tsx is unable to return meaningful information as there is nothing of meaning in asPath and query.
Answer: Turns out this was very stupid. Didn't realize console.log() was logging in the console online, not VSCode's console. Most of the time console.log() is just logging in VSCode so that was surprising. Everything is working now. Ended up not doing window.location.href because that was returning nothing and just using location.href which is working properly.


In two particle system why can't we calculate the gravitational potential energy of each mass separately and find the net potential energy?

Question: In a two particle system, suppose both are moving by their internal gravitational force, and hence the potential energies of the system is changing. Since both are acted upon by the conservative forces i.e. gravitational force and we know that the potential energy is equal to negative of work done by the conservative forces, can't we calculate potential energy of both the masses individually because both conservative forces is doing some work. Then add the values of potential energies to get the net change in potential energies of the system?
Answer: Gravity is a pairwise interaction with an associated potential energy of the form
\begin{equation}
E = - G\frac{m_{1}m_{2}}{\left|{\vec r_{1}} - {\vec r_{2}}\right|}
\end{equation}
where $m_{1}$ and $m_{2}$ are the two masses involved in the interaction and $r_1$ and $r_{2}$ are their positions. From the form of this potential its obvious that it makes no sense to ask about individual potential energies.
Comment: It still makes sense to say they have individual potential energies. Just  to say that they mutually share this energy instead.
Answer: The fundamental answer to your question is that the potential energy between 2 charges is mutually shared.
It is true that mass $M_{1}$ has a potential energy of $$U_{1} =-\frac{Gm_{1}m_{2}}{R}$$
It is also true that mass $M_{2}$ has a potential energy of $$U_{2} =-\frac{Gm_{1}m_{2}}{R}$$
It is NOT true however, to state that the potential energy of the system is $U_{1} + U_{2}$
"because both conservative forces is doing some work"
The definition of potential energy, is the amount of work required to bring a charge from infinity to some r,against the force of gravity.
This is work done by ME, not the gravitational fields.
The definition of potential energy of a system, is the amount of work to build up a distribution.
Let's say that we want to make  mass $m_{1}$ move to location x, what is the work that is needed to be done to move this mass from infinity to x?
There are currently no external gravitational fields, so zero work is needed.
Now let's build up mass $m_{2}$ in the presence of the gravitational field from $m_{1}$
$\int_{\infty}^{r} -\vec{F} \cdot \vec{dr} = -\frac{Gm_{1}m_{2}}{R}$
"Paradox 1":
You may now think that "hold on a minute, you've said that 0 work is required to move $m_{1}$ in its origin position, yet it HAS gravitational potential energy"
Yes, that is very true, since the calculated potential energy of $m_{1}$ assumed $m_{2}$ "existed" first. This is the amount of work required, given $m_{2}$
Existed at point y, to move $m_{1}$ to its location, in the presence of gravitation forces.
Potential energy of a particle, assumed the other parts of the distribution existed "first". Which is why both particles have some potential energy, That is mutually shared. It is the same energy!
It is the work required to bring them together.
If I fix "m1" in place, "m2"  gains that energy if it moves to infinity. If I fix "m2" in place, "m1" gains that energy if it moves to infinity
Paradox 2:
if I move mass 1, its PE changes,corresponding to work being done on mass 1. But if PE is mutually shared, mass 2's PE changes, so work must be so done on mass 2.
No,  potential energy required fields are static. Using the change in potential for mass 2, as proof of work being done, when in reality its because mass 1 moves, is invalid as there is a change of "external field"


Target Openers of Specific Sends

Question: I would like to send a campaign to an audience who opened my last two campaigns- ie, need to specifically target openers of the 2 campaigns vs. openers in a certain time period. Is there a way to do this? I do not write SQL- help!
Answer: You can do this in multiple different ways, but let's focus on some that don't require writing SQL.
First, you can navigate to the "Tracking" tab within "Email Studio", and click on the recent job (or send) that you're wanting to pull opens from. Once there, you'll find a clickable link that reads "Unique Opens." Click it, and you'll get a list of all subscribers who have opened the email at least once. From here you can click the "Copy All" button to copy all of these records into a New or Existing List. You can then re-send to this list. Alternatively, you can export this list if you'd like to re-import it into a Data Extension.
Second, you can create a Tracking Extract within Automation Studio to generate a file of all opens within a specified time frame. These opens will be split by Job ID. More info can be found about Tracking Extracts here.

Target Openers of Specific Sends


How to migrate Product custom options records from magento 1.7 to magento 2.x in product edit, order, invoice,Shipment and Credit memo?

Question: I looking for the migrate Product custom options records from magento 1.7 to magento 2.x
I have have migrated all the data from magento 1.7 to magento 2.2.6, but custom options not showing.
Answer: Please check in the product editing page to see whether custom options are showing. If they are there but not on the front end, go checking the catalog_product_entity table. In this table, there is a has_option field, this field must be set to 1 in order for the custom options to show up
Let me know if this helps
Comment: I want to show custom options in order, invoice,Shipment and Credit memo in back-end and Front-end
Comment: Then, please check the sales_order_item table to see if product_options collumn already has data or not. If yes:
For Magento version < 2.2, it has to be one serialize string.
For Magento version > 2.2, it's a json string


What cloud platform supports playframework?

Question: I know 2 now:

http://heroku.com: Supports play1 and play2, has free plan.
http://www.playapps.net: Supports play1, unknown play2, no free plan.
Answer: There many options for deploying play framework applications on the cloud
Like codemwnci said, most of them work with a war deployment.

Heroku for play!
princing: http://blog.heroku.com/archives/2011/8/29/play/
(seems like you get 1 web dyno + 5mb postresql db for free)
sample: http://devcenter.heroku.com/articles/play
db: postgresql
deployment: native via git
tutorial: https://github.com/opensas/play-demo/wiki/Step-13---deploy-to-heroku
play2 support: http://www.playframework.org/documentation/2.0/ProductionHeroku
Openshift
A PaaS offering by Red Hat
module: http://www.playframework.org/modules/openshift
pricing: you get 5 apps, with 500MB space each, for free, supports mysql, mongo, jenkins, perl, php, python and java
article: http://playlatam.wordpress.com/2012/02/09/play-framework-on-the-cloud-made-easy-openshift-module/
db: mysql, mongodb, postgresql
deployment: war deploy via git (or using the module)
(Using the raw cartridge is possible to deploy play apps natively, I'll see if I can write a tutorial on the next few days...)
vote for native support: https://www.redhat.com/openshift/community/content/native-support-for-play-framework-application
tutorial: https://github.com/opensas/play-demo/wiki/Step-12.5---deploy-to-openshift
Google Application Engine
module: http://www.playframework.org/modules/gae-1.4/home
cons: can't use mysql, should not use JPA
http://www.playframework.org/modules/siena-2.0.0/home
db: uses it's own datastore (Instead of JPA it is advised to use siena)
deployment: via module
nice example: http://viralpatel.net/blogs/2011/01/first-play-framework-gae-siena-application-tutorial-example.html
tutorial: https://github.com/opensas/play-demo/wiki/Step-14---deploy-to-gae
dotCloud
module: http://www.playframework.org/modules/cloudbees
princing: https://www.dotcloud.com/pricing/
(there's a free plan with 10MB db)
floss: https://www.dotcloud.com/pricing/pricing-faq/
AWS - Amazon Web Services
pricing: http://aws.amazon.com/en/ec2/#pricing
pricing: http://aws.amazon.com/en/elasticbeanstalk/#pricing
samples:
http://www.ibm.com/developerworks/java/library/j-javadev2-19/index.html
http://www.ibm.com/developerworks/java/library/j-javadev2-16/index.html
Jelastic -
homepage: http://jelastic.com/
module: http://www.playframework.org/modules/jelastic
CleverCloud
homepage: https://www.clever-cloud.com/en/
pricing: https://www.clever-cloud.com/doc/clever-cloud-overview/pricing/
deploying for Scala: https://www.clever-cloud.com/doc/scala/play-framework-2/
deploying for Java (same?): https://www.clever-cloud.com/doc/java/play-framework-2/

There are lots of options, and new ones come out every day...
Here's an article with a list of the Public and Private Cloud PaaS for java: http://cloud.dzone.com/articles/regarding-java-platforms
Regarding play 2 support, heroku provides native support and once war deployment is ready (is scheduled for next minor release) you'll be able to deploy to most of them. I managed to deploy a play2 app to openshift using the do-it-yourself cartridge, here's a screencast and a tutorial)
Comment: Let me just add, the PlayApps solution is not a cloud based one. You cannot scale up/down your server on the fly.
Comment: An awesome one is missing: [Clever Cloud](http://www.clever-cloud.com/en/), a PaaS which auto-scales (vertical / horizontal). It supports Play 1 and 2 (Java and Scala flavours). (no free plan but you can try it for free)
Comment: Just an update: CloudBees is shutting down its cloud hosting service
Answer: At the present date, Heroku and Playapps are your options for native Play support. There is a new one being developed that will also support web sockets (called Incipit), currently in beta supports 2.0 natively through uploading a zip file from the dist commmand and 1.0 through exporting as a WAR and uploading.
Your other option is to use one of the many cloud platforms, but exporting your application as a WAR file. Not ideal, but it opens up options for the likes of CloudBees and OpenShift and many more. There is also an open community request to add Play support to OpenShift here.
Answer: Cloud Foundry now has support for play 2.0 as well. Haven't tried it though.
See: http://blog.cloudfoundry.com/2012/05/31/cloud-foundry-now-supports-play/.
By the way, Playapps stopped its services. It promotes Heroku on their website.
Answer: I am using DotCloud, which offers a free plan
So far it looks good !
There is a module to make deployment easier for this platform.


Why Gothic fairweitjan doesn't have an ablaut?

Question: Gothic "jan" means a causative (e.g. driggkan "to drink" drankjan "to give drink to").
Gothic "ei" PGmc ī should turn into "ai" (e.g. dreiban "to drive" draibjan "to trouble").
Why Gothic fairweitjan doesn't have an ablaut?
Comment: [correction: Why doesn't Gothic fairweitjan have an ablaut?]
Answer: Not all Germanic class 1 weak verbs (that is, the ones formed with -j- or -ij-) are causatives; many are a second, occasionally more complicated category, which I'll just call "other".
The causatives derive from the PIE causative suffix *-éy-e/o-, which also put the verb root in the o-grade. PIE *o became Proto-Germanic *a, which is why you get a in inherited causatives where a corresponding plain verb, which usually just had the e-grade in PIE, might have i. (By analogy causatives created later, in Proto-Germanic or later still, received the vowel of the past tense singular of the plain verb. The Germanic past tense of strong verbs continues the PIE perfect, which usually had the o-grade in the singular, so the result was often the same.)
The other category ultimately continues PIE *-y-é/ó- and *-ey-é/ó-, which in the PIE stage put the verb root in the zero-grade, but by Proto-Germanic (*-(i)janą) just preserved the vowel of whatever stem they were applied to. You can still get (something that goes back to) an o-grade here occasionally if the stem had one for whatever reason (some nouns do, and this category is often denominal), but it's not typical or required.
Fairweitjan isn't a causative (of what verb? what would it mean?), but in this second category. No ablaut is expected.


Can I shoot a bear in self-defense?

Question: Can I shoot a bear in self-defense?  Will I face fines and jail time if I do?
Comment: Really, if a bear is about to kill you, do you care if stopping it gets you in trouble with the law.  I want *that* to be my last thought when a bear is eating me "well at least I won't have to see a judge"
Comment: In addition to what @RussellSteen just said, if you plan on shooting at the bear, you better shoot to kill as if you don't, you're screwed big time. If I were you, I'd rather try to shoot in the air first and hope it'll scare the bear off. In majority of the cases it will. Especially if you stand tall, put your hands in the air, try to look as big as you can and yell at the same time.
Comment: @RussellSteen your comment should be an answer.
Answer: You can. Bear spray is a more humane option; however, you do ask about legal repercussions. You can shoot pretty much any animal in self defense in the USA. After you shoot the animal it is important what you do if you want to avoid fines. Once the fight is over and you know you are safe you need to call the forest service. If you don't know their number call 911 and they can and will help you.
Source:
Last year a buddy of mine killed a Mountain Lion (cougar) in self Defense and didn't have a tag for one. A guy came out and looked at the Cougar, asked some basic questions like what weapon was used. Where was he standing. Where I was. What was the Mountain Lion doing that made him feel he had to kill it. When did it happen. The last question was "Will you help me carry it back to my truck?" He filled out a piece of paper with our info and that was it.
During the carry back we asked about what happens and he told us that depending on very technical qualifications such as if he wants to eat the animal or not and how far is is from his truck determines if he hands the hunters a tag and says have a nice day or takes it himself. Also, he said that if it was obviously not self defense or he had a bad feeling about it he could get the police involved but usually doesn't have to.
Comment: @NateEldredge No, do call 911. If you are in a life threatening situation to the point that you had to kill another (large) living creature, they would have no problem hearing from you. I know these people deal with a lot of crap calls (apparently people use 911 as an answering service for anyone who works for the city) but one where someone's life is/was very recently in danger, they will help. The first question will be "Are you safe now?" and when you say yes, the next question will be "Do you need medical attention?" If no, then they will give you the number you need to call.
Comment: Personal stories always make for good answers!
Comment: -1: If nobody is in immediate danger, do *not* call 911.  Call a non-emergency number; if you don't know it, call 411 and try to find a number for the appropriate authorities.  (It will only be the Forest Service if you shot the bear in a national forest.)
Comment: If you have to hike to get reception, then yes, don't call 911. Find the number for the forest service, but if you have reception where the attack happened, the 911 operator that you are connected to will be used to people in the wilderness calling in.
Answer: For hunting bears you have to check with your local rangers for hunting season, permits and so on.
Self-defense is self-defense if your mental state does not allow you to think and you feel killing is the only way out than it the only way out.
BUT Bear Defense Spray is more effective and easier to obtain than .45
Also Noise will scare them off. So if you shoot don't shoot the bear just shoot in its direction to spook it away from you.
Comment: FYI - I'm not too familiar with different caliber's but have heard that many will just bounce off the skull of a Griz (which is what you will be presented with if one is charging you - not a nice broad-side heart/lung kill shot). To wit, when I worked in Griz country (Alaska) we were required to carry 12-gauge shot-guns loaded with slugs.  +1 for bear spray.
Comment: "So if you shoot don't shoot the bear just shoot in its direction to spook it away from you" - Sure, I will probably shoot at his direction but not at him ;)
Answer: You can shoot a human in self defense in many countries, so don't worry about shooting a bear if you have to. I have UK military experience, and let me tell you, shooting a moving target with a handgun is difficult. If a 400kg bear is coming at you, and you only have 5 seconds to get an accurate shot away with all the adrenalin flowing, then chances are you will not stop the bear, even if you are well practised with the handgun.
The only firearm I would consider for a CLOSE encounter with a bear is a pump action shotgun. Easier to aim and far more stopping power. Not a particularly convenient or inconspicuous piece of kit to carry when hiking! But you do have that as a legal option here in the U.S.?
But bear(!) in mind, your mindset will change if you are carrying a firearm. You may be tempted to go for the gun too readily when there is perhaps a better alternative course of action, e.g. talk loudly, avoid eye contact and move away slowly.
Still, if I had a shotgun and bear spray, I would instinctively go for the shotgun first, which may be less effective than the spray. Given enough time though, I would fire shots in the air, before aiming at the bear. I have seen u-tube videos of Grizzlys scampering away in fear from the noise of a shotgun.
Answer: The TL;DR answer: Yes.
You can always kill in self defense if your life is in serious danger* from the animal or even person you're shooting, e.g. if you have good reason to believe they are trying to kill you (for instance because they're a bear and they're charging) in any jurisdiction I know of. It doesn't matter if that animal/person is the last white tiger or the queen of Britain. It even doesn't matter whether in hindsight you were actually in danger. If the bear is drawing what after the fact turns out to be a fake gun on you (I know, great example) you were still in the right, because you had no way to know it was fake.
If you ever die messily, let it not be because you wondered about local laws.
*Some jurisdictions like several US states use a more relaxed idea of serious danger, while other places like much of Europe are stricter, but getting mauled by a bear counts everywhere, even in places without bears.
See all the other answers for things to consider and some great alternatives.
EDIT: Oh wow, didn't see how old this question was.

Can I shoot a bear in self-defense?


Reason for vibration of molecules

Question: Why do molecules of a body exhibit vibrational motion? Is it due to interaction between various molecules of the body, or interatomic interactions between atoms in the same molecule? If it is because of any of them, how can these interaction cause the molecules to vibrate?
Comment: Atoms and molecules have energy even at 0 K.  This energy causes them to vibrate (among other things).  Interactions between various components of the molecules (nuclear/nuclear repulsion, electron/nuclear attraction, electron/electron repulsion, etc.) determine their motion (rotational, vibrational, translational).  Each component has a finite amount of energy associated with it.
Comment: Geeze all the answers are too complicated. In the simplest sense a molecule in free space can "vibrate" because the atoms which make up the molecule can move in different directions relative to the position of the whole molecule. See images within https://en.wikipedia.org/wiki/Infrared_spectroscopy#Theory
Comment: Matter is energy and the zero point vibrational mode is part of matter and is not caused by energy; it is energy.
Answer: Here is a picture and an equation that may add to the comment LordStryker made.  Molecules vibrate because they have energy. First the equation, as $T \to 0$ (absolute zero), the first term will vanish, but the molecule will still have an energy given by $h\nu/2$.  So even at absolute zero a molecule will have some vibrational energy, this is called the "zero point energy".  The parabola (representing the hydrogen well, for example, that two hydrogen atoms will "fall into" when they bond and become a stable hydrogen molecule) gives a pictorial representation of why this must be - energy levels are quantized.  Even the lowest level is above the bottom of the parabola, so even in the lowest energy level at absolute zero, the atom or molecule will still have a non-zero energy which will cause it to vibrate.
$\displaystyle\varepsilon = \frac{h\nu}{\mathrm e^{h\nu/kT} - 1} + \frac{h\nu}{2}$
Comment: Can we tap that for free, infinite energy?
Comment: @LordStryker  Lots of people have tried / are trying, but no success to date, that I am aware of (and I'm sure it would be big news!).  Google "zero-point energy" and you'll see some links.
Answer: Molecules have zero-point energy as a consequence of the Heisenberg Uncertainty Principle, which directs that it is not possible to simultaneously know the position and momentum of a particle, in this case a vibrational quantum. The zero point energy, $h\nu/2$, is that minimum energy needed to satisfy uncertainty.
In contrast rotational motion can have zero energy, i.e. the molecule does not rotate, but it is then not possible to know in which direction the molecule is pointing. As soon as it starts rotating its spatial orientation is limited to only certain values; again uncertainty limits this.
Comment: The uncertainty principle explains not causes.  Vibration or rotation are the energy in the molecule and are a result of the QM properties of matter and energy. They are not caused by the "presence" of energy. Changes in their levels are quantized and are the reason for the larger heat capacities of molecules over atoms. There is a zero rotational energy and most likely a zero translational energy. Can ZPE be harvested? QM energy can be; think lasers, microwaves and photosynthesis. ZPE requires more effort; It must wax and wane in nuclear fission, fusion and other nuclear reactions.
Answer: Heat
Molecules vibrate because of heat. Or we could say this the other way round: heat is because molecules vibrate. If we ignore quantum stuff (molecules vibrate even at zero kelvin) then the major reason for vibration is because  things are warm. And the reason why any particular molecule vibrates is because is is constantly bumping into all the other molecules around it. The more vibration, the hotter.
In a molecular gas, the molecules hit each other a lot and this ensures that any energy they have is well distributed among the molecules (in a gas much of the thermal energy is tied up in the kinetic motion of the molecules or atoms, but for molecules, some of it will be distributed in vibrations and the constant bumping into each other will ensure that the energy is well distributed).
Solid or liquids are similar but much of the energy is distributed to those vibrational modes. Solids, where the atoms or molecules in them don't have kinetic energy by definition (that is, they are locked in relative place, which is more or less the definition of a solid), most of the energy is tied up in vibrations either of atoms/molecules vibrating around their location in the solid or by stretching vibrations of the bonds inside the molecules. Molecules in the solid interaction with each other (if a neighbour molecule is vibrating strongly, you will pick up some of that energy because you are close to and interacting with that neighbour).
For example, heat one end of a bar of metal and the atoms will vibrate more strongly. But those vibrations excite the atoms near the hot end and they start to vibrate more strongly as well. They in turn do the same until the whole bar is warmer and all the atoms are vibrating more vigorously.
Comment: I think "atoms or molecules in them don't have kinetic energy by definition" is misleading. The translational KE of molecules in a solid correlates with temperature just as in a liquid or gas. The difference is that the translational motion in a solid appears as a very small amplitude vibration. The difference between these translational vibrations and a true vibrational mode is that the center of mass is moving. The vibrations tend to couple on a large scale in the form of phonons.
Answer: Taking a stab at theoretical physics here.
As long as there is some energy, the electrons and other sub atomic bits will move randomly. This randomness will result in tiny fluctuations in the distribution of energy /mass inside the atom resulting in vibrations that can be passed on to adjacent atoms.
The fluctuations will also result in fluctuations in charge distribution inside the atom, that can affect the state of adjacent atoms, again causing vibrations and rotations.
Before long, a feedback loop could in theory arise between adjacent atoms whereby the motions of a neighborhood of atoms may appear random to the macro observer, but be quite deterministic at the sub particle level.
I have no proof of this from an experimental standpoint, but from my understanding of the topic as an energy engineer, this makes sense to me. Cheers

Reason for vibration of molecules


I changed bitcoin address but the bitcoin is still stuck in the old address and i don't know how to access my former address??? Please help me

Question: I sent bitcoin to my bitcoin core app a few weeks ago, however the app wasn't synced so i tried to export the private key but it wouldn't work, it said it couldn't work for the address, so i changed address but the bitcoins remained in the previous address, i updated my hard drive so i could sync the app and now the app doesn't have my old address in my history but the coins are still in the old address, is there any way i can access the former address??
Comment: Welcome @James Kimberly, you need the private key, it is stored in wallet.dat in Bitcoin core, do you have that file backed up somewhere? If you could provide more info about your O.S., that would be helpful.
Comment: hi,  in my finder i have two documents 'wallet.dat' and 'wallet backup.dat' but it says i don't have an application that can open them, i have a MacBook air
Answer: Where are bitcoins stored?
Some basic principles:
Bitcoins are not actually stored in wallets. Your private-key is stored in your wallet and from that the "bitcoin address" is derived.
The bitcoins are associated with the address.
Movements of bitcoin values are kept track of in an accounting ledger called "the blockchain". Bitcoins are not actually stored in the blockchain, the blockchain just keeps track of the movements of bitcoin values from one address to another.
There is no master copy of the blockchain but lots of people running bitcoin software have their own copies of it and can use it to check transactions.
So bitcoins are not stored anywhere and moving their value from one address to another involves a bitcoin transaction paid for using a mining fee. You cant just change the address of some bitcoins without making a transaction and having it published to everyone's copy of the blockchain.
Where are my bitcoins?
To see how many Bitcoin are associated with your "old address", you can type the address into a "blockchain explorer" website.
If the bitcoin value has been moved ("spent"), this will show you the bitcoin addresses it went to.
Change address
You don't say how you changed the address. Is it possible you mistakenly generated a change address - This is an address for change to be sent back to you when you buy something. Change in a similar sense to small coins returned when you buy something using a large banknote. If you did this, your original address is still usable and nothing is lost or broken.
Recovering from an unusable wallet
Using the private key
See How can I export the private key for an address from the satoshi client? and note that, if your wallet is protected by a passphrase (as it should be), you have to enter command walletpassphrase correcthorsebatterystaple 600 before command  dumpprivkey 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 but replacing correcthorsebatterystaple with your wallet passphrase and replacing 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 with your old address.

One way to recover from a broken wallet requires the private key. It looks something like either of these two examples

E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262 or
5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF

If you have that written down somewhere (which you really should), you can download a lightweight wallet to a new clean computer and import your private key into that wallet. Use a lightweight wallet because it takes much less time to sync and be usable.
Once you have recovered, I would suggest using a paper wallet for long term storage or a hardware wallet for more security. Regularly practise recovering your wallet from backups, recovery-phrases and private keys.
Using an old backup copy of wallet.dat
See Import wallet.dat into a new Bitcoin-Qt client - essentially, make a copy of old wallet.dat install a new bitcoin-core wallet somewhere, stop the program, replace it's new wallet.dat with your copy of the old wallet.dat and restart the program. You may have to wait a few days while it synchronises with the network.


How do I increase the /proc/pid/cmdline 4096 byte limit?

Question: For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps.  I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline.  How can I increase this limit?
Comment: Being a non-Java-guy, I wonder how you run that on Windows. XP had a limit of, I think, 2048.
Answer: For looking at Java processes jps is very useful.
This will give you the main class and jvm args:
jps -vl | grep <pid>

Comment: Even worse for me. Truncates quickly
Comment: @HaveAGuess, wfm - it shows the main class, no matter how obscenely long the classpath may be, which is what the OP asked for. (It can also optionally show other arguments.)
Comment: Works for me too, shows all parameters for insanely long (more than 4096 chars) Weblogic command lines (Linux 64bit). Thanks Kevin!
Comment: I am trying `jps` to see full classpath of hadoop java processes... for some reason `jps` won't even show me the classpath!
Comment: Thanks, this worked for me. I needed to add the -m option to see the command line arguments.
Comment: `jps -lvm` even better for me - the `m` is needed to show command-line args (not JVM args) passed to your Java `main` method.
Answer: You can't change this dynamically, the limit is hard-coded in the kernel to PAGE_SIZE in fs/proc/base.c:
 274        int res = 0;
 275        unsigned int len;
 276        struct mm_struct *mm = get_task_mm(task);
 277        if (!mm)
 278                goto out;
 279        if (!mm->arg_end)
 280                goto out_mm;    /* Shh! No looking before we're done */
 281
 282        len = mm->arg_end - mm->arg_start;
 283
 284        if (len > PAGE_SIZE)
 285                len = PAGE_SIZE;
 286
 287        res = access_process_vm(task, mm->arg_start, buffer, len, 0);

Comment: Recompiling the kernel feels like moving to a new house because you didn't like the previous one's sofa.
Comment: Anything can be adjusted if you are willing to recompile the kernel but it still can't be changed dynamically.
Comment: [This was fixed in June 2015](https://github.com/torvalds/linux/commit/c2c0bb44620dece7ec97e28167e32c343da22867) and this answer is now out of date.
Comment: Note that this can be adjusted if you're willing to recompile the kernel to do so (see my comment for a how-to link).
Answer: I temporarily get around the 4096 character command line argument limitation of ps (or rather /proc/PID/cmdline) is by using a small script to replace the java command.
During development, I always use an unpacked JDK version from SUN and never use the installed JRE or JDK of the OS no matter if Linux or Windows (eg. download the bin versus the rpm.bin).
I do not recommend changing the script for your default Java installation (e.g. because it might break updates or get overwritten or create problems or ...)
So assuming the java command is in /x/jdks/jdk1.6.0_16_x32/bin/java
first move the actual binary away:
mv /x/jdks/jdk1.6.0_16_x32/bin/java /x/jdks/jdk1.6.0_16_x32/bin/java.orig

then create a script /x/jdks/jdk1.6.0_16_x32/bin/java  like e.g.:
    #!/bin/bash

    echo "$@" > /tmp/java.$$.cmdline
   /x/jdks/jdk1.6.0_16_x32/bin/java.orig $@

and then make the script runnable
chmod a+x /x/jdks/jdk1.6.0_16_x32/bin/java

in case of copy and pasting the above, you should  make sure that there are not extra spaces in  /x/jdks/jdk1.6.0_16_x32/bin/java and #!/bin/bash is the first line
The complete command line ends up in e.g. /tmp/java.26835.cmdline where 26835 is the PID of the shell script.
I think there is also some shell limit on the number of command line arguments, cannot remember but it was possibly 64K characters.
you can change the script to remove the command line text from /tmp/java.PROCESS_ID.cmdline
at the end
After I got the commandline, I always move the script to something like "java.script" and copy  (cp -a) the actual binary java.orig back to java. I only use the script when I hit the 4K limit.
There might be problems with escaped characters and maybe even spaces in paths or such, but it works fine for me.
Comment: This is probably the easiest way to go.  You can also set the `CLASSPATH` environment variable just for that specific command, or split the needed paths between `CLASSPATH` and the command line.
Comment: Great workaround to see the full command line, I've used it for javac too
Comment: If you have access to the actual java executable used (for example in Eclipse), you can skip the moving of the binary and just create the script that prints the commandline (to a file) and then starts the java application. Make sure you place the script in the JDK bin folder.
Answer: You can use jconsole to get access to the original command line without all the length limits.
Comment: it may work and it increases the length limit, but for really huge command line it doesn't work anymore and gets truncated (just experienced that).
Answer: It is possible to use newer linux distributions, where this limit was removed, for example RHEL 6.8 or later
"The /proc/pid/cmdline file length limit for the ps command was previously hard-coded in the kernel to 4096 characters. This update makes sure the length of /proc/pid/cmdline is unlimited, which is especially useful for listing processes with long command line arguments. (BZ#1100069)"
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/6.8_Release_Notes/new_features_kernel.html
Answer: For Java based programs where you are just interested in inspecting the command line args your main class got, you can run:
jps -m

Answer: I'm pretty sure that if you're actually seeing the arguments truncated in /proc/$pid/cmdline then you're actually exceeding the maximum argument length supported by the OS. As far as I can tell, in Linux, the size is limited to the memory page size. See "ps ww" length restriction  for reference.
The only way to get around that would be to recompile the kernel. If you're interested in going that far to resolve this then you may find this post useful: "Argument list too long": Beyond Arguments and Limitations
Additional reference:
ARG_MAX, maximum length of arguments for a new process
Comment: -1. The first part of your comment is not correct. On my system, `getconf ARG_MAX` says that `ARG_MAX = 2097152` (meaning that my maximum argument length is 2 megabytes). However, `/proc/$pid/cmdline` is truncated to `PAGE_SIZE` which is 4096. Your how-to link does NOT cover this specific situation - I have no idea if changing the relevant bit in `fs/proc/base.c` would cause other problems.
Answer: Perhaps the 'w' parameter to ps is what you want.  Add two 'w' for greater output.  It tells ps to ignore the line width of the terminal.
Comment: nope, even with ww, it truncates at 4096.  I think ps is reading from /prod/pid/cmdline which is also truncated.
Comment: Just to clarify what @Caskey said with "Add two for greater ouput", that's -w -w (or -ww) for unlimited width in the output.
Comment: @Jay unfortunately it seems it is not unlimited, it is limited to 4096 characters.


Is stupidest a word?

Question: Is the word stupidest grammatically incorrect? I've seen that you have to write "the most stupid," or something like that. But we're taught that stupidest is wrong.
Comment: From [Merriam-Webster](https://www.merriam-webster.com/dictionary/stupid): "**Is stupidest a word?** The word *stupidest* has been in use for hundreds of years; there is nothing wrong with it. *Most stupid* means the same thing, and people who don't like *stupidest* should feel free to use it instead."
Comment: Long ago the rule was - single-syllable words (fast, tall, hot, fat) could get the -est ending (fastest, tallest, hottest, fattest), and multi-syllable words would use most (important: most important; unruly: most unruly; hateful: most hateful), with at least some exceptions for some two syllable words ending in -y, like happy: happiest or silly: silliest. Another exception was for at least some two-syllable words with emphasis on the first syllable, like stupid. We always said stupidest, and that still sounds better to me than more stupid.
Answer: Yes, "stupidest" is a real word and it is grammatically correct. I only found that out now as I researched this answer.
When I was in elementary school in the 1960's, I was also taught that one had to say:

stupid
more stupid (comparative)
most stupid (superlative)

In recent years, I hear people saying things like, "That's the stupidest thing I ever heard." Or, "Can anything be stupider than that?"
It seemed to me like slang, like people were just too lazy to speak correctly in the vernacular. However, when I looked it up on Google just now, I found the following in Grammarly:

Stupid is a two-syllable adjective, which means you can make its
  comparative and superlative forms in one of two ways: by adding the
  corresponding suffix or by adding more or most.

For some two-syllable words, says Grammarly, we put more and most in front of them but for stupid we can use either method.

Comparative: er: tall, taller; stupid, stupider; more stupid
Superlative: est: tall, taller, tallest; stupid, stupider, stupidest; most stupid

According to Grammarly:

Stupider is grammatically correct, it is a real word, and it's been in
  use for at least the last two hundred years.
...
As with stupider, stupidest is perfectly correct and listed as
  standard in dictionaries.

I'm not going to argue with Grammarly and standard dictionaries. In fact, I like the words stupider and stupidest. There's just nothing that expresses disgust for lack of thought better than those two words, in my opinion.

Is stupidest a word?


Does publication importance diminish over time?

Question: Thinking of applying for a PhD in a 2-3 years as I want to focus on my industry job at the moment, and I was wondering how publications are evaluated by grad admissions over time?
Will a very good publication not be evaluated as highly if it happened 2-3 years prior to the candidate's application (given they have not been in academia during these last 2-3 years)? Is there an expectation that your most recent pub will be the best?
Comment: Well, it depends on each single comitee. I any case, you should frame your publication as "when I was a student, I was able to publish" rather than thinking "my best publication is 2 years old". Think about what the publication tells about you, not about what the pubblication contains...
Comment: "Is there an expectation that your most recent pub will be the best?" No.
Comment: I did my PhD as a "Mature Student" many years after I completed a masters by coursework and thesis. I also published a couple of papers at the time. The admission criteria was based on the ability to do research, hence they required either a masters by thesis or equivalent and/or evidence of publication. They didn't care how old the publications were. (In Australia PhD candidates usually have to complete an MRes/MPhill before entering a PhD program to "prepare them" and this is waived if you have previous research experience)
Answer: No one can predict how an individual will judge something like this, but I would find it highly unusual that a small number of years would even be noticed. Twenty or so years might be, however.
But, peripherally related to this is a sense that one might well favor someone who is active in research, though more for a faculty position than doctoral admissions.
One way to mitigate any effect, however, is to have a "Work in Progress" section on your CV. This indicates that you haven't given up the research "mindset". If you are currently active in research I suggest that you keep a notebook of "ideas" that occur as you go along. Ideas about extensions or variations on the current theme or just things that pop into your head and that might be worth pursuing later. Mining such a notebook for research is a valuable thing to do and can lead to that "Work in Progress" section.

As for the headline question, an incited work probably diminishes in importance over the years as no one currently finds much value in it. But a highly cited paper probably increases in "value" for such things.
Answer: If you write your essays correctly, your application will be evaluated in the context of your career path.  If your career path carried you outside of areas where you are expected to publish, your evaluators should pick up on that, and a 2-3 year gap in your publication record should not impact your application negatively (Keep in mind that a good number of candidates who get accepted to PhD programs will have zero or one publication of any real merit).
I would think that an important part of your application package would be conveying a feel for why you want back in to academia after going to work in industry.  You want your evaluators to think of you as an applicant with real direction, and not one simply wandering from gig to gig.  This isn't as critical for your current situation as for, say, somebody in industry for 10 years, as you haven't been in the working world for that long, but paying some attention to this will make your applications stronger.


Torch.cuda.is_available() is false for cuda 11.8

Question: I have been struggling with this problem for the last two days yet not resolved.
My torch.cuda.is_available() is always False despite whatever I try. But there is no problem with Tensorflow for the GPU.
My Details:
Cuda Version: 11.8
Cudnn: available for cuda 11.x
python version: 3.10.4
Visual Studio: 2022
OS: Windows 10
Installation Method Used For Pytorch:
Used as mentioned in Pytorch: https://pytorch.org/
Command:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
Please please please help
Comment: Pytorch just doesn't support CUDA 11.8 yet, I think. You will need to downgrade to CUDA 11.7 or wait.
Answer: From the official site torch. There is no Cuda 11.8 support yet started. So try 11.7 or 11.6


Recursive Newton Square Root Function Only Terminates for Perfect Squares

Question: I wrote a program that looks very similar to other recursive newton square root functions I have seen on the web. For some reason this one only works with perfect squares and I can't seem to find a reason why. I have tried passing 3 variables(epsilon), setting x=a, setting a = to the equation passed in line 9 then passing abs(a*a-x). I tried to describe it the best I could it's a slightly new topic for me and I am just not sure if this is only capable of finding perfect roots or if my code/equation is incorrect.
 1  #include <cmath>
 2  #include <iostream>
 3  using namespace std;
 4
 5  double newtroot(double x, double a) {
 6      if (fabs(a*a - x) <= DBL_EPSILON)
 7          return a;
 8      else
 9          return newtroot(x, fabs(a*a + x)/(2*a));
10  }
11
12  int main() {
13      cout << newtroot(9, 1) << endl;
14      system("pause");
15      return 0;
16  }

EDIT: The function does not only work for perfect squares but it only returns correctly for perfect squares. If it is not a perfect square a ends up being the correct value (checked in the debugger) but the recursion never stops. I figured it must be something with the comparison in line 6 so I tried replacing DBL_EPSILON with a and the incorrect value is returned.
This error also shows on line 6 when a non-perfect square is entered:

Unhandled exception at 0x00007FFE8E9C06F0 (ucrtbased.dll) in RecursionProgrammingExcercisesMurphyT.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x00000013B2603FE8). occurred
Answer: Not detecting the base case is due to an overly optimistic interpretation:
DBL_EPSILON is not "a value suitable to terminate improving any approximation," but
Difference between 1 and the least value greater than 1 that is representable:
it needs to be scaled to limit relative error.
return (fabs(approx*approx - x) <= 2*x*DBL_EPSILON) ? approx
        : newtroot(x, fabs(approx*approx + x)/(2*approx));
When an approximation is fast enough to tolerate numerical errors, a promising approach to terminate it is to check that the new approximate value is neither the current nor the previous one.
/*! approximate the value of x**.5 */
double newtroot(double x, double approx, double previous) {
    double next = fabs(approx*approx + x)/(2*approx);
    return next == approx || next == previous
        ? approx : newtroot(x, next, approx);
}


Is this normal: my direct Ethernet is 5x faster than the same Ethernet via Airport Express?

Question: When I connect my Mac via Ethernet it has 5x more maximum speed than when connecting it with the same Ethernet to the latest Airport Express. Is this normal (and if so, why)?
Answer: It is probably because you are connecting to a gigabit switch when referring to "direct Ethernet" and when you connect to your Airport Express via Ethernet, it is connected at 100Mb or "Fast Ethernet"
From Apple's website for the Airport Express:

I would check the switch you are using to connect "direct" and confirm that it is a gigabit switch.