Does a Turing complete shell means equal secure?

Question: I have heard that Linux is more secure than Windows. Is that true? I think they are equally secure because both has a Turing complete shell so if you management to do harm on one system, there is a method to do the same harm on another system. Is my reasoning correct?
Comment: Turing completeness doesn't have a direct impact on security in that way. It doesn't require that any given method will work on every system.
Comment: There are a number of turing-complete interpreters available [in this old stackoverflow question](https://stackoverflow.com/questions/1053931/creating-the-shortest-turing-complete-interpreter). See how much damage you can do to a system if your shell is set to one of those...
Comment: What does turing completeness have to do with security...?
Answer: It is not possible to determine whether Linux is more secure than Windows or vice versa. Turing completeness is not a security metric that can be used to objectively compare to what degree two systems would be considered secure.
Given the architectural differences between them, Linux and Windows are incommensurable abstract constructs in the context of security. That is, given their considerable differences, absent an objective standard or rubric that can be used to evaluate how measurably secure a system is, these two systems can't be directly compared in terms of how secure/insecure they are.

The term "Linux" actually refers to the Linux kernel.
Linux kernel architecture is monolithic, meaning the kernel implements all of the functionality expected of an operating system. This is not the case with the Windows operating system, whose architecture is hybrid kernel based, rather than monolithic kernel based.

NT-based Windows is classified as a hybrid kernel (or a macrokernel) rather than a monolithic kernel because the emulation subsystems run in user-mode server processes, rather than in kernel mode as on a monolithic kernel, and further because of the large number of design goals which resemble design goals of Mach (in particular the separation of OS personalities from a general kernel design). Conversely, the reason NT is not a microkernel system is because most of the system components run in the same address space as the kernel, as would be the case with a monolithic design (in a traditional monolithic design, there would not be a microkernel per se, but the kernel would implement broadly similar functionality to NT's microkernel and kernel-mode subsystems).1

Even if the Windows NT kernel and the Linux kernel were both considered to be monolithic in design, there are still significant differences in implementation, and by extension, functionality. A stark example of this is the differences in the kernel interfaces (system call APIs): while the number of Linux system calls is approximately 340, there are far more Windows system calls(~700 to over 1000 (speculated), depending on which kernel). In addition to this, the manner in which syscalls are invoked differs between systems as well.
Given the differences in the design and implementation of the Windows and Linux kernels, it should come as no surprise that the the format a binary must have in order to be loaded into memory and executed differs between the two systems as well - both kernels enforce different application binary interfaces (ABIs) which describe how a process is to be created in virtual memory based on the various segments of an executable binary. In order for the Windows program loader to map into memory and execute a binary, the binary must conform to the Portable Executable (PE) format, whereas Linux binaries must conform to the Executable and Linkable Format (ELF).

Why is any of this relevant? Due to the above differences and many more besides between the Windows and Linux kernels, Windows and Linux processes are created from differently formatted and designed binaries, mapped and loaded into virtual memory by different kernels that enforce different ABIs, have different runtime environments, have different kernel invocation mechanisms, have different conceptions of dynamic linking, etc. These differences prevent direct comparisons between operating systems being made when it comes to security, since they will generally not share the same weaknesses. This is obviated when one attempts to compare the Windows shell with the Linux shell - even the term "shell" does not have a common meaning between the two systems. Linux does not have a registry, the COM, WMI, ASP.NET and so on. A concrete example of this is trying to compare bash with PowerShell in order to determine which is "best" - it can't be done.

1. MS Windows NT Kernel-mode User and GDI White Paper
Comment: Minor nitpick - the binary format is surprisingly less important than it appears these days, as it is possible to run PE binaries on Linux (WINE) and ELF binaries on Windows (WSL), and these layers also expose many of the same APIs. Of course, the kernels are still very much different.
Answer: Turing completeness does not mean you can do everything. It means any program is expressible in the language. It does not mean that the underlying system will actually allow that program to do what it is expressed.
For instance, in Linux, a user level program (ie, not root), can indeed express and run "rm -rf /" to remove everything on the computer. However, it will not actually succeed as the user level program running in the user level shell simply cannot remove files that the user does not control.
Answer: Turing completeness and security are independent of one another.  Linux has a reputation of being more secure due to its permission model and the fact that everything is open source. The reasoning behind open source being more secure is that more people are capable of reviewing the OS for security vulnerabilities.
Answer: Turing completeness means that a machine can do any calculation that another Turing complete machine can do.  This does not mean that it can do anything else.  All computers have capabilities which extend beyond what a Turing machine does because all computers are expected to do more than just compute calculations.
A Turing machine does not:

Read from a keyboard
Craft ethernet packets
Display information on a screen
Read a clock or otherwise gauge the passing of time.

What being Turing complete does imply is that you can generally emulate any calculations another computer might do, so long as those calculations aren't time bound.
As a real life example, consider Google's Native Client (NaCl).  In general, it is very risky to run unknown executables on your computer.  You never know when they will be malicious.  NaCl provides a strict subset of that native functionality which is designed to prevent clever ways to do damage.  It does not, however, prevent these applications from being Turing complete.  They're welcome to calculate anything they please within their little bubble... they just aren't allowed to have any unintended side effects outside of that bubble.


How to understand this form of writing the solution: (some salt • n H₂O)?

Question: For example — "high purity chloride salt of Zinc $(\ce{ZnCl2.2H2O})$" or "various concentrations of $\ce{FeCl2.4H2O}$". What does the number before $\ce{H2O}$ mean?
Answer: The salt's crystal lattice's repeating unit is constituted of n molecules of salt and m molecules of water. Such salts are called hydrates. Wikipedia even has a nice picture of a hydrated vs non hydrated salt.
You can have anhydrous ferrous chloride, as well as ferrous chloride tetrahydrate. The number indicates how many water molecules are present in the crystal lattice's unit cell.
EDIT
This has just crossed my mind: be careful when preparing solutions of metal complexes to make sure you know what compound you're working with. One gram of anhydrous salt contains more equivalents than a gram of hydrated salt. This information should be obvious on the bottle. If not, ask a lab tech if they can identify the hydrated/anhydrous salt by memory.
Comment: Note that the older notation for coordination compounds used a dot as well, before coord compounds were properly understood.
Answer: You should look up water of crystallization.
These H2O molecules that are written after that salt are actually the water of crystallization, i.e., the no. Of water molecules that attach to one formula unit of a salt.
You may know about the fact that hydrated CuSO4 salt (blue vitriol) is blue in color. This salt has these same water of crystallization. Its formula is CuSO4.5H2O. But upon heating, it loses water of crystallization due to evaporation and simply reverts to its anyhydrous state CuSO4.


Difference between Cache,Session,Application,View in ASP.Net

Question: I want to store some data during my site viewing.
Sometime i need to store large data like crystal reports and some times i need to store a string.
So which is best to use and when to use.
Where are these datas stored. i.e., Client or Server
Comment: What are the use of storing crystal reports and string?
Comment: to display a crystal report in browser, if a crystal report have many pages we have to store in session so that pagging can be done
Answer:
Please go through this link:
Nine Options for Managing Persistent User State in Your ASP.NET Application
Answer: What you are asking is about State Management in ASP.NET. What you have actually listed is Server Side state management options.
You can made a choice of which to use depending on your requirement or functionality.
I will recommend you do some background reading on MSDN regarding State Management. I am not sure which answer you need here as your query is a bit generic.
Here is a link to get you started... http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx
Answer: This is a very open ended question.  Ass Julius said you need to learn more about the different ways you can store information.  For example, Application is used when you want to store information on the initial startup of the site and make it available to all users.  Session is for a single user so you may have many sessions open depending on how many users you have online at that time.  Cache is also a way you can store information on the server.  All of these are stored on the server so if you have hundreds of users online at the same time, server memory will be consumed holding all this information.  Rule of thumb is to try to be conservative when storing information in these locations.  Personally, I rarely use application and also try to limit my use of session to when it makes sense.  If I were to write an app that used crystal reports as you are, I would probably use sql to store the paramaters of the report and generate the report from the parameters but it depends entirely on the needs of the user using the app.
You can find a wealth of infomation on this subject on line.  Hopefully this will give you some information.


How to know the login user of a docker image?

Question: I'd like to know the default user of a docker image (e.g., publicisworldwide/python-conda) from command line. Is there a way to do so? Thanks.
Answer: If you will refer : python-conda:dockerfile which shows default user is lion.
You can retrieve that default user value from $USER variable as well.
Without Dockerfile and starting container , below command can be used.
docker image inspect <image_name> | grep 'User'

Comment: You can execute docker image inspect  | grep 'User' and look for User section that will have the default user in it.
Comment: I'd like to directly get from an image. As for this example, you can track down a docker file. But there be case only image is known, but not the docker file.
Answer: Every docker image can have multiple users and their definition of "default user" may differ.
Here comes to the rescue, environment variables defined in Dockerfile.
docker exec CONTAINER bash -c 'echo "$CONTAINER_USER"'

This will get the CONTAINER_USER variable(which is usually the default user) from the running container via bash shell.
More information regarding docker/exec.
Comment: But this requires the start of a container. How to get the default user without starting a container from the image?


Spoke Tensions and Pitch

Question: What are standard spoke tensions and what note pitches do they produce in order to adjust them with a bare minimum of tools.
Answer: Not really answerable as written because there are no "standard tensions"
There is "enough" and "not yet enough"  (okay there's also the rare case of "too much" but that requires significant effort.)

a rim is done when it is true and has minimal lateral and vertical runout, and has "sufficient tension" to not fold under side loads.

My rule of thumb for gauging tension is that every spoke should flex no more than two millimetres in the middle when squeezed against its crossing-pair spoke.  Ideally it would be half that.A rear wheel would have higher tension on its drive-side than the NDS.
If you want a musical version of that, lightly bounce a metal thing like a screwdriver on the spokes while the wheel spins should offset in pitch by no more than half an octave, and any clear outliers should have their tension spread across the neighbouring 2 or 4 spokes on that side. No wheel is perfect tension across all spokes.

The bare minimum tools are:

a spoke-nipple key that fits your square drives closely and minimises the risk of rounding off.   If you have weird nipples like Mavic, the correct tool is necessary.You might think a flathead screwdriver in the end of the nipple is sufficient?   No it really isn't so don't bother.
a rag or way to clean your nipples and rim.   A clean rim is so much nicer to work on.
a clean finger to use as a gauge between the fork/stay, and the rim's sidewall/brake track.
Something to distract you  - a background music track, radio, TV or whatever.
PATIENCE !

Nice to have tools:

A truing stand is overkill - I use an old fork upside down with the steerer tube in a bench vise, and I have one for 100mm front wheels and another stretched to accommodate rear wheels.If you have nothing else, the bike itself can be used to hold the wheel while truing.

some cable/zip ties around the fork legs to act as visual indicators when truing.

If you have bladed spokes, then some way to support the spoke in the correct orientation while turning the nipple, is wise.

Unnecessary tools:

Spoke tension meter - I've never needed one.
Dishing tool - probably would make a rear wheel come together faster, but they're not required.  If your dish turns out to be off, you loosen all the nipples on the tight side by half or one full turn, and then tighten all the nipples on the other side by the same amount.  Then you re-true the rim laterally.

Remember to true wheels with no tyre/tube fitted but rim tape is okay.
Answer: This is not a method that works well unless you have a reference wheel.
The problem is that spokes in all wheels but radial wheels cross. This creates extra complexity: when you pluck a spoke, it creates a quite complex tone caused by parts of the spoke you pluck, and partially by the other spoke that crosses with it.
I have never found this "tone method" to work. Even if you have a mobile phone with a tone generator, allowing to create a tone with certain frequency, you probably won't be able to accurately determine spoke tension from that. Not even if you know the physics and can calculate the theoretical tone based on the spoke diameter, length and tension.
You really can use the "tone method" only one way. If you have a wheel with spokes of certain spoke pattern, spoke count, length, diameter and tension, and if you want to build a similar wheel with spokes of approximately the same length, the very same diameter, spoke pattern and spoke count, and the very same tension, you can compare the tones on those two wheels. As an example, 700c cross-3 36-spoke wheel with 2mm spokes can be used as a reference to build a similar 700c cross-3 36-spoke wheel with 2mm spokes, even though the spoke lengths may vary by few millimeters. Then if you compare the tones, you will be able to have approximately the same spoke tension. This works if you are not tone deaf.
For building your first set of wheels, if you don't have a suitable reference wheel, or if you are going to change spoke type (for example going from 2mm straight gauge spoke to 2.34mm/1.8mm/2.0mm triple butted spoke), or change spoke length massively (for example going from 26" wheel to 700c wheel), or change spoke count massively (for example going from a low spoke count wheel to 36-spoke wheel), you probably need a tensiometer. Fortunately a tensiometer that works isn't terribly expensive.
Oh and of course after reading Criggie's answer, that reminded me to mention that of course you can compare spoke tones on the same wheel, and identify outliers. That's the way tension outliers on a single wheel are identified, and is part of good wheelbuilding practices. However, you can't determine tension in Newtons based on the frequency in Hz, that's just way too difficult for the reasons I mentioned.

Spoke Tensions and Pitch


Why the ancient Greeks associated planets with gods?

Question: They associated the Sun with Helios and the Moon with Selene, with the names of these gods also being used for these astronomical bodies. For other astronomical bodies, a name and an associated god were present: Phainon (Saturn) was associated with Cronus, Phaethon (Jupiter) with Zeus, Pyroeis (Mars) with Ares, Phosporos (Venus) with Aphrodite, and Stilbon (Mercury) with Hermes. (And today these planets are named after the Roman equivalents of these gods).
Why they did associate planets with gods?
Comment: The Greeks were influenced by the Babylonians https://en.wikipedia.org/wiki/Babylonian_astrology#Planets_and_gods It seems to be common for ancient civilisations to associate planets with gods. https://en.wikipedia.org/wiki/List_of_solar_deities
Comment: [In same vein, Romans named the planets](https://astronomy.stackexchange.com/a/55407/35206)
Comment: There is a good explanation here as well: https://mythology.stackexchange.com/questions/6151/why-did-the-romans-name-the-planets-after-their-gods
Answer: Naming planets with the name associated with their god is true not only for ancient Greeks but also for other cultures, such as Vedic. Religion and scriptures were the major means through which people were united at that time. Motion and the presence of the Sun and moon were affecting human lifestyle directly. Ancient philosophers associated them with their gods. There is always a trend to associate things that we do not understand clearly with some superpowers.
Moreover, They explained celestials in accordance to their luminosity, color, shape, position, etc. in skies. There are numerous constellations named after their shapes. Personification of objects could make general people understand what the objects are. Ancient people must have tried to associate celestials with their gods having similar characteristics. Or ancient people wrote scriptures mentioning these celestials as some super powerful creatures and named them in accordance to their culture.
People may have thought those bright objects in the night sky must have a direct effect on our lives. They were personified as gods. I am not sure about Greek culture but in Vedic culture, philosophers have associated different planets with different aspects of natural phenomena such as rain, eclipse, etc. The attraction of humans toward astrology till this time shows how people still think.


Does Ed Sheeran sing out of key on a few studio songs?

Question: A few songs in which I believe this to be the case are One and New York from the album X (Wembley Edition).
Is it just me, or does he sing out of key on these songs?
Comment: Please note: this isn't to say that he is a bad singer. It just seems strange to me that an artist of his caliper would produce music with such mistakes.
Comment: s/caliper/calibre/
Comment: Maybe you could point us exactly where you think he is out of key?
Comment: https://www.youtube.com/watch?v=kW-Ll4Ii3h4 I think this is what he means its a parody
Answer: To start with, even the best singer doesn't hit every note perfectly right. As such, singing out of key is a gradual thing.
For the two songs you mention, I would not say that Ed sings out of tune. On contrary, his music has a quite produced feeling, and it wouldn't surprise me if some sour notes have had their pitch corrected. I wouldn't swear on this though, but it is a common technique in popular music.
So again, I don't hear anything particilarly out of tune here. Perhaps you are getting tricked by the falsetto singing style which kind of gives that feeling?
Comment: I understand that no one is perfect. Hence the pitch correction you mentioned. I also understand falsetto and believe that I am not being tricked by it. My question was more of a technical one, I guess. I am looking for a definitive "yes, his pitch is off" or "no, he doesn't sing sharp or flat in these tunes." It would be especially useful if there were a tool for assessing such a question that one could employ to know for sure.
Answer: I personally didn't hear any notes that struck me as particularly off --you might need to specify particular notes for us to hear it --but I can hazard a guess as to why those might be in there, if they are.
For a long time, the trendy sound was a highly-produced, auto-tuned sound with computer perfected pitch.  The pendulum is swinging back, and people now want something more organic sounding.  So the decision may have been made to not auto-tune notes that were naturally just a little bit off.
In addition, many great singers of the past (Billie Holiday and Ray Charles being two particular examples) deliberately used imperfections in tone, rhythm and pitch.  That gave them a richer and more nuanced palette of emotional colors for their songs.


how do i detect the current position in vlc video-playback in vb.net?

Question: how do i detect the current position in vlc video-playback in vb.net?
Basically as the clip is playing, I want in a label for it to say "02:58/21:35" relating to the current clip being played.
So I'll need to somehow figure out how to detect current position and end position. Does anyone know how to do this?
Code so far:
Public Class Form1
    Dim Paused As Boolean = False
    Dim Started As Boolean = False
    Dim PlayedSecond As Boolean = True
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        PlayedSecond = False
        AxVLCPlugin21.playlist.items.clear()
        AxVLCPlugin21.playlist.add("https://vula.uct.ac.za/access/content/group/fe879ca4-927a-4fca-9cc9-33b12c348b37/vids/Lessig-ItIsAboutTimeGettingOurValuesAroundCopyright522.flv")
        AxVLCPlugin21.playlist.play()
        Started = True
    End Sub

    Sub playsecond()
            AxVLCPlugin21.playlist.items.clear()
            AxVLCPlugin21.playlist.add("http://lsta2011.wikispaces.com/file/view/Rogue%20Waves.mp4")
            AxVLCPlugin21.playlist.play()
            PlayedSecond = True
            Started = False
    End Sub

    Private Sub AxVLCPlugin21_pause(sender As Object, e As EventArgs) Handles AxVLCPlugin21.pause
            Paused = True
    End Sub

    Private Sub IsFinished_Tick(sender As Object, e As EventArgs) Handles IsFinished.Tick
        If Not AxVLCPlugin21.playlist.isPlaying And Paused = False And Started = True And PlayedSecond = False Then
            playsecond()
            Started = True
        End If
    End Sub

    Private Sub AxVLCPlugin21_play(sender As Object, e As EventArgs) Handles AxVLCPlugin21.play
        Paused = False
    End Sub
End Class

Answer: According to the documentation, you can get the current position and the length of the video by reading the following properties:

AxVLCPlugin21.input.time to get the current position.
AxVLCPlugin21.input.length which contains the length of the video.

Both these properties are in milliseconds; you will have to convert them by yourself in hours, minutes and seconds.


Installing ubuntu instead of windows 10

Question: I have a laptop with ssd and hdd drives and windows 10 installed.
I want to install ubuntu instead of windows, and that seems confusing when i want to make partitions, on windows i have C and D dirves and when i want to install software i had to decide which drive to install it on.
I want to make sure that i will have the same approach on linux ubuntu.
My questions are:
1-what choice of installation choices should i choose.
2-how do i partition the drives should i partition the ssd (a part for the os and other part for the softwares)
And what about the hdd can i partition it and what you recommend about that.
3-what the hell is mount point i think its the point where the dirve is said to be right?
So what mount point should i assign for the drives and what incase of partitioning the ssd or hdd drive.
Sorry i am a bit confused about the installation, i hope you will help me figure out the right thing.
Thank you anyway
Answer: It sounds like you would like to delete Windows and just run Ubuntu on your laptop. If that is the case when you run the installer it will give you the option to 'Erase disk and install Ubuntu'. Choose that. You will then be asked which disk to install Ubuntu. From there I would advise you to just do an automated install if you haven't done partitioning before. Don't forget to back-up all your Windows files (photos, documents, videos etc) because they will all be destroyed/deleted. Ask me if you need to do manual partitioning yourself and I'll send a link to instructions. I recently installed 'Lubuntu-20.04.5-desktop' on an old laptop because it's a lightweight installation and it's great but if you have a fairly new laptop install 'ubuntu-22.04.2-desktop-amd64'.
Answer: Linux does not use the concept of "C" and "D" drives. In Linux, there is single filesystem tree, and various drives (in fact, partitions, not whole drives) can be mounted at various points of this tree. These are the mount points you are asking about.
You need to familiarize yourself a bit with the Linux filesystem structure. It starts with root directory (not to be confused with the root user home directory, /root), which is at the very top and its name is simply /. There are various subdirectories under this directory, like bin, dev, etc, usr, var and others - all of them have specific purpose for the system and basically you shouldn't touch them manually (except sometimes editing of some configuration files in /etc or its subdirectories may be needed - as this is the directory that holds configuration files for various system components). The one that will be interesting to you is the /home directory. This is the directory where home directories of all users are located.
In Linux, the concept of home directory is very important. Each user has their own subdirectory under /home, with the same name as the username. Home directory is the place where all per-user configuration is stored (contrary to global configuration common for all users which is in /etc) and also is the place for storing user data, like documents, photos, videos etc. (in Ubuntu, you even have dedicated subdirectories for these types of data in user's home directory).
Something similar also exists in Windows, and is called "user profile directory" which is located somewhere like C:\Users\username (and also has subdirectories for "My Documents", "My Videos" etc.), but it is not so important and prominently used in Windows as it is in Linux (in earlier versions of Windows there was no concept of "user profile directory" at all and this thing didn't exist, while in Linux it is there from the very beginning).
A commonly used configuration when you have two drives like you have is to use the first drive (SSD) for the root directory (/) and all its subdirectories except /home, and use the second drive (HDD) for /home. Thus we may roughly say that the first drive will be the "system drive" and the second one the "data drive" - this is probably closest to the concept how do you use "C" and "D" drives in Windows. However, be aware that all the software that you install in a standard way, from a repository, will be installed to "system drive" - in Linux, the locations where software is installed are fixed and there's no easy way to change it. Only some third party software is "self-contained", ie. can be installed in any place, in particular within your home directory (especially the software distributed in form of so called "AppImages" - these don't require installation at all, you just put them anywhere, make executable and run). You can also usually change the installation location if you compile the software yourself from source. Other than that, the software goes to fixed places within the "system drive".
So you have to create at least one partition on your "data drive" and as many partitions on the "system drive" as the installer requires. Probably it will be three partitions: EFI partition (if you already have Windows then you probably already have this one, it can be reused), boot partition and the main root partition.
In Linux, your first drive is usually called sda and the second one sdb, so the partitions will be sda1 for EFI, sda2 for boot, sda3 for the root partition, and sdb1 for the single partition on the data drive.
Use installation mode with custom partitioning. You should choose / as the mount point for sda3, /boot as the mount point for sda2 (the installer will probably set these automatically as default), and /home for sdb1 (this will not be set automatically, you need to explicitly set this).
Note that you will be using the drive and partition names (like sda or sdb1) explicitly only under very specific circumstances, like partitioning/installation. During normal system use, you will just refer to the path to a particular directory/file. For example, /usr/bin directory (it's the directory where most Linux system commands/programs are located) will be placed on "system drive", and your home directory /home/myname will be placed on "data drive" because of the mount points.
As noted in the other answer, backup all your important data (documents, photos etc.) from your current Windows installation as they will be overwritten during Ubuntu installation.
Comment: Ohhh thank you very much.

Installing ubuntu instead of windows 10


How to apply logarithmic type formula for speed?

Question: I want my character's speed to ramp up using somewhat of a logarithmic formula. I am confused about how specifically I would implement this. I want the character to move fast with a little movement as as the movement gets larger the added contribution to speed is less and less. I said logarithmic function because this kind of mimics the shape of what I am after. Does anyone have an example of how this is done?
Answer: As much as I can tell you want something like this:
Target_Speed = some value;
Time = -log(Initial_Speed);

while(runnning) {
    Time += delta_time;
    Current_Speed = Target_Speed - exp(-Time);

    do some other stuff
}

And here is why this algorithm works:
We know logarithmic function exp(x) tend to approach 0 when x goes to negative infinity. So in order to make that logarithmic function become zero we should reduce Time to a very low value, or we can increase Time, and compute exp(-Time) instead. based on the current argument, it's easy to see when Time gets very large, -Time becomes real large negative and so exp(-Time) becomes almost zero.
And for the initial values:
Target_Speed is your desired speed, and you can set it as you want. in the first cycle we want the Current_Speed to be zero, so Target_Speed - exp(-Time) should evaluate to zero.
        Target_Speed  = exp(-Time)
=>  log(Target_Speed) = log(exp(-Time)) = -Time
=> -log(Target_Speed) = Time

So simply by setting the initial value of Time to -log(Target_Speed) we will get what we wanted.
All that said I think my answer is exactly the same as Arne's except with little more information about how it's working!
Answer: You can add a curve and manually adjust the acceleration graph.
public AnimationCurve curve;

Then simply select it in the inspector and use a preset.
To change speed, use:
currentSpeed = curve.Evaluate(t);

where "t" can be Time.time/5f or other value from 0 to 1.
If you want a more physical way then use rigidbody and rigidbody.AddRelativeForce(Vector3.forward);
Comment: what library is this code using?
Comment: Sorry I'm new here, I thought it's a Unity question. My bad.
Answer: each frame do this:
speed += 0.05;
pos += speed;
speed *= 0.99;

adjust parameters at will.
Comment: You should explain what this is doing and why it works in your answer.
Comment: This much I know. But I want a way to specify a smooth formula for ramping down the effect of speed as it gets faster.


Can you use SFTP to transfer files "backwards" to client during SSH on host?

Question: While connected to a host computer in Linux (Ubuntu) in command prompt I often find the need to transfer files back to my client computer. I was wondering if Linux offers the capability to move these files through SFTP or any other mechanism.
Answer: If you mean transfer the files without opening a new session from your current system, then the answer is probably no, you will need to do a new session of some kind to your target computer.  Some SSH utilities open multiple sessions to make file transfers easier.  However, if you're typing on Host A, and SSH'd into Host B, then you can SCP from Host B to Host A:
hostb $ scp catphoto.jpeg me@hosta:/home/me/Pictures

That won't require you to do anything other than type the password of Host A, assuming Host A is running sshd or some other SSH server utility.  If it's not, and I'm talking about Windows here, I've had some luck with Windows 10's developer mode enabling SSH servers which this article talks about nicely.
Alternatively, mobaxterm is one of the clients I've used with a handy explorer-style file transfer bar, click and drag to bring it over.
Answer: There's no way to initiate a file transfer back to local machine using an existing SSH session to a remote machine.
Alternative approaches (some are probably obvious):

If the local machine runs SFTP (or FTP) server, you can of course "upload" the files to the local machine using command-line SFTP (or FTP) client.
You can use SFTP/SCP client on local machine to download the files from the remote machine, using the same credentials that you use for SSH.
Some SSH clients support connection-sharing.
For example PuTTY. While you still need to run a compatible file transfer client (the pscp or psftp), no new login is required, it automatically (if enabled) makes use of an existing PuTTY SSH session.
To enable the sharing see:
Sharing an SSH connection between PuTTY tools.


Transient terms in the solution of a linear differential equation

Question: I know how to solve a linear differential equation. But question is that what does that mean transient terms in general solution.
Comment: when $t$ or $x\rightarrow \infty$ the transient components vanish and only steady state long term effects are seen in (the short range time terms vanish) the solution. Please give your specific example.
Comment: x^2 dy/dx + x(x+2)y = e^x  the solution of this Linear Differential Equation is y = 1/2 x^-2 e^x + Cx^-2 e^-x  so identify transient terms??? Is x = 0 a singular point???
Answer: The general solution $x(t)$ of a scalar linear differential equation
$$x^{(n)}(t)+a_{n-1}x^{(n-1)}(t)+...+a_1x'(t)+a_0x(t)=u(t)$$
can be expressed as a sum of the homogeneous solution $x_\text{h}(t)$ particular solution $x_\text{p}(t)$
$$x(t)=x_\text{h}(t)+x_\text{p}(t).$$
The homogeneous solution is sometimes referred as the natural solution, unforced solution (which means $u(t)\equiv 0$) or transient solution.
If the differential equation is stable, which is equivalent to the statement that all the eigenvalues (roots of the characteristic equation) have a strictly negative real part, then the transient solution will be insignificant for $t\to \infty$, as $x_\text{h}(t) \to 0$ and the behaviour of the system is dominated by the particular solution $x_\text{p}(t)$.
Comment: Thanks bro
Answer: If solution of
$$ x^2 dy/dx + x(x+2)y = e^x $$
is
$$ y = \frac{e^x}{ 2 x^2}  +\frac{ C}{x^2} -\frac{2}{e^{x}} $$
then the last two terms tend to zero, whatever (even infinite) starting value may be.
Comment: So nice of . . ❤❤❤ excellent


Are pledges I made in a job interview binding?

Question: Among some "pro" tips shared in my neighborhood for desperate job seekers is the myth that promising to never unionize drastically improves the chance of landing on a job. If one were to actually say that in a face-to-face interview then get employed, are they never allowed to unionize? Does it not matter unless the clause made it to the actual contract?
Answer: One problem with your example is that under US labor law, employees always have a right to unionize. We could then substitute a different promise, such as a promise to reside within 5 miles of the factory. If you break that promise while employed, you could probably be fired (I assume no specific written labor contract, just the usual verbal exchanges about pay and duties). However, you can also be fired if you don't break that promise – employment in the US is generally at-will, and firings don't have to be justified. Some jobs have written contracts and restrictions on firings, and in that case verbal interview promises are immaterial, what matters is what is in the contract.
Employers in the US do not have the legal power to forcibly prevent a person from moving outside a particular radius. They may have the power to take action that is against the employee's interest. A contract can limit such actions, for example a "tenure" clause may stipulate limited conditions under which a person can be fired. If the employee engages in fraud in inducing the company to hire him, the contract could then be invalidated. There is a thin relationship between fraud and promise-breaking. A promise is when you vow to act in a certain way in the future. If you make a promise, the promise is material to the employer's decision to offer you the contract, and you do not at that time intend to keep that promise, you have committed fraud, which could suffice to invalidate the contract. The employer might have a hard time proving these elements, but that is at least a way in which an job-interview promise (to do in the future) could become legally enforceable.
Comment: "employees always have a right to unionize": the question is whether a promise not to exercise that right is binding.
Answer:
If one were to actually say that in a face-to-face interview then get employed, are they never allowed to unionize? Does it not matter unless the clause made it to the actual contract?

It probably does not matter even if the clause is written into the contract, because statutory rights such as the right to unionize typically cannot be waived, and any contractual agreement purporting to waive that right, or to agree not to exercise it, are typically "void as contrary to public policy."
Another thing to consider is the meaning of "not being allowed to unionize."  In general, contracts and laws enforce prohibitions by specifying negative consequences.  The most severe negative consequences in an employment relationship are things like a reduction in pay or being fired.  So you have to compare the employer's capacity to reduce the pay of, or fire, someone who hasn't made such a promise to see whether the promise is effectively enforceable.
This in fact explains why employers can't bind their employees to a promise not to unionize, and why the invalidity of such agreements is "contrary to public policy": the point of a statutory right to unionize is to prevent employers from using their position of power to exploit employees.  If employers could use that position of power to extract binding promises not to unionize, that protection would be meaningless.
Comment: Arguably the protection exists for the employers. When employers have tried to fight the existence of unions in the past (the reason for which is always the same, to screw the workforce harder than a union will allow), violence and killings have ensued, in which the de facto union forms and exists anyway, but more like a guerilla organisation.


Importance of raising/lowering/ladder operators

Question: While learning quantum mechanics I repetitively encountered the concepts of raising and lowering operators. Firstly in the harmonic oscillator $a_\pm \ $and now in angular momentum I am introduced to $J_\pm$ raising and lowering operators. Why this idea of these operators are of so importance in quantum mechanics? As they are abstract, what do they mean in physical approach? I mean can't we find some analytical approach instead of using them?
Answer: That is just the thing about quantum mechanics. It is based on the fundamental principle that interactions involve the exchange of quanta. As a result of this principle each particle field taking part in the interaction contributes or receives a quantum to or from the interaction. It was this principle that help Max Planck to solve the problem of black body radiation. So when we model such interactions in our theories, we find it convenient to use such raising and lowering operators. Theories that are based on this principle (using quantum field theory for instance) have been found to be quite successful when their predictions were compared with experimental result.
If by "some analytical approach" you mean an approach not based on operators, then there is indeed a different formalism. It is called the Moyal formalism and is based on operations among distribution functions on phase space instead of operators. It is not as popular as the operator approach.
Comment: Maybe one should make clear that the theories of quantum mechanics *developed* by  trying to model  and predict the quantized nature observed in experimental measurements that classical theories could not model .(  starting with black body radiation, spectra of atoms, phototelectric effect)
Comment: @annav: Thanks for the suggestion. See my edits.
Comment: The statement that quantum mechanics is based on exchange of quanta is not technically correct.  Quantum field theory is based on this, but quantum mechanics is only loosely based on Hamilton-Jacobi theory.  The idea of creation and destruction operators postdates the original solution (by Schrödinger) of the hydrogen atom using the famous equation that bears his name.
Answer: The construction of raising and lowering operator is very natural when there is an underlying Lie algebra.  Thus yes there's some systematic way of constructing them.  In fact, if the Lie algebra is of the semi-simple type, then the construction of representations is completely based on raising and lowering operators.
If the Lie algebra is not semi-simple, one can use Levi's theorem which very loosely states that any Lie algebra has a semi-simple part and "another" part (called a radical) that contains operators (tensor operators) which generalize the idea of raising and lowering operators.
In your examples, the operators $\hat a,\hat a^\dagger$ and $\hat 1$ span the Heisenberg-Weyl Lie algebra $\mathfrak{hw}(1)$.  The angular momentum operators $\hat L_x,\hat L_y$ and $\hat L_z$ span the Lie algebra $\mathfrak{su}(2)$.  (Actually the raising and lowering operators are often complex combinations of the observables in your model, so you need to first consider these operators over the complex field and then possibly go back to the reals but that's a technical matter. )
All the $\mathfrak{su}(n)$ algebras are semi-simple and the representations are constructed using raising and lowering operators.  With $i,j$ running from $1$ to $n$, the operators $\hat C_{ij}=a_i^\dagger a_j$ with $i<j$ can be taken as raising operators, with their hermitian conjugates
$\hat C_{ji}= a^\dagger_j a_i$ the lowering operators, acting on basis states where
$\hat{C}_{ii}-\hat{C}_{jj}=a_i^\dagger a_i-a_j^\dagger a_j$ is diagonal.
Likewise representations of the symplectic algebras $\mathfrak{sp}(2n,\mathbb R)$ are constructed by first considering the $\hat C_{ij}$ of $\mathfrak{u}(n)$ and adding $\hat A_{ij}=a^\dagger_ia^\dagger_j$ and $\hat B_{ij}= a_i a_j$.  The $\hat A_{ij}$'s and $\hat B_{ij}$'s are raising and lowering respectively, in addition to the raising and lowering operators in $\mathfrak{u}(n)$.
The Lie algebra $\mathfrak{e}(2)$ is not semi-simple.  It is spanned by $\hat L_z,\hat p_x$ and $\hat p_y$.  Yet, it's possible to define $\hat p_\pm = p_x\pm i p_y$ so that $\hat p_\pm$ act by "raising" and "lowering" action on the eigenstates of $\hat L_z$ much in the way that $\hat L_\pm$ act by raising and lowering.


How to get rid of a color cast that covers part of a photo using gimp?

Question: There is this color cast over the middle of the picture which was taken on film. In Gimp I have tried going to Colors> hue-chroma, and also Colors > colour-balance and adjusting color levels and hue, color and lightness, but was not able to get the selected color cast to no longer stand out. Is there a way to neutralise the color cast completely so that the photo looks normal?
Answer: No single click operation will do the trick. The cast is not only an extra transparent magenta layer, it has also affected the underlying image colors and brightnesses. You can start by making a BW image which has plausibly right brightnesses. GIMP has Color > Components > Mono Mixer for this. It's very clever idea because it even allows negative weights.
In the next image the filtering uses the fact that in your image the blue channel is quite good although not perfect. Fortunately the cast has not destroyed details below so weighted linear mixing can make some improvement.

The top layer is filtered. There's also a couple of originals left for future steps and a spare.
The BW version on top has blending mode Lightness. It sets the ligntness for the next layer which is the original filtered with Channel Mixer. I guess no perfect filter settings exist, but at least this is less magenta than the original:

You can apply curves to the BW layer for more contrast. It doesn't exaggerate color saturation like inserting contrast to an RGB layer. But the errors can still become more disturbing:

My opinion is that you should make selections and paint right colors on the areas in the 2nd layer. Essentially you recolor the image. That treatment is applied to the sky and the sea. Sorry for coarse selections:

I selected with lasso at first the sky, picked the color from the non-magenta corner of the original and filled the selection with the paint bucket. The sea got the same.


Can a neutron star/quark star have a photon sphere?

Question: Can a neutron star/quark star have a photon sphere?
A photon sphere has a radius equal to 1.5 times the Schwarzschild radius. Is it possible for a neutron star to have on?
Answer: The answer is yes. This is discussed in the article "Properties of ultracompact neutron stars" by Nemiroff, R. J., Becker, P. A., & Wood, K. S. (http://adsabs.harvard.edu/full/1993ApJ...406..590N)
Comment: Please do not rely on links surviving indefintely.  We want to avoid [link rot](https://en.wikipedia.org/wiki/Link_rot) making answers useless.  Instead make a very brief summary of the key points/reasons that the article describes.  This way answers are standalone.  On Physics SE we generally give a link to the *abstract* page rather than the article/document itself.


How do I stop daemonized OpenVPN connection?

Question: I started a VPN connection with sudo openvpn --daemon --config connection.ovpn. Is there a way to terminate this connection without using ps to search for the process and then kill it myself?
Answer: Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill them.
If you got multiple instances running, but would like to kill only a specific one, the -f option allows you to match against the full process-call including parameters, e.g. pkill -f "openvpn --config connection.ovpn".
See the output from ps x or pgrep -lf <process-name> (same as pkill, but doesn't kill them, so essentially similar to ps | grep <name>) to find out with which parameters the daemon was started.
Answer: From https://openvpn.net/community-resources/how-to/
Controlling a running OpenVPN processRunning on Linux/BSD/Unix
OpenVPN accepts several signals:
SIGUSR1 — Conditional restart, designed to restart without root privileges
SIGHUP — Hard restart
SIGUSR2 — Output connection statistics to log file or syslog
SIGTERM, SIGINT — Exit

Use the writepid directive to write the OpenVPN daemon's PID to a file, so that you know where to send the signal (if you are starting openvpn with an initscript, the script may already be passing a –writepid directive on the openvpn command line).
So , you should use kill command, and start openvpn with arg -writepid.
Answer: No, you will need to kill the process. In fairness a daemon management script would do just that. You can use pgrep or pkill to make your life easier.
Answer: sudo openvpn3 session-manage --disconnect --config $'client'.ovpn

Replace client with the corresponding name.
This will shutdown the session.


How long to cook dry brined turkey?

Question: I have a thawed, dry brined 22 lb turkey.  Does anyone know how long it'll take to cook it and what temp? Thank you!
Comment: Hello, and welcome to Stack Exchange. How will you be cooking it?
Answer: According to a highly rated recipe from Food Network for dry brined turkey:

Put the oven rack in the lowest position; preheat the oven to 350 degrees F. Put the turkey breast-side up on a rack in a large roasting pan, tucking the wing tips under. Tie the drumsticks together with twine. Roast until the skin is golden brown and a thermometer inserted into the thigh registers 165 degrees F, about 15 minutes per pound. Transfer to a cutting board and let rest 30 minutes before carving.

Keep in mind that there are a lot of variables. Your thermometer is your friend. If the turkey is stuffed, it could take as long as 7.5 hours.
Comment: For a turkey that large, you might have better results if you drop the temperature to 325.  If the cooking time is 5.5 hours at 350, maybe you don't want to drop it after all, but I'm channeling a Cooks Illustrated recipe that used a wet-brined 22 pound bird.  They crisped the skin at 425 degrees for an hour (breasts down in a foil-lined V-rack), then flipped the bird over and roasted at 325 for 4 hours or so.  I think I'm going to start cooking a turkey in October every year to test some of this stuff out. :)

How long to cook dry brined turkey?


Why doesn't Windows Explorer support directly copying WAV files from Music CDs?

Question: As far as I understand, Music CDs are nothing more than some metadata along with a bunch of WAV files. So why doesn't Windows (by default) allow one to copy WAV files from a CD?
Comment: My very basic understanding is that *Redbook Audio* is containerless. Usually when you talk about files, you are actually talking about an encoding method *and* a storage method. When you RIP audio, the software is reading the stream and then placing in a WAV container. Only *then* is it a file. Note that the stream decoding is/was often handled by the drive itself. Ealier IDE CDROM drives often had headphone jack and a play button. I have plugged one of those into a jumpered PSU without any other computer components and used it as a cd player.
Answer: Audio CDs don't have any files at all. The tracks' data is compatible with WAV format, but their appearance as files is faked by Explorer and the Windows' CDFSs driver. (Some CD formats even have a data track alongside audio tracks, in which case Explorer doesn't show the audio tracks at all.)
Although I remember Windows 98 actually had a third-party replacement driver which added this exact feature, by taking the emulation further, and presenting .wav files with correct headers added. So it was fairly straightforward to implement, although I'd say more confusing UI-wise.
In the end, that's likely a decision that only Microsoft can explain, although "make it less straightforward to copy music as per RIAA's wishes" might be a good guess.
Comment: Dang, that link to the cdfs driver for w98 in your link is still good, copy and pasted it into my browser, Chrome did not like it though....
Answer: They are not WAV files with metadata, it is one continuous "file".
See this article about detailed explanation.
http://www.techsupportalert.com/how_to_work_with_audio_cd_cda_files.htm
From the link:
If you view the contents of a music CD from Windows, you'll see that it contains a number of .CDA files each corresponding to a song track. (CDA stands for Compact Disk Audio)
I regularly get letters from subscribers asking why can't they just copy these files to their PC rather than first having to rip them to .WAV, MP3 or other music files.
It's a good question with a simple answer: there are no .CDA files on a CD. In fact, from a Windows perspective, there are no "files" at all.
A music CD differs greatly from your hard drive or floppy disk drive in the way information is stored.
Hard drives and floppy disks store data in concentric rings called tracks. In contrast, music CDs store data in a continuous spiral starting from the inside of the CD and ending at the outer edge of the CD. Kind of like a vinyl LP in reverse.
The format of the data stored on CDs is also quite different; it's a continuous stream of raw digital data rather than a collection of individual files.
The reason the data is stored in this strange way is the music CD format was developed in the late 1970s long before the age of the home computer. CDs were designed to be played by CD players and at that time nobody  even considered that one day they would be played on a computer.
So what are .CDA files that you see on a music CD when you place a CD in your computer's CD tray?
These files are created by the Windows CD driver. They are simply representations of the CD audio tracks and are not actually on the CD.
Each .CDA file is a kind of a pointer to the location of a specific track on the CD and contains no musical information. CDA files are all 44 bytes in length and each contain track times plus a special Windows shortcut that allows users to access the specific audio tracks.
So if .CDA files contain no musical information, what happens if you "copy" a .CDA from an audio CD to your hard drive and then double click it?
If the CD is still in the drive then the corresponding track will play from the CD. If you remove the CD you will get an error message. That's because the .CDA file contain no music, it only points to where the music is located on the CD.
To work with music tracks on your CD you need first to convert them to .WAV, .MP3 or another file format that computers understand. That's what a CD ripper does and that's why you must use a ripper before you can work with your music files on a computer. Simple as that.


What is the difference between gostava and gostaria?

Question: I have seen both "gostava" and "gostaria" translated to "j'aimerais" in French. Can the two be used interchangeably, or are there specific contexts where it is better to use one rather than the other?
Comment: J'aimerais y aller. = Gostaria de ir lá. = I would like to go there. J'aimais y aller. = Gostava de ir lá.= I used to like going there. OR I liked going there.
Answer: The Imperfect and the Conditional generally have the same value only if they take modal values, for instance in conditional sentences:

Se tiveres tempo, gostava/gostaria que me levasses a jantar.

Or a polite request without a full conditional sentence:

Gostaria/Gostava que me levasses a jantar.

In these two examples, the Imperfect is more common in informal European Portuguese.
On the other hand, only the Conditional can act as future of the past:

Ontem de manhã ela encontrou-o na rua e mais tarde levá-lo-ia a jantar/*levava-o a jantar.

And only the Imperfect can describe some past events (generally with some overlapping or inclusion with another past time):

Quando era jovem, gostava/*gostaria de dormir até tarde.

(Though note that the Imperfect is not always articulated against some other point in the past — for instance, in julgava-te em Roma (I tought you were in Rome), the reference point is the present).


Why has XSLT never seen the popularity of many other languages that came out during the internet boom?

Question: The use of XSLT (XML Stylesheet Language Transform) has never seen the same popularity of many of the other languages that came out during the internet boom.  While it is in use, and in some cases by large successful companies (i.e. Blizzard Entertainment), it has never seemed to reach mainstream.  Why do you think this is?
Comment: Which is a MAJOR downfall of this site.
Comment: We prefer questions that can be answered, not just discussed.
Answer: One problem is that XSLT looks complicated.  Any developer should be able to pick up the language constructs as there are analogs in most other languages.  The problem is that the constructs and data all look exactly the same which makes it difficult to distinguish between the two which makes XSLT more difficult to read than other languges.
A second issue is that the uses for it are more limited than other languages.  XSLT is great at what it does; making complicated or radical transformations on XML.  But it doesn't apply to as wide a range of problems as other languages, so it is not used as much.
Third, many programming languages have their own libraries for transforming XML.  Much of the time when working with XML, only small changes or lookups are needed.  The XML is also probably being generated or consumed by a program the developer is already writing in another language. These factors mean that using a language's built in utilities is just more convenient.
Another problem that all of these issues contribute to is inertia.  That is, people don't know it, they don't see that they have much need for it, so they avoid it as a solution if there is another option.
What you end up with is a language that is the last choice of many developers when creating solutions.  It is likely that XSLT is even avoided when it would be the best tool for the job as a result.
Comment: I agree with most of what you say, but in a polyglot implementation where you are not doing everything in that perfect all around language, XSLT rocks for transforming XML, which after all is what it is for.
Comment: A consequence of your first point is that you must escape "i<10" as "i<10". It's minor, but doesn't that just make your skin crawl? It does mine.
Comment: I agree 13ren, XSLT doesn't lend itself to syntactic sugar.
Answer: XSLTs uses functional programming - something most programmers are not used to (hence why some people consider it non-intuitive I guess).
Answer: In my opinion, one of the most annoying things in standard XSLT (I'm talking about XSLT 1.0 because that's the only version I have used) is that it lacked support of string transformations and some basic date-time functions manipulations.
One thing I could never understand is why a function such as translate() was designed and implemented into xpath wheras other more useful functions such as replace, to_lower, to_upper, or - let's be crazy - regular expressions were not.
Some of these issues were adressed I guess with eXSLT (extended xslt ?) for parsers other than Microsoft's MSXML. I say I guess because I actually never used it as it was declared incompatible with MSXML.
I don't understand why XSLT 1.0 was designed with this principle that 'text' manipulation was not be in the scope of the language when it's obvious that whenever you are converting files you can't avoid those string conversion issues (e.g. : transform an unregularly padded date given in french format to american format, 31/1/2008 to 2008-01-31) huh...
These text manipulation issues were generally very basic and easily adressed in MSXML by allowing XSL to be extended with JScript functions : you could call a JScript function to perform some processing just as you would call any XSL template, but I always found that solution inelegant and ended up creating my own XSL template libraries. First because the JScript way broke your XSL portability, and then because it forced you to mix your programming logic : some bits in pure XPath/XSLT expression and other bits in DOM/object notation with JScript.
Not having updatable variables is another limitation that is very confusing for newcomers, some people just don't overcome this and keep struggling with that.
In some simple cases you can have workarounds with a mix of paremetrized templates and recursive calls (for example to implement an increasing or decrasing counter) but let's face it, recursion is not that natural.
I think I heard all those limitations were adressed in the XSLT 2.0 specification, sadly MS decided not to implement it and promote XQuery instead. That's sad, why not implement both of them? I think that XSLT would still have a good chance of becoming as popular as CSS became for HTML. When you think about it, the most difficult part in learning XSLT is XPath, the rest is not as difficult as understanding the cascading behaviour in CSS, and CSS has become so popular...
So, in my opinon, it's the lack of all those little things mentioned here and the time it took to adress them in XSLT 2.0 (with not even MS supporting it anyway) that has lead to this situation of impopularity. How I wish MS decided to implement it after all...
Answer: Because most XSLT implementations have a high memory footprint (I suppose that's caused by the design of the language), because people tended to abuse XSLT for all kinds of things that it was not particularly well-suited for and the purely-declarative nature of XSL which makes certain types of transformations quite difficult.
Answer: It's great for xml, but not great for typical coding.  It lacks typical basic concepts (ie mutable variables) and makes what should be simple quite complex (or impossible).  Most of its problems stem from the fact that xml is a great data representation language but not a great programming language.  That being said, I use it daily and would recommend it where it makes sense.  In conjunction with external namespaces, it can be made more useful (calls to java, etc).  In the end, it's another language to learn, and many coders would prefer to stick with something they're used to or resembles something they're used to.
Comment: The absence of mutable variables is not an oversight, as your answer might make it seem, but rather quite deliberate. Functional programming in general revolves, among other things, about immutable values, and has many benefits.
Answer: Because it is easier to write and maintain code that uses Java, C#, JavaScript, etc. to deserialize an XML stream, transform it, and export the desired output, and XSLT offers no substantial performance advantage.
XSLT makes somethings easy, but it makes other things very, very hard.
Answer: Well... Maybe because it is a pain to write xslts... I had to write a few xslts a few months ago and I was dreaming of pointy brackets...
<Really>
    <No>
        <fun/>
    </No>
</Really>

(I do know, that this is no xslt)
Answer: XSL is mainstream and widely adopted. What other languages are you referring to? XSL isn't a programming language, just a transformation language, so it is pretty limited in scope.
Comment: XSLT is even turing-complete, see http://www.dpawson.co.uk/xsl/sect4/turing.html
Comment: What constitutes a programming language... xslt has loops, conditions, variables, sub-routines with parameters... it would be like saying pl/sql isn't a programming language because its scope is limited to Oracle databases.  I think it is a language specifically for transformation.
Answer: Generally, the times when you will be required to transform XML data into a different form of XML data, but not do any other processing to it are going to be very limited. Usually XML is used as an intermediary between two separate systems, one of which is usually custom made to process the output of the other. As such it's simpler to just write one of the systems to process the XML output of the other without the extra step of having to perform some kind of transform.
Answer: I think it boils down to XML syntax is arguably good for describing data, but it's not a great syntax for what's essentially a programming language (XSLT).
Answer: As previously stated XSLT (like "the good parts" of JavaScript) is a functional programming language. Most traditional programmers hate this statelessness. Also too many traditional programmers hate angle brackets.
But, most importantly, correct use of XSLT solves both the declarative-GUI-generation and the data-binding problem for the Web server in a platform agnostic way. Vendors like Microsoft are not motivated to celebrate this "inconvenient" power.
However, I will argue that Microsoft has the finest XSLT support for the IDE (Visual Studio) in the world.
Answer: I think it tried to cover way too many use cases thus becoming a Turing-complete (or so I heard) language. If you try to do any nontrivial transformation, you end up writing complex loops, conditions... in an ugly and verbose language, which is best done with a GPL.
In my view, this complexity makes writing a correct implementation of XSLT difficult and limited the available choices, thus, widespread use among the vocal hackers who often likes to tinker with small and efficient code, not enterprisey code.
Answer: XSLT is very powerful, but requires a different way of thinking about the problem.  It also made life hard for itself by not providing useful data functionality in the early versions.  Take for example a ToUpper() style method, you typically implement it with something like:
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>

<xsl:value-of select="translate($toconvert,$lcletters,$ucletters)"/>

Not the easiest way of coding!
Answer: xslt is great for xml to xml, when you have data that is already escaped and a clear definition of inputs and outputs. using it for things like xml2html to me just seems like such a headache, and with nearly any dynamic language and css the output is a lot easier to implement with style.
Answer: I found it great for 'composite web service architecture'.Sometimes number of webservices work together to have the final output.When those webservices need to communicate among them via XML then XSLT can transform the xml message from one form to another.


What is the best abstraction for HDL code?

Question: I have recently started seriously coding in Verilog HDL. Although I am still to get a grip of FPGAs and CPLDs, I am curious about the levels of abstractions used in these codes. I understand I have 3 options right now, Behavioral, Register Transfer and Gate level modeling. But I cannot decide which is the most suited for good synthesis. For example, when making smaller circuits I dabbled in Gate level modeling, but later on when I moved to describing my own ALUs I used behavioral level modeling. But Behavioral modeling feels like just concurrent programming and not exactly hardware description. So what is the best way to write code which will ensure proper synthesis?
Comment: I think there is no best way; one is better suited for fitting the behavior, while one is closer to the HW implementation, so will map more directly the real configuration
Comment: As far as I can tell, the only way to ensure your HDL is synthesizable is to follow known patterns. There are supposedly a few good books you might look for. I lurked on the comp.arch.fpga and comp.lang.vhdl groups for a long time absorbing information. IMHO, gate level is ridiculous for anything complex. I would suggest that you embrace the higher level modeling, just learn a few good patterns (all synchronous unless you have a very good reason not to, careful attention to clock domains, a good state machine model you use consistently, etc)
Answer: You should completely ignore the terms "behavioral", "Register Transfer", and "Gate level".  I think these terms were invented by professors or people writing text books and have little or no relevance to "actually getting work done".  It's like scientists and professors inventing Latin names just for the sake of making them sound smart.
Write your code (Verilog, VHDL, or whatever) so that you get the results you want and your code is readable and understandable.  After you have done this a while you will settle into a style that works for you.
I should mention that the only way this can happen is if you learn everything about Verilog (or whatever).  Often there are features of the language that are not covered very well by books or professors but really help you efficiently write code that is easy to read.
Comment: This is exactly what I had to do in order to "grok" VHDL. The second I stopped reading the books and instead started reading code and speaking to people who actually did the work I found out a) how much bad code there is out there, b) how bad most of the books are and c) that there is absolutely no substitute for talking to someone about a block of code you're trying to make work.
Comment: @AndrewKohlsmith  I think that a lot of the bad code (and there is a LOT of it) comes from people with very little software background.  There is a huge difference between writing 1k lines of code and writing 500k lines, and the software guys generally know how to write 500k while the HW guys don't.  Most of that difference is in managing the logistics of writing 500k lines and still be sane at the end.  I actually started doing SW and switched to HW, so writing huge chunks of VHDL is not a big deal to me.
Comment: same here -- almost two decades of C programming but under 3 in HDL. Most of the bad HDL I see seems to have a common source problem where the writer has no real understanding what the tools will create given the code, but the second most common source issue is the lack of understanding regarding synchronous logic.  What's left after that is just plain old bad code. :-)
Answer: No one should write at "gate level". There isn't any need for that outside of learning. It's just too low-level to be productive.
The most common level is Register Transfer level. However when you are inferring an adder, for example, that is "behavioral" in that you aren't telling the tools how to do it.


What is the highest amount of Fortify Archery I can receive on a single item?

Question: I know that I can use larger soul stones to increase the amount, but it only goes so far. How do I get more? I do not have any DLC other than Hearthfire.
Comment: With a Grand soul, 100 levels in enchanting, and the appropriate perks you can get a 40% fortify archer per item. This can be further increased with fortify enchanting potions.
Answer: First, there is no real answer because of the fortify restoration glitch.  This glitch allows abnormally large numbers when enchanting.  However, there are some general tips for increasing your enchanting abilities.
First, make sure to use grand soul gems or black soul gems.  Either one works for the highest level enchantments, and should be filled with a grand soul for maximum results.
You should increase your enchanting ability up to level 100.  You can do this by training with an enchanting trainer, or do it through experience.
You should also increase your alchemy to 100, since you can use fortify enchanting potions to also increase your enchanting ability.
Of course, to get better fortify enchanting potions, you should wear clothing items (Falmer Helmet/head/hands/ring/necklace) that are enchanted to give fortify alchemy bonuses.
There is a loop created here that can be repeated a few times, before increased results are diminished to zero.

Enchant +Alchemy clothing.
Wear +Alchemy clothing, create +Enchanting potions
Drink +Enchanting potions.
Repeat.

Eventually, the numbers stop going up, and you have your best +Alchemy clothes.  Use those enchanted clothing items (5 total:  Falmer Helmet+Head+Hands+Ring+Necklace) to make your best +Enchanting potions, and you are ready to create your best +Archery enchanted gear.
Comment: I believe the fortify/restoration glitch was patched. http://elderscrolls.wikia.com/wiki/Thread:252227
Comment: Nope. I play on PC fully patched no mods. I started early September 2013 on my first character. More than 1000 hours and a year later, I started a new one and played it over 600 hours. Then another, also 600+ hours. It was then I loaded up the most recent save from my first character to mess about a bit with Fortify Restoration potion glitching. I already had 100 Alchemy, Enchanting and Smithing (well perked) so it didn't take long to reach some pretty game breaking numbers. When I tried to use a Fortify Smithing potion though, it said I didn't have enough skill to improve the item.


Performance of unsupervised compared to supervised learning on labeled data

Question: Imagine we have a labeled dataset. I always thought that a supervised algorithm would outperform an unsupervised one when applied to labelled data because it can learn from the observations. Is that true? Can a data scientist get any insight from applying an unsupervised learning algorithm on labeled data that he cannot get with a supervised one?
Comment: Presumably you can learn if your features (except the labels, of course) have sufficient information to recreate the labels, at leats approximately.
Comment: This seems like a vague and broad question. Can you include more detail into what you're asking. Unsupervised and supervised statistical techniques are generally applied to different problems with different goals in mind.
Answer:
Can a data scientist get any insight from applying an unsupervised
  learning algorithm on labeled data that he cannot get with a
  supervised one?

Yes, because supervised and unsupervised methods are used for different purposes. You could start with Unsupervised, supervised and semi-supervised learning thread that describes differences between those groups of methods. In unsupervised case you could be interested in finding some distinct groups in your data, e.g. by using cluster analysis. In such case algorithm looks for similarities between your cases that can help for grouping them. In supervised case you have variable or variables that you want to use to predict values of other variable or variables.
Example
With unsupervised methods you could try to look for groups of customers who have different shopping patterns, this could help you to learn more about those groups e.g. to create profiled advertising. With supervised methods you could try to find out what makes people to make purchases, what is more or less efficient, so to make predictions or to adjust to customer behavior and try to influence it. You could try to learn what generally is makes people to buy your products, but you can also ask specific questions: what makes females respond to your advertising and what makes males respond to it? Finally, there are methods that are somewhere in-between.


How can I speed up the dash?

Question: I have this issue with Ubuntu 13.10. The dash is simply too laggy when it comes to type something into it moreover it takes more than 3 secs to open so I can type something inside. It's FASTIDIOUS and quite disappointing. I've seen this issue in computers with much more power resources and that somewhat comply with the standard requirements. Come one I've seen this bug on pc's with 3gb of RAM and 2,6Ghz processors not to mention the advanced graphic cards. Can this bug be solved in the future or will it stick around with Ubuntu as long as it's installed on my pc? Please answer something.
Comment: What kind of pc do you have?
Answer: It's a bug with your hardware and graphics drivers rather than Ubuntu and Unity. The dash is faster than it was with Ubuntu 13.04 or prior releases. If you're using open source drivers, you'll want to immediately add the oibaf PPA to get better open source drivers for your graphics card. However, since oibaf currently does not support Saucy, you'll need to edit oibaf to use raring repos instead.
sudo add-apt-repository -y ppa:oibaf/graphics-drivers; sudo sed -i 's/saucy/raring/g' /etc/apt/sources.list.d/oibaf*; sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get dist-upgrade -y

Then reboot.
If you are using proprietary drivers you will need to uninstall them first. If you are using NVDIA you need to use the closed source drivers from NVIDIA instead with sudo apt-get install nvidia-current -y
Answer: If you don't really care to have a fancy dash and you just want it to work, I would recommend getting lubuntu.  It is a lot less fancy and much faster.  Just put
sudo apt-get install lubuntu-desktop
into terminal.  You can always get back to the default by the login screen.

How can I speed up the dash?


Missing Telerik files in project\obj upon window store app package creation

Question: I've been working on an UWP app with a Telerik RadDataGrid component on it. It builds fine in debug and release mode. However, when building the windows store app package the process fails with the following reason:
ErrorFor file "C:\Projects\CompanyAppClient10\obj\x64\Debug\PackageLayout\Telerik.UI.Xaml.Grid.UWP\Assets\FilterFlyout\ic_arrow_down_white.scale-140.png" -
0x80070003 - The system cannot find the path specified.CompanyAppClient10 C:\Projects\CompanyAppClient10\MakeAppx
What could be the cause of this?
I've already tried creating a new clean UWP application with only a RadDataGrid component on MainPage.xaml. This results in the same error as above.
I've also repaired my Telerik UWP installation. Makes no difference.
Answer: Installing the newer update fixes it.
Alternatively you can use the following workaround -- copy the entire folder
C:\Program Files (x86)\Telerik\UI for Universal Windows Platform Q2 2016\Binaries\Telerik.UI.Xaml.Grid.UWP\Assets\FilterFlyout
into
C:\Program Files (x86)\Telerik\UI for Universal Windows Platform Q2 2016\SDKs\Telerik UI for Universal Windows Platform\Redist\CommonConfiguration\neutral\Telerik.UI.Xaml.Grid.UWP\Assets
Answer: Based on the error message my guess is that your app requires scale 140 assets but Telerik doesn't provide them. You many want to contact Telerik directly and file a bug report.


Solving equation involving Euler's totient function

Question: Given $m\in\mathbb{N}$, is there a general way to solve the equation
\begin{equation}
\varphi(n)=m
\end{equation}
where $\varphi$ is the Euler's totient function? For example, I want to solve for all the $n$'s such that $\varphi(n)=4$. Is there any way to solve it that are also applicable to many (if not general) cases?
Comment: Does this answer your question? [How to solve the equation $\phi(n) = k$?](https://math.stackexchange.com/questions/23947/how-to-solve-the-equation-phin-k)
Comment: For related problems, see Ford's Theorem and Carmichael's Totient Conjecture.
Answer: Let $n=p_1^{k_1}\cdot p_2^{k_2}\cdots p_r^{k_r}$, where $p_i$ are disntinct prime numbers.
Then, $\varphi(n)=p_1^{k_1-1}(p_1-1)p_2^{k_2-1}(p_2-1)\cdots p_r^{k_r-1}(p_r-1)=2^2=1\cdot 4=2\cdot 2$.
Now it is easy to conclude $r=1$, $p_1=2$, $k_1=3$ or $p_1-1=4$, $p_1=5$, $k_1=1$ (remain case $p_1-1=2=p_2-1$, isn't possible since $p_1\neq p_2$).
Solutions are $n=8$ and $n=5$.
Comment: The number of integers $t\leq p_i^{k_i}$ that are divisible by $p_i$ is $p_i^{k_i-1}$.  Thus the number of $t$ **not** divisible by $p_i$ (or in other words, coprime to $p_i^{k_i}$) is $p_i^{k_i}-p_i^{k_i-1}=p_i^{k_i-1}(p_i-1)$
Comment: What about $p_1 = 5$ and $k_1 = 1$?
Comment: @ dhk628 Thanks for observing that, I  added that solution.
Comment: Thanks. Can you briefly explain how you get the equation $\varphi(n)=p_1^{k_1-1}(p_1-1)\cdots p_r^{k_r-1}(p_r-1)$? Sorry I am new to this function and do not know too much about the property of this function.
Comment: Solutions are $5$, $8$, $10$, $12$
Answer: Consider the wiki
https://en.wikipedia.org/wiki/Euler%27s_totient_function#Unsolved_problems
and look up "totient numbers".  There are many nontotient numbers.  The page as a whole is very informative.
Comment: Thanks. Yeah I have actually looked up the page before, and I found that $n=5,8,10,12$ satisfy $\varphi(n)=4$, and it also seems that the larger the $n$, the larger the $\varphi(n)$, so it seems natural to conjecture that these four are the only $n$'s with $\varphi(n)=4$. However I have no any rigorous argument before the answer's given here.


Moving average over time on data entering stochastically

Question: The examples for using MovingAverage mostly refer to data evenly spaced in time,such as stock values.  In typical physics data, events arrive random in time (e.g. radio active decay events, but also if acting in day trading on the stock market). I do not see how I can use the apparatus of MovingAverage and associated evaluations in this case. Do I not understand the function, or should I go ahead and invent my own functions?
Comment: Make a `TimeSeries` object from your data, then use [`TimeSeriesResample`](https://reference.wolfram.com/language/ref/TimeSeriesResample.html) to get an evenly sampled version from it, then use `MovingAverage`.
Comment: No, that is not good: never add or remove data points. This is like "fake data", may look a handy tool but can lead to trouble in later analysis. I think I have the solution, in my second remark.
Comment: Sure. I'd expect the result to be the same, since I expect that `TimeSeriesResample` would do a linear interpolation over the missing range, and the `MovingMap` with a `Quantity[1, "Hours"]` window that you proposed in comments below would probably do the same for you, but behind the scenes. I don't see how else it could possible average over data that is not there.
Answer: By default the MovingAverage could be applied for 1-D lists but regarding to your case, you need make the TemporalData from your {t,y} list:
y= Table[RandomReal[{-1, 1}] + 5 Sin[i/(6 Pi)], {i, 1, 100}];
t = Table[i + RandomReal[{-0.3, 0.3}], {i, 1, 100}]; (*As you see, the timestamps contain random shifts*)
td = TemporalData[y, {t}];

ListPlot[{td, MovingAverage[td, 5]},
 PlotMarkers -> {Automatic, None},
 Joined -> {False, True},
 ImageSize -> 800,
 PlotStyle -> {Directive[Lighter[Blue, 0.5]],
   Directive[Red, Thick]}]

Comment: @HansW, the fundamental sense of the moving average is namely about moving the aver-window from data point to data point but not from timestamp to timestamp.
Comment: Thank you, but still I am not quite happy: The moving average is now averaged over 5 neighboring points and not over time. To get the average event rate I need the number of events within the averaging time window and divide by the window width.
Comment: Have to change my comment: I can indeed average over time using for the time in the temporal data datelists and averaging with Quantity[1,"Hours"] . Would not have guessed from the documentation. Thanks again.
Comment: What you calculate is an event average, I need a time average. Another aspect is that in comparing moving averages for different averaging windows, the results are out of phase by half a window. This is because it averages data all prior to the data point for which the average is made. This is also visible in the plot you made. The red curve needs to be moved by  2.5  to straddle the data. Is there a simple fix?
Comment: @HansW, the time-averaging requires another filters. The MoAv deals namely with your sample points by the definition of MoAv. The shift of the red curve occurres due to the principle of MoAv - it takes an array of `N`-points and returns the `N-r+1` points when av-window size is `r`. In my example `r=5` and the averaged array is shorter than initial for 4 points (the new timestamps of `TemporalData` take it in account).


Can a Fighter without multiple attacks use Two-Weapon Fighting?

Question: If you are a level 5 fighter who just picked up two-weapon fighting, even if you don't have multiple attacks, would you be able to attack with two weapons?
Specifics: Weapon training: blades, heavy; using a pair of Longswords +1
Comment: SSD has guessed you are talking about Pathfinder, but it would be good form for you to confirm that for us.
Answer: Yes. In Pathfinder, any character can fight with two weapons by taking a full-attack action to attack with his primary weapon and his off-hand weapon. Having a higher base attack bonus merely gives you extra attacks with your primary weapon.
From the the combat section of the Pathfinder System Reference Document, here is the relevant text:

If you wield a second weapon in your off hand, you can get one extra
  attack per round with that weapon. You suffer a –6 penalty with your
  regular attack or attacks with your primary hand and a –10 penalty to
  the attack with your off hand when you fight this way. You can reduce
  these penalties in two ways. First, if your off-hand weapon is light,
  the penalties are reduced by 2 each. An unarmed strike is always
  considered light. Second, the Two-Weapon Fighting feat lessens the
  primary hand penalty by 2, and the off-hand penalty by 6.

Longswords aren't light, so at level 5, you could use a full-attack action to make one attack with your primary longsword at a -4 penalty, then one attack with your off-hand longsword at a -4 penalty. At level 6, you would be able to make two attacks with your primary longsword–one at a -4 penalty, and one at a -9 penalty–then one attack with your offhand weapon at a -4 penalty.
I'm no expert on optimization, but I suspect you would be better off using a light weapon in your off-hand. That would reduce the penalties for each attack by 2 and have little effect on your damage.
Note that using two-weapon fighting requires a full-attack action, not a standard action. In general, this means you can't move and attack with both weapons in the same round. However, you can use a standard action to attack with either weapon.
Answer: Fighting with two-weapons automatically grants an additional attack, which is in addition to the number of attacks one is granted from their Base Attack Bonus.  A character who normally has 1 attack will have 2 when fighting with two weapons under normal conditions, and likewise someone with 4 attacks would have 5 (however, it's likely to be more - feats revolving around such a build continue to add an even greater number of attacks.)  One can decide to fight with "two weapons" even when unarmed, leveraging the use of both hands (or simply twice as much abstract body-parts, if a monk), meaning that anyone can simply gain this extra attack whenever they wish (although as with all cases of multiple attacks, it's only useful when taking a full-round action), and even a commoner can fight with two attacks per round (although not very well - the Two-Weapon Fighting feat is critical to make it viable).


Cronbach's alpha and reverse-scored items

Question: When calculating Cronbach's $\alpha$, would I include the reverse scores? I have 20 items in total, including 11 reverse-scored items. Would I just calculate the original scores?
Answer: You should reverse the scores of the reversed items before computing Cronbach's $\alpha$.
If you wish to reverse items into the original scale you can compute:
$$
r_{jk} = (max_j-min_j) - x_{jk}
$$
Where $max_j$ and $min_j$ are the theoretical maximum and minimum values of item $j$, $x_{jk}$ is the score of individual $k$ in item $j$ and $r_{jk}$ is the reversed score of individual $k$ in item $k$.


glance image-create fails with error Unable to establish connection

Question: I installed openstack using conjure-up(single node installation - all services of openstack on one server, this is for experimental purposes) and then was able to upload couple of sample images as follows
glance image-create --name "xenial-cloud1" --disk-format qcow2 --container-format bare --file xenial-server-cloudimg-amd64-disk1.img

the size of this image is around 280MB.
Then I proceeded to upload an image of size 12GB which is a ubuntu 16.04 Desktop image with Hawkbit installed on it.
glance image-create --name "ubuntu-16-hawkbit-qcow2" --disk-format qcow2 --container-format bare --file hawkbit-image.qcow2 --progress
It failed at 70% giving the below error

Error finding address for http://ip_of_
  glance:9292/v2/images/7dc43b2a-5d42-41fc-acbe-16493f0d8395/file:
  Unable to establish connection to http://:9292/v2/images/7dc43b2a-5d42-41fc-acbe-16493f0d8395/file

after this even when I try to upload a smaller size image it doesnt work.
All the services are up and running when I check status with the command
juju status
Even glance related commands like
glance image-list also give the same error
Error finding address for http://ip_of_glance:9292/versions: Unable to establish connection to http://ip_of_glance:9292/versions
Glance service is listening on port 9292 , i sshed into the glance node and ran
ubuntu@juju-64a1f1-4:~$ sudo netstat -plnt | grep ':9292'
tcp        0      0 0.0.0.0:9292            0.0.0.0:*               LISTEN      1682/haproxy
tcp6       0      0 :::9292                 :::*                    LISTEN      1682/haproxy

So am not sure, whats the problem. Any help to resolve this issue will be appreciated.
Note: This is the first time I am using openstack, so am a novice, please bear if ive missed out giving certain details or gone about things in the wrong fashion.
when running lxd init before installing openstack using conjure-up,
we chose 27GB as the size of the loop device(it was the default one indicated)
storage backend as zfs
UPDATE: When I set the

default_store = file

in /etc/glance/glance-api.conf
I am able to upload an image which is really small like 13MB or so but a bigger image throws me an error described here : https://ask.openstack.org/en/question/27033/image-storage-media-is-full/, thats because I don't have enough space on filesystem_store_datadir = /var/lib/glance/images/
I figured that my initial default_store was set to rbd after I finished installation using conjure-up, which is related to ceph. Also I've notice that ceph.service is active but in exited state, I tried to restart it but it wont leave the exited state

ceph.service                            loaded active exited    LSB:
  Start Ceph distributed file system daemons at boot time

If I can get this to be working, I'm sure things will return to normal from where I left off when I could upload two images successfully (when file store was set to rbd)

Is it possible to increase the space in /var/lib/glance/images/ post installation or even point filesystem_store_datadir to another machines path which has space on it ?
Comment: I was able to mount a location in my server which had space , gave that path in the glance api conf file and was able to store created images in the file system
Answer: allow connections from "ip_of_glance to port 9292/tcp and 9292/udp.


If $X$ is a normally distributed random variable, then what is the distribution of $X^3$? Does it follow a well-known distribution?

Question: I am trying to estimate the power production ($P$) from a wind turbine. The instantaneous power of a wind turbine varies with the cube of the wind speed ($v$), so $P = v^3$. If $v$ is normally distributed, what would be the distribution of $P$?
Comment: What can be said about the quartic of a normally distributed variable with nonzero mean? see https://stats.stackexchange.com/q/560245/269684
Comment: Googling this I get that the distribution is indeterminate (roughly the sum of infinite positive and negative pieces). PDFs of Berg's 1988 paper in _Annals of Probability_ are behind pay walls. If you have access to JSTOR (e.g, through a university library), you may be able to get a copy.
Comment: Thank you! Will check it
Comment: Related, answer discusses this issue (not really a duplicate): https://stats.stackexchange.com/questions/58846/ratio-of-sum-of-normal-to-sum-of-cubes-of-normal/260368#260368
Comment: I doubt the wind speed is accurately modeled by any Normal distribution.  Rather than go down the route of computing the distribution of the cube of a Normal, then, consider finding better models for the wind speed itself (or directly modeling the power from your data).
Answer: The general case of the cube of an normal random variable with any mean is quite complicated, but the case of a centered normal distribution (with zero mean) is quite simple.  In this answer I will show the exact density for the simple case where the mean is zero, and I will show you how to obtain a simulated estimate of the density for the more general case.

Distribution for a normal random variable with zero mean: Consider a centred normal random variable $X \sim \text{N}(0,\sigma^2)$ and let $Y=X^3$.  Then for all $y \geqslant 0$ we have:
$$\begin{equation} \begin{aligned}
\mathbb{P}(-y \leqslant Y \leqslant y)
&= \mathbb{P}(-y \leqslant X^3 \leqslant y) \\[6pt]
&= \mathbb{P}(-y^{1/3} \leqslant X \leqslant y^{1/3}) \\[6pt]
&= \Phi(y^{1/3} / \sigma) - \Phi(-y^{1/3} / \sigma). \\[6pt]
\end{aligned} \end{equation}$$
Since $Y$ is a symmetric random variable, for all $y > 0$ we then have:
$$\begin{equation} \begin{aligned}
f_Y(y)
&= \frac{1}{2} \cdot \frac{d}{dy} \mathbb{P}(-y \leqslant Y \leqslant y) \\[6pt]
&= \frac{1}{2} \cdot \frac{d}{dy} \Big[ \Phi(y^{1/3} / \sigma) - \Phi(-y^{1/3} / \sigma) \Big] \\[6pt]
&= \frac{1}{2} \cdot \Big[ \frac{1}{3} \cdot \frac{\phi(y^{1/3} / \sigma)}{\sigma y^{2/3}} + \frac{1}{3} \cdot \frac{\phi(-y^{1/3} / \sigma)}{\sigma y^{2/3}} \Big] \\[6pt]
&= \frac{1}{3} \cdot \frac{\phi(y^{1/3} / \sigma)}{\sigma y^{2/3}} \\[6pt]
&= \frac{1}{\sqrt{2 \pi \sigma^2}} \cdot \frac{1}{3 y^{2/3}} \cdot \exp \Big( -\frac{1}{2 \sigma^2} \cdot y^{2/3} \Big). \\[6pt]
\end{aligned} \end{equation}$$
Since $Y$ is a symmetric random variable, we then have the full density:
$$f_Y(y) = \frac{1}{\sqrt{2 \pi \sigma^2}} \cdot \frac{1}{3 |y|^{2/3}} \cdot \exp \Big( -\frac{1}{2 \sigma^2} \cdot |y|^{2/3} \Big)
\quad \quad \quad \quad \quad
\text{for all } y \in \mathbb{R}.$$
This is a slight generalisation of the density shown in Berg (1988)$^\dagger$ (p. 911), which applies for an underlying standard normal distribution.  (Interestingly, this paper shows that this distribution is "indeterminate", in the sense that it is not fully defined by its moments; i.e., there are other distributions with the exact same moments.)

Distribution for an arbitrary normal random variable: Generalisation to the case where $X \sim \text{N}(\mu, \sigma^2)$ for arbitrary $\mu \in \mathbb{R}$ is quite complicated, due to the fact that non-zero mean values lead to a polynomial expression when expanded as a cube.  In this latter case, the distribution can obtained via simulation.  Here is some R code to obtain a kernel density estimator (KDE) for the distribution.
#Create function to simulate density
SIMULATE_DENSITY <- function(n, mu = 0, sigma = 1) {
    X    <- rnorm(n, mean = mu, sd = sigma);
    density(X^3); }

#General simulation
mu      <- 3;
sigma   <- 1;
DENSITY <- SIMULATE_DENSITY(10^7, mu, sigma);
plot(DENSITY, main = 'Density of cube of normal random variable',
     xlab = 'Value', ylab = 'Density');

This plot shows the simulated density of the cube of an underlying random variable $X \sim \text{N}(3, 1)$.  The large number of values in the simulation gives a smooth density plot, and you can also make reference to the density object DENSITY that has been generated by the code.

$^\dagger$ This paper has a terrible name, which should never have made it through the journal reviewers.  Its title is "The Cube of a Normal Distribution is Indeterminate", but the paper relates to the cube of a standard normal random variable, not the cube of its "distribution".
Comment: @BruceET I think there is no discrepancy, the paper defines determinancy as uniqueness among moment-equivalent random variables.
Comment: Yeah, the moment-sequence of the cube of a normal is known not to be unique to that distribution (i.e. it's not determined by its moments); that on its own is perhaps mildly surprising -- however the really freaky thing is that while $X^3$ isn't determined by its moments, $|X^3|$ *is*. Also relevant: J. B. S. Haldane (1942), "Moments of the Distributions of Powers and Products of Normal Variates", Biometrika
Vol. 32, No. 3/4 (Apr.), pp. 226-242 .
Comment: More generally, it is a https://en.wikipedia.org/wiki/Chi_distribution with 3 degrees of freedom, that is a https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution - for N=2, this would be a https://en.wikipedia.org/wiki/Rayleigh_distribution
Comment: Thanks for the detailed answer!
Comment: Puzzled:  Berg, Christian: "The cube of a normal distribution is indeterminate", _Annals of Probability,_ .V16,.Nr.2 (April 1988). Abstract begins "It is established that if $X$ is a stochastic variable with a normal distribution, then $X^{2n+1}$ has an inderterminate distribution for $n \ge 1. \dots.$ Can you explain what seems to me to be a discrepancy?
Comment: The linked answer looks correct to me.  In that case, because he is dealing with a square instead of a cube, the probability interval actually corresponds to the CDF of interest, so he does not get the $\tfrac{1}{2}$ factor.
Comment: @ReinstateMonica, thanks again for your quick reply. I would have guessed his answer is correct. However, now I wonder if there is any rule that helps to determine when to include this $\frac{1}{2}$ (or any other) factor. Is there any hint you could give me? I am happy to pose this as a question if you prefer. Best, Dom
Comment: I'm not sure it is a particular rule, so much as a factor that happens to appear in that particular application of Leibniz integral rule.
Comment: Would you mind explaining where the $\frac{1}{2}$ in $f_Y(y) = \frac{1}{2} \cdot \frac{d}{dy} \mathbb{P}(-y \leqslant Y \leqslant y)$ is coming from? I generally get the approach. I compared this with [here](https://stats.stackexchange.com/questions/192807/pdf-of-the-square-of-a-standard-normal-random-variable) (see section on CDF technique) and found that no $\frac{1}{2}$ was added. Any clarification would be appreciated.
Comment: The $\tfrac{1}{2}$ comes from the fact that the probability is for an interval that is pushing out with $y$ on both sides, so you have to halve the rate-of-change to get the density value.  To see this, consider the fact that you have the integral expression $\mathbb{P}(-y \leqslant Y \leqslant y) = \int_{-y}^y f_Y(r) \ dr$ and then apply [Leibniz integral rule](https://en.wikipedia.org/wiki/Leibniz_integral_rule) to get $\frac{d}{dy} \mathbb{P}(-y \leqslant Y \leqslant y) = f_Y(y) - (-f_Y(-y)) = 2 \times f_Y(y)$ (using symmetry of the density).
Comment: @ReinstateMonica, I really appeciate your answer. It makes perfect sense. Thanks. I will now ask the author of the other pist why he has not done this as well :)