Sharepoint 2013: no attachment column available

Question: I am having the same issue as here, but I have no "list" option in the ribbon, and therefore no "list settings" option.  I am working on a list, but I am baffled by why there is no "attachment" column available.  Attachments are enabled. Please help!
Comment: Are you sure it is a list an not a library? If so the node is called "Library settings"
Comment: Does your list ribbon appear on other lists? This may sound silly, but i'm assuming you have the correct permissions to edit the list?
Answer: There must be a Lists option near item option in the Ribbon.
Try following approach:

Sometimes ribbon options are not showing as soon as you open the list. So, open the List and select any item created in the list and ribbon will be shown.
If list is created by someone else, Check the permissions you are having on the list.

For attachments:

Modify the list view and select attachments column to show which list items are having attachments. In list view only paper pin will be shown against item.
To see or download these attachments you need to open the respective item(View Item).
Comment: does this answers your question?
Answer: If you have Attachments enabled, then go to Modify View and select Attachments to see them. Attachments are usually enabled by default.
Attachments is one of the columns that is automatically added to a list based on settings (like version) so you cannot add or remove it in the list settings.


Selection rules and type of photon?

Question: Let us consider the following matrix element:
$$\langle n',m',l'|x| n, m, l \rangle$$
For the corresponding radiative transition we have the selection rule that $\Delta m=\pm 1$. But will the photon emitted be circularly polarized i.e.:
$$|\psi \rangle=|\pm m=1 \rangle$$ or linearly polarized (i.e. a combination of two circularly polarized waves) i.e.:
$$|\psi \rangle=a(| m=1 \rangle+| m=-1 \rangle)$$
Answer: Given two states $|n,l,m⟩$ and $|n',l',m'⟩$, the following radiative transition matrix elements are nonzero:
$$\left\langle n,l\pm1,m+1 \middle| x+iy \middle| n,l,m \right\rangle,$$
$$\left\langle n,l\pm1,m-1 \middle| x-iy \middle| n,l,m \right\rangle,$$
and
$$\left\langle n,l\pm1,m \middle| z\middle| n,l,m \right\rangle,$$
and that's it (for transitions between states of definite angular momentum about the $z$ axis; you can also have transitions to e.g. $|n,l+1,m+1⟩+|n,l+1,m-1⟩$, using a linearly polarized photon in the $x$ direction and propagating in the $y,z$ plane, or to similar superposition states).
The first two correspond to absorption or emission of a circularly polarized photon propagating along the $z$ axis, with selection rule $\Delta m=±1$ on the atom, while the third one corresponds to absorption or emission of a linearly polarized photon polarized along the $z$ axis and propagating on any axis in the $x,y$ plane, with selection rule $\Delta m=0$ on the atom.
For further details, consult any advanced undergraduate textbook on quantum mechanics.
Comment: @Quantumspaghettification Yes, so long as the photon is propagating along the $z$ axis (since otherwise the re-use of $m$ for $m_z$ is misleading).
Comment: Do you have any specific recommendations for textbooks??  I cannot see why the transition I have given is zero, as it's just a linear combination of two of yours.
Comment: See edit with clarification. On textbooks it's up to taste, really; I normally recommend Cohen-Tannoudji but I don't have it at hand to confirm it treats this well enough to recommend specifically.
Comment: Shankar has a good section on electromagnetic interactions towards the end of the book.
Comment: No worries, I will take a look in Cohen-Tannoudji. Just to clarify, when we do have a transition to the state e.g. $|n,l+1,m+1⟩+|n,l+1,m-1⟩$ the state of the photon would be $a(|m-1\rangle +|m+1\rangle)$, which is a linearly polarized photon??
Answer: I assume you are talking of the transition dipole element which is typically defined as $$\langle n',m',l'|qx| n, m, l \rangle$$
with q being the charge of the dipole and x its position.
As you already said, the linear polarization is a superposition of the two circular polarization Eigenstates. And in addition, horizontal and vertical polarization states are an independent basis to describe the polarization of the emission.
Your measurement will determine the answer to your question. If you check for linear polarization you will project your emitted photon to the linear polarization basis. Same for circular polarization. The basis for your polarization is arbitrary.
This may change if you have conditions where the intrinsic symmetries of your Hamiltonian are broken.

Selection rules and type of photon?


Export BIOS Settings

Question: I'd like to be able to export the BIOS settings for systems with SuperMicro H8SCM-F motherboards.  I need to be able to process the results programmatically, so text output is ideal.  What sort of tool/utility exists to provide the settings export functionality?
Answer: Have you tried using IPMI?  You may be able to get many of the BIOS settings using IPMI while the box is running....spool it off, scp wherever you'd like, process it, etc. On linux you will need ipmitool.

Export BIOS Settings


New Tub Lip problem

Question: In my guest bath remodel, I have taken old tub and tile out, and put new tub and concrete board in. My problem is, tub lip is out in front of concrete board on tub sides about a quarter inch maybe a bit more, and not flush with concrete board. God help me if there isnt a simple fix.....lol   HELP !
Comment: the lip of the tub is supposed to be behind the concrete board, with the board overlapping the lip of the tub
Comment: @jsotola I would expand this into an answer I agree the lip goes behind but with it out in front it sounds like the tub was not located correctly by 1/2"
Answer: I am not God but i play one on the world wide intertubes.
What thickness cement board did you use ?
Please provide a detailed explanation of what work you have done, did you demo down to the studs etc.
You could take the cement board off and put some furring strips of the appropriate thickness on the studs and then re-install the cement board.
If you used 1/4 inch board You could replace it with 1/2 inch
You could add more cement board over the top of the other with longer screws.
Either way you are making the wall thicker in the shower area than the drywall next to it so you will need to determine how you are going to transition from the tile the the drywall. ( furr all of the wall so it is equal? or some funky step down transition? )
I use denshield for a tile backer in a shower because it is the same thickness as drywall so not funky transitions are needed. ( plus it has a waterproof barrier on it. )

New Tub Lip problem


iOS tabbed application with table view, how to reset table view tab? Beginner.

Question: I have a tabbed application with 3 tabs
The first tab is a table view
The second and third tabs are single page views
When a user clicks on a table cell in view one a new view is pushed on with a back button to the table cell.
Now lets say they click tab 2, then back to tab 1. The new view that was pushed on tab 1 is still visible. What I would like is to have the table view "reset" when they navigate away from it with another tab so that when they return they are presented with the table view instead of the new view that was pushed on .
Comment: That really goes against the "normal" user experience on iOS.  Why would you think the user would want to "start over" when switching Tabs?
Answer: I agree with ElJay comment, but to answer the question use UITabBarControllerDelegate
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

when a new tab is selected see if the current one is tab 1 selectedIndex property of tabBarController and if so popToRootViewController:
Answer: As the others have said, this is probably not a good user experience. The idea of a tab controller is that it lets the user switch freely between the different parts of their app and go right back to what they were doing before.
If you're determined to do it this way, then make your navigation view controller's root view controller a custom subclass, and set it up as the tab bar controller's delegate.
In your custom view controller, implement the function shouldSelect(), as below:
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool
{
  if viewController == self.navigationController {
    self.navigationController.popToRootViewController()
  }
  return true
}

Disclosure: I haven't tried to compile the code above, much less test it.


How to set environment variables for Xfce windowing environment

Question: We're using Ubuntu 12.04.1 with Xfce 4.8.  We have a script which sets environment variables needed by our software.  In the past, I figured out how to run this script in the Xfce start up so that these environment variables are set up and available to gui based programs launched via icons.  Recently an OS upgrade wiped out this setting and I can't remember or find how to do this.  I've tried sourcing the script from ~/.profile, ~/.xinitrc, and ~/.config/xfce4/xinitrc, but no luck.
Answer: per this https://wiki.archlinux.org/index.php/Xfce#Session you should "Copy the file /etc/xdg/xfce4/xinitrc to ~/.config/xfce4/". I edited etc/xdg/xfce4/xinitrc directly and the var was in the user session.
Comment: I had edited that file ... but didn't have the correct path to the file with the customized environment variables.  Doh!  Thanks.
Comment: This doesn't work for me. There is just no effect.
Answer: To have environment variables available for the X session I set them in <code>~/.xsessionrc</code>. This works also with Xfce, at least with version 4.12, I'm just running.


Group texting with Iphone users, my texts get delayed until theirs all stop

Question: I have an S4 with the latest software update (though this has been a problem for a long time before too). And when I am in a group text with Iphone users, it seems that my outgoing texts get stuck in limbo until all of theirs is through.  Sometimes several minutes, so I am always behind in the conversation.  Is there a fix?
Answer: Even I own a galaxy s4 and I know that the latest update has been so terrible. I don't think that Samsung is anyway going to push any updates for this but follow the solution below.

You can wipe the cache partition from the recovery mode. (Shut down and reopen by pressing menu, power and volume button at once) then scroll down using volume button to wipe cache partition and power button to confirm. Reboot the device.
Very important go to developer options and switch off all the animations.

Follow some more from. http://www.androidpit.com/galaxy-s4-lollipop-problems-and-how-to-fix-them
Comment: Won't that wipe everything?  I don't want to do that.
Comment: No it won't delete everything
Answer: What messaging app are you using? People experience a lot of variation depending on the app. I think even Samsung will allow you to change your default texting app. May I suggest Google's very own Messenger? Link It's supposed to have pretty good group messaging support.


ac unit without running the car

Question: I want to travel with my dog and many times I have to go into a store where I cannot take my dog, but would worry about the heat in the summer building up while I am absent with the car turned off.  Is there some sort of unit that is available
to turn on with the car OFF while I run into a store or restroom, etc.
thanks to all that respond, p
Comment: Don't leave the dog in the car...
Comment: Not that I know of. Take the dog in the store as a service dog...
Comment: There are solar powered fans that clip over your door window. Better than  nothing.
Answer: Consider the power needs of an A/C unit. The Prius one is about 1 kW and runs off the high voltage traction battery. It would require 90 amperes if run from a 12V battery, but it doesn't because it has a higher voltage.
A 50 Ah battery could in theory provide 600 watt-hours, meaning 36 minutes of runtime. However:

There is Peukert's law meaning you get less capacity with increased current draws. The 50 Ah capacity is valid at 10 or 20 hour rate, not at 36 minute rate! At 36 minute rate, flooded batteries with alpha=0.33 have 3.3 times less capacity at 90 amperes when compared with merely 2.5 amperes, i.e. the intended 20-hour discharge rate.
Lead-acid batteries don't like deep discharge. Thus, you should be using only at most 20% of the battery capacity, i.e. 7.2 minutes without Peukert's law effects, and 2.2 minutes with Peukert's law effects.

Is 2.2 minutes of runtime enough for you? If it is, you could connect a 12-volt A/C unit to the 12V battery without damaging the 12V battery. Remember to use thick wiring rated for 90 amperes!
For me, I would say 2.2 minutes isn't enough to be of any use. The car won't get very hot in 2.2 minutes. For a duration of 2.2 minutes, the dog won't suffer even without any A/C.
From experience, I can say that in my 2016 Toyota RAV4 hybrid, the A/C compressor won't run for long using the 1.6 kWh traction battery. It occasionally needs to start the engine, i.e. the prime mover. The battery is just a temporary energy storage bank.
Solar power would be a relatively good choice for air conditioning. Air conditioning is needed whenever sun is shining and thus solar power is available, and the electricity produced from solar power should be barely enough to remove the excess heat caused by the same solar power. However, cars have relatively small roof area and large windows. You would need to cover the entire roof and also probably the hood for the solar power powered A/C to work.
Most solar power units are just ventilating units designed to circulate air. Better than nothing, but not enough to leave a dog in a car! This should be evident from the small size of their solar panels.
Edit: justification for solar power: commercial polysilicon cell efficiency is about 17%. At the same time, EER is about 12 for a very efficient air conditioner, meaning COP is about 3.5 (i.e. 3.5 kW of cooling for 1 kW of input). Thus, 3.5 * 0.17 = 0.595, meaning 59.5% of heat per square meter can be removed per each square meter of solar cells. So, you would need 1/0.595 = 1.68 times the cell area when compared with the area you need to cool. Barely possible, if you cover the entire roof and hood with solar panels. And this assumes good polysilicon solar cells and very efficient A/C system. With multijunction solar cells, you could achieve over 40% efficiency, but then again those are used only in space applications, so they have a huge price and are very hard to find.
Answer: They make small portable "air conditioners" for cars, they have a fan and are powered by plugging into the cigarette lighter/power port.
These units are not "air conditioners" in the way you may be thinking of, because they do not have a compressor driven refrigeration cycle like your car air conditioner. They are a fan-driven heat exchanger that use ice as the refrigerant. They work about as well as your car unit if set to the lowest setting and only work as long as you have unmelted ice.
I don't like linking to specific products but have made an exception here. Use google-fu or search the ubiquitous on-line shopping website.

ac unit without running the car


How `UDP Hole Punching` Works?

Question: Can anyone explain how UDP hole punching works in a simple way? I know how NAT and PAT works, but can't get a clear idea about UDP hole punching.
Answer: Details vary but basically it goes something like.

The two peers both open a UDP socket bound to a random local port
The two peers both contact a server on the internet. This server responds and tells them what IP and port their packet was received from. Since the server is on the Internet the IP/port seen by the server is the external IP and port
The two peers exchange information about the external IPs and ports through some mechanism.
The two peers start trying to send UDP traffic to each other.
Hopefully the external IP and port used by the NAT for the traffic to the server are the same as the external IP and port used for the traffic sent towards the other peer. So once both peers have sent packets out through their NATs the incoming packets match the mappings and peer to peer communication is established.

This strategy will work reliablly with full cone, restricted cone or restricted port cone NATs. It will work most of the time with port-preservative symmetric NATs. It will not work with randomising symmetric NATs.
Comment: `Hopefully the external IP and port used by the NAT for the traffic to the server are the same as the external IP and port used for the traffic sent towards the other peer` This didn't make sense to me right away, it would have been helpful to elaborate on _why_ that is important (just a quick example). Still, the answer is very clear. Thanks.
Comment: @j3141592653589793238 can you provide that example?
Comment: @j3141592653589793238 if otherwise, the NAT will drop the packet because the common behavior of NAT is that if no packet was sent to an external device, it won't allow the external device to send a packet inside. Here is a detailed answer about UDP hole punching: https://stackoverflow.com/a/74954710/9857078
Answer: From testing, when you send a UDP to a server it will respond back with the port you used, the thing is when you try to contact the other peer the port you use will be different based on your NAT, making the whole chit chat with the middle server to find what your external port was to accomplish communication with a third node pointless.
Comment: You need to find out your public-side source port that is used *after* NAT. Locally, you only ever see your private-side port. You do need an external *which-IP-and-port-am-I-talking-from* service.

How `UDP Hole Punching` Works?


Alternative for google maps api?

Question: We use geocodes(google map APIs) in our healthcare application to locate how far doctors and clinics are located from the patient. The locations are pointed on the map embedded into salesforce and also exact distances(in kilometres) are calculated and shown on the same page. Can we replace this mapping location solution with anything else with a cost lower than google maps API?
Comment: Yes, you can use virtually any API you can get a hold of. Did you have a specific one in mind? Can we help you?
Comment: Thanks @sfdcfox for your response, could you suggest Which would be the best and less complex alternative for google api's? We have a scenario in place where in healthcare section, how far patient is located from clinics and doctors is calculated and displayed on map(lightning view) using pointers. This had been setup using google apis.
What is the estimate that we can replace this using any other apis?
Answer: I'm a fan of Geocodio. First 2,500 lookups are free, then it's just $0.50 per each additional 1000 requests.
I also liked that they have the ability to make batch/bulk requests through their API which comes in handy when trying to navigate governor limits.
Answer: One thing to keep in mind in evaluating pricing is that not all API calls are created equal. Depending on the API you're integrating against the number of calls involved can vary. The way to  evaluate the costs are to consider your workflows involving these APIs and count the # of API calls involved. From there consider the volumes.
Having said that I used TomTom and Here Here is 500$ / month for 1 million API calls... With TomTom we did bulk pricing (1 million calls was 500$).
Answer: Best alternative is HERE JS (Geocoding Api)
Check out this Link - HERE JS API

Alternative for google maps api?


Does the term "polygon" just mean "face"?

Question: Is polygon just another word for face in Blender? For example, a cube has 6 faces. Does this mean that you could also say that this cube is made up of 6 polygons?
Answer: Yes. Polygon (or sometimes 'poly' for short) refers to a face of a 3D shape.
For a more full answer:

'Tri' refers to a 3-sided polygon (triangle)
'Quad' refers to a 4-sided polygon (quadrilateral)
'ngon' refers to a polygon of more than 4 sides ('n' being used as a placeholder to mean 'penta', 'hexa' (-gon) etc. for brevity. They're all placed in the same bucket for 3D models because they all have the same practical problems.)

Polygon also just refers to any 2D shape in the world of maths/geometry too :)
Comment: A polygonal chain which is not closed is a geometrical shape as well, but not a polygon ;)
Answer: Well, yes and no. While a polygon is first of all a set of points connected by lines to form a closed shape, this does not necessarily have an interior (generally speaking for geometry), whereas in 3D software usually a polygon is used for a "filled" polygon with interior rather than a hole surrounded by edges.
And for Blender, while you can say polygon to this shape no matter if you're looking at it in Vertex Select, Edge Select or Face Select mode, the word face distinctly refers to a filled polygon. You can select a boundary only polygon (unfilled) in Vertex Select or Edge Select mode and it's geometrically still a polygon, but you cannot select it in Face Select mode.
Okay, that was a little bit too excessive maybe, in case for what you are asking the simple answer would be: Yes, you can say the cube is made up of 6 polygons.
Let's put it this way: a face is always a polygon, but a polygon not always a face.
Answer: Basically yes, for Blender (since this where we are right now), a polygon is shorthand for a filled closed shape, unlike in regular geometry, where a polygon is not always needed to be filled. We need this as an approximation of the curves in real object, which would require an infinite amount of data for the point otherwise.
However, since this is a software we are talking about, it depend on which setting you are drawing the cube in to define how many polygon does it have. In this question for example, the post-triangulated cube actually have 12 polygons instead of 6 (each square face turned into 2 triangles). On the other hand, this cone is made of n triangle polygon (where n is the number of vertices)


Issue moving new item to newly added list until I do page refresh

Question: I am using a jquery template for dynamically creating a list (columns) which has different items (they are also added dynamically) and also created a plugin which helps moving items from one list to 2nd or 3rd i.e. using jquery ui drag & drop, but having a problem while dropping the item to the newly added list.
Scenario: When I click add list button, it creates list on the page. So I added a list named 'list1' and each list have a button to add items on the list so by pressing it twice I added 2 items on 'list1'. And items are moveable/draggable/dropable. Now added a 2nd list named 'list2'. So if I try to move an item from 'list1' to 'list2' it doesn't do that instead the item moves to 'list1'. This is happening without page reload, but if I refresh the page and do the same action now the item can be moved to 'list2'. Here is the code that I am using the for drag and drop purposes is here (the following code is placed in my jquery plugin):
var id = $('.' + options.dropID);
            var id0 = options.dropID;

            $('.' + options.dropID).sortable({

                helper: "clone",
                revert: "invalid", // go back to original droppable when drop outside drop area
                connectWith: '.' + options.dropID,
                over: function (event, ui) {

                    // may be usefull
                    var sortableElement = this;

                    var dataToSave = {
                        name: ui.item.text(),
                        objid: ui.item.attr('title'), // id has changed for array so use original id stored in title
                        thisID: $(sortableElement).attr('id'),
                        array: $(sortableElement).sortable("serialize")
                    };

                    // save the new data
                    saveData(dataToSave);
                }
            });

so I noticed a behaviour that the different behaviour is here:
- added an item and no page load, it add following div

so if i try to add item here it doesn't allow me.

after page load, it modify the above div to:

it adds ui-sortable to class attribute. So I try to search how or when this ui-sortable is added, it is done by jquery's sortable method.
and on page load I am calling the plugin like this:

I also calling the ListDragandDrop() after adding the new list or item but it doesn't add ui-sortable to the div, and I have to refresh the page so it can make 'list2' dropable. Can you tell me what I am doing wrong or what should I modify to make it work.
Answer: JQuery sortables seems to have been fixed in the latest version for items added after the creation.  If you're still seeing this problem, please add a jsfiddle so we can help with debugging.


C# Windows Form with Attached Windows Service

Question: I know how I can create a Windows Service in C# but I have a series of variables that the user currently feeds into a text file and I wanted to control this process. So can I attach a Windows service to a Windows form application to control such things as installing the service, uninstalling the service, start and restart. Or is it better to have them completely separate and just use the form app to run system commands for install/uninstall and use the serviceController to start/restart?
Thanks
Answer: I suggest to make it completely separated.
Answer: It's probably better to keep them separate: have the form write a config file for the service, then either restart the service or have the service detect the changed file and reconfigure itself.
If the service interacts with the desktop, then you'll have to start worrying about what happens if they're running as different users, or if there isn't a logged-on user at all, or...
Answer: You can do it by allowing the service to interact with the desktop. It's an acceptable way of doing it, but saying that, I agree with dario-g!


Square root of 4 equals 2 (or) ±2?

Question: Simple yet much debated question inside my study circle. Please explain with reasons.
Comment: Every non-zero complex number has two square roots, but by convention, "the" square root of a positive real is the positive real square root.
Comment: It depends on the notation; when one uses the notation $\sqrt 4$ then the root is 2 but when one uses the notation $2^{\frac{1}{2}}$ then it can be any one of/ both of roots depending on the context.
Comment: *The* square root of $4$ is a single well-defined number. *A* square root of $4$ has two choices.
Comment: https://math.stackexchange.com/questions/2299199/square-root-of-x?rq=1
Answer: The word "root" is an old expression roughly equivalent to "solution". The square root of $a$ is the solution(s) to the equation  $x^2=a$. There are three cases.
If $a$ is a negative number, there are no real-number solutions.
If $a$ equals $0$, then $x=0$.
If $a$ is a positive number, then $x=\sqrt a$ or $x=-\sqrt a$.
The expression $\sqrt a$ is defined as the positive solution to the equation $x^2=a$. So people often write the solutions to $x^2=a$ as $x=\pm \sqrt a$.
This leads to some confusion some times. Students are often told to solve an equation like $x^2=25$ by "taking the square root of both sides. They then write

$\sqrt{x^2} = \sqrt{25}$ and then $x=5$ and miss the solution $x=-5$
or they write $x=\pm 5$ but don't really understand what they are doing
or they write $x=\pm 5$ because $\sqrt{25}$ "means" $\pm 5$ which gives the correct answer but is an incorrect reason.
Answer: I have flagged this question as a duplicate (I don't have enough reputation to cast a close vote) and just in case that link is inaccessible, here's the answer from the original question:

$\sqrt{\cdot}$ is the principal square root operator.  That means it returns only the principal root -- the positive one.  $\sqrt{64}=8$.  It does NOT equal $-8$.
On the other hand, the equation $64=x^2$ DOES have $2$ solutions: $x=8$ or $x=-8$.  Thus both $8$ and $-8$ are square roots of $64$.
Let's see what happens when we take the principal square root of both sides of this equation:  $$\begin{align}64 &= x^2 \\ \implies \sqrt{64} &= \sqrt{x^2} \\ \implies 8 &= |x| \\ \implies x&=8 \text{  or  } x=-8\end{align}$$
Thus the fact that the principal square root operation throws out the negative root isn't much of a problem as the math still works out correctly.

The answer above will apply for this case, replace all "$64$" with "$4$", replace "$8$" with "$2$" and replace "$-8$" with "$-2$".
Answer: $\sqrt 4 = 2$
$\sqrt x$ is always non-negative
Comment: @Blue corrected
Answer: By definition for $x≥0$ $y=\sqrt x$ is that value $y≥0$ such that $y^2=x$.
Then of course also the opposite $z=−y$ satisfy the condition $z^2=(−y)^2=x$ but , by convention/definition, the square root is assumed to be the positive one.
The underneath motivation is that the function $y=x^2$ is not invertible on the whole domain $\mathbb{R}$, then by convention the inverse has been chosen for $x\ge 0$ and that is $y=\sqrt x$.
There is not any other motivation but a matter of preference and convention in order to can define an inverse function for $y=x^2$.

Square root of 4 equals 2 (or) ±2?


How to run a shell command through PHP code?

Question: I am trying to run a Jar file in the backend of my php code.But I am not getting the desired output to it.There is a jar file which runs in the background and returns the Page Rank of any of the  keyword and Domain given to it.
I am attaching the code,please suggest me any solution to it,because when I run it on the terminal,it is giving correct output.
Here is the Code :
    <?php
set_time_limit(0);
function returnJarPath()
{
    $jarPath = $_SERVER['DOCUMENT_ROOT'] . "myFolder/tools_new/includes/Rank.jar";
    return $jarPath;
}
$jar = returnJarPath();
$command = "java -jar $jar aspdotnet/microsoft.com";//Passing the Argument to the Jar file.

$shellOutput = shell_exec($command);
    print "The Shell Output is : " ; var_dump($shellOutput);print "
";
exec($command,$executeCommmand);
    print "The Exec returns the value : " ; var_dump($executeCommmand);print "
";
passthru($command,$passthruCommand);
    print "The Passthru returns the value : " . $passthruCommand. "
";
?>

I just checked apache's error log and the last error I found was :

sh: java: command not found

But as I have already said,I have been using the same command through SSH to run the Java command.So there's no such possibility of not having JAVA installed on the server.Please help me out of this mess...
Comment: Are you getting any output at all? Any errors?
Comment: @Buggabill : No.Not through Php but I am getting the correct output through Terminal(Console).
Answer: If the jar file writes to standard output you can use exec.
Here is an example how I use it:
may be first: exec("cd jar dir"); // if jar fine needs to be executed from the same dir
$output = exec("/usr/bin/java -jar $jar aspdotnet/microsoft.com");

But as you say:
sh: java: command not found

It means the there is no path alias to java from php. Just use the full java path to the executable /usr/bin/java.
Comment: first find the java path on linux command promtp with this command: which java. It will return /usr/bin/java. Use it as a full path in your command "/usr/bin/java -jar $jar aspdotnet/microsoft.com". Also you may need to cd to the jar directory if desired by the jar.
Comment: this only outputs the last line for me :/
Answer: Given you are calling java. My bet is the output is being displayed in the Java Console, and not in the shell, where PHP could pull the text information.
How to solve this dilemma?
Well you could write the results to a file, if you have the java source to modify, and then read that file through php to get the results. The possibility of a collision here would be pretty good. The other option is to have Java connect to your MySQL database (if you had one) and then run the java then query the database for the response. Of course, you would need to pass Java a way for it to input the data to insert a record you could identify (a hash of some sort), I have never done that in Java, just a theory of how you might be able to do it.
Update
You may want to try the standard output as suggested by darko petreski as another option as well.
Answer: If the PHP code is to be executed in a server (and not via command line) the user that runs the java executable is www-data, not you. In that case make sure that www-data has the permissions to read the jar file and to execute the java executable
Comment: The error message says "java: command not found", not about privileges.
Answer: The first thing that I would check/change is the line in the function where you are building the $jarPath variable from this:
$jarPath = $_SERVER['DOCUMENT_ROOT'] . "myFolder/tools_new/includes/Rank.jar";

to this:
$jarPath = $_SERVER['DOCUMENT_ROOT'] . "/myFolder/tools_new/includes/Rank.jar";

The trailing slash may not be present in $_SERVER['DOCUMENT_ROOT'] which could cause issues.
I am assuming that when you say it runs from the console, you are running the java command like so:
$ java -jar /rest/of/path/myFolder/tools_new/includes/Rank.jar aspdotnet/microsoft.com

I would ensure that you include the path to the java binary in the $command variable like so...
$command = "/path/to/java -jar $jar aspdotnet/microsoft.com";

The user that owns the web server process may not have a $PATH variable that includes the path to the Java binary.


Bass Trombone in G or F

Question: I play in a community brass band and have just taken up the trombone.  I'd like to use my tenor trombone (in b flat) to play bass trombone parts where necessary.  A lot of the bass trombone parts are in a different key.  Eg: Bandology (arranged by Frank Wright) has the 2nd Bb Trombone in the (treble) key of C but the bass trombone is in the (bass) key of Bb.  In Amparito Roca arranged by Aubrey Winter the 2nd Bb trombone is in the key of Eb but the bass trombone in the key of Db.  I guess the music was written for trombone in the key of C?  So transposition for a Bb tenor trombone to play Bass trombone is a full tone up?  Am I correct?
Answer: If this is brass band music, with Trombones 1 and 2 in treble clef, bass in bass, I  hope that ALL the bass trombone parts are in a different key!
Most brass band instruments are written in treble clef, as transposing instruments - yes, even the basses (tubas).  Bass trombone is the exception, it gets bass clef at concert pitch.
If you're used to reading orchestra/wind band/commercial trombone parts in bass clef, read brass band bass trombone parts the same way.  Written Bb is sounding Bb in first position.
Read brass band Trombone 1 and 2 parts a 9th down.  Written middle C is Bb a 9th lower.
If you know tenor clef, there's a dodge.  'Brass band treble' is the same as 'Orchestra tenor' with two flats added to the key signature.
Try not to be confused by instrument names.  'Bb Trombone' describes the instrument, but not necessarily how it's written.  In the Brass Band it's written transposed 'in Bb'.  Just about everywhere else it's written concert pitch 'in C'.   But it's still a 'Bb trombone'!
For completeness, I suppose I'd better mention the obsolete 'G Bass Trombone' which is larger than the Bb instrument but still reads bass clef 'in C' in band or orchestra.   And some European wind bands write trombone parts in bass clef, but transposed 'in Bb'.
Comment: All blown brass band instruments apart from bass trombone are written in treble clef and are either Bb or Eb transposing. The complication that tenor trombones face is that they are treated as Bb transposing treble-clef instruments in Brass Band, but as concert-pitch, i.e. non-transposing instruments in other contexts, and there the clef is often bass clef or one of the other more exotic clefs.First position is concert Bb - but the notation required to produce that concert Bb changes with the ensemble.
Answer: I think you are a little turned around by the terminology.  Contemporary Tenor and bass trombones are pitched in Bb but normally are read in C.  In other words, when you see a "C" written, you play a "C".
In brass band, there is some level of transposition still performed in some parts.  If you see a bass clef part it should be in "C", which means you play a "C" when you see a "C".  For the treble parts, it is probably in Bb, which means when you see a "C", you play a "Bb".  Note that this is completely independent of the key of the piece.
The concert key of the piece is going to be what it sounds like, independent of what transposed instruments are part of the band.  So a trumpet player might have a "C" written, but what sounds is a "Bb", a French horn player might have a "C" written as well, but it sounds like an "F", so on and so forth. The key signature for the trumpet player might be no flats/no sharps (Key of C) and the key signature for the hornist would be one flat (Key of F).  However, for untransposed instruments, it would be "Bb", ergo, the concert pitch would be "Bb" even though the transposed instruments might be seeing a different key signature.
In this case, The Amparito is probably in the "concert key" of Eb. The 2nd trombone part sounds like it is written untransposed, ergo a written "Eb" sounds like an "Eb".  The bass trombone part sounds like it is transposed for trombone in Bb, which makes everything down a whole step as you indicated. So a written "C" is going to be a "Bb" for that part.
In your first example, Bandology, it sounds like the 2nd trombone is in transposed "Bb" (so when you see a "C" you play a "Bb") and the bass trombone part is untransposed (when you see a "C" you play a "C").
Comment: Your explanation is unclear - please preface all "C" or "Bb" with the terms "Concert" or "Written" as appropriate so we understand what transpositions you are defining.
Answer: If the 2nd Trombone part is in treble clef, you probably have a part written for trumpet players filling in on valve trombone. It's fairly common to see this in Baritone/Euphonium parts.
Tenor Trombone and Bass Trombone are both "C" instruments. That means the written pitch is the pitch that sounds. Compare that to a Bb trumpet, or an F Horn, or an Eb Alto Sax.
To directly answer your question, there is no transposition between tenor and bass trombones.
Comment: I am downvoting this. The reason is that due to tradition in British brass bands where the tenor trombones are treated as transposed Bb instruments and written in G-clef. This goes for all the instruments: the tubas have G-clef and are transposed  Bb, Eb or F -- often there are several variations in the same set of parts. The single exceptionellt is the bass trombone that is written non-transposed in bass clef. Odd, but if you hear them play you it works.
Comment: It's not "several variations in the same set of parts".   The standard brass Band lineup includes two sizes of tuba, 'Eb Bass' and BBb Bass' (yes, that's what they call it).   Different staves in the full score, different parts, and by no means always doubling the same musical line.   There's no F Tuba part.

Bass Trombone in G or F


Volunteering opportunities for kids

Question: Does anyone have recommendations for volunteer opportunities for a 7 year old kid in the NYC / NJ area? He wants to help other kids or maybe animals. What im not sure about is a safe place to start looking for opportunities to do something Saturday and Sundays in the morning.
Comment: Hi LeoRosa , my son has enjoyed helping to fill food hampers and build trails with the local parks services. He also occasionally enjoys helping with volunteer webcast teams in several roles.
Answer: A lot of children become interested in animals at this age. Consider contacting a local rescue group or animal shelter near your home. Your son may be able to help by preparing the animals meals (measuring food into the bowls), playing fetch with some of the dogs, cleaning or sweeping the area, and taking the dogs on walks (with supervision). Added bonus: your son would learn the responsibilities involved in having pets.
Keep in mind that you will be volunteering to work along side him - at least until he demonstrates reliability and the skills he'll need "for the job".
Good luck to you both, please let us know what he chooses and how it goes!
Comment: Thanks, this is helpful. Will post updates when I confirm a group.
Answer: The places I'd go to find out about volunteer opportunities would be:

Your city/village hall - most likely there is either a department or at least a person who works with volunteer organizations, both to help coordinate city resources that might be needed, and to help direct various other people to them
If you belong to a church, or even if you don't, churches often can direct you to organizations that are good for children (often non-religious organizations, but obviously if that is a problem consider that)
Other major organizations like boy/girl scouts, for example, likely also have connections to various volunteer organizations.

If you're specifically interested in animals, then your local zoo (if one is nearby) will be a great resource, as would 4-H groups or similar organizations.
Specifically related to kids, you might try contacting a homeless or domestic violence shelter nearby.  Many of them have needs, even as simple as playing with kids at the shelter, bringing spare toys, blankets, making things for them (7 year old can probably sew and or crochet effectively, if he wants to, at least mine can), etc. I co-founded a group at my college that did something similar with a local homeless shelter; in our case, as it was college age, we served a lunch once a month and took the kids to a museum or zoo a few times.  It would be easier to find one through another resource probably, but if you don't have any luck it's worth reaching out directly; the bigger ones may have community outreach directors or similar.
Good luck!
Comment: Super helpful! I will post updates when I confirm a group.
Answer: I'm very glad your son is interested in volunteer work-this warms my heart!
There are plenty of soup kitchens in the city that accept younger volunteers, especially on winter mornings. This would mean providing soup and/or other foods to homeless people in need.
As Elbrant points out kids get interested in animals at this stage. Animal Care Centers of NYC can involve many jobs, but for younger children, it's usually just refilling water and generally spending time with the animals.
If I'm not mistaken, Central Park Cleanup runs on weekends as well, this  just involves picking up plastic and general waste from the park.
Other than these suggestions, just keep encouraging this volunteering instinct!

Volunteering opportunities for kids


Morphisms of sheaves

Question: My question concerns direct/inverse image of sheaves and their properties. Let $\mathfrak{R}$, $\mathfrak{S}$, $\mathfrak{T}$ three sheaves of groups, over topological spaces $X$, $Y$ and $Z$ respectively, and suppose that there exist two continuous functions $f:X\longrightarrow Y$ and $g:Y\longrightarrow Z$. My goal is to naturally define a morphism of sheaves $\mathfrak{R}\longrightarrow (g\circ f)^{-1} (\mathfrak{T})$, given that two morphisms $\mathfrak{R}\longrightarrow f^{-1}\mathfrak{S}$ and $\mathfrak{S}\longrightarrow g^{-1}\mathfrak{T}$ exist. Is there a natural way of defining such a morphism? My biggest problem with this definition is that I am not sure weather $(f_{*}f^{-1})(\mathfrak{S})=\mathfrak{S}$.
Comment: There is always a map $\mathcal G \to f_*f^{-1}\mathcal G$, but usually this isn't an isomorphism. Take $X$ to be a point, for example.
Comment: That's what I taught. Is there a theorem that gives sufficient conditions for $\mathcal{G}\rightarrow f_{*}f^{-1}\mathcal{G}$ to be an isomorphism?
Answer: Given  $\mathfrak{R}\longrightarrow f^{-1}\mathfrak{S}$ and $\mathfrak{S}\longrightarrow g^{-1}\mathfrak{T}$ gives you $\mathfrak{R}\longrightarrow f^{-1} \mathfrak{S}\longrightarrow f^{-1} (g^{-1}\mathfrak{T}) = (g\circ f)^{-1}\mathfrak{T}$, which is the wanted arrow. Of course, the arrow $f^{-1} \mathfrak{S}\longrightarrow f^{-1} (g^{-1}\mathfrak{T})$ is obtained from the arrow $\mathfrak{S}\longrightarrow  g^{-1}\mathfrak{T}$ by functoriality of $f^{-1}$.
Let me detail a bit the inverse image sorite. This is general, say you have $f : X \rightarrow Y$ continuous. How is defined the functor $f^{-1}$ from the category of sheaves of abelian groups of $Y$ to the category of sheaves of abelian groups on $X$ ? First, how does it act on objects ? Let $\mathscr{F}$ be a sheaf of abelian groups on $Y$. Consider the following presheaf of abelian groups $I_{\mathscr{F}} : U\mapsto {\varinjlim}_{f(U)\subseteq V}\mathscr{F}(U)$. Then the sheaf $f^{-1} \mathscr{F}$ is simply the sheaf associated to this presheaf by the sheafification functor. How does our inverse image functor act on arrows ? For this, let $u : \mathscr{F} \rightarrow \mathscr{G}$ a morphism of sheaves of abelian groups on $Y$. Interpreting presheaves as contravariant functors from the category of open sets of $Y$ with inclusions as arrows and interpreting sheaves in the same way plus the equalizer conditions, $u$ is simply a morphism of functor, as so-called natural transformation. Or also a morphism of directed systems of abelian groups. This allows to define a morphism $I_{u} : I_{\mathscr{F}} \rightarrow I_{\mathscr{G}}$. Applying to it the sheafification functor gives you $f^{-1} u$, and finished the definition of the inverse image functor. Valid of course for the category of sheaves of abelian groups. For $\mathscr{O}_Y$-modules the definition is not the same : the inverse image is noted $f^{\star}$ and is defined as $f^{\star} \mathscr{M} = (f^{-1} \mathscr{M}) \otimes_{f^{-1} \mathscr{O}_Y} \mathscr{O}_X$ for any $\mathscr{O}_Y$-Module $\mathscr{M}$.
For all this stuff, two references come immediately to me : the long and noble road SGA IV I, first exposés, and Maclane's and Moerdijk's Sheaves in Geometric and Logic. And maybe one of Kashiwara's and Shapira's books the name which I can remember for now. I don't remember if Hartshorne does it.
Comment: Thank you for your reply. Can you please give me the explicit construction of the map $(g\circ f)^{-1} \mathfrak{T}$ on the open subsets?
Comment: Edited my answer to address the question of your last comment. Note that the key is simply to know how how the functor $f^{-1}$ is defined, as after you apply it to an arrow, that you then compose with another arrow to get the final arrow.

Morphisms of sheaves


Good idea to purchase condo with no home owners association?

Question: I'm looking at REO condos on homepath.com (the site for Fannie Mae foreclosures, etc).  I'm wondering, is it a good/bad idea to purchase a condo with no home owners association?  Most of them have one, but I've seen one or two properties now which explicitly are advertised as having no HOA.  Is this a good/bad idea?
Answer: Bad bad bad idea. Properly managed HOA has rules that regulate usage of the common areas and property; HOA manages repairs and maintenance, insurance and reserve.
Not having HOA means the owners deal with problems on their own, as the problems appear. Need to fix the roof? Assessment. Need to paint the walls - assessment. The roofer fell and broke a leg - liability suit. Huuuuuge assessment.
You really want to deal with that?
Comment: Everything you say is true... but to me they are the good side of that coin.
Comment: @Chad - well, some people enjoy spanking, too. Being a masochist is not a crime, so have fun.
Comment: Me either which is why I ruled out a condo all together :p
Answer: I don't understand why so many people want to avoid a HOA. For a condo community they are the interface between the residents and the management company. The board is made up of the residents of the community.
The board follows and enforces the covenants and other documents, makes the budget, puts aside the money for major repairs.
I would never think of buying a condo without a HOA.
Comment: I don't think many people want to avoid an HOA when buying a condo. I'd avoid one when buying a regular home, but then I wouldn't have the same issues with repairs to common areas.
Comment: I don't want to avoid it; I was just asking about properties that happen to be sold without HOA.  I didn't know if this was common enough so that insurance companies sell some sort of special insurance for this situation.


Confusion in the usage/property of Laplace Transform.

Question: While proving that $$\int^{\infty}_0 \frac{\sin x}xdx$$
I saw the Laplace Transform proof.
It used that $$\cal L\left\{\frac{\sin t}{t}\right\}=\int^\infty_0 \cal L\left\{\sin(t)\right\}d\sigma$$
So for understanding it, I tried:
$$\cal L\left\{\frac{\sin t}{t}\right\}=\int^\infty_0e^{-st}\frac{\sin t}{t}dt=\int^\infty_0\frac1t\cal L\left\{\sin t\right\}dt$$
But I cannot see how that $\sigma$ emerged and $t^{-1}$ vanished?
Also, how do we know that using the Laplace transform, we would get an integral that is equal to the original one ($\int^\infty_0\frac{\sin x}{x}dx$)
Answer: You can write,
$$
\int_{0}^{\infty}\frac{\sin t}{t}dt=L\bigg\{\frac{\sin t}{t}\bigg\}_{s=0}=\Bigg(\int_{s}^{\infty}L\big\{\sin t\big\}du\Bigg)_{s=0}\\
=\Bigg(\int_{s}^{\infty}\frac{1}{1+u^{2}}du\Bigg)_{s=0}=\Bigg(\tan^{-1}(u)\Bigg|^{\infty}_{s}\Bigg)_{s=0}=\frac{\pi}{2}.
$$
Comment: How did you deduce the third expression?
Comment: if $L\{f(t)\}=F(s)$ and $f(t)/t\rightarrow \alpha<\infty$ as $t\rightarrow 0^{+}$ , then $$L\{f(t)/t\}=\int_{s}^{\infty}F(u)du$$. This is one of the well known properties of the Laplace transform.
Answer: Your formula is a (too) short notation, suppressing the variable of the Laplace transform. It should read
$$\mathcal{L}\left\{\frac{\sin t}{t} \right\} (0) = \int_0^\infty \mathcal{L}\{ \sin t\}(\sigma) \,d\sigma.$$
This follows from the rule `Frequency-domain integration'. A proof of this is rather straightforward. If you have troubles, I can provide some more help.


What if I double the frequency of incident light in photoelectric effect?

Question: The photoelectric effect occurs when the frequency of incident radiation is above a threshold frequency. If we double this incident frequency, what effect will it have on the experiment? Also what will happen if we double the wavelength?
Comment: Please take the time to use proper grammar and capitalization in your questions. I fixed this one for you, but in the future please do it yourself. It is a courtesy to the people take time to answer your questions
Answer: The energy of the photon used to reap the electron from the atom and give it some kinetic energy, thus -
$h\nu =\frac{hc}{\lambda}=\frac{1}{2}mv^2+W_0$,
where $W_0$, the energy needed to reap the electron from the atom, is constant per type of atom. Thus
$ v=\sqrt{\frac{2(h\nu-W_0)}{m}}=\sqrt{\frac{2(\frac{hc}{\lambda}-W_0)}{m}}$
As long as $h\nu=\frac{hc}{\lambda}>W_0$ - the electrons will be reaped from the metal. Changing frequency/wavelength of the photons won't change the number of reaped electrons, but will change their speed/kinetic energy.
Comment: For completeness (last part of the question), if you double the wavelength you halve the energy. If you were just above the cutoff, you will now be below it and there will be no electrons emitted. You might want to edit that into your answer.
Comment: It's embedded in the  $h\nu=\frac{hc}{\lambda}>W_0$ condition
Comment: I realize that, but I stand by my recommendation to be explicit. "Abundantly clear" is a good strategy.


What size is the lead screw?

Question: I built a 3D printer kit a while back but now I want a large printer to play with. I would like to build a 300x300x400 mm clone of a 3D printer. But I am not sure what size lead screws to buy. They come in 300 mm length but once you connect the coupler and the to the screw that takes 20 mm's that the axis can not travel too so isn't it more like 280 mm length? Or do most people round up to the next size?
Comment: If your printer is 200x200x180, how much you need to add to get 300x300x400? So that simple.
Answer: You'll need to do some calculation to figure out how long of a lead screw you need. The best solution would be to mock up the entire printer in CAD so you can visualize how everything fits together. Not only is the coupler going to take up some space, but the nut also takes up some space, and perhaps (due to design constraints) you won't be able to have the nut go up right against the coupler so you'll need some more space. Unfortunately, there isn't a general "just take the length of your Z-axis and add X millimeters"-type formula.
Comment: Thanks for your anwser Tom life took over and forgot I had posted on stack exchange about this. When Life gets done with me I will give that a shot
Answer: CAD visualization like mentioned in this answer is the safest route. If you are not equiped with CAD skills you could do some manual calculations as well.
You already confirmed that you need 20 mm for the coupler, and you have to include space for the distance between the coupler and the trapezoid nut, this should be added to the travel length you want.
You can buy the screws in virtually any size you want (many far Eastern vendors, you can ask whatever length you want). You could even buy oversized and grind them to the final desired length.
I once bought oversized screws but was a little too lazy to grind them down, so they are still sticking out, no problem.

What size is the lead screw?


Integral of a derivative.

Question: I've been learning the fundamental theorem of calculus.
So, I can intuitively grasp that the derivative of the integral of a given function brings you back to that function.
Is this also the case with the integral of the derivative? And if so, can you please give a intuition for why this is true?
Thanks in advance
Comment: You need some assumptions. See https://en.wikipedia.org/wiki/Volterra%27s_function for an example where it doesn't work.
Comment: (up to a constant term)
Answer: Since$$\int_a^xf'(t)\,\mathrm dt=f(x)-f(a),\tag{1}$$the short answer is that the integral of the derivative is the original function, up to a constant.
Of course, $(1)$ isn't true without restrictions. But if $f'$ is continuous, then, yes, $(1)$ holds.
Comment: @S.C. But it still requires that $f'$ is Riemann-integrable. On the other hand, I did **not** write that $f'$ *needs* to be continuous. All I wrote was that *if* $f'$ is continuous, then $(1)$ holds.
Comment: Hi, Professor Santos. Could you please clarify why $f'$ needs to be continuous? Spivak's *Calculus* presents the 'Second Fundamental Theorem of Calculus' as **not** requiring the assumption of continuity of the derivative.
Comment: Isn't the Cantor function a counterexample? f'=0, which is continuous, Riemann-integrable, but it's integral is a constant, not the Cantor function.
Comment: @MSIS No, the Cantor function is not a counterexample, since it's not even a differentiable function.
Answer: The derivative and integral are almost inverse functions, so in turn, you are almost correct. For simple polynomials, one multiplies by the power and then removes 1 from the power, and the other adds 1 to the power and divide by the new power.
For more complex functions, you can consider it visually, or even compare it to physics. If you have a line (velocity), the gradient is the acceleration. If you derive this line to get the gradient, you know have the acceleration function. Now, if you have a flat line with no gradient (acceleration), and you integrate it, you will be left with a line with gradient for the velocity function.
This is because acceleration represents rate of change of distance relative to time, just like how gradient represents rate of change of y relative to x.
The only main difference is that integrating leaves you with an unknown constant $ C $. You may notice that if you differentiate $ f(x) = 2x^2 + 3x + 6 $, you're left with $ f'(x) = 4x + 3 $, and the $ 6 $ has absolutely no effect on the final answer. This is because, no matter where the line/curve is located in the y-axis, the gradient for the x co-ordinate remains the same. You require a co-ordinate from the original function in order to calculate $ C $.
Comment: In the final paragraph you write "if you integrate $f(x)=..." followed by "[then] you're left with f'(x)=...", did you mean to write "differentiate" instead?
Comment: @LoveTooNap29 I did. Thanks for pointing that out!
Answer: The integral of the derivative isn't always equal to the original function.
example : let $f$ be a function as $$f(x) = 2x+2$$
so we have $$f'(x)= 2$$
If you integrate $f'$, you'll end up with $$F(x) = 2x + c$$ with c a real constant. So you'll have your initial function only if $c=2$

Integral of a derivative.


PHP4 to PHP5 Migration

Question: What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break?
Answer: I also once worked on an app which used PHP4's XML support quite heavily, and would have required quite a bit of work to move to PHP5.
One of the other significant changes I was looking at at the time was the change of the default handling of function parameters. In PHP4 if I remember, they were pass-by-copy unless you specified otherwise, but in PHP5 is changed to pass-by-reference by default. In well written code, that probably won't make a big difference to you, but it could certainly cause problems.
I think one other thing I found changed is that objects are no longer allowed to overwrite their 'this' field. I would say that was a really bad idea to begin with (and I think it may have not been an intentional feature in PHP4), but I certainly found a few parts of our system that relied on it.
Hope some of that helps.
Comment: I just happened to notice this post at the top of Google search results when I searched for PHP4 vs PHP5 passing arguments to function behavior. [the php manual](http://php.net/manual/en/functions.arguments.php) states otherwise; passing by value (pass-by-copy) is _still_ the default.
Answer: The best advice I could give anyone working with PHP4 is this:
<code>error_reporting( E_ALL );
</code>
It pretty much will tell you exactly what you need to do.
Answer: We had an app that relied heavily on the PHP 4 XML DOM functions and it required a lot of retooling to change over PHP 5.
Beyond that most changes were improvements to things like error handling (to take advantage of exceptions) and PHP Classes.
Answer: OOP is one of the largest differences. It won't break as the PHP4 and PHP5 OOP styles are interchangeable but I'd reccommend taking advantage of PHP5's new OOP styles. It's not a huge amount of work to convert your existing classes to PHP5 and it does give you some extra magical methods that may help solve some existing hacks (I remember having a near useless __toString equivalent method in most classes).

PHP4 to PHP5 Migration


Can I create a hidden page in SharePoint 2010?

Question: Is it possible to 'hide' a page to everyone but a certain user or group of users?
Answer: Yes, you'd go into the library that contains the page and set item level permissions for the page assuming you have the permissions to do so.  Or you could create it in a separate library with unique permissions.
Comment: I created a library but for some reason, I can't edit the permissions; which doesn't make sense since I'm a farm administrator.
Comment: Just being a Farm Admin does not grant you full admin permissions to the site collections.  You need specific permissions on the site collection as well.
Comment: I'm an administrator of the site collection and if I look at the site permissions, I says I have full control.
Comment: Does the Full Control privledge defined for your site collection allow you to Manage Permissions.  Perhaps a policy has altered that?  I don't have a 2010 install to look at to walk you through the GUI to break permissions on the librrary and create new ones. 2007 it was Settings, Library Settings, Advanced Permissions.  Then Actionn, Edit User Permissions, click OK then edit/remove users.
Answer: You can make use of the Audiences feature that allows you to restrict visibility of the page via several different mechanisms, including Groups, distribution lists or other rules based on profile data.
Comment: Understandable, but I'm coming from the perspective of managing a very large SharePoint deployment where per-item security settings are "evil".  They lie out there and multiply in the darkness making the management of site security that much more complex because *nobody* ever remembers that they put that security out there.
Comment: Audiencing isn't security though.
Comment: True, but he said it only had to be hidden, not necessarily secure
Comment: Yep, that's true I suppose.  I'd rather take the route to ensure security than audience target.  If they don't need to see it, they shouldn't have access to it.
Comment: I suppose it also depends on the sensitivity of the content needing to be restricted.  The preferred route would be creating a secured document library and not item level permissions for various files in a library.
Answer: If you have publishing turned on you can do this as well by unpublishing the pages, then you can create groups with specific permissions to see pages in various states.


Why is my lawn sprinkler backflow preventer failing?

Question: I have 14 zones which work fine except for zone 6. When it starts water starts coming out of backflow preventer. I already changed the valve parts and solenoid. Is there any thing else I can check?
Comment: Traditional sprinkler designs have one back flo preventer regardless of number of stations. Sounds like a problem with the station valve.
Comment: You could improve your question by providing more details on the sprinkler and a photo
Answer: It sounds like you have a blockage in that zone and the water is dispersed through the backflow.
Try taking the heads off at the beginning of the zone.  Also look for damp ground where a brake may have occurred.   If you had a break and repaired it there may be debris in the pipe that has been compressed by the water and is now a solid block.


Help install software and using wine

Question: I built a pc and I want to install Radeon Pro Software for Enterprise on Ubuntu 18.04.1, I search and tried to tweak the files but it did not work and also I don't know how to use wine as the instructions varies.
Comment: have you configured wine?
Comment: I have no idea.
Comment: I think I install a program, now I need to know how to run it, if I can find it first.
Answer: I do not really understand what you want to do very well. if you intend to install the software "(driver)" from amd en wine, I regret to tell you that it will not work, if what you want to install is the driver provided by amd you should do this:
Download the driver from the official website of amd.
Depending on the version of the driver you will need to edit the system file / etc / os-release on line 3 ID=elementary to ID=ubuntu on line 6 of VERSION_ID = "5.0" to VERSION_ID = "18.04" (open "files" with administrator privileges for to be able to make the change).
If you do not know that, it will say OS not supported.
After that open the folder where the driver is with the terminal and put there:
<code>./amdgpu-pro-install -y
</code>
(this installs Base kernel, Accelerated graphics, Multimedia table, OpenGL Pro, Pro Vulkan, Pro OpenCL).
After installing everything correctly edit the system file / etc / os-release again, on line 3 ID=elementary on line 6 of VERSION_ID = "18.04" to VERSION_ID = "5.0" to leave that file as it was before.
https://www.youtube.com/watch?v=_zDLT9wQHmU&t=68s
cya

Help install software and using wine


Radio lights are on

Question: I have a 2001 Chrysler Sebring and when I turn my car off the radio still glows with the time and CD that's playing, is that normal?
Comment: Is it an original, or an aftermarket?  Has it done that all the time you have owned it?  Has anyone been changing the wiring?  It is generally not normal, but it depends who wired it up.
Comment: It does this with the key removed? I believe most chryslers have the ACC key position to the left of the off position that will leave the radio on with the key still inserted. Do the dome lights work normally? or do they stay on when the key is removed?
Comment: All the lights work except the blinkers inside and out. But yes the key is removed it's just the radio light that's on I turned off my dome lights so I know it's not because I left anything on. But the radio isn't playing or anything
Answer: If when you open the door and the radio shuts off, then this is perfectly normal. Most cars since the early '90 (maybe before that?) have what's called a Body Control Module (BCM - manufacturers may call it something else, but they all serve the same purpose). The BCM will keep some of the accessories on for a period of time after you shut the vehicle off. My Silverado keeps the radio on for about 15 minutes, as an example. When you open the vehicle door, this tells the BCM to shut things down. It is a convenience item for your vehicle. If this is how your vehicle is behaving, then there's no issue.
Comment: It's like that with the door and closed it goes off after a while but it does stay on a long time
Comment: @Courtney - This seems like perfectly normal behavior. You may check your Owner's Manual, as the "on time" can be adjusted in some models. You may also find that your electric windows, if so equipped, can be operated during the "key off, before you open the door" period.

Radio lights are on


Is there any way to reinitialize a mapping

Question: I am trying to code a smart contract and I am using a mapping (address => bool) ; i make it true when a certain conditions meet. Now for another condition I want my mapping to reset and loose all of its data , i want it to be where it was in the beginning a empty mapping.

Problem statement : I am setting all true for whoever voted using in my Dapp using a mapping ( address => bool ) now after voting is ended i want all my mapping values to be false , is there any efficient way to solve this
Thank you in advance..
Answer: no. not really at this point in time. the only way is to iterate through the mapping, using a helper array of all the mapping's keys, and reset each value one by one to default/false
https://docs.soliditylang.org/en/develop/security-considerations.html#clearing-mappings


Why hasn't public key encryption or one time password been introduced to battle online card fraud?

Question: With all the identity theft and card fraud in the world. Even though some One time password measures have been put in place in the banking system where the cardholder verifies the transaction with a code sent to their mobile. Why isn't it widespread and used to verify all transactions online?
Comment: Encryption isn't the place where confidential information is compromised always, you need supercomputers to decrypt even a 128 bit encryption but it does happen. Banks have a prerogative to do so, else they loose money. Other business aren't that hard pressed to do so. But slowly everybody is getting in line and implementing them. This cannot happen overnight, because it takes resources to be assigned to do this which costs money.
Comment: what are the other transactions you want to protect? Credit cards and debit cards have their own security and fraud detection systems. Vendors who link to those systems are protected by those systems.
Answer: Most often these have to do with a cost vs. benefit trade-off.
The banks would be the ones that are setting up these kinds of systems. And at the end of the day, if their IT departments aren't making an analysis of the situation at all... then nothing happens.
If they are making an analysis of the amount of transaction fraud that happens to their customers, (and they still don't have these), then my guess would be that the CIOs that have been presented with these are seeing something like "it costs our bank $500,000 per year in fraud... we could buy this system for $3,000,000."
And then, when they make the budgeting decisions there just isn't enough to go around, or they have other projects with higher priorities.
Answer: The concept you are describing is generally known as "two-factor authentication". The theory, and potential benefits, are obvious; someone wishing to use your card has to have not only the card, but access to your mobile device. I can think of several potential problems with this system in a point-of-sale situation:

Massive equipment firmware upgrade required - every CC reader in the country will have to be upgraded to support entry of the confirmation code. For some, this is as simple as a firmware upgrade to add another step in the process. Other readers, including some brand new ones, don't have the keypad needed (because CC transactions currently don't require the user to punch in any such code). This is a bigger deal than debit cards were, because debit cards were designed to be used either as ATM cards (PIN) or as credit cards (signature, if that). So, if a retailer didn't feel the need to upgrade to support the debit card process, they didn't have to; they could use the card like a credit card. Now, you're asking retailers to upgrade again for a relatively large process change.
You now need two devices to access your money - In addition to having to have your card, you have to have your mobile device in order to receive the confirmation code. First, not everyone has a mobile device, so requiring a system like this basically requires every U.S. cardholder to have and pay for a mobile device, even if this is the only thing it's ever used for. Second, even if this system is opt-in, your mobile has to be by your side, charged, and receiving a signal in order for you to pay for anything with your credit card. If you're going to go through all that, why not just switch to something contained in your phone, like Google Wallet, or an online banking app that will give you similar scannable one-time codes?
Mobile communications are not 100% reliable - Text messages are notorious for showing up several minutes or even hours after they are sent. When you think of what's necessary to get the text message from one mobile device to another, and how many texts per minute the mobile network has to support, it's mind-boggling that the system works at all. But, the technical marvel that is the U.S. cellular network is little comfort to you when the text message you need in order to close out the credit card transaction isn't showing up on your phone, and the line's getting longer and people are yelling at you to just pay and go.
Two-factor authentication is nothing new, even for credit cards - For big purchases, the ones that are most likely to be fraudulent, you have to have the credit card and your signature. For debit card transactions you have to have the card and your pin. In both cases, the two factors are something you have (the card), and something you know (your PIN< or how to sign your name uniquely). The change you are proposing simply switches the thing you know to a second thing you have.
It's a step backward in convenience - In recent years, credit card issuers and retailers began accepting signature-less credit card transactions under a certain amount. That allows the "swipe and go" transaction which speeds up the checkout process considerably, in turn increasing the retailer's revenues during peak times. Now, you're proposing not only adding a code to the process, but having to wait for that code to be given to you before you can enter it.
Comment: Great answer, however the original question was more to do with online transactions, thus eliminating any hardware upgrades with the merchant.

Why cant the bank simply get a confirmation text message on all online transactions? They already require text message confirmation when sending BACS transfers.
Just curious, what is your profession?
Comment: I'm a software developer, currently in the video surveillance field.
Comment: The biggest problem with doing it only for online transactions is knowing which of them are online. With a lot of stores being "click and brick", the Vendor ID which is sent as part of a credit inquiry can't always be used to determine whether the transaction was made online or in-person. All these transactions are processed in the same way by the credit network in question. Also, the convenience factor is still a factor; you would still need to wait for a text message, and if there were network problems, your session could timeout before you get it.
Answer: There is encryption of data that is sent across the network. The key issue is if the card is lost or skimmed, it can be misused and this is what happens quite a few times.
The one time password authentication is much better, however it cannot be rolled out overnight to all usecases, it takes time for everyone is supply chain to upgrade to a newer system. Hence it will happen overtime. And even with onetime password, there are cases where a SIM card was stolen/cloned, account hacked and onetime password entered ... or the phone number in company's database is hacked and changed to new number, alerts and one time codes received in new number ...
So in today's world its always the fight between what is the best way to minimize fraud and its a battle as always between good and evil
Answer: I agree there's a cost, but one imagines that in this day and age, the cost has fallen well below the risk the banks bare.
There's Google 2 step verification which, in theory, should eliminate a high percentage of the simple fraud going on. My wife can have my card and all the details a spouse would know, but without my smart phone in her hand as well, no transaction.
If Google can offer this as a free security measure for one's web site, it would seem a partnership with the major card companies would be a natural evolution.
(On further reflection, this is a comment, as I'm surprised as well that it hasn't taken off.)


Propagating modes in a waveguide, what do they represent?

Question: In a hollow rectangular wave guide of dimensions $a \times b$ for example, I know how to apply the boundary conditions to find the solutions. In particular, for TE (or TM) modes we have the expression $$k=\sqrt{\left(\frac{\omega}{c}\right)^2-\pi^2\left[\left(\frac{m}{a}\right)^2+\left(\frac{n}{b}\right)^2\right]} $$ as our dispersion relation. I understand that in order to excite a certain TE$_{mn}$ mode the driving frequency must exceed the cutoff frequency for such mode. My question is what does it mean to excite a mode? Is it that we may only find waves propagating with distinct frequencies that correspond to the excited modes?
Comment: I checked this: [link](https://physics.stackexchange.com/questions/295191/what-does-excitation-frequency-mean-for-te-mn-modes) but it wasn't of help
Answer: There are many ways to excite modes in a waveguide. The term is often used in a theoretical sense, like `let there be a wave...'
In a more practical sense, one can think of the one end of the waveguide being connected to a horn antenna, which receives some radiation from free-space and as a result excites modes in the waveguide. Does this answer your question?
Answer: For some given $\omega$, one can only excite specific traveling modes corresponding to different values of $k$ as shown by the dispersion relation. This means that a traveling mode can be excited at any frequency as long as it exceeds the cutoff frequency $\omega_{mn}\equiv c\pi \sqrt{\big(\frac{m}{a}\big)^2+\big(\frac{n}{b}\big)^2}$ for that mode.
Answer: I will give you a mostly non-mathenatical way to understand waveguide modes.
First, note that waves propagating in the space between two surfaces must bounce off the surfaces.
Next, note that when a wave reflects off a surface it forms a standing wave pattern with stationary (Bragg) surfaces parallel to the reflective surface.
A wave propagating between two parallel surfaces, then, forms standing waves with Bragg surfaces associated with both surfaces.
Those Bragg surfaces, on both sides of the structure, are stacked with a separation that depends on the wavelength of the propagating wavefront and the angle of incidence on the reflective surfaces.
The math would show that in order for the system of Bragg surfaces to be stable, allowing a steady-state wave pattern in the space between the reflective surfaces, th he Bragg surfaces inside the space must coincide.  That means, for light of any given wavelength, there is only a finite number of propagation angles that support a steady-state wave pattern.  Those propagation angles correspond to the  available propagation modes in the waveguide.
All the equations describing waveguide modes derive from these considerations.
Note also that a 3D waveguide can support a lot more modes than a 2D waveguide, such as "corkscrew" modes that reflect cyclically off of all of the faces of the waveguide.


Why is cold air drier than warm air?

Question: I know this has been asked before but i could not understand the replies. If someone has a simpler answer please do so.
My simple Geog lesson just said that warm air molecules are further apart leaving bigger gaps for water vapour. Is this correct somewhat is it more than this.
Comment: It would be better if you linked the question you found here but didn't understand. That'll help the answerers to better gauge the level of their answers.
Comment: Warm air being hotter can carry more number of water molecules in vapour state , I believe
Answer: That explanation is wrong. Cold water has less vapor pressure than warm water, and so we find less water vapor in air that is cold, and (if the water is available) more of it in air that is warm. This has only to do with the temperature dependence of vapor pressure.
Answer: Between freezing and boiling point, the thermodinamical stable phase is liquid water. So, at first no water molecules should be present in air.
But in order to join together, the water molecules must form a boundary, and it requires energy. The balance equation is:
$$\Delta G .V + \gamma A < 0$$
where
$\Delta G$ is the free energy of the bulk of water, and is negative in temperatures and pressures where liquid water is the stable phase.
$V$ is the volume of the water droplet
$\gamma$ is the energy per unit of area of water at the temperature, and $A$ is the surface area of the droplet. This term is positive.
A spherical droplet has the minimum area per volume, and for a radius R the inequality becomes:
$$\Delta G \frac{4}{3}\pi R^3 + \gamma 4\pi R^2 < 0$$
$$R > \frac{3 \gamma}{-\Delta G}$$
Any random meeting of molecules that form a smaller radius are not stable and returns to water vapour.
$\Delta G$ is negative just below the boiling point, and becomes more and more negative as the temperature decreases.
So, in colder air the critical radius is smaller, and it is easier for random meetings form stable water drops, decreasing the amount in vapor phase.
Comment: if there would be an extra about the free energy itself and how it is temperature dependent, then this would be a perfect explanation!
Answer: The key is saturation vapor pressure at a given temperature. This determines how much water vapor a packet of air can retain before it gets saturated and condensation begins. The saturation vapor pressure increases with temperature so warmer air has a greater capacity to retain moisture.
Think of it as the upward force of water molecules exerting pressure against the downward force of ambient air at atmospheric pressure. As the ambient temperature increases, the vapor pressure of the water molecules increase (overcoming the pressure of ambient air) and they are more likely to enter the vapor phase. This is why the free energy of water in the liquid phase is 'more negative' as temperature decreases since vapor pressure also decreases and liquid phase becomes more stable/favorable.
Note that temperature is not the only variable at play here since pressure also affects this equilibrium between water and air. As the ambient pressure increases, it becomes more difficult for water to 'escape' into the vapor phase even though ambient temperature might be high. The greater ambient pressure increases the dew point which reduces the absolute humidity of the air, even though the relative humidity may not change.

Why is cold air drier than warm air?


Does Craft/Twig help with cache-busting js/css?

Question: Usually, I would use PHP to append the filetime of a file provide cache-busting. Does Craft or Twig do anything that can help with this?
Answer: No, Craft/Twig itself doesn't really do anything in regards to cache busting your assets. Bust is one tool, and you'd also want to take a look at the awesome Minimee plugin port.
Comment: Yes, John deserves a special place in heaven/St. Tropez & 100 billion dollars. Perhaps some nice craft beer. He likes that.


MySQL Workbench - Error Getting DDL Object (It doesn't exist?)

Question: The problem started when a table, started not to fetch a single SELECT. It was only a SELECT * FROM table; and it started to run and never stopped. After several attempts, all of them failed, and then I tried to drop the table (it has backups), but the SAME problem happened.
My last, and failed attempt was to rename the table and then restore a backup table.
I tried to use MySQL Workbench feature to Alter Tables but, Windows error (I use Windows 7 at my job). Windows offered me to "Try to restore the program" and it indicates me it was an "Error Getting DDL Object". Then I checked the tables information, and DDL tab was empty.

So.... I don't what to do. Is there a way to change this DDL? Or maybe another way?
Comment: I already tried to add a column too.
Answer: I discovered, after a long research, that it could be a process which wans't interrupted (somehow).
Then it was only:
show processlist;
kill [ID of the running process];

And then I was able to drop/alter that table.
Answer: In my case, I got the same error message with a full disk at the server side where MySQL was running. Obviously, MySQL server failed to run correctly.


Examples of homology sphere that bound a nonsmoothable contractible 4-manifold

Question: Freedman's theorem shows that all 3-dimensional homology spheres bound topologically a contractible 4-manifold. It is well known that the Poincaré homology sphere does not bound a smooth contractible 4-manifold. Is there other explicit examples or is there an invariant of homology sphere characterizing this property(whether or not smoothly bound a contractible 4-manifold)?
Answer: There are certainly lots of obstructions coming from gauge theory, for instance Frøyshov's $h$-invariant or Ozsváth and Szabó's $d$-invariant. If an integer homology sphere $P$ has $d(P) \neq 0$, then $P$ does not even bound a rational homology ball. There are $\mathbb{Z}/2\mathbb{Z}$ refinements (more precisely, obstructions to bounding spin rational homology balls).
In addition to this, and closer to your question: using periodic ends and Seiberg–Witten theory, Taubes proved that if $Y$ is a homology 3-sphere that bounds a negative definite 4-manifold with non-diagonal intersection form (e.g. $Y$ is the Poincaré sphere, which bounds the $E_8$-plumbing of spheres), then $Y \# {-Y}$ does not bound a contractible 4-manifold. (It does bound an integer homology 4-ball, namely $(Y\setminus B^3)\times [0,1]$.) As far as I know, there is no single invariant capturing this information. Certainly there is no single invariant capturing whether a 3-manifold bounds an integer homology 4-ball.
Some keywords you might care about are: (integer or rational) homology cobordism group, homology cobordism invariants, Heegaard Floer correction terms (or variants thereof, like involutive Floer homology).
Answer: Freedman proved that any integral homology 3-sphere topologically bounds a contractible, compact 4-manifold. If we start with an integral homology 3-sphere $\Sigma$ and double the associated contractible 4-manifold along $\Sigma$, then the resulting space is a homotopy 4-sphere, which is homeomorphic to $S^4$ (due to the topological 4D Poincare conjecture). So I think the core of the posted question is whether $\Sigma$ smoothly embeds in $S^4$. (It's easy to see that every homology sphere admits a locally flat topological embedding in $S^4$) There are Brieskorn homology spheres which smoothly embeds but some Brieskorn homology spheres do not embed. If I remember correctly, it's still unclear which Brieskorn homology sphere embeds and which does not. On P31 in Budney-Burton, they listed several Brieskorn homology spheres which do not embed in $S^4$ since the Rochlin invariant or d-invariant (which is mentioned in Marco Golla's answer) is not zero. However, Budney-Burton also provided Brieskorn homology spheres do embed in $S^4$ smoothly. See Theorem 2.13 or P24. I don't know if there are other classified Brieskon homology spheres which are not listed in their survey.
If one is willing to expand the roster of candidates, Marco Golla has already given a nice answer in general. A weaker question than the posted one could be when an integral homology sphere can arise as the boundary of an acyclic 4–manifold. There are some recent research surrounding this, e.g. Homology spheres bounding acyclic smooth manifolds and symplectic fillings


What is the proper use case for an Iteration 0?

Question: When starting a new software version and/or embarking on a new product, what is the purpose of, and what are the crucial pieces of an "Iteration 0?"
Answer: It's important to realize that, in Scrum, there is no such thing as "Iteration 0" or "Sprint 0". All Sprints are the same and all result in a potentially releasable Increment.
However, Scrum isn't a complete product development life cycle. There are several early-life cycle activities that fall beyond the scope of Scrum as it's defined in the Scrum Guide. Some of these activities include obtaining funding for the effort, the formation of the team, the selection of Scrum as an appropriate framework, initial creation of the vision and first set of requirements (the first Product Backlog Items, in Scrum), set up of tools and infrastructure, verification and validation strategies, and perhaps the initial release planning.
These types of activities are typically done when launching a new product. I'm not sure that I would even consider an Iteration 0 in the case of a new version, unless that new version is not simply incremental improvements over the past version or if the team is launching for the first time.
Answer: Every Sprint must produce a product increment, right? Working software. But when you start any project, you don't ever hit the ground running because you might need to prepare things: setting up the project and access rights, infrastructure work, buying and setting up servers, adding enough meat to user stories to actually be able to work on them, etc.
Sprint 0 or Iteration 0 was the name given to these preparation activities needed before you actually started to deliver something at the end of the Sprint. It was a "special Sprint" because you often didn't deliver much at the end of it. Why did it need to be "special"? Alistair Cockburn and Ken Schwaber had the following to say about it:

Alistair Cockburn remarked: I have a sneaking feeling that someone was pressed about his use of Scrum when he did something that had no obvious business value at the start, and he invented "Oh, that was Sprint Zero!" to get the peasants with the pickaxes away from his doorstep ... and then others thought that was a great answer and started saying it, too ... and then it became part of the culture.
Ken Schwaber offered the following observation in reply: Exactly ... sprint 0 has become a phrase misused to describe the planning that occurs prior to the first sprint ... and since planning creates artifacts that often change, it should be minimized prior to the first sprint, and then occur every sprint at the sprint review/sprint planning meeting (just in time planning)

Read more details in the following post (from where the above comments are taken): Scrubbing Sprint Zero.
Comment: I'm upvoting this as essentially right, but would add that in well-formed Scrum implementations all of this "initial work" is really part of the initial Product Backlog and/or defined during the first Sprint Planning event. In my personal opinion, Sprint 0 is a political escape hatch for companies that still think of it as an extension of (or replacement for) traditional project chartering and initialization activities.
Answer: Iteration 0 is a bit of a misnomer. There is no such thing in Scrum and it is often abused. So let me first start with the bad, then how I've seen it used well.
The Bad
The problem is that in Scrum, the product is meant to be developed in increments with the result of each sprint being potentially releasable. Where this falls apart with an iteration 0 is when people use that time to do a large up-front design that the following sprints will slowly build out.
Where It Can Really Help
I know an agile coach who calls this a Hudson Bay start. For those readers who aren't Canadian, the Hudson Bay company used to run expeditions in colonial Canada. Before leaving on a long expedition, they would travel about a day out of their starting point, set up camp for a few days, and make sure all equipment and supplies were in good working order.
So applying this to Scrum, we would pick some product increment to build. I've worked with teams that use throw-away increments. The important thing is that they'll use the same environments and architecture as the real project. Then, in this first sprint, they will try to build something and "ship" it in the first sprint. Like the Hudson Bay expeditions, this drives out problems like permission errors, missing skills, license and plugin problems, etc.
Or?
Can you do an Iteration 0 and just focus on those same things that the Hudson Bay start brings out? Absolutely. The structure of the HBS just helps avoid dysfunction.
Also, you don't have to run an Iteration 0 at all if the team feels comfortable jumping in.
Answer: Iteration 0 is not a formal part of Scrum, but the best definition I have heard is:

Form the team and have sufficient work in your backlog for at least one sprint
Answer: Even if you are not doing Scrum, there is nothing special about an iteration 0...
In any Agile methodology, you deliver something of business value with each iteration - no matter how primitive.
This actually highlights both the benefits and weaknesses of Agile because it prioritizes delivery over planning - potentially at the expense of overall productivity...
In any methodology, there is always the trade-off between initial planning vs initial delivery: in a well-understood domain, planning up-front can result in a massive efficiency boost. Meanwhile, in a less well-understood domain, planning could be completely wasted due to unexpected events that derail everything.
Pure Agile prioritizes adaptivity & delivery over everything else, and treats each iteration as potentially the last. The result is that you will always get something of value from a project, but it may not be the best value for money - especially if you are operating in a complex domain that is well-understood by a well-known team.
In those situations, an Iterative development cycle based on an up-front planning and design phase will tend to deliver a much more efficient/effective level of productivity than pure agile!
The reason is that Agile relies on refactoring as a way to evolve the design - a design that is only intended to reflect the near-future, and not long-term goals (because In Agile, the long-term may not exist...).
Refactoring creates overhead due to re-work, and this re-work could be avoided in an iterative design/delivery plan that was optimized around a longer-term delivery approach that prioritized efficiency over regular delivery of features.
The relevance of this to Iteration 0 is that if you are doing pure Agile, you deliver something in iteration 0, even if you know it will bear no relationship to what is being delivered 6 months down the line!
The benefit of doing this is that you get to calibrate team productivity and velocity at a much earlier stage than you would otherwise, and in a high-risk domain, you can determine much earlier whether the project stands a chance of succeeding or failing.
Answer: To avoid repeating the above, I'll change it up.
If you didn't have a Sprint 0, what's in your first Sprint?
If that first sprint doesn't typically deliver value to the customer, then it's more than likely a Sprint 0.
No project ever magically happened to have CI/CD, Envirnoments, Infrastructure just simply... exist. Someone has to set it up right? And that takes time & effort.


Why is n log n dominated by n log^2 n?

Question: Does the rule of $n ^ a$ dominate $n ^ b$ if $a > b$ apply here as well?
My understanding is that $n \log n$ will be dominated by $n \log ^2 n$ because of $\log$ being raised to the power of $2$.
Comment: Can you please try and use [LaTeX/MathJax](https://cs.stackexchange.com/editing-help#latex) to present formulas?
Answer: little-oh proof
An equivalent but more straightforward question would be why $\lg n$ is dominated by $\lg^2 n$, that is why $\lg n \in o(\lg^2 n)$.
Then based on the definition of little-oh we need to show that for any choice of constant $ c > 0 $, we can find a constant $ n_0 $ such that the inequality $ \lg n < c \lg^2n $ holds for all $ n > n_0 $.
We prove that if we pick $ n_0 = \sqrt[c]{b} $ where $ b $ is the base of $ \lg $, then the definition above holds.
If $ n_0 = \sqrt[c]{b} $ then we have $ n > \sqrt[c]{b} $ or $ n > b^{\frac{1}{c}} $.  Now since $\lg n$ with a base $ b > 1 $ is an increasing function, then $ \lg n > \lg b^\frac{1}{c} $ or $ \lg n > \frac{1}{c} $.  If we multiply both sides by $ c > 0 $, we have $ c \lg n > 1 $.  Now we can multiply both sides by $ \lg n > 0$ (Note that for $ \lg n > 0 $ to be true, we must have $ n_0 \geqslant 1 $ which leads to $ \sqrt[c]{b} \geqslant 1 $ or $ b^\frac{1}{c} \geqslant 1$ which results in $ \lg b^{\frac{1}{c}} \geqslant \lg 1 $ or $ \frac{1}{c} \geqslant 0 $ or $ c > 0 $; which is already guaranteed.) to have
$$
 c \lg^2 n > \lg n .
$$
This is what we needed to show.

Big-Oh proof sketch
A slightly different but related question could be why $\lg n$ is bounded above by $\lg^2 n$, that is why $\lg n \in O(\lg^2 n)$.
The answer is that since $\lg n > 1$ for $n$ larger than the base of $\lg$, then if we raise $\lg n$ to any power greater than $1$ (including power of $2$), it will be larger than $\lg n$ itself.
(We could rather argue that since we proved that $ \lg n \in o( \lg^2 n) $, it follows from $ o(f) \subset O(f) $ that $ \lg n \in O( \lg^2 n) $.)

Note
So yes, the rule of $n^a > n^b$ if $a > b $ and $ n > 1 $ does apply here.  Note that this rule is equivalent to the statement that any exponential function with a base greater than $1$ is an increasing function.
Comment: (I seem to remember $f(n) \in o(g(n))$ for *dominated*, $f(n) \in O(g(n))$ for *bounded above*.)
Comment: Consider that $O(f) \supset o(f)$.
Comment: @greybeard I updated my answer.
Answer: Assume $O(n \log n) = O(n \log ^2 n)$. This implies that for any function $f(n) \in O(n \log ^2 n)$, there exist a positive constant $k$ and a constant $n'$ such that $f(n) < k (n \log n)$ for all $n \geq n'$.
Take $f(n) = n \log ^2 n$. Clearly $f(n) \in O(n \log ^2 n)$.
So we have that there exists a value for $k$ and $n_0$ such that $n \log ^2 n < k (n \log n)$ for all $n \geq n'$.
Noting that $n \log ^2 n = n \log n \log n$, we arrive at a contradiction: whatever constant value we choose for $k$, there exists a value $n'$ such that $\log n > k$ for all $n \geq n'$.

In simpler terms, were $O(n \log n)$ to be the same as $O(n \log ^2 n)$, it would mean that $n \log ^2 n$ does not grow faster than some constant factor of $n \log n$. But this is obviously not correct as $n \log ^2 n$ grows at a rate of $\log n$ times $n \log n$ (and $\log n$ grows faster than a constant).

Why is n log n dominated by n log^2 n?