Question: The scipy integrators take two parameters when integrating: (1) `step` which tells the integrator to take only a single step, and (2) `relax` which tells the integrator that it is fine to step past the final time point.

I want to take steps (so that I can collect the entire solution), but also not step past the final time (because I have a discontinuity in my real problem). However, `step` being `True` seems to ignore `relax` being `False`. It will take one step over the final time with abandon.

Here is a simple example illustrating the problem:

```
from scipy.integrate import ode

obj = ode(lambda t, y: -y)  # Simple exponential decay
obj.set_initial_value(4.0)

final_time = 2.0

ts_new = []
ys_new = []

# Take one step at a time until the final time is reached
while obj.t < final_time:
    y_new = obj.integrate(final_time, step=True, relax=False)

    ts_new.append(obj.t)
    ys_new.append(y_new)

print(ts_new[-1])  # 2.073628416585726

```

I would have expected the last step to be a partial step (is that what it's called?) and stop exactly on `final_time`, such as the value given by `obj.integrate(final_time, step=False, relax=False)`. Other than rerunning the entire ODE, is there a way to get the last point? I would be fine with setting `step` to `False` just before the last step, but I see no way to know if it will step over the final time until it does.

Answer: 
This will give you an array of the values you want:

```
var r = window.location.href.split("?");
r.shift();
console.log(r);

```

If there are always exactly two values, you can use this to extract them:

```
var val1 = r.shift();
var val2 = r.shift();

```

Here's a version which gives the `.chicken` result:

```
var r = window.location.href.split("?");
r[0]='';
var totalval = r.join('.');

```
I'd suggest:

```
// obviously, in production you should use document.location.href:
var url = "http://www.example.com/?chicken?toast",

// take a substring of the url variable, starting at the index of
// the (first) '?' character and running to the end of the string,
// giving "?chicken?toast", we then split that resultant string
// on the '?' characters, and filter the resulting array using
// filter(Boolean), which retains only the true/truthy array-elements:
    values = url.substring(url.indexOf('?')).split('?').filter(Boolean);
console.log(values);

```

```js
var url = "http://www.example.com/?chicken?toast",
    values = url.substring(url.indexOf('?')).split('?').filter(Boolean);
console.log(values);
```

You could, instead, use `document.location.search` to retrieve the substring from the first `'?'` onwards (if using `document.location.href`).

References:

* [`Array.prototype.filter()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
* [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
* [`String.prototype.split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split).
* [`String.prototype.substring()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring).