Accessing UEFI hardware info from Linux

Question: I want to get info about hardware through UEFI. I know, I can get the efi variables and make dump using fwts tool in Linux. Also, I know about "device" command for EFI shell, which will show me all devices, managed by UEFI. But I don't see the method, how I can get that info from Linux. I know, there is a range of methods to get info about hardware using another tools, but I want to know if this is possible using UEFI (this if for my studying).
Answer: There are no devices managed by UEFI.  Because the Linux OS called the UEFI ExitBootServices function.  This is required to allow the OS to start managing any device at all.
Modern OS's include drivers for hardware devices.  A single device should not be driven by two different drivers.  This includes parent devices / "buses", which are used to enumerate and communicate with their child devices.
For example, a USB hub on your monitor, which you connect to your computer through a USB-C port, which is on a PCI-E card plugged in to a PCI-E slot on your motherboard.  Your boot firmware could have the capability to load an EFI executable from a USB storage device connected to this USB port.  But when you run that executable and it calls UEFI ExitBootServices, it is allowed to take control over of all of these.
So the general rule is that the OS is what enumerates the connected hardware.  The firmware no longer has control.  You cannot ask the firmware to enumerate currently connected hardware and get any sensible result.
There are exceptions to the general rule.  They are all very horrible to deal with.  The question as written does not include any reason to enumerate all the exceptions that apply on your machine.  So don't do that.
Some hardware information is available through ACPI and DMI.  The ACPI tables are technically provided through UEFI, by virtue of passing one pointer (and I suppose by leaving the relevant memory reserved, in the memory map which the OS is passed by UEFI).  Presumably DMI is similar.
The DMI command is dmidecode.  DMI mostly seems to be a collection of identifiers.  Some of them are gathered from the hardware at boot time.  Neither of these is required to be comprehensive, so basically you need to have bus drivers to find all the hardware devices you need.
There are a number of ACPI commands including acpidump, and acpixtract.  One of the tools is a disassembler for an interpreted language called AML, which the OS runs on various occasions.
AML may sound somewhat horrible, but it is at least designed so you can avoid having an OS driver and an AML driver associated with the same hardware, and causing conflicts.  For example the OS has a driver for an Embedded Controller device, and AML can actually talk to the OS driver.  Or ACPI can reserve certain hardware resources, so that AML can use them directly, and the OS knows it is not allowed to use them.
ACPI also replaces the previous version of ISA PNP.  This is used to enumerate legacy devices like serial ports, where they cannot be enumerated by the OS itself.
Similarly, ACPI is nominally responsible for telling the OS to look for the initial PCI registers or IO memory addresses.  (I'm not up to date here.  But if ACPI says there aren't any, I can imagine that Linux would try to probe the normal address for this anyway).
A lot of devices are accessed through the PCI bus, directly or indirectly.
IIRC Windows will expose this in Device Manager by showing PCI as a child device of ACPI.  Linux doesn't seem to bother (I have pci0000:00/ directly in /sys/devices); I don't remember whether  ACPI->PCI is in a specialized format that there's basically no point exposing, or whether it's Linux that special-cases it and doesn't bother to expose ACPI as the parent device.

Accessing UEFI hardware info from Linux


How do I change the Color of the border of a Label created at run-time?

Question: The code below is for the dynamic creation of a Label named Title, it sets properties as Font, ForeColor etc. related to the Label's Text.
 Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Title As New Label
    Title.Text = "BROKERS"
    Title.Font = New Drawing.Font("Times New Roman", 30, FontStyle.Bold)
    Me.Controls.Add(Title)
    Title.ForeColor = Color.Red
    Title.Location = New Point((Me.Width / 2), (Me.Height / 2))
    Title.BackColor = Color.Black
    Title.Size = New System.Drawing.Size(220, 50)
    Title.BringToFront()
    Title.BorderStyle = BorderStyle.Fixed3D
    Me.Size = New System.Drawing.Size(900, 700)
End Sub

This section is supposed colour the border of the Label but it doesn't do so.
Private Sub Title_paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
    Dim g As Graphics = e.Graphics
    Dim pen As New Pen(Color.Red, 4.0)
    For Each ctr As Control In Me.Controls
        If TypeOf ctr Is Label Then
            g.DrawRectangle(pen, New  _
                            Rectangle(ctr.Location, ctr.Size))
        End If
    Next
    pen.Dispose()
End Sub

Answer: You should subscribe to the Paint event of your Label (or Labels, if you add more than one; use the same event handler for all).
When the Paint event is raised, the sender object is the Control that raised the event, so you can cast sender to Control or Label (we just need the ClientRectangle property value, which belongs to the Control class, so you could use the same event handler for other Controls that are not Label; e.g., a Panel).
Now, if you want your Label to auto-size to its Text content, you need to set AutoSize = True: the Label will auto-size when its Layout is performed (after you add it to a Container - the Form here).
So, to show it in the middle of the Form, set its Location property after you have added it the Controls collection and you have changed the Form size.
If you want to set a specific Size instead, don't set AutoSize = False, set the Size Property explicitly and the Location Property after you have changed the Form size (it appears you want to resize the Form at run-time).
Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    MyBase.OnLoad(e)
    Dim lblTitle As New Label() With {
        .AutoSize = True,
        .BackColor = Color.Black,
        .BorderStyle = BorderStyle.None,
        .Font = New Font("Times New Roman", 30, FontStyle.Bold),
        .ForeColor = Color.Red,
        .Text = "BROKERS"
    }

    AddHandler lblTitle.Paint, AddressOf TitleLabel_Paint

    ClientSize = New Size(900, 700)
    Controls.Add(lblTitle)
    lblTitle.Location = New Point(ClientSize.Width - lblTitle.Width) \ 2,
                                 (ClientSize.Height - lblTitle.Height) \ 2)
End Sub

Private Sub TitleLabel_Paint(sender As Object, e As PaintEventArgs)
    If sender Is Nothing Then Return
    Dim ctrl = DirectCast(sender, Control)
    Using pen As New Pen(Color.Red, 4)
        e.Graphics.DrawRectangle(pen, ctrl.ClientRectangle)
    End Using
End Sub


What if angular velocity is parallel to linear velocity

Question: Hello I want to ask you a question about rotational movement. Say I would consider a system and the center of mass is moving with a velocity $\dot{\mathbf{R}}$ and the system is rotating with an angular velocity $\boldsymbol{\Omega}$. How does the movement look if $\boldsymbol{\Omega} \vert\vert \dot{\mathbf{R}}$? Is this a screw motion?
Answer: Yes this is by definition screw motion with pitch value $ h = \frac{ \| \boldsymbol{\dot{R}} \|}{\| \boldsymbol{\Omega} \|}$. Pitch is the scalar ratio of translational velocity to rotational velocity in units of length.

Helical motion figure from wikipedia
Now the theory (Chasle's Theorem, wikipedia) goes that any motion of a 3D solid body can be decomposed as screw motion along an arbitrary axis of rotation. The direction of the axis of rotation is parallel to $\boldsymbol{\Omega}$.
This means that if the center of mass translates with $\boldsymbol{\dot{R}}$, and rotates by $\boldsymbol{\Omega}$ not necessarily parallel to each other, then the rotation axis position $\boldsymbol{R}_{\rm axis}$ and pitch $h$ are found by
$$ \begin{aligned} \boldsymbol{R}_{\rm axis} & = \boldsymbol{R} + \frac{ \boldsymbol{\Omega} \times \boldsymbol{\dot{R}}}{ \| \boldsymbol{\Omega} \|^2} & h & = \frac{ \boldsymbol{\Omega} \cdot \boldsymbol{\dot{R}} }{ \| \boldsymbol{\Omega} \|^2} \end{aligned} $$
Here $\cdot$ is the dot product and $\times$ is the cross product
In reverse, given the rotation $\boldsymbol{\Omega}$, the rotation axis position $\boldsymbol{R}_{\rm axis}$ and the pitch $h$ then the translational velocity is
$$ \boldsymbol{\dot{R}} = h\,\boldsymbol{\Omega} + ( \boldsymbol{R} - \boldsymbol{R}_{\rm axis} ) \times \boldsymbol{\Omega} $$
Note that $\boldsymbol{R}_{\rm axis}$ is the point on the rotation axis closest to $\boldsymbol{R}$.
References:

Page 4 of this presentation on screw theory for robotics.
Paper on robot kinematics using screw theory
Comment: Added a link to Chasle's theorem.
Answer: Yes, the trajectory will look screw-like. You are right about that. The direction of the angular velocity vector is the axis of the rotation. And if this axis is aligned with the COM motion superposing both movements yield a screw like motion.
Comment: Do you have a picture of this?
Comment: You have to be careful that the angular velocity vector points in the direction of the AXIS of the rotation. So when the axis of the rotation is aligned with the linear motion this yields a spiral (at least for points not on the axis itself). If the vector is perpendicular this would not yield a screw like trajectory
Comment: @ Buraian No, sorry, I am searching for the picture of it :)
Comment: @bluesky Thanks for your comment!


Regain access to (partly) locked phone

Question: I know I know: Again someone asking "how do I unlock my phone without the pattern", but please read  to the end haha.
I use a VPN software on my phone that asks me to change me lock screen settings every 6 months. So did I, guess what, 6 months ago. Since I never restarted my phone and I use face unlock and fingerprint, I never had to re-enter my pattern.
Today I was stupid enough to restart my phone and locked myself out.
It's a huawei mate 10 pro (BLA-29) and yes, I can prove that I am the legal owner of this device :D
Some months ago I activated the developer options and also USB debugging. Why? I thought that I could remove the "gesture.key" file if I forget the pattern. So yes, my PC can find the phone with fastboot and abd. But i did NOT unlock the boot loader (and I did not check the option in the developer settings).
I tested a lot of patterns but the time inbetween the 3 chances to enter a pattern rises, I am at 2 hours at the moment.
Fortunatelly I added a second user account to the phone, but it's a standard user and not an admin. I also installed "lostandroid" by https://www.androidlost.com/ but unfortunatelly my phone does not receive any commands since I am logged in with the second (non-admin) account.
My next attempt was to remove the pattern file via "adb shell rm /data/system/gesture.key" but the file does not exists. Yes, I googled and found out, that since android marshmellow the files are p.e. "/data/system/gatekeeper.pattern.key" but this file ALSO does not exist.

I can't flash a new zip or su.zip since the bootloader is still locked and I can't unlock it.
I can't pull the gesture file since none of them (as mentioned above) exist.
I can't push another key since I always get "permission denied", no matter to which directory I try to push
"SU" is not installed.
"adb root" doesn't to anything but also throws no error.
The system partition is read only.
I can't remount the system partition since it gives a error message that verity is enabled.
I can't disable verity since it's a user build.
The backup created with "adb backup" are way too small (just about 1 GB), no matter which parameters (apk/noapk, all, system/nosystem etc.) I use. So there is no chance to create a backup of my data, right?
I can't unlock the bootloader with "fastboot oem unlock UUUUUUUUUUUUUUUU" since I did not check the setting in the developer options. My second user is not allowed to open the developer settings.
my second account seems to be broken since my phone throws an error "apps are beeing prepare, try again later" (translated roughly from German) but even after 2 hours, several reboots, the apps don't open.

I stumbled accross this thread and honestly I dont know if this could help with my problem.
How to disable dm-verity on Android with "user" build type ROM?
So is there anybody that can help me with this?
I know that I am really stupid but hard resetting without a backup is no option.
I got backup files of course but I received important files of a big customer of my business on that phone 2 days ago, so there is no backup yet which includes these files.
As I wrote: it's my phone, I can prove it :D
but it's really important so maybe there is anybody that can help me :(
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/133774/discussion-on-question-by-markus-schnepf-regain-access-to-partly-locked-phone).
Answer: Success.
Even if I can't explain how/why. I took my phone and my muscle memory "remembered" the correct pattern. At first I was happy with that, of course, but then I realized that it was the pattern that I tried a dozen times in the last 2 days.
I also wrote down all patterns that I tried and it was the very first!
How come it suddenly worked?
Now knowing the pattern I locked my phone again and unlo...  wait. I was in. No pattern any more. it just disappeared!
I opened the settings app and searched for the security settings for "display lock".
Before, I could decide between "PIN" (numbers only), "Password" (alphanumeric) and pattern. "Face unlock" and "fingerprint" were additionally available AFTER I set up a display lock.
But now I can only choose "unlock password" which is a fixed length (6 digit) number. Why do they call it "password" if it's just a PIN?!
So... why are the other options gone? Why can't I choose the pattern anymore? Why did it suddenly disappear? Questions after questions.
My system information tell me that the phone still runs with android 10 and EMUI 10, the last security patch was on "01.07.2021" (july 1st). Also "USB debugging" was disabled. There was no software update for a long time.
I am glad that I can use my phone again but I felt like the dumbest person on earth since I own a repair shop and I repair smartphones since 2010. Every time a customer tells me that he did not make any backups (what I did!) and that he did not set up any recovery option for his phone, I get a little angry with him.
And then I could not access my own phone even I set up

huawei ID
google "find my phone"
"Lost android" by www.androidlost.com
SMS commands (like unlocking my fckn phone!) by www.androidlost.com
USB debugging with an authorization for my computer
but nothing of that worked.

In conclusion: I may not be as stupid as I felt and I'll never get an answer on how that happened. But I'm very happy.
thanks for your time @alecxs

Regain access to (partly) locked phone


What exactly is a probation period at a new job?

Question: I'm about to accept a job with a 90 day probation period. What does this mean and why do these exist? I've heard an input that after that period my salary might increase slightly (my salary is almost 10k below average for engineering). Does this mean if I don't perform to their standards they could decide to let me go after those 90 days or earlier? There's not much in my job offer that states more about it, but days off and vacation begin after it and so do benefits I believe.
Comment: Can you add a location tag? In germany, you have a decreased notice period during the probation, as has the employer. The mandatory notice period increases the longer you work for your employer - in the beginning it is 1 day, after the probation at least 1 month.
Comment: Related, regarding Probations in Germany (@Jost): [What is a probation period in contracts?](https://workplace.stackexchange.com/q/45107/73791)
Comment: *Does this mean if I don't perform to their standards they could decide to let me go after those 90 days or earlier?* Depends on the country, but in the U.S. that's typically exactly what it means. You'll often have more frequent formal reviews to make sure that you're progressing according to their expectations.
Comment: This is location specific. In Argentina, for example, this is the period where the employer can terminate the contract without cause, and pay no severance. After this, companies are required to pay severance, to the equivalent of 1 salary for every year worked, in order to fire you without just cause. Almost double that if not given early notice.
Comment: Is this actually location specific? I have never heard of any probation period *laws*. The detail of your probation period are probably defined in your *contract*
Answer:
I'm about to accept a job with a 90 day probation period. What does this mean and why do these exist?

It means that for 90 days both you and the company have the chance to get a look and feel of each other, to see if you are a good fit for the company, and also for you to realize if this is job is a good fit for you.
Usually this implies that if any party does not wish to continue with each other after the probation period, you can part ways gracefully.
In other words, they could fire you at will, and you could quit at will during this period without major drawbacks or hassle.
It's also usual that during this period you will be given an on-boarding process or introduction, so you can learn your ways around the company.

Does this mean if I don't perform to their standards they could decide to let me go after those 90 days or earlier? There's not much in my job offer that states more about it, but days off and vacation begin after it and so do benefits I believe.

Yes, they could let you go when that period ends or before. You are also in position to quit when or before that period ends.
It's likely that as you stated vacations, PTO, and other benefits start counting after the Probation Period.
In most cases, when the Probation Period ends and both parties are happy and wish to continue, a new contract is made and signed, where more permanent arrangements and benefits can be reached.
Comment: I've never seen or heard of a new contract being signed after the probation period--the probation period explanation has always been in the original contract. In fact, normally there isn't even any actual mention that the probation period ended--for the most part it's just a formality and no one even thinks about it unless something is wrong
Comment: Especially in Germany, there are extremely employee-friendly laws. The bigger th company, the harder it would be to get you out again. Probation period is the life insurance for employers to get rid of non-fits. Notice period is zero in that time. I've never seen a company make use of this, though.
Comment: @Jessica: I've seen someone being asked to leave after just two hours. Admittedly he was an absolute idiot. Told his supervisor to do a job herself because it was beneath him.
Comment: @gnasher729: how on earth did someone like this manage to get past an interview...? ;-)
Answer: It really depends on the your location and the labor laws that apply, as well as whether or not your place of work or your industry is unionized.
In my case, I had a probation period of 1 month, and during that time, both me and my employer were meant to evaluate each other, and decide whether or not we are a good fit.
If either of us would have decided that this will not work out, we could have ended it without any notice period.
Answer:
Does this mean if I don't perform to their standards they could decide to let me go after those 90 days or earlier?

This depends on the country and what kind of contract you have, but in the U.S. at least that's typically exactly what it means. (In at-will employment states, they could technically fire you at any time, even outside the probation period, and for any non-illegal reason). Even in other countries and with other "special" kinds of employment contracts (e.g. union contracts), it means something similar to that; at a minimum, the process to fire you during that time (even in countries with stricter labor laws than the U.S.) will often be a lot less strenuous.
Many companies that have a probation period will also have some kind of formal process for regular reviews during this period to make sure that you're progressing according to their plan (or, at a minimum, a review at the end of the probation period to make sure that you're performing up their expectations). (Even if you don't have this kind of a process at your company, I'd definitely recommend that you ask them what their expectations are).
It's also not uncommon that your salary and/or benefits will change somewhat after the probation period. You may get a salary review at the end of the probation period, and you may become eligible for certain new benefits (like vacation, additional company-provided insurance, etc.)
Comment: At-will employment law doesn't trump contract clauses. If your contract has a probation period, i'd assume it also has Notice clauses, unless there  are salary/benefit changes as you mentioned. There may also be a refund in training costs


Lack of colour in Nitric Oxide

Question: Usually compounds' colours are explained by the presence of unpaired electrons which is free to excite and de-excite giving the compound a charectistic colour. NO has atleast one unpaired electron but even then it is colourless. Can anyone tell me what the reason is?
Answer: I am not a physics major, this post will be rather free of equations and spherical chickens. This is a chemist's view of the situation ;)
You need more than an unpaired electron to create color in a substance. You need two places for it to be, with a given energy difference in the visible color range. Looking at the molecular orbital diagram of NO we see that no such organisation is possible (within reasons). The only choice is to go from one $\pi^*$ to the other, but those are at the same energy level. There is no way for this diatomic molecule to deform in any meaningful way so as to create a difference in energy levels between them. Metal complexes, especially iron- and cobalt-based ones, can do this, but not with the $\pi^*$ in any case. There is only $\sigma^*_2$ left, but the distance from $\pi^*$ to $\sigma^*_2$ is in huge, larger than visible spectrum (an event that knocks an electron up there is likely to unravel the entire molecule).
All in all, there is no possibility for the electron to move anywhere that requires the emission of a photon in visible range. It cannot produce the color you seek.
Comment: @Beast You would probably benefit from reading on the molecular orbital theory, you need that to understand fully. From MO theory: HOMO is the highest occupied molecular orbital. The uppermost arrow in the diagram. For 2 electrons to co-habitate in a single orbital, they need to have opposing spin. (Pauli exclusion principle)
Comment: What do you mean by HOMO, and when you said 'it needs to change it's spin direction to "there" '. What exactly did you mean? I understand that you mean other places it can go to but what are the other places and why does it need to change it's spin to go there?
Comment: I know the basics of MO theory and Pauli's Exclusion Principle, I just wanted to know where else the electron could go where it had to change it's spin, did you mean into N or O's orbitals?
Comment: @Beast Well, at second glance, I see I was a bit fast writing that. There is no open singly occupied orbital in the MO. So nowhere to go even if the spin flips. Sorry for the confusion there. I'll update the answer.

Lack of colour in Nitric Oxide


JTAG'ing firmware into imx28

Question: My goal here is to load a custom kernel and initramfs into the memory of the wink hub 1 based on imx28 dev board and boot it using the bootm command from u-boot shell.
So, I downloaded the u-boot 2014.01 source code and built it from scratch using the patch provided here then I downloaded the latest buildroot and build the kernel and root file system along with initramfs for the imx28 board.
Using JTAG I'm able to load the u-boot at 0x40000100, kernel at 0x42000000 and initramfs at 0x42300000 but when I pass these addresses into the u-boot shell and hit bootm the kernel hangs after decompressing and nothing happens...
I thought there might be the problem with the kernel but even when I pass just the kernel address without loading the custom one ( i.e. loading the kernel present in the nand memory ) in the RAM still the kernel hangs and does not boot it only works well with the boot (bootcmd) command.
This is the output when trying to load the kernel manually from a memory address nothing happens after decompression.
=> bootm 42000000 42300000
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-220.127.116.11-flex-dvt
   Created:      2014-04-30   3:15:35 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1928460 Bytes = 1.8 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 42300000 ...
   Image Name:   Root Filesystem
   Created:      2019-01-12  14:23:44 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    893637 Bytes = 872.7 KiB
   Load Address: 40800000
   Entry Point:  40800000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

But on the u-boot shell just after hitting boot command it boots and everything works fine.
I don't know what I'm doing wrong I've checked the /include/configs/mx28evk.h for the kernel uImage, initramfs & fdt addresses and everything seems right.
Answer: I've figured out what the problem was.
I had enabled low level debugging and had redirected all printk's to Embedded ICE UART port so it would not show any output on the UART console.
[ ] Kernel low-level debugging functions
      [ ] Early printk (NEW)
      [ ] Kernel low-level debugging via EmbeddedICE DCC channel (NEW)

keep it unselected as above.
Regards,
Amit.

JTAG'ing firmware into imx28


Why does my dog constantly try to lick my butt when i get home?

Question: Whenever I get home from work, I get greeted by my Great Dane. He runs up to me in the doorway and insists on kissing me, but when I walk a little further he sticks his face up my butt and tries to lick (keep in mind that I don't let him do this).
I understand why he smells me there but why does he lick?
Does this happen to anyone else, and how have other people stopped this behavior?
Answer: I'm pretty sure most dog owners will know this behavior and/or have seen it some time (even if it's just with other dogs or cats) - it's natural and theoretically nothing bad. It's basically part of their communication with each other. There are many sources to be found with more details about this, like this article on mental_floss, where they also show a short video about it.
What they explain in the video in regards to getting to know other dogs or knowing more about them, is basically the same your dog tries with you (since you're part of the pack).
It can get awkward with other people around etc. that's true and probably the only reason you should try to get rid of it. Some might associate it with dirty underwear, but that's really just a tip of an iceberg. Dogs don't need dirty underwear to smell their owner.
Our Husky puppy showed a similar behavior, but he preferred to sniff and lick people's frontside... I guess you get the idea.
There are different methods to fight this, but most basically involve distracting the dog with something different that's far more interesting. What actually works really depends on the dog. Trial and error.
In our case I've had two distractions and they worked pretty fast (stopped doing it after just one or two weeks):

Start fondling the dog in a position it loves. Our dog just loves being tickled between the front legs and will instantly sit or lie down to enjoy it. No time to sniff or lick around.
Try a reaction similar to other dogs (not perfect for public for obvious reasons): Make a small jump/turn around, face the dog, and snort for a moment (just a second or so should be enough). This would typically get our dog to start wagging its tail and start playing with me (throwing on the ground, waiting, etc.). Sniffing and licking were no longer on the priority list.
Whatever you try, don't do something exclusive the dog loves. Like getting it a special treat or making this the only time of the day you play, etc. Otherwise you might get the direct opposite result: The dog would do the undesired behavior to get you to do the desired behavior (playing, treats, etc.).
Comment: It isn't just dogs, of course. My cats will sniff each other's butts. They can't usually reach mine but they'll sniff my knees or armpits at times. To them, this is a somewhat nosey (pardon the pun) version of "hey, where have you been, have you eaten anything interesting lately and if so is there any for me, ..."
Answer: Dogs and cats sniff bums because the anal glands hold a lot of information, such as age, sex, point in reproduction cycle, level in pack dominance, and much more. It makes sense that animals would do this upon meeting each other, and even after knowing each other for a long time. Think of it as an animal's way of saying "How was your day? How are you feeling?" It's also an animal's way of asserting or allowing dominance. (Interesting point: when an animal lifts their bums when they get scratched, they're inviting you to sniff it!)
Obviously humans don't sniff each others bums. Our sense of smell is no where near what a dogs sense of smell is, so we don't understand why an animal might do this and an animal doesn't understand why we might find this embarrassing.
It's important that when your dog does this, you don't just distract him, unless you plan to have every visitor in your house do this. That will also train him that when he tries to sniff a humans bum, he will be rewarded. If you go that direction and then do something different when he does it to someone else, it will be extremely confusing.
Animals work by instant association. If I do this, this will happen. You need to teach him that if he tries to sniff a human in an undesirable area, something will happen. You don't need to do anything that will cause pain (and please don't), so think of something a fellow puppy or mother dog would do. If I had a dog that continued this, I would gently push his nose away, then walk away. No loud noises or sharp movements, or he'll start to associate you coming home and taking shoes and coats off with that. Act completely normal otherwise, just gently push his nose away so he's facing away from you, then act normal again. Eventually he'll make the association that doing that will cause his nose to be pushed away, much like how a fellow dog would nudge him away when he's doing something wrong, and he'll stop. Ensure that if he's doing it to company, you do the same thing. If you can tell the person before they come over the process, do. Otherwise, don't waste time telling them or the period of association will be over.


Bottom-up TileList in Flex 3.5

Question: In Flex 3.5, is it possible to use mx.controls.listClasses.TileList to layout tiles horizontally and bottom up?  The first part is easy - TileList.direction = TileBaseDirection.HORIZONTAL.  But what about bottom up instead of from the top down?
Answer: I believe you'll have to write something custom to get this to work. I know you mentioned you were working in Flex 3.5, but here are some links that may be of use to you in getting started.
http://www.adobe.com/devnet/flex/articles/spark_layouts.html
How to bottom-align cells in a DataGroup using TileLayout?
how do I make a TileGroup layout that has the jaggy edge on top?

Bottom-up TileList in Flex 3.5


Assign customer to group based on product bought

Question: Is it possible via some extension or modification to assign customer to a customer group based on the product he buys? For example if we have a "Membership 2015" product and we need to automatically assign customers who buy that product to the "Members 2015" customer group. This way we could set up a catalog price rule that would give discounts for any customers that belong to the Members 2015 group.
Comment: I'm looking for a very similar solution.  Although mine might not be based on membership purchased, I want to add a customer to a group based on specific physical products purchased.

My use case is that customers who purchase a particular product will get a lifetime discount on certain other add-on products or replacement parts.
Answer: I ended up with using modified version of this extension:
http://mageshopapps.com/shop/customer-membership.html
However here is another extension that should do the job without modifications:
https://plugin.company/magento-extensions/automatic-customer-group-switching.html


How to quantify the semantic depth of a sentence?

Question: I'm looking for a robust way to roughly quantify the amount of information conveyed in a sentence, specifically in English. For instance "He went to the place" conveys less information than "John went to the store at 3 AM." Is there a standard way to do that? Would simply counting the number of content words be a robust enough approach?
Answer: First, the term depth is highly misleading here. Hearing the word depth will invoke the picture of a syntax tree in the mind of a trained linguist, and the depth of a tree is easily measured in terms of levels from the root.
But the question itself is sufficiently clear. To get at the information contained in a sentence (measured in bits) you need a language model. A simple language model is the so-called unigram model that measures the probability of a word just by taking its frequency in a suitable and large corpus. Summing up the terms $p\log p$ for the words in the sentence gives a measure of the information contained in the sentence.
Just counting "content words" is probably too crude, since nouns carry a lot more information than content verbs (in English language).
Answer: Ideally, the semantic content of an analysis should be language-agnostic. The semantic depth (informally speaking) should correspond to the complexity of the interaction between all the entities and the verbs (at least).
The best method for your scenario might turn out to be based entirely off named entity recognition and verbs in a sentence. To quote an example from spaCy documentation,

Apple|ORG is looking at buying U.K.|GPE startup for $1 billion|MONEY

There are more rigorous ways of quantifying the semantic complexity of sentences. To my knowledge, Discourse Representation Structures, is one of the most fundamental ones. There are more recent variants of the original DRS, which you might have to look into.
Here is an illustrative example from the paper by Liu, et al, (2018) Discourse Representation Structure Parsing:


Where to get realtime stock market data legally

Question: Can anybody point me to some service (free or paid) where my software can get real-time market data for analysis without recurring to web scraping? I'm interested in Latin American stock markets
Answer: There is a free API service called Alpha Vantage that provides "free APIs for realtime and historical data on stocks, forex (FX), and digital/crypto currencies." However, there are some usage limits to the service, you can only 5 API requests per minute and 500 requests per day. The logistics of using the Alpha Vantage API are covered on their website. Furthermore, Alpha Vantage libraries on GitHub can be found here.
Comment: FYI - it seems "realtime" in this case means updated every minute. "Their intraday data is realtime up to the current minute, which is fine for my research purposes but may not satisfy users who want to beat the market with millisecond precision." Source: https://github.com/RomelTorres/alpha_vantage/issues/13
Comment: Similar platform is https://iextrading.com/developer/
Answer: The only real-time trading data comes directly from the brokers or exchanges. To get access you need to be a licensed trader with them, and usually the live data in machine readable formats costs even more. Here's more details.
For real-time trading data (transactions) you should consider less traditional securities like blockchain currencies.


Working paper to published paper

Question: I have a couple working papers on ssrn.com that I am preparing for submission to a journal.  If it is accepted, should I pull the ssrn.com copy from the website or block people's access to it by making it private?  Is there either a duty from the copyright change to remove it or if there is no legal obligation is there an ethical one?
Answer: Their FAQs section states:

10. Does submission to SSRN restrict in any way what I can do with my paper?
  No. And if at any time you wish to immediately remove a paper from SSRN, you may do it yourself through SSRN HQ, or contact us to remove it for you.

Contacting them is always an option to make sure though.
Comment: Yes, but the question wasn't "can I remove it," but rather do I have a duty to remove it?
Comment: Yes but the answer is not "can you remove it" either. It is very clearly written "AND if you want to remove it". So they say that you can do anything you want with your paper as fas as they're concerned.

Working paper to published paper


How to unassign a 1.14 Minecraft Villager's career in survival, no villager farm

Question: Is there some way I can make something like a Farmer turn into a Weaponsmith or a Toolsmith? without creative or cheats?
Comment: Seems like you just need to put them near different workstations (which seems weird, but ok, villagers were always a bit weird). If that doesn't work, you can abuse [a bug](https://bugs.mojang.com/browse/MC-148564): Turn them into zombie villagers and cure them, then they lose their profession.
Answer: The Village & Pillage Update (v1.14) now lets you control a Villager's Profession, with the use of job site blocks or "Workstations". These blocks can be "claimed" by Villagers, at a 1:1 ratio (one villager to one workstation).
If a Villager's workstation is destroyed, or they can no longer path find to that block (this can include moving beyond a certain radius of the block), they will lose their Profession, and can then be re-assigned a new one. Villagers must be at least one block away from a workstation, and be able to pathfind to the block to be assigned a new profession.
The exceptions to this are that Villagers cannot be Nitwits, or babies. Villagers that you have traded with prior to v1.14 can still be assigned a new Profession by workstations. Additionally, there is a bug in v1.14 pre-release 4 that can be abused:

Cured zombie villagers lose profession


grep some archived logs using find and xargs

Question: I have a list of IP's in a csv file and I need to search for any encounters of this IP's in a whole bunch of archived logs but only for file in January.
I first tried this:
for i in `cat /tmp/ips.csv`; do zgrep -rHc $i /webstats/2010/some_dir/*/*.2010-01*.access.gz ; done

But that doesn't work. I get:
bash: /usr/bin/zgrep: Argument list too long

However I thought using find + xargs but I'm not that sure on how I should build my expression.
I was thinking of this:
find /logs/2010/some_dir/ -name *.2010-01*.access.gz -type f -print0 | xargs zgrep -rHc `/tmp/ips.csv` {}

But something doesn't look that good.
Comment: cat file | grep IP | grep DATE ?
Answer: Try this :
find /logs/2010/some_dir -name '*.2010-01*.access.gz' -type f -print0 | xargs -0 zgrep -Hc -f /tmp/ips.csv


Does Shiva ever die ? And what about Vishnu?

Question: Brahma has a certain lifespan - 100 Years ( Brahmlok years)
But what about Shiva ji and Vishnu ji ? Do, they also die ?
Does Shiva die at the end of this universe ?
And Does Vishnu die at the end of this universe ?
Comment: Different puranas have different view on this due to sectarian differences.
Comment: Nope, Parambrahma is eternal and Trimurtis are Saguna Sakar Parambrahma.
Answer: ---------SHIVA--------

Oh Soma-Rudra the mighty/strong (avyase), with pleasant or beneficent
heart (Shamtamam Hruday), who is the resort to all hymns/songs
(gātha-patim), the resort of Yajñá/Sacrifice/Oblations (medha-patim),
who is the very bliss/ānandam (śam-yoḥ sumnam), you are the immortals
family possessing the elixir (pra-jāḥ amṛtasya), you are the home to
the highest truth (ṛtasya). Please Note: Both terms "ṛtasya" and
"amṛtasya" are synonymously used, soma is also used as its replacement
occasionally.
Bestow upon us oh Immortal Rudra, that which the mortals (like us) can
eat. Be gracious oh benevolent one, towards our lineage (offspring).
We praise thy Rudra with the sweetest of hymns, oh father of Maruts,
oh Immortal one, grant upon us your benevolence, our food, offspring
~Rig Veda 1.43 / 1.114.6
नमस् ते रुद्र कृण्मः सहस्राक्षायामर्त्य ॥ 11.2.3 Salutations/homage
(नमस् ते ) to the Immortal (अमर्त्य) Rudra (रुद्र) with
infinite/thousand eyes (सहस्राक्ष) मुमुक्तम् अस्मान् दुरिताद् अवद्याज्
जुषेथाम् अमृ॒तम् अस्मासु धत्तम् ॥ 5.6.8 Free us oh Soma Rudra from
troubles and from disrespect and humiliation, accept our
homages/worship oh Soma Rudra, bestow up us that immortality  ~Atharva
Veda 11.2.3 / 5.6.8
"nama̍ste astu bhagavan viśveśva̱rayā mahādevāya tryaṁbakāya
tripurāntakāya trikalāgni-kālāya kālāgnirudrāya nīlakaṇṭhāya
mrutyuṁjayāya sarveśvarāya śankaraya sadāśivāya śrīmanmahādevāya
namaḥ. "My Salutations unto the Divine Authority over all that
pervades, the principle (maha) of all divine, the one with three eyes,
the one who ended the Tripurasuras the 3 celestial worlds, he is the
3 fires which blaze at all times, this is the fire that devours time,
the one with blue neck which holds the anti-creation element, by this
He is beyond death, he is the authority over the entirety, the one who
bestows bliss, as he is forever auspicious, he the prosperous highest
of divine my homage " ~ Kṛṣṇa Yajur Vedā 4.5
एवा बभ्रो वृषभ चेकितान यथा देव न हृणीषे न हंसि । हवनश्रुन्नो रुद्रेह
बोधि बृहद्वदेम विदथे सुवीराः ॥ Certainly (एवा ), oh mighty
chief/overlord (वृषभ ) with tawny-reddish hue (बभ्रो), henceforth we
proclaim (यथा ) the all-knowing/omniscient Divine (चेकितान देव) ,
forgive us/not punish us (न हृणी), be not angry (न हंसि ), hear our
oblation (हवनश्रुन्न) and direct us on this occasion (विदथ), oh
powerful (बृहद्व) Rudra of perfect wisdom/speech (बोधि), bless us with
noble and heroic successors (सुवीरा) || ~Rig Veda 2.33.15

RUDRA himself is Death

येते सहस्रमयुतं पाशा मृत्यो मत्यााय हन्तवे। तान्यज्ञस्य मायया
सवाानवयजामहे॥ मृत्यवेस्वाहा- मृत्यवेस्वाहा ॥ Yajur Veda 4.5.16 You are
that End of all beings (मत्यााय), your form is that death (मृत्यो)
tethered (पाशा) are all beings (सवाान) in thousands (सहस्र) and tens
of thousands (ऄयुतं), we loosen (ऄवयजामहे) these tethers with our
worship/Vedic rites (तान्यज्ञस्य मायया). Our homage to the one who is
the form of death (मृत्यवे स्वाहा) ~Yajur Veda 4.5.16

RUDRA gives freedom from Death

त्र्यंबकं यजामहे सुगंधिं पुष्टिवर्धनं । उर्वारुकमिव
बंधनान्मृत्योर्मुक्षीय मामृतात् ॥ 7.59.12 Oh Triambaka (3
eyes/seasons), we offer our oblation (यजाम), nourish us (पुष्टि) and
bestow us (वर्ध) into the trance of fragrance (सुगंधिं) | May you
untie our bonds (बंधना) like a ripened gourd fruit (उर्वारु) unties
itself from the stem, and take us beyond death (मृत्यु) and deplete
(र्मु–क्षीय) our compulsions (र्मु) and take us (मा) into the immortal
state (अ॒मृत॑) (मृत्यु + मोक्ष (मोह+क्षेय) + मा-अमृतात्) Please note:
सुगंधिं does not mean physical perfume, but the nostalgia one feels
upon experiencing a certain sound or fragrance or taste. So it means
to bestow us into the sweetness of imagining Thy Divinity during the
transcendental states of dhyana/dharana. र्क्षीय: means to deplete,
and र्मुक्षीय means to deplete our moha/compulsions arising out of
Avidya. मा is also an Adj & Conj use as negative as "not". ~Rig Veda
7.59
स एव काले भुवनस्य गोप्ता विश्वाधिपः सर्वभूतेषु गूढः। यस्मिन्युक्ता
ब्रह्मर्षयो देवताश्च तमेवं ज्ञात्वा मृत्युपाशांश्छिनत्ति॥4.15 He in
Time (स एव काले ) the overlord/caretaker (गोप्ता) who is the one sole
ruler (विश्वाधिपः) of all celestial mansions/creation (भुवनस्य) hidden
indweller (गूढः) of all beings (सर्वभूतेषु ) | In whom (यस्मिन् ) the
exalted sages who attained Brahmi states (ब्रह्मर्षयो) the divine
beings (देवताश्च) merge into (युक्ताः ) by knowing him (तमेवं
ज्ञात्वा) are released/cuts/free oneself (चिनत्ति) from the tethers of
Death (मृत्युपाशां).~ Svetasvatara Upaniṣhad 4.15

RUDRA himself is TIME
kālāgnirudrāya (कालाग्निरुद्र) meaning fire that devours time, why because Rudra itself is TIME, hence the title Kālāya Namaha"कालाय नमः" TA10.18 (I bow to you oh time) and this finally landed in Svetasvatara Upaniṣhad wherein it says "अन्त:काले सञ्चुकोच"SU3.2 meaning He dissolves all beings into Him at end of time. One might consider both past and future to be non-existential, however, though non-accessible in this dimension, the same Upaniṣhad says "संयोगनिमित्तहेतुः त्रिकालात् परः अकलः अपि दृष्टः"SU6.5 meaning when one beheld in witness of Rudra, know He is the cause and the beginning of all causes; beyond the past, present and the future and he is not a part of it. Śrī Kṛṣṇa says to Yudhishthira in Mahābhāratam Anushasnika parvam 161.11 that Rudra is the past, the present, and the future, the exact statement was repeated by Rśi Vyāsa in Drona Parva 202. Maharśi Vaśiṣṭha's Ramayana speaks extensively on the accessibility of time through dimensions beyond the current, and how Devi Sarasvatī takes her devotee across time to make her witness the past, present and future unfold at the same instance. This is why Maharśi Vaśiṣṭha says "only concepts like Shiva go beyond time". We know that Rudra is the immortal one, He is the Prana and the inner self of all Devas and all beings, and this inner self is not bound by time, the following Shiva Sankalpa Suktam of Rig Veda Baskala Khila and also present in the SukYajur Veda lays this out perfectly:

येनेदं भूतं भुवनं भविष्यत्परिगृहीतममृतेन सर्वम् । येन यज्ञस्तायते
सप्तहोता तन्मे मनः शिवसंकल्पमस्तु ।। 4 यस्मिन्नृचः साम यजूँ॑षि
यस्मिन्प्रतिष्ठिता रथनाभाविवाराः ।यस्मिँ॑श्चित्तँ सर्वमोतं प्रजानं
तन्मे मनः शिवसंकल्पमस्तु ।।5 That (येनेदं) mental framework (मनः) is
the one who experiences (परिगृहीत) the past (भू॒तं) the
current/present (भुवनं) and the future (भविष्यत) is immortal (अमृतेन)
all-knowing all-comprehending (सर्वम्) inner self (तन्म – येन) it is
the inner fire and source (यज्ञ) it encompasses (स्ता॒यते) seven
(सप्त) inner priests performing the real sacrifice (होता) may that be
my auspicious resolve – many my resolve be of Shiva (शिवसंकल्पमस्तु) 4
In which (यस्मिन्) the Rig, Sama, and Yajur Veda (ऋग् साम यजूँ॑षि )
are established (प्रतिष्ठिता) like the spikes of a chariot wheel
(रथ-नाभाविवाराः) so that knowledge is linked within all beings
(सर्व-मोतं प्रजानं) in that inner self (तन्मे) may that be my
auspicious resolve – many my resolve be of Shiva (शिवसंकल्पमस्तु) 5
Rig Veda Baskala Shakha Khila Sukta 33 / Sukla Yajur Veda Kanva Shakha
33

In one simple line, Shiva is called sadāśivāya = forever śivā.
Full Article Source: LINK
-------------VISHNU--------
There is a detailed event in Mahabharatam Dhrona Parvam explained by Rishi Vyasa about Narayana and Nara, their origin, and evolution. It's a huge section, hence best read in proper context.
Answer: No they have no life span, because Shiva and Vishnu are Supreme Brahmins, they have neither beginning nor end.
Comment: Welcome to Hinduism Stackexchange! Answers posted here must be backed up by authentic sources. Please edit and add proper citation to support your answer or else it will be deleted in future. Also before you get started feel free to take a [**TOUR**](https://hinduism.stackexchange.com/tour) of the site.
Answer: There are scriptures which speak of all 3 Brahma, Vishnu and Shiva being subject to origin and disappearance.

It is called Prākṛta Pralaya ('the dissolution of Prakṛti') wherein
God Brahmā, Viṣṇu and Rudra cease to exist. The all-destroying Supreme
Lord understands easily that Supreme Person.

~ Skanda Purana, Kāśī-khaṇḍa, Chapter 31

त्रीणि कल्पशतानि स्युः तथा षष्टिर्द्विजोत्तमाः । ब्रह्मणः कथितं वर्षं
परार्द्धं तच्छतं विदुः ।। ५.१६ तस्यान्ते सर्वसत्त्वानां सहेतौ प्रकृतौ
लयः । तेनायं प्रोच्यते सद्भिः प्राकृतः प्रतिसंचरः ।। ५.१७
ब्रह्मनारायणेशानां त्रयाणां प्रकृतौ लयः । प्रोच्यते कालयोगेन पुनरेव च
संभवः ।। ५.१८
Brahma, Narayana, Shiva - all three attain dissolution in Prakruti
during  prākrita pralaya and will be manifested again.
एवं ब्रह्मा च भूतानि वासुदेवोऽपि शंकरः । कालेनैव तु सृज्यन्ते स एव
ग्रसते पुनः ।। ५.१९
Thus the Trinity and all beings are created and devoured by Kala.
अनादिरेष भगवान् कालोऽनन्तोऽजरोऽमरः । सर्वगत्वात् स्वतन्त्रत्वात्
सर्वात्मत्वान्महेश्वरः ।। ५.२०
Even though the Trinity is subject to creation and lapse, the eternal,
all-pervading, independent Kāla   remains the same.

~ कूर्मपुराणम्-पूर्वभागः/पञ्चमोऽध्यायः
The same is supported in Parasharasmriti I.20 too which states Brahma, Vishnu Maheshvara undergo origination and dissolution in every kalpa.


Can you sync an iPhone to the new MacBooks wirelessly?

Question: I recently bought a new MacBook and it doesn't have a usb port (I knew this when I bought it) I assumed there was a way to sync my iPhone to it wirelessly but I'm not sure if you can, Im just wondering if I'm going to have to buy the extension for the usb?
Answer: Are you talking about the MacBook that has exactly one port that handles everything, including power? That actually is a USB port, it just uses a USB type-C connector, which is not what your iPhone cord has.
You will need to buy the USB to USB-C adapter. Virtually 100% of USB devices sold today use the connector before type-C, the one that has been standard for nearly two decades (like the one on your iPhone cord), and so buying the adapter will likely become necessary at some point regardless of your iPhone's need for it.
Once you plug the iPhone into the MacBook for the first time, you can modify the settings so you can sync wirelessly with iTunes in the future - see Tetsujin's answer for instructions.
Answer: From comments - you may need to borrow an adapter to initialise the trust between iPhone & Mac, physically [see if a Genius bar will let you borrow one of theirs for 5 mins; they'll probably help you do it, too]
after that it will work as below...
You can sync & backup your iPhone to iTunes, so long as they are both on the same WiFi network.
It will run automatically when the phone is plugged into a charger, or manually at any time by selecting the device, then clicking the Sync button in iTunes.
You can also manually run Backups the same way.
I use these settings so that I get sync to iCloud & iTunes automatically…
Backups go automatically to iCloud & manually to the Mac.

Note both Sync & Backup buttons are active, even though the phone is not currently connected over USB.
Comment: Don't you have to plug the device in once before it will appear in iTunes in order to let you select the "Sync...over Wi-Fi" option?
Comment: ahhh… I never thought of that. Not sure, tbh, but you may be right. My Phone's been 'married' to my Mac for so long it never occurred to me, as the over the air sync/backup didn't used to be possible but is now. I'll tweak my answer, thanks.
Answer: if you wanna sync your pictures and videos just log in to your iCloud from MacBook and retrieve them !
now USB cable is necessary for backing up and restore your iPhone .
Comment: No, it's not. You can sync to iCloud directly from the phone, and you can also sync wirelessly with iTunes.
Comment: Sync wirelessly will be available only when you'd pluged in the cable once before ! And that's what didn't happen to our friend .


Can I ask about installing mods?

Question: I'm asking this question because I dont want the other question to be put on hold, is asking a question about how to install world edit on minecraft worthy of being put on hold?
Comment: @Zibbobz WorldEdit does have a clear set of instructions in its downloads section on [how to install it](http://wiki.sk89q.com/wiki/WorldEdit). (It refers readers to the install instructions of SinglePlayer Commands, which is a necessary mod to use WE.) It's easy for the impatient to miss, yes, but "I didn't read what I was supposed to" isn't really our fault.
Comment: @soulreaper You might want to read [this page](http://gaming.stackexchange.com/help/whats-reputation)!
Comment: Unless the home page for WorldEdit has a clearly marked "How to" guide for installing it, I would say it's a reasonable question...if it does though, you should probably just follow the directions given unless you run into some difficulties doing so, then explicitly state the problem you ran into while installing it.  A good rule of thumb is to try to solve the problem first, to find an answer second, and to then ask a question about it third.
Answer: It would depend on the question itself.  From the short description you've given us, it sounds like it would be on topic.  It would be a duplicate of something already asked, though.
Be aware that if that's all your question is, you're going to get lots of downvotes for showing no effort.
Comment: Like they say in school, "Show your work".  Did you do anything to try to figure this out before asking here?  Did you try following directions, and got stuck somewhere along the line?  While showing effort isn't a requirement for asking a question, it's usually looked upon as something nice to do, so that we don't have to waste time repeating the stuff you've already done.
Comment: @soulreaper showing effort is like, ""I've found a site (you would need to link it there) and Have found the download, however it says I need to use Minecraft Forge which I have from another site, How do I know which minecraft forge do I have? I looked in my Minecraft launcher and all it says is Forge in a profile, The forge file I have is just called forge.java located in C:\Users\SupaBeast\AppData\.minecraft\mods\MineCraft Forge\"" It shows that you've tried, where you've been and how to better assist you.
Comment: As you type a question's name, it will (usually) bring up a list of questions like it that will indicate whether it has been asked before (Or something similar), and it pays to check and see if your question is fully answered by these questions.  If not, it pays to reword the question to cover anything that wasn't covered.
Comment: Well i don't know how to show effort.
Comment: @soulreaper It's never too late to learn. Reading old questions is a good way to get started.

Can I ask about installing mods?


camera view alingment to show user perspective

Question: I am new to blender. I am trying to build a 3d plane game. The attached picture is my user perspective. I want to make the camera view everything inside the red box. How do i do that? Also my sky dome is not showing in my camera view.
Answer:
Press Ctrl + Alt + NumPad 0 to move the camera to the current perspective view.

Select the sky dome, change to edit mode and press A to select all faces, next press Ctrl + Shit + N to flip normals to inside.


Get prefix and suffix from a Number field

Question: So here is my issue;
I got a price in a Number (decimal) field in a node, I need to process this number in some ways depending on users interactions then send it back (via an ajax request) as an integer, but also formatted with proper currency sign which is stored in the fields prefix/suffix settings.
I should mention that this should also work with translations of the price and its prefix/suffixes.
I get the price now this way;
<code>$node = \Drupal::entityTypeManager()->getStorage('node')->load($node_id);
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
$translated_node = $node->getTranslation($language);
$price = $translated_node->get('field_price')->getValue()[0]['value'];`
</code>
So now I want to constuct a formated variable with the translated prefix/suffix depending on which language is curretly selected.
Answer: After some trial and error and cache problems I found the answer to this myself. Here is how I got the prefix/suffix;
<code>$prefix = $translated_node->get('field_price')->getSettings()['prefix'];
$suffix = $translated_node->get('field_price')->getSettings()['suffix'];
</code>


How to traverse a maze programmatically when you've hit a dead end

Question: Moving through the maze forward is pretty easy, but I can't seem to figure out how to back up through the maze to try a new route once you hit a dead end without going back too far?
Answer: Use backtracking by keeping a stack of previous direction decisions.
Answer: The simplest (to implement) algorithm would be to just keep a stack of locations you've been at, and the route you took from each, unless backtracking gives you that information.
To go back, just pop off old locations from the stack and check for more exits from that location until you find an old location with an untested exit.
By consistently testing the exits in the same order each time, if you know that backtracking to a location comes from down (ie. last time you were at the old location you went down), then you simply pick the next direction after down.
I am not entirely sure what you mean by going back too far though, I would assume you would want to go back to the previous place you have untested routes, is that not what you want?
Note that unless you try to keep track of the path from the starting point to your current location, and avoiding those squares when you try to find new routes, you might end up going in circle, which would eventually make the stack too large.
A simple recursive method which marks the path it takes and never enters areas that are marked can easily do this.
Also, if your thing that moves through the maze is slightly smarter than just being able to move, and hit (stop at) walls, in that it can see from its current point in all directions, I have other algorithms that might help.
Answer: Eric Lippert did a series of articles on creating a C# implemention of A*, which might be more efficient.
Comment: Isn't the idea of a maze that you don't know the entire layout? Does A* still work in that context?


Is there other options for SQL-like languages?

Question: I'm currently writing a stored procedure in MySql, but soon noticed a few shortcomings. First of all I'm using cursor on a large set of data (~50 million rows) and do calculations on those. However, the performance for cursor is not good. Furthermore, I faced some limitations on the calculation because there are no array/list in MySql. I know that I should separate the logic in application layer instead of database, but at this point I need to try to perform calculations in database layer.
So my question is, is there other SQL-like languages that are optimized for algorithms and calculations?
Answer: SQL is best when you work within a SELECT statement.  You should try to express your calculations in a query.  Depending on what you are doing with the arrays, you might be able to re-cast the operation to assign rank with joins, instead. Perhaps SQL can do the job. If you can do this, it should definitely be done in the databse!
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: APL has operators for everything.  Example: Matrix inversion.  No, it is not SQL-like.
Some non-MySQL SQLs have and "array" datatype.
SELECT SUM(foo) FROM t

will be a lot faster than using a cursor to walk through t one row at a time using a "cursor".  Whenever I see someone using a "cursor", I ask them whether they are long-time programmer who is new to SQL.  SQL loves to act on lots of rows at once.  See if you can change your calculations to work that way.
(If you want help in SQL, please provide the calculations.)
More

data point (mz, intensity) ... that is closest

Is the a 2-dimensional problem?  Like finding the nearest coffee shop to where you are?  Of so, then I list 5 approaches (in increasing speed) for Find Nearest
The first approach is equivalent to checking all 50M 'data points'.  The second is more like 10K to 100K.  The other three are more like 5-50 rows being checked.

dot product formula

Perhaps it is not quite like the geographic problem; can you show me the dop product?
Comment: Thanks for your answer. Basically I have a given data point (mz, intensity) and a set of data points in the database to search against (~50 m). I wan to find the data point that is closest to the given data point. To do so I need to loop through the data points table to get each one to compare with the  given data point using dot product formula. I have proper index on my table so even if I filter out some data points to search against it is still very slow. So I should avoid looping through a large table using cursor?
Comment: @Tony "*So I should avoid looping through a large table using cursor?*" - You should avoid looping and cursors in SQL always. There's usually a much more efficient relational approach one can use instead. If you provide example code of what you're doing exactly (including whatever the "dot product formula" is) then we can probably suggest how to solve your problem with SQL efficiently.
Comment: I added a link to a blog that might help.


Machine Learning, After training, how exactly does it get a prediction? opencv

Question: So after you have a machine learning algorithm trained, with your layers, nodes, and weights, how exactly does it go about getting a prediction for an input vector? I am using MultiLayer Perceptron (neural networks).
From what I currently understand, you start with your input vector to be predicted. Then you send it to your hidden layer(s) where it adds your bias term to each data point, then adds the sum of the product of each data point and the weight for each node (found in training), then runs that through the same activation function used in training. Repeat for each hidden layer, then does the same for your output layer. Then each node in the output layer is your prediction(s).
Is this correct?
I got confused when using opencv to do this, because in the guide it says when you use the function predict:

If you are using the default cvANN_MLP::SIGMOID_SYM activation
  function   with the default parameter values fparam1=0 and fparam2=0
  then the function used is y  = 1.7159*tanh(2/3 * x), so the output
  will range from [-1.7159, 1.7159], instead of [0,1].

However, when training it is also stated in the documentation that SIGMOID_SYM uses the activation function:
f(x)= beta*(1-e^{-alpha x})/(1+e^{-alpha x} )
Where alpha and beta are user defined variables.
So, I'm not quite sure what this means. Where does the tanh function come into play? Can anyone clear this up please? Thanks for the time!
The documentation where this is found is here:
reference to the tanh is under function descriptions predict.
reference to activation function is by the S looking graph in the top part of the page.
Since this is a general question, and not code specific, I did not post any code with it.
Answer: I would suggest that you read about appropriate algorithm that your are using or plan to use. To be honest there is no one definite algorithm to solve a problem but you can explore what features you got and what you need.
Regarding how an algorithm performs prediction is totally depended on the choice of algorithm. Support Vector Machine (SVM) performs prediction by fitting hyperplanes on the feature space and using some metric such as distance for learning and than the learnt model is used for prediction. KNN on the other than uses simple nearest neighbor measurement for prediction.
Please do more work on what exactly you need and read through the research  papers to get proper understanding. There is not magic involved in prediction but rather mathematical formulations.


cygwin bash tab completion for arguments fork failure

Question: I have an odd problem with tab completion under cygwin's bash on my Win 7 installation. I get fork failures ('permission denied') under very specific circumstances..
Tab completion works fine for all commands.
Tab completion works fine for arguments of builtins and any cygwin-supplied program in /usr/bin, /usr/sbin, etc. (including .exe files as well as shell scripts)
Tab completion works fine for commands in my personal ~/bin directory.
However, whenever I attempt tab completion for an argument to one of my own shell scripts, I get a fork/permission denied error.
I've compared file permissions and ownerships of my shell scripts to those of cygwin-supplied shell scripts, and they are equivalent.
I've created a directory outside of the /cygwin/C hierarchy (named it /mybin) and copied my scripts into that directory. Then invoked the scripts directly (e.g., /mybin/gv n[TAB]) and the failure still occurs.
I've made sure the scripts have mode 775 and owned by me. I've made sure the directory in which the scripts exists is mode 775 and is also owned by me.
I haven't created anything in /usr/share/bash-completion (afaik, I shouldn't have to for argument-based filename completion). But I've not had issues with cygwin scripts without entries in /usr/share/bash-completion (e.g., /bin/zegrep is a shell script but has nothing under /usr/share/bash-completion)
I'm stumped at this point, but would like to resolve it since tab completion is such a vital feature.
Here's an example...
<code>% gv n[TAB] 0 [main] bash 9308 fork: child -1 -CreateProcessW
failed for 'C:\Users\binaryb\cygwin\bin\bash.exe', errno 13 bash:
fork: Permission denied
</code>
.. in this example I was attempting to complete a filename (in current directory) by typing 'n[TAB]'. There is only one file starting with 'n' in my current directory.
I am running this under Win 7 (64 bit), with the following cygwin bash.exe version...
<code>% uname -a
CYGWIN_NT-6.1 binaryb 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64 Cygwin

% bash --version
GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
</code>
Answer: I think I found the problem, but I'm not 100% sure. It seems to occur for scripts whose filenames are only 1 or 2 characters long. If I rename my script to, say, gvx, the problem goes away.
<code>% gv n[TAB] 0 [main] bash 4556 fork: child -1 - CreateProcessW
failed for 'C:\Users\binaryb\cygwin\bin\bash.exe',
errno 13 bash: fork: Permission denied

% mv ~/bin/gv ~/bin/gvx

% gvx n[TAB]
% gvx newfile.txt
</code>


Netty wrapper around smack XMPP

Question: does anyone have recommendations for a netty base wrapper around smack/xmpp. I need a client talking a text based protocol over xmpp/telnet/ssh etc.
XMPP is a bit different because there is one XMPPConnection, but I need to use different xmpp peers, and the pipeline per xmpp peer needs to be changed when connecting my protocol.
Regards,
Leen
Answer: Look at netty-xmpp (XMPP Decoder/Encoder for Netty).

Netty wrapper around smack XMPP


Why no menu bar in LibreOffice

Question: When you move your cursor to the top of the screen in Libreoffice you don't get a menu.  You do for other applications like Firefox and Thunderbird but not for Libreoffice.
Answer: Try:

sudo apt-get remove libreoffice-gtk

It will remove the global menu bar and replace it with a basic one, but it might give you functionality. That worked for me anyways.
You can also try getting updates - there may have been a bug fix for it:

sudo apt-get update

Or just use the GUI updater.
Answer: Ubuntu software center -> search for "lo-menubar" and install. Now you have a unity menu for Libre Office. Make it so.
Answer: I'm using Ubuntu 12.10 with LibreOffice 126.96.36.199 and this is what worked for me:
sudo apt-get remove libreoffice-gtk

Then opened LibreOffice and there was the menu, no need to install lo-menubar.
Answer: Just updated Ubuntu. Latest updates included several LibreOffice updates. This appears to have fixed the problem.
Answer: I've been updating my ubuntu 12.10 and this problem still occurred.
Here is what I've done and it worked for me:
sudo apt-get purge libreoffice-gtk
sudo apt-get install libreoffice-gtk

Hope it helps!
Answer: (I know this is an old question but happened to me again now)
For me, changing the Java Runtime fixed the problem, instead of using the Oracle one I choose the Ubuntu and the bar appears again.

Why no menu bar in LibreOffice


Compilation problem with miktex 2.9 on windows 8.1

Question: I install MikTeX 2.9 on my Windows 8.1 but compilation always fails.
Which version of MikTeX is compatible with Windows 8.1?
when i launch a document compilation, i always have the error message below
Comment: Welcome, you say the compilation fails, do you mean the document preparation or installation of MikTeX? If the first, you just have faulty code.
Comment: There is in general no issue with Win8.1 and MiKTeX 2.9: we will need to see some specific details to help.
Comment: Possible duplicate of [Setting up MiKTeX and TeXworks](http://tex.stackexchange.com/questions/60702/setting-up-miktex-and-texworks)
Comment: miktex 2.9 works fine in windows 8.1 (and window 10).
Comment: Looks like the `pdflatex` executable is not found. You need to configure your LaTeX editor and tell it where MikTeX is installed, or add MikTeX to the PATH variable. However, I have no idea which editor it is (TeXMaker? TeXStudio?), so I can't really help you with that.
Comment: @coliasso: You should use the comment function to answer to commends. The answer button is just for answering your question.
Comment: ok, sorry. It is because I'm  new user on this forum
Comment: Welcome to TeX.SX! You can have a look at [our starter guide](http://meta.tex.stackexchange.com/q/1436) to familiarize yourself further with our format.
Answer: It looks like the pdflatex executable is not found. You need to configure your LaTeX editor and tell it where MikTeX is installed, or add MikTeX to the PATH variable.
Here's a toturial on how to add MikTeX to your PATH variable. It should also work for the non-portable version of MikTeX.
Comment: I have read and  the tutorial indicated  above,
Comment: I have read and  the tutorial indicated  above, at the step where I would had to paste a path at the PATH location, it wasn't possible (pasting there wasn't allowed); thus, my problem persists.
Comment: @coliasso: What do you mean by *"pasting there was not allowed"*? Can you not write anything there? Or is it just pasting that doesn't work?
Comment: I can't  paste, nor write there
Comment: @coliasso Then that seems to be a problem with your setup (assuming you clicked the right things). I can't really say what the problem might be. However, if you are the administrator of your PC, you could also use the *"Edit the system environment variables"* dialog and add MikTeX to the System-wide PATH variable, instead of the one for your own user account.


Is it possible to play with Goro in Versus mode?

Question: In MK9 on Xbox, is it possible to unlock Goro or others?
Answer: Game FAQs Cheats lists only Cyber Sub-Zero and Quan Chi as unlockable characters. Furthermore one of their most complete FAQS for move lists does not show Goro as a playable character.
Answer: No, you can only play as Goro on Challenge Tower #150, on both the Xbox 360 and PS3 versions.


Why People have skin color between fair and dark?

Question: According to Mendel's laws traits do not show any blending. So according to his laws people only with fair or dark skin should exist. Do the alleles in this case blend? And why?
Comment: There are several traits that do not follow the simplistic Mendelian rules. With skin colour, the trait is actually polygenic (and also quantitative).
Comment: Mendel also fudged his data. Traits blend all the time.
Comment: this question has been well addressed here: http://biology.stackexchange.com/questions/34565/skin-color-explanation
( so I guess it might be marked as duplicate ).
Answer: Mendel's laws were very basic to aid in the comprehension of genetics.  You think of Mendel's genes as an +- pair where + is dominant and - is recessive, making our +- gene produce offspring with the + trait but still being a carrier of the - trait.
However, when it comes skin colour, eye colour, hair colour, height, tendency to muscle growth, and a thousand other things, the gene is more like a series of ++-++-+++-, + is more recessive than -, but some of + will still show up over -.
In short, the colour of a person's skin is not a simple +- gene of dark and fair; everyone carries a certain amount of pigment genes and certain number of non-pigment genes.  The amount that one carries of each of the genes will determine his skin colour and his/her ability to pass on the dark/light characteristic.
Comment: To give a basic idea about the dimensions: if I remember correctly, from genome-wide association studies, height is currently known to be influenced by approx. 500 genes - that is 2-3% of all approx. 20000 protein-coding genes. However, studying these loci explain only about 20% of the variation seen in the phenotype height.
Comment: A minor suggestion: Instead of X and Y use some other symbols. X and Y can be confused for chromosomes.
Comment: Good point, @WYSIWYG .  Hadn't thought of that.


Front-End Interfaces Without Shortcodes

Question: So, I consider myself a "advanced novice" at WordPress development but I still do not have the concept of pages and templates fully understood.  I'm having an issue with a feature I'm attempting to include in my plugin and discovered that it's possibly due to the way I am displaying my interfaces on the pages (via shortcodes).  Without customizing a theme, how would one display interfaces (grid with interactive functionality) on the font-end?  The way my plugin works currently is that it uses shortcodes to house all of my php code that performs the work to display my interfaces and those shortcodes are added as content to pages that my plugin creates upon activation.  Is there another way to do this?
Answer: What you're doing is, in my opinion, the best way to accomplish this. First off, the pages are a good way to go, because they give users the ability to customize parts of the page like title, meta fields, etc. You don't have to use shortcodes per se, you can filter the_content for these pages, but shortcodes offer additional flexibility. For instance, your users can call them directly in a template file if they don't want to use pages, or they can use them in other posts if they want to use a custom post type or something. Anyway, nice work, this is a great way to go. That doesn't solve your issue, but you can probably cross it off your list.
Comment: Many thanks for the info.  Helps to know that all the thousands of lines of code I've written are not in vain.  I'll keep the course with the shortcodes.  My next question is, I have forms on those shortcodes that get POST'ed and I capture the POST'ed data and save it to the database.  BUT, once I'm done with the database, I would like to automatically redirect the user back to what I call the "dashboard".  When I try to do a wp_redirect after the POST, I get the Warning about the Headers already being sent.  Do you know of a way around this?
Comment: As a quick guess, I'd say you're trying to run the redirect too late in the request chain. Check out the [Action Reference](http://codex.wordpress.org/Plugin_API/Action_Reference) which shows you a typical request chain. You should catch the POST data before `send_headers`. The `init` action is perfect. If that doesn't help, it's best to open a separate question and try to provide as much detail as possible!

Front-End Interfaces Without Shortcodes


Why does gas form a star instead of a black hole?

Question: When a space gas gets pulled together a star is formed. On the other hand, when a massive star dies, it collapses to a black hole.
You would think that the initial mass of the gas would be bigger than the star that had existed for billion years and lost mass in the process.
So what stopped the space gas from forming a black hole in the first place?
Comment: Starting to sound like "Amongst our weaponry are such diverse elements as..."
Comment: what stops water vapour at common Earth atmospheric pressure ranges from becoming ice at once?
Comment: I propose editing your title to say "instead of a" rather than "but not a" because the latter is misleading - it suggests a black hole can form a star.
Comment: @ruakh Fair point. "Instead of" seemed clearer to me somehow, but I can see that it can also be ambiguous.
Comment: Some don't have enough mass to become a black hole anyway, they eventually become neutron stars or white dwarfs instead of black holes.
Answer: Essentially gas does, it just happens to form a star first.
Mass is not the only factor in creating a black hole. You also need for this mass to reach a high density. In the process of doing this, a star usually forms. The energy producing processes in the star interior produce a pressure that balances the gravitation attraction. This prevents a star from reaching a critical density needed for black hole formation. As these energy producing processes run out of useable fuel the star will eventually collapse onto itself creating a black hole.
So you can't just take a large volume of gas and create a black hole. Other physical processes occur.
Comment: As a minor addition I'd like to note that it's possible the giant black holes in galactic centers may have formed by direct collapse in the early universe.  This is a currently an open question and an area of active research, but the largest ones we know of are straining the fastest formation models we have for accretion starting from stellar mass black holes.
Comment: Don't forget you can fall inward without getting any closer. It's called an orbit.
Comment: Not all stars become black holes. Your answer seems to assert that they do.
Comment: @sdenham I'm far from an expert, but certainly outside of the actual physical object we refer to as the star, I'd expect gravity to trump radiation pressure. In other words, gases would still fall inward, toward the star, not be pushed away from it by the star.
Comment: @ToddWilcox it's a little more complicated than that - as I understand it, the inner core stops producing enough energy to continue resisting gravity and collapses, shearing off from the outer part of the star in the process (as that collapses more slowly).  The sudden compression of the core causes a large energy buildup, which in turn blasts the outer layers of the star away, which is why you end up with a compacted dwarf star (or a black hole) - _someone correct me if this is incorrect_
Comment: @walter Literature? How is the Salpeter timescale circumvented? Just through disk accretion? Indeed one needs "Hyper-Eddington" accretion. See this very month's Astronomy & Geophysics that arrived in my mail today!
Comment: Absolutely. I didn't even think of that while answering. Thank you for that observation.
Comment: Once a star forms, does its radiation not tend to drive away the surrounding gas, effectively putting an end to the accretion process in most cases?
Comment: I'm not an expert either. Gas does fall inward. I was referring to the actual gravitational collapse which doesn't happen due to this pressure.
Comment: @MichaelKjörling I thought radiation pressure trumping gravity was exactly what a (super)nova is.
Comment: @MichaelKjörling It seems radiation pressure is an issue, but "when the density and temperature are high enough, deuterium fusion begins, and the outward pressure of the resultant radiation slows (but does not stop) the collapse...Finally, hydrogen begins to fuse in the core of the star, and the rest of the enveloping material is cleared away. This ends the protostellar phase and begins the star's main sequence phase." (https://en.wikipedia.org/wiki/Star_formation) The article goes on to discuss how very massive stars may continue to accrete matter, despite radiation pressure.
Comment: @DanNeely  Did the Higgs FIeld act as an attractor?   Is that at all related to the studies of those early black holes?  For that matter, is anyone postulating other long-dead fields?
Comment: @CarlWitthoft  That's way outside my knowledge zone and probably should be two new questions; but AIUI the theory is just that in the early universe the gas was dense enough that thousands to millions of solar masses of matter were able to collapse directly into BHs at the time that galaxies started forming.
Comment: @ToddWilcox this answer describes what happens better than I did: https://astronomy.stackexchange.com/a/8215/17210
Comment: @DanNeely There is no strain with forming SMBHs from stellar mass seeds, and no need to hypothesize crazy ideas defying the wisdom of astrophysics.
Comment: @walter Just been at EWASS17 - lots of posters about how difficult it is to build a billion solar-mass black hole from 100 solar-mass stellar seeds - most were exploring the alternatives that DanNeely mentions.
Comment: @RobJeffries It is only difficult if the accretion efficiency is low, which is the case only if the hole is spinning fast. Due to an erroneous early study, it has long been believed that accretion discs always align with the BH spin and hence spin the BH up. However, that was wrong, accretion discs may also anti-align, when BH spin remains low and accretion efficiency high. Unfortunately, that earlier error lead to a whole industry of crazy ideas for massive seed BHs and that bandwagon cannot be stopped easily...
Answer: In simple terms: Because the gas nukes itself apart.
When the gas (H or He) is put under extremely high pressure, which happens before a black hole is formed, the atoms start nuclear fusion, which releases a lot of energy. That continuous stream of energy is what makes the sun bright and is also what keeps the sun from collapsing into itself.
When the fusion burned up/fused too much of one element, another element becomes the dominant element  for fusion, which leads to different states during the life of a star. And once the star runs out of fuel, gravity wins.
As Rob says, you'd need way more mass than that of a "massive star" to counteract the nuclear fusion energy.
Answer: In the present day universe, this does not happen for two reasons. First, the gas is unstable to fragmentation as it collapses. The reason for this is that the Jeans mass, the smallest mass that is likely to collapse, scales as $T^{3/2}/\rho^{1/2}$, where $T$ is the temperature and $\rho$ the density. If the gas can cool as it collapses, then the temperature remains roughly constant, the Jeans mass falls and the cloud breaks up into smaller cores. These cores are usually much smaller than the (at least) several solar masses required to form a black hole (see below).
Second, each of those cores eventually gets hotter in the middle. For masses above $0.075M_{\odot}$, the core becomes hot enough for nuclear fusion. This maintains the high temperature and pressure, which keeps gravity at bay until the fuel runs out. After this, quantum mechanics in the form of electron degeneracy or neutron degeneracy pressure or even the repulsive force between nucleons might support the star (as a white dwarf or neutron star), but not if it is more massive than $\sim 3M_{\odot}$. For lower mass balls of gas (brown dwarfs or planets) they skip the nuclear fusion and go straight to being supported by electron degeneracy.
However, in the early universe, what you suggest might actually happen and this might be how supermassive black holes and quasars exist only a few hundred million years after the big bang.
Primordial gas made of just hydrogen and helium atoms cannot cool very efficiently (it is the presence of heavier atoms, produced by previous generations of stars, in present day gas clouds that leads to efficient cooling). Primordial clouds are thus less susceptible to fragmentation because they heat up as they get more dense and the Jeans mass cannot become small. In such circumstances it could be that a large black hole ($10^4$ to $10^5$ solar masses) can form directly from a collapsing gas cloud.
See this press release for an alternative summary of this idea and links to recent academic papers on the topic (e.g. Agarawal et al. 2015; Regan et al. 2017).
Comment: What's the reason why light gasses cannot cool efficiently?
Answer: Not a full answer, but more than a comment. Can't we just pile in more and more mass to overcome the problems the other answers presented? Surely at some point in the Universe, e.g., at the very beginning, conditions were favorable for forming extremely massive stars such that the inward pressure could overcome any outward pressure from heat/fusion. Possibly then a black hole might form right away, despite the barriers preventing total collapse. After all, there's always barriers preventing total collapse, be they radiation pressure, degeneracy pressure, etc. It's just a matter of overcoming it with enough mass.
It turns out someone already asked this question and their answer is (sometimes) no. Johnson et al. 2013 discusses the idea of primordial super massive black holes being formed by super massive stars. By super massive, I mean $\sim50,000\:M_\odot$ (the largest, currently known star on record is $\sim200$-$300\:M_\odot$). Their idea is that you could have such a huge amount of mass pile up early in the universe that you might have a "star" by some technical sense of the word but it would almost immediately (compared to cosmological timescales) form a black hole. Their ultimate result was that they found that trying to overcome the radiation pressure barrier you see in normal star formation by piling on insane amounts of mass just causes things to explode in "the biggest explosion in the Universe".
Comment: Fragmentation. See other answers.
Comment: @ProfRob In the *present day* universe, sure, fragmentation is the answer. My answer was intended to supplement the existing answers to describe a situation in the *early* universe where the general rules may not apply because the conditions were so drastically different. I was specifically citing a condition explored in Johnson et al. 2013 in the early universe concerning massive star formation. I don't see how this response warrants a downvote. It is not wrong and acts to add more information and context to the already existing answers.
Answer: When that space gas gets pulled together to form a star, the original gas and now a star their mass is the same (unchanged), but the size reduced, due to gravity. When the star collapses to be a black hole, again their mass the same but size shrunk, due to gravity.
It is not a valid way to ask in this manner:

So what stopped the space gas from forming a black hole in the first place?

The space gas does eventually shrink to become a black hole [if the initial mass is good enough for it to exist as a star then collapsed as a black hole], only the observer taking section by section of the whole process to observe [depends on which section is observed]. It's simple, when replace the object for analogy to this: heating the ice. Ice melts to become water, then gas. Now the OP is like asking: why ice doesn't turn to gas when heated but water? It sounds logical but in fact it is the construct of the words mystified a simple analogy.
Comment: Most stars will not become black holes, though, which is the whole point of the question.
Comment: @HDE 226868 I aware that not every star becomes black hole, it has to have certain mass to reach certain criteria. If the initial gas the mass is good enough then, like [another answer](https://astronomy.stackexchange.com/a/21424/17330) (by "john") said: "Essentially gas does, it just happens to form a star first." But your comment prompts me to edit to clarify my answer, thx.


I can't afford to pay for Statement of Purpose (SOP) proofread. What should I do?

Question: Reliable SOP proofreading services are very costly, almost around $150-$200. I have written an SOP for my Ph.D. program in the USA, which is almost 1400 words, but I need to reduce it to 1000 words. Moreover, needs some proofreading as well. Is there any free or cheaper service (but reliable) available that can help to reduce the size and proofread my SOP? I don't want my professors to check my SOP since they don't know what the admissions committee in the USA (or other Western countries) really wants. Thank you.
Comment: "I don't want my professors to check my SOP since they don't know what the admissions committee in the USA (or other Western countries) really wants." What makes you think that the people who charge $150 for proofreading know more than your professors? If the logic is simply "they ask for money, so they must know what they are doing", this is false.
Comment: When something so important is free, the value is zero. But you can try your luck with chatgpt, or fiverr.com to find a freelance with a lower rate.
Comment: Sadly, if you are in the situation you indicate, that is, of needing someone else to ... "refine" ... ??? ... your SOP, you are already somewhat out-of-the-running. That is, if your genuine experience and qualifications are not up to expectations, making a personal statement fancier will not change anything.
Answer: For a basic check, either free version of Grammarly or ChatGPT can be of some help. Paying for one month of premium for these is relatively affordable, so you might want to try that too.
On the other hand, you write that your supervisor does not know what US universities want. Without any judging, you can always ask in the sense that your are more interested in grammar and typos. You can also disregard the possible suggestions on removals.
The combination of the two approaches could be significant already.
Answer: I agree with the other comment, that grammarly and  Chatgpt can certainly be helpful. However in my experience you would need the paid version for them to "reduce word counts" in any meaningful method that would still keep your words at heart and not lose meaning.
You could also try to do a run through again yourself. One thing that is sometimes helpful is to use the text to speech option in a word processor or similar. Then you can "hear" how it sounds. Sometimes this can be helpful to identify portions that don't make sense or don't need to be there.


Why do I already have 4 primary partitions, and which one (if any) can I change to logical?

Question: I have a brand new computer and I was about to put a new partition on, and somehow, there are already 4 primary partitions. The first is called system, then C:\,  then the recovery drive, and then one that says HP_TOOLS, which for some reason contains files pertaining to the BIOS. Would it be safe to convert the system or HP_TOOLS partition to a logical partition so that I can make a second partition. Or if anyone knows EASUS PM better than me, is there any way to create a partition as a logical partition, because it will only allow me to create a primary partition, and for some reason, it will only allow me to have 3 primary once I switch, instead of 4.
Comment: See this link for nice instructions specifically for HP...http://h30434.www3.hp.com/t5/Other-Notebook-PC-questions/How-to-repartition-HDD-of-HP-notebook-with-pre-loaded-Windows-7/m-p/742019
Comment: I just want to be sure I am clear on this, apparently, the boot.ini file is now stored in the system partition, so there is no need to set the C drive as primary, or if I were to create a new drive for say... ubuntu, that would not have to be primary either because the system partition contains the boot.ini file, is this correct?
Comment: @Sean: AFAIK, the Windows *boot* partition must still be primary.
Comment: Windows 7 does not use a boot.INI anymore. Yes the Windows boot loader is stored on the first partition and must remain a primary partition.
Answer: The NT systems can have 4 primary partitions without any problem + extended.
I have never seen any problem with it, or any real reason for doing it.
If there is also a hidden partition, then you would see it in Easus.  Notes: There are some tiny portions of unallocated that might not be visually represented in Easus and in disk manager
Mentally I picture many primaries like this.
|---primary---|------Primary-----|------Primary-------||==extended==with logical==||
Being old school and trying to keep the thing as normal and regular as possible i prefer only 1 primary.
What I concider the "normal method" is like this.
|---Primary----|----------The space called extended where Logical Drives are set-------|
Which to us after that is all created looks like this.
|---Primary----||=====Logical============Logical============Logical===all in that ext space=||
|---Primary----||=====Logical=====|=======Logical=====|=======Logical===================||
See the differance?  Well dont feel bad because I don't totally understand either.
Right now you can not make a logical without that Extended hole space made First.
Logicals are all created IN the extended space.   A primary does not use the extended space method.  Until you or the progam remove or move any primaries that are in the way, and create or enlarge an extended space, you will not be able to put Logicals INTO the extended space.
Without a backup, and knowing that primaries ARE a workable method, the least would be a clone backup of the whole drive before proceeding.  Most methods for partition conversion, require entire re-write of the data, and messing with the partition table. they wouldnt let ME do that without a backup :-)  so why trust software .
Comment: This is **not** related to NT system or any other. It's the property of MBR partitioning scheme. Newer NT systems or any other OSes that uses GPT partitioning scheme does not suffer from this situation
Comment: @LưuVĩnhPhúc The reference to the NT system in this context was to refer to the windows NT system , and compatibility with all of them. The OPs question did not specify the OS that is why (I do not know other OSes and cannot know what would be right for them). You just utilized the same context when referring to Newer NT :-) When GPT is again not limited to NT this gets understood in your Useful comment.  I specifically did not cover GPT as the OP question indicates they are not using that.  So if there is something that is in need of correction here, we need to figure out what that is.


Touch ID available only after sleep but not when starting the laptop

Question: I just got my new MacBook Pro and the fingerprint is available only after sleep but not when starting the laptop. Is that the normal behavior?
Comment: Related: https://security.stackexchange.com/questions/139549/why-does-an-iphone-require-me-to-enter-the-passcode-and-not-accept-my-fingerprin
Answer: Yes this is normal behaviour.
Like on an iOS device, Touch ID is unavailable immediately after a restart.

Note that you must type your password to log in after you start up, restart, or log out

In some situations, you need to enter your password instead of using Touch ID:

If you've just restarted your Mac
If you've logged out of your user account
If your fingerprint isn't recognized five times in a row
If you haven't unlocked your Mac in more than 48 hours
If you've just enrolled or deleted fingerprints

Use Touch ID on MacBook Pro
Comment: @Alexander [Security](http://www.redmondpie.com/heres-why-you-cant-use-touch-id-on-iphone-to-unlock-right-after-reboot/)
Comment: @ThomasWard Well obviously, but it wasn't clear how it helped improved security. In the case of iPhones with secure enclaves, I now learned the answer is: the pin decrypts the encrypted enrolled fingerprint data in the secure enclave. I suspect a similar thing is happening in my android device
Comment: @Alexander Among other things, in the United States a court can require you to provide your fingerprint to unlock but *generally* can't force you to enter your password.
Comment: Do you have any clue as to what the reasoning of this is? My Android device has a fingerprint sensor, but always requires manual pin entry after  start up. I've always wondered why. I figured that if the finger print whitelist is stored on the sensor chip itself, then there's potential to swap out the sensor, with one that has the attacker's prints enrolled. In that case, couldn't there just be some sort of pairing between the main board and sensor? (e.g. the sensor must authenticate itself with the mainboard via some handshake process)
Comment: @Alexander When in doubt assume Security :p
Comment: @Alexander if and only if that device has a TPM or similar (the computer-version of a Secure Enclave), then yes.  The tricky part about security is, well, the security part, and how to protect the components which help you authenticate easily :P


SharePoint cascading drop down on visual web part using client side code

Question: Hi I am working with cascading drop down in a visual web part. I am able to complete this functionality using c# but I want to implement this functionality using JavaScript jquery basically I want to reduce load on server. Can anyone please help. Thanks in advance
Answer: For client side cascading drop downs, I use SPServices.  If you aren't familiar with it here is a link to the SPCascadeDropdowns.
For this you will have to have your cascading structure defined in lists with lookup fields.  After you set that up it's fairly straight forward.
Here's a couple more resources on how to use SPServices and cascading drop downs:
Two Level Cascading Drop Down in SharePoint 2013 using SPServices
Cascading Drop Down Multiple Levels
Comment: As I mentioned it is not for designer forms or out of box forms.. I need to implement it for a visual web part.. Ascx page
Answer: You can refer following link:
http://jedcurl.blogspot.com/2016/03/add-cascading-drop-downs-to-any-list-or.html
Regards,
Chandani Prajapati