622 S.E.2d 638 (2005)
Karen Ann BLANKENSHIP and Mike Thompson, Plaintiffs,
v.
TOWN AND COUNTRY FORD, INC., Defendant.
No. COA04-702.
Court of Appeals of North Carolina.
December 6, 2005.
*640 David Q. Burgess, Charlotte, for plaintiff-appellee.
Parker Poe Adams & Bernstein, L.L.P., by Michael S. Malloy and William L. Esser, IV, Charlotte, for defendant-appellant.
*639 HUDSON, Judge.
In April 2001, plaintiffs brought suit against defendant for claims arising from defendant's failure to disclose prior damage to a used car defendant sold to plaintiffs. Upon plaintiffs' motion, the trial court entered default judgment against defendant in August 2001 and awarded trebled compensatory damages and attorney fees to plaintiffs. This Court entered an opinion on 31 December 2002, which affirmed in part and reversed in part. Blankenship v. Town and Country Ford, 155 N.C.App. 161, 574 S.E.2d 132 (2002), disc. rev. denied, 357 N.C. 61, 579 S.E.2d 384 (2003) (Blankenship I). The trial court heard the remanded case on 2 September 2003 and entered judgment on 3 October 2003, finding that defendant's conduct did violate the statutes in question and again awarding trebled compensatory damages and attorney fees. Defendant appeals. For the reasons discussed below, we affirm in part, and vacate and remand in part.
The evidence tends to show that on 1 March 2000, defendant bought a used 1999 Chevrolet Cavalier (the vehicle) at an auto auction. Defendant then sold the vehicle to plaintiff Blankenship for $12,566 "as is." Defendant provided a "Damage Disclosure Statement" as required by North Carolina law and answered "no" to the question of whether the vehicle had "been damaged by collision or other occurrence to the extent that damages exceed 25% of its value at the time of the collision or other occurrence." After purchase, plaintiffs began to experience numerous problems with the vehicle, including a popping sound coming from the right front during left turns, a "right pull" during left turns, a radiator leak, water leaking into the trunk, and a door that was difficult to open. In February 2001, plaintiff Thompson took the vehicle to Spruill Chevrolet-General Motors, where the technician documented "physical damage to rear of car  bondo [a patching material] in side trunk," and "physical damage to front of car, fenders, bolts loose, etc."
Plaintiffs filed a complaint against defendant on 5 April 2001. Plaintiffs alleged that defendant violated the Motor Vehicle Act, N.C. Gen.Stat. § 20-71.4, by failing to disclose that the vehicle sustained damage in a collision in excess of 25% of its value; that such failure to disclose constituted an unfair and deceptive trade practice in violation of N.C. Gen.Stat. § 75-1.1; and that defendant's failure to disclose was committed with "intent to defraud," thus giving rise to a claim under N.C. Gen.Stat. § 20-348(a). Defendant failed to respond to plaintiffs' complaint and default judgment was entered on 6 August 2001, for $55,281, which consisted of damages trebled under §§ 75-16 and 20-348(a), plus attorney fees. As discussed, this Court then remanded the case after defendant's first appeal. On remand, the trial court limited the evidence on remand to the issue of damages, as it concluded that defendant had admitted liability with the entry of default judgment. It heard evidence from experts for both parties regarding the value of the car and the amount of damages. The trial court found that defendant's conduct violated both statutes and again awarded trebled damages and attorney fees, totaling $79,983.
In its brief, defendant first contends that the trial court erred by refusing to allow it a hearing regarding whether its conduct violated the various statutes. Defendant next contends that the trial court erred in finding that defendant admitted the allegations of plaintiffs' complaint as a result of the entry of default judgment. We disagree with both arguments and address defendant's second argument first.
When default is entered due to defendant's failure to answer, as here, "the substantive allegations raised by plaintiff's complaint are no longer in issue, and, for the purposes of entry of default and default judgment, are deemed admitted." Bell v. Martin, 299 N.C. 715, 721, 264 S.E.2d 101, 105 (1980) (internal citation omitted). Here, on remand, the trial court adopted plaintiffs' complaint by reference and made it part of *641 the findings of fact, "word for word." Findings of fact made by the trial court upon a motion to set aside a judgment by default are binding on appeal if supported by any competent evidence. Kirby v. Asheville Contracting Co., 11 N.C.App. 128, 132, 180 S.E.2d 407, 410, cert. denied, 278 N.C. 701, 181 S.E.2d 602 (1971); Norton v. Sawyer, 30 N.C.App. 420, 422, 227 S.E.2d 148, 151, disc. review denied, 291 N.C. 176, 229 S.E.2d 689 (1976).
Defendant contends that the trial court's adoption of plaintiffs' complaint was improper because the complaint was based upon information and belief and only "well-pled factual allegations" are admitted by default. However, defendant cites no North Carolina law in support of this argument. Although defendant cites cases from other jurisdictions, our research reveals no North Carolina statutes or caselaw which preclude a trial court from entering default where the allegations are based upon information and belief. Furthermore, in addition to the plaintiffs' complaint, the plaintiffs submitted sworn affidavits, and the trial court heard evidence on remand from experts on both sides regarding the damage to the vehicle. We conclude that the trial court's findings of fact are supported by competent evidence.
Defendant also asserts that the trial court "refused to permit a hearing" and did not comply with the mandate of this Court because it denied defendant's request for discovery and its attempts to introduce certain evidence. We disagree. This Court stated:
[W]e remand this case to the trial court for a determination and findings as to whether defendant's conduct amounts to an unfair and deceptive trade practice under N.C. Gen.Stat. § 75-1.1 and a violation of N.C. Gen.Stat. § 20-71.4, as well as an intent to defraud under N.C. Gen.Stat. § 20-348(a)(1). On remand, plaintiffs and defendant may present evidence on issues relating to damages under the applicable statutes.
Blankenship I, 155 N.C.App. at 168, 574 S.E.2d at 136. On remand, defendant requested discovery and plaintiffs filed a protective order in response. The trial court allowed discovery "solely on the issues of whether Defendant's conduct amounts to an unfair or deceptive trade practice under N.C. Gen.Stat. § 75-1.1 and a violation of N.C. Gen.Stat. § 20-71.4 with intent to defraud under N.C. Gen.Stat. § 20-348(a)(1)."
"It is a general rule that orders regarding matters of discovery are within the discretion of the trial court and will not be upset on appeal absent a showing of abuse of discretion." Hudson v. Hudson, 34 N.C.App. 144, 145, 237 S.E.2d 479, 480, disc. review denied, 293 N.C. 589, 239 S.E.2d 264-65 (1977) (internal citation omitted). Rule 26(b)(1) of the Rules of Civil Procedure provides that a party "may obtain discovery regarding any matter, not privileged, which is relevant to the subject matter involved in the pending action, whether it relates to the claim or defense of the party seeking discovery or to the claim or defense of any other party[.]" N.C. Gen.Stat. § 1A-1, Rule 26(b)(1) (2003). As discussed, after an entry of default against a defendant, he or she "is deemed to have admitted the allegations in plaintiff's complaint, and is prohibited from defending on the merits of the case." Spartan Leasing Inc. v. Pollard, 101 N.C.App. 450, 460, 400 S.E.2d 476, 482 (1991) (citing N.C. Gen.Stat. § 1A-1, Rule 8(d)) (internal citation omitted). We conclude that the trial court did not abuse its discretion in limiting discovery.
Defendant also contends that the trial court erred by refusing to allow it to present evidence regarding whether its conduct violated the statutes at issue, but was only allowed to introduce evidence regarding compensatory damages. The trial court stated that the hearing would be limited to evidence regarding damages, as the issue of liability had already been decided. We remanded for findings of fact regarding whether defendant's conduct violated the statutes. On remand, the trial court made such findings, based on the plaintiffs' allegations which were deemed admitted upon defendant's default, as discussed above. As discussed, the trial court's findings of fact here are binding on appeal if supported by any competent evidence. Our review of the record, specifically *642 the affidavits of plaintiffs in support of their motion for judgment by default, as well as the evidence introduced at the hearing on remand, indicate competent evidence supports the trial court's findings of fact. Thus, these findings are conclusive on appeal.
We conclude that the trial court was not required to take further evidence on these matters. Indeed, this Court explicitly stated that on remand the parties could present evidence regarding damages, which is what the court did. Furthermore, in their argument regarding the exclusion of evidence, defendant fails to show prejudice. In a civil case such as this
not every erroneous ruling on the admissibility of evidence ... will result in a new trial. The moving party has the burden to show not only that the trial court erred, but also to show that he or she was prejudiced and that a different result would have likely resulted had the error not have occurred.
Bowers v. Olf, 122 N.C.App. 421, 427, 470 S.E.2d 346, 350 (1996) (ellipses in original) (internal citations and quotation marks omitted). Defendant has shown no prejudice.
Defendant also contends that the trial court erred in awarding plaintiffs treble damages under both N.C. Gen.Stat. § 20-348(a) and again under Chapter 75. We agree. In Blankenship I, this Court remanded to the trial court for findings of fact so that this Court could determine whether damages were appropriate under the applicable statutes but did not decide whether multiple awards of treble damages were permissible. Now that the trial court has made findings of fact that defendant's conduct violated both statutes, we must address whether plaintiffs may recover damages under both statutes.
Defendant argues that the trial court awarded damages to plaintiffs twice for the same wrong and that plaintiffs are not entitled to "double recovery." In United Laboratories v. Kuykendall, the North Carolina Supreme Court held that pursuant to the doctrine of election of remedies, a party may not recover twice based on the same conduct. 335 N.C. 183, 191, 437 S.E.2d 374, 379 (1993).
Where the same source of conduct gives rise to a traditionally recognized cause of action, as, for example, an action for breach of contract, and as well gives rise to a cause of action for violation of G.S. 75-1.1, damages may be recovered either for the breach of contract, or for violation of G.S. 75-1.1, but not for both.
Id. (internal citation omitted). Although Kuykendall involved a common law and a Chapter 75 claim, our Supreme Court has also held that in a case involving a statutory violation and an unfair and deceptive trade practice claim plaintiff faces an election of remedies for recovery based upon the same conduct or transaction. Stanley v. Moore, 339 N.C. 717, 724, 454 S.E.2d 225, 229 (1995). Here, the Court's conclusions of law reveal that the Court awarded damages and treble damages for the same conduct:
[Defendant] failed to disclose in writing to the Plaintiffs before the time of transfer that the automobile had been involved in a collision or occurrence involving the vehicle resulting in twenty-five percent (25%) of its fair market value.
The court then concluded that this conduct violated N.C. Gen.Stat. § 20-71.4(a) and also N.C. Gen.Stat. § 75.1.1 and awarded treble damages pursuant to each statute.
Plaintiffs argue that Wilson v. Sutton, 124 N.C.App. 170, 476 S.E.2d 467 (1996), and Washburn v. Vandiver, 93 N.C.App. 657, 379 S.E.2d 65 (1989), control here. However, we conclude that neither case controls. In Wilson, the Court addressed whether the trial court erred in denying defendant's motion for judgment notwithstanding the verdict, not whether the trial court's awards of treble damages were permissible. Id. In Washburn, the Court upheld multiple awards based on N.C. Gen.Stat. § 20-348, which specifically authorized state statutory remedies in addition to federal odometer law remedies. 93 N.C.App. at 663, 379 S.E.2d at 69. Here, the applicable statutes contain no similar language authorizing multiple recoveries. We conclude that plaintiffs were required to elect between the two remedies and we therefore vacate this portion of the trial court's order and remand for the plaintiffs to elect between the two awards.
Defendant also contends that the trial court erred in refusing to offset the value plaintiffs received from use of the vehicle *643 against the award of damages. As this is a matter of law, we review this contention de novo. At the time of the hearing, plaintiffs had driven the vehicle 87,000 miles since their purchase. The trial court calculated damages by calculating the difference between the amount paid and the vehicle's actual value, but did not offset the amount by the plaintiffs' use. Defendant cites Taylor v. Volvo North America Corp. in support of its argument that the court was required to offset for use. 339 N.C. 238, 451 S.E.2d 618 (1994). However, we read Taylor as supporting the actions of the trial court here. We note that Taylor involved the Warranties Act, N.C. Gen.Stat. § 20-351, and a leased car, rather than Chapter 75 and an owned vehicle, as here. Id. But Taylor did address the calculation of damages, holding that any benefit received must be deducted before trebling damages. Id. at 261, 451 S.E.2d at 631. And, in Taylor, the Court held that the benefit received was usage, as the car was leased. Id. However, the Court noted that in a case where the car is owned, the benefit is the value of the car. Id. (citing Washburn). Thus, under Taylor, the trial court calculated damages correctly here.
Finally, defendant argues that the trial court erred in awarding unreasonable attorney fees. The trial court here awarded attorney fees to plaintiff pursuant to N.C. Gen.Stat. §§ 20-348(a)(2) and 75-16.1 Under N.C. Gen.Stat. § 75-16.1, a prevailing party may recover a reasonable attorney fee upon a finding by the trial court that "the party charged with the violation has willfully engaged in the act or practice, and there was an unwarranted refusal by such party to fully resolve the matter which constitutes the basis of such suit...." N.C. Gen.Stat. § 75-16.1; Barbee v. Atlantic Marine Sales & Serv., 115 N.C.App. 641, 648, 446 S.E.2d 117, 121, disc. review denied, 337 N.C. 689, 448 S.E.2d 516 (1994). The decision whether or not to award attorney fees under section 75-16.1 rests within the sole discretion of the trial judge. Barbee at 648, 446 S.E.2d at 121. And if fees are awarded, the amount also rests within the discretion of the trial court and we review such awards for abuse of discretion. Shumaker v. Shumaker, 137 N.C.App. 72, 78, 527 S.E.2d 55, 59 (2000). However, when awarding fees pursuant to N.C. Gen.Stat. § 75-16.1, the court must make specific findings of fact that the actions of the party charged with violating Chapter 75 were willful, that it refused to resolve the matter fully, and that the attorney fee was reasonable. Barbee at 648, 446 S.E.2d at 121-22. Here, the court made such findings. On appeal, the record must also contain findings regarding the attorney fees, such as: "findings regarding the time and labor expended, the skill required to perform the services rendered, the customary fee for like work, and the experience and ability of the attorney." Id. (internal citations omitted). Our review of the record reveals that the trial court made the requisite findings and we conclude that it did not abuse its discretion.
Affirmed in part.
Vacated and remanded in part.
Judges WYNN and STEELMAN concur.


Always in my frigE

the best feedback you have received from someone who has followed your Clean Keto plan

“A million thanks Karissa. You’ve delivered so much more than you promised. I now do have food freedom after a lifetime full of emotional eating. I feel so much better it’s not funny. The weight is melting off me but that’s just one of the plethora of benefits that you have provided me. You are brilliant at what you do. My biggest gain is that everything is easier, I move easier, meal prep is easier, my life is easier. Thank you again.”

Favorite nonstarchy vegetables.

Spinach—it is so versatile! Use it as base for a salad, throw some into a keto smoothie, or sauté it in oil and garlic for an amazing side dish!

Asparagus—I just love the taste and it is so easy to make!

And of course—cauliflower! It can be transformed into pizza, rice, and mashed so resemble potatoes! It also tastes great on its own roasted in the oven!

pre-packaged food that is always in my kitchen.

BPA free cans of full-fat coconut milk.

Ghee—it is creamy delicious clarified butter. I have all the Fourth & Heart flavors (vanilla, pink Himalayan salt, roasted garlic and even truffle!!)

Frozen veggies—broccoli, cauliflower, green beans

Gut-healing bone broth—I always make big batches of bone broth and store the extra in the freezer

Three Favorite Keto Recipes.

A classic Cobb salad with my homemade keto ranch dressing!

Cauliflower Mash—I add horseradish to mine version to give it a kick of flavor.


import io
import os
import sys

import pytest

import urllib.request as urllib_request

import numpy as np

import asdf
from asdf import util
from asdf import generic_io
from asdf.asdf import is_asdf_file

from . import helpers, create_small_tree, create_large_tree

@pytest.fixture(params=[create_small_tree, create_large_tree])
def tree(request):
    return request.param()

def _roundtrip(tree, get_write_fd, get_read_fd,
               write_options={}, read_options={}):

    # Since we're testing with small arrays, force all arrays to be stored
    # in internal blocks rather than letting some of them be automatically put
    # inline.
    write_options.setdefault('all_array_storage', 'internal')

    with get_write_fd() as fd:
        asdf.AsdfFile(tree).write_to(fd, **write_options)
        # Work around the fact that generic_io's get_file doesn't have a way of
        # determining whether or not the underlying file handle should be
        # closed as part of the exit handler
        if isinstance(fd._fd, io.FileIO):
            fd._fd.close()

    with get_read_fd() as fd:
        ff = asdf.open(fd, **read_options)
        helpers.assert_tree_match(tree, ff.tree)

    return ff

def test_mode_fail(tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    with pytest.raises(ValueError):
        generic_io.get_file(path, mode="r+")

def test_open(tmpdir, small_tree):
    from .. import open

    path = os.path.join(str(tmpdir), 'test.asdf')

    # Simply tests the high-level "open" function
    ff = asdf.AsdfFile(small_tree)
    ff.write_to(path)
    with open(path) as ff2:
        helpers.assert_tree_match(ff2.tree, ff.tree)

def test_path(tree, tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    def get_write_fd():
        f = generic_io.get_file(path, mode='w')
        assert isinstance(f, generic_io.RealFile)
        assert f._uri == util.filepath_to_url(path)
        return f

    def get_read_fd():
        # Must open with mode=rw in order to get memmapped data
        f = generic_io.get_file(path, mode='rw')
        assert isinstance(f, generic_io.RealFile)
        assert f._uri == util.filepath_to_url(path)
        # This is to check for a "feature" in Python 3.x that reading zero
        # bytes from a socket causes it to stop.  We have code in generic_io.py
        # to workaround it.
        f.read(0)
        return f

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 2
        next(ff.blocks.internal_blocks).data
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)

def test_open2(tree, tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    def get_write_fd():
        f = generic_io.get_file(open(path, 'wb'), mode='w', close=True)
        assert isinstance(f, generic_io.RealFile)
        assert f._uri == util.filepath_to_url(path)
        return f

    def get_read_fd():
        # Must open with mode=rw in order to get memmapped data
        f = generic_io.get_file(open(path, 'r+b'), mode='rw', close=True)
        assert isinstance(f, generic_io.RealFile)
        assert f._uri == util.filepath_to_url(path)
        return f

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 2
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)

def test_open_fail(tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    with open(path, 'w') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, mode='w')

def test_open_fail2(tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    with io.open(path, 'w') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, mode='w')

def test_open_fail3(tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    with open(path, 'w') as fd:
        fd.write("\n\n\n")

    with open(path, 'r') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, mode='r')

def test_open_fail4(tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    with open(path, 'w') as fd:
        fd.write("\n\n\n")

    with io.open(path, 'r') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, mode='r')

def test_io_open(tree, tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    def get_write_fd():
        f = generic_io.get_file(io.open(path, 'wb'), mode='w', close=True)
        assert isinstance(f, generic_io.RealFile)
        assert f._uri == util.filepath_to_url(path)
        return f

    def get_read_fd():
        f = generic_io.get_file(io.open(path, 'r+b'), mode='rw', close=True)
        assert isinstance(f, generic_io.RealFile)
        assert f._uri == util.filepath_to_url(path)
        return f

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 2
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)
        ff.tree['science_data'][0] = 42

def test_close_underlying(tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    with generic_io.get_file(open(path, 'wb'), mode='w', close=True) as ff:
        pass

    assert ff.is_closed() == True
    assert ff._fd.closed == True

    with generic_io.get_file(open(path, 'rb'), close=True) as ff2:
        pass

    assert ff2.is_closed() == True
    assert ff2._fd.closed == True

def test_bytes_io(tree):
    buff = io.BytesIO()

    def get_write_fd():
        f = generic_io.get_file(buff, mode='w')
        assert isinstance(f, generic_io.MemoryIO)
        return f

    def get_read_fd():
        buff.seek(0)
        f = generic_io.get_file(buff, mode='rw')
        assert isinstance(f, generic_io.MemoryIO)
        return f

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 2
        assert not isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.ndarray)
        ff.tree['science_data'][0] = 42

def test_streams(tree):
    buff = io.BytesIO()

    def get_write_fd():
        return generic_io.OutputStream(buff)

    def get_read_fd():
        buff.seek(0)
        return generic_io.InputStream(buff, 'rw')

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(ff.blocks) == 2
        assert not isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.ndarray)
        ff.tree['science_data'][0] = 42

def test_streams2():
    buff = io.BytesIO(b'\0' * 60)
    buff.seek(0)

    fd = generic_io.InputStream(buff, 'r')

    x = fd._peek(10)
    x = fd.read()
    assert len(x) == 60

@pytest.mark.remote_data
def test_urlopen(tree, httpserver):
    path = os.path.join(httpserver.tmpdir, 'test.asdf')

    def get_write_fd():
        return generic_io.get_file(open(path, 'wb'), mode='w')

    def get_read_fd():
        return generic_io.get_file(
            urllib_request.urlopen(
                httpserver.url + "test.asdf"))

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 2
        assert not isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.ndarray)

@pytest.mark.remote_data
def test_http_connection(tree, httpserver):
    path = os.path.join(httpserver.tmpdir, 'test.asdf')

    def get_write_fd():
        return generic_io.get_file(open(path, 'wb'), mode='w')

    def get_read_fd():
        fd = generic_io.get_file(httpserver.url + "test.asdf")
        assert isinstance(fd, generic_io.InputStream)
        # This is to check for a "feature" in Python 3.x that reading zero
        # bytes from a socket causes it to stop.  We have code in generic_io.py
        # to workaround it.
        fd.read(0)
        return fd

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 2
        assert not isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.ndarray)
        ff.tree['science_data'][0] == 42

@pytest.mark.remote_data
def test_http_connection_range(tree, rhttpserver):
    path = os.path.join(rhttpserver.tmpdir, 'test.asdf')
    connection = [None]

    def get_write_fd():
        return generic_io.get_file(open(path, 'wb'), mode='w')

    def get_read_fd():
        fd = generic_io.get_file(rhttpserver.url + "test.asdf")
        assert isinstance(fd, generic_io.HTTPConnection)
        connection[0] = fd
        return fd

    with _roundtrip(tree, get_write_fd, get_read_fd) as ff:
        if len(tree) == 4:
            assert connection[0]._nreads == 0
        else:
            assert connection[0]._nreads == 6

        assert len(list(ff.blocks.internal_blocks)) == 2
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.core.memmap)
        assert isinstance(next(ff.blocks.internal_blocks)._data, np.ndarray)
        ff.tree['science_data'][0] == 42

def test_exploded_filesystem(tree, tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    def get_write_fd():
        return generic_io.get_file(path, mode='w')

    def get_read_fd():
        return generic_io.get_file(path, mode='r')

    with _roundtrip(tree, get_write_fd, get_read_fd,
                    write_options={'all_array_storage': 'external'}) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 0
        assert len(list(ff.blocks.external_blocks)) == 2

def test_exploded_filesystem_fail(tree, tmpdir):
    path = os.path.join(str(tmpdir), 'test.asdf')

    def get_write_fd():
        return generic_io.get_file(path, mode='w')

    def get_read_fd():
        fd = io.BytesIO()
        with open(path, mode='rb') as fd2:
            fd.write(fd2.read())
        fd.seek(0)
        return fd

    with get_write_fd() as fd:
        asdf.AsdfFile(tree).write_to(fd, all_array_storage='external')

    with get_read_fd() as fd:
        with asdf.open(fd) as ff:
            with pytest.raises(ValueError):
                helpers.assert_tree_match(tree, ff.tree)

@pytest.mark.remote_data
def test_exploded_http(tree, httpserver):
    path = os.path.join(httpserver.tmpdir, 'test.asdf')

    def get_write_fd():
        return generic_io.get_file(path, mode='w')

    def get_read_fd():
        return generic_io.get_file(httpserver.url + "test.asdf")

    with _roundtrip(tree, get_write_fd, get_read_fd,
                    write_options={'all_array_storage': 'external'}) as ff:
        assert len(list(ff.blocks.internal_blocks)) == 0
        assert len(list(ff.blocks.external_blocks)) == 2

def test_exploded_stream_write(small_tree):
    # Writing an exploded file to an output stream should fail, since
    # we can't write "files" alongside it.

    ff = asdf.AsdfFile(small_tree)

    with pytest.raises(ValueError):
        ff.write_to(io.BytesIO(), all_array_storage='external')

def test_exploded_stream_read(tmpdir, small_tree):
    # Reading from an exploded input file should fail, but only once
    # the data block is accessed.  This behavior is important so that
    # the tree can still be accessed even if the data is missing.

    path = os.path.join(str(tmpdir), 'test.asdf')

    ff = asdf.AsdfFile(small_tree)
    ff.write_to(path, all_array_storage='external')

    with open(path, 'rb') as fd:
        # This should work, so we can get the tree content
        x = generic_io.InputStream(fd, 'r')
        with asdf.open(x) as ff:
            # It's only when trying to access external data that an error occurs
            with pytest.raises(ValueError):
                ff.tree['science_data'][:]

def test_unicode_open(tmpdir, small_tree):
    path = os.path.join(str(tmpdir), 'test.asdf')

    ff = asdf.AsdfFile(small_tree)

    ff.write_to(path)

    with io.open(path, 'rt', encoding="utf-8") as fd:
        with pytest.raises(ValueError):
            with asdf.open(fd):
                pass

def test_invalid_obj(tmpdir):
    with pytest.raises(ValueError):
        generic_io.get_file(42)

    path = os.path.join(str(tmpdir), 'test.asdf')
    with generic_io.get_file(path, 'w') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, 'r')

    with pytest.raises(ValueError):
        generic_io.get_file("http://www.google.com", "w")

    with pytest.raises(TypeError):
        generic_io.get_file(io.StringIO())

    with open(path, 'rb') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, 'w')

    with io.open(path, 'rb') as fd:
        with pytest.raises(ValueError):
            generic_io.get_file(fd, 'w')

    with generic_io.get_file(sys.__stdout__, 'w'):
        pass

def test_nonseekable_file(tmpdir):
    base = io.IOBase

    class FileWrapper(base):
        def tell(self):
            raise IOError()

        def seekable(self):
            return False

        def readable(self):
            return True

        def writable(self):
            return True

    with FileWrapper(os.path.join(str(tmpdir), 'test.asdf'), 'wb') as fd:
        assert isinstance(generic_io.get_file(fd, 'w'), generic_io.OutputStream)
        with pytest.raises(ValueError):
            generic_io.get_file(fd, 'rw')

    with FileWrapper(os.path.join(str(tmpdir), 'test.asdf'), 'rb') as fd:
        assert isinstance(generic_io.get_file(fd, 'r'), generic_io.InputStream)

def test_relative_uri():
    assert generic_io.relative_uri(
        'http://www.google.com', 'file://local') == 'file://local'

@pytest.mark.parametrize("protocol", ["http", "asdf"])
def test_resolve_uri(protocol):
    """
    Confirm that the patched urllib.parse is handling
    asdf:// URIs correctly.
    """
    assert generic_io.resolve_uri(
        '{}://somewhere.org/some-schema'.format(protocol), '#/definitions/foo'
    ) == '{}://somewhere.org/some-schema#/definitions/foo'.format(protocol)

    assert generic_io.resolve_uri(
        '{}://somewhere.org/path/to/some-schema'.format(protocol),
        '../../some/other/path/to/some-other-schema'
    ) == '{}://somewhere.org/some/other/path/to/some-other-schema'.format(protocol)

def test_arbitrary_file_object():
    class Wrapper:
        def __init__(self, init):
            self._fd = init

    class Random:
        def seek(self, *args):
            return self._fd.seek(*args)

        def tell(self, *args):
            return self._fd.tell(*args)

    class Reader(Wrapper):
        def read(self, *args):
            return self._fd.read(*args)

    class RandomReader(Reader, Random):
        pass

    class Writer(Wrapper):
        def write(self, *args):
            return self._fd.write(*args)

    class RandomWriter(Writer, Random):
        pass

    class All(Reader, Writer, Random):
        pass

    buff = io.BytesIO()
    assert isinstance(
        generic_io.get_file(Reader(buff), 'r'), generic_io.InputStream)
    assert isinstance(
        generic_io.get_file(Writer(buff), 'w'), generic_io.OutputStream)
    assert isinstance(
        generic_io.get_file(RandomReader(buff), 'r'), generic_io.MemoryIO)
    assert isinstance(
        generic_io.get_file(RandomWriter(buff), 'w'), generic_io.MemoryIO)
    assert isinstance(
        generic_io.get_file(All(buff), 'rw'), generic_io.MemoryIO)
    assert isinstance(
        generic_io.get_file(All(buff), 'r'), generic_io.MemoryIO)
    assert isinstance(
        generic_io.get_file(All(buff), 'w'), generic_io.MemoryIO)

    with pytest.raises(ValueError):
        generic_io.get_file(Reader(buff), 'w')

    with pytest.raises(ValueError):
        generic_io.get_file(Writer(buff), 'r')

def test_check_bytes(tmpdir):
    with io.open(os.path.join(str(tmpdir), 'test.asdf'), 'w', encoding='utf-8') as fd:
        assert generic_io._check_bytes(fd, 'r') is False
        assert generic_io._check_bytes(fd, 'rw') is False
        assert generic_io._check_bytes(fd, 'w') is False

    with io.open(os.path.join(str(tmpdir), 'test.asdf'), 'wb') as fd:
        assert generic_io._check_bytes(fd, 'r') is True
        assert generic_io._check_bytes(fd, 'rw') is True
        assert generic_io._check_bytes(fd, 'w') is True

def test_truncated_reader():
    """
    Tests several edge cases for _TruncatedReader.read()

    Includes regression test for
    https://github.com/asdf-format/asdf/pull/181
    """

    # TODO: Should probably break this up into multiple test cases

    fd = generic_io.RandomAccessFile(io.BytesIO(), 'rw')
    content = b'a' * 100 + b'b'
    fd.write(content)
    fd.seek(0)

    # Simple cases where the delimiter is not found at all
    tr = generic_io._TruncatedReader(fd, b'x', 1)
    with pytest.raises(ValueError):
        tr.read()

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'x', 1)
    assert tr.read(100) == content[:100]
    assert tr.read(1) == content[100:]
    with pytest.raises(ValueError):
        tr.read()

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'x', 1, exception=False)
    assert tr.read() == content

    # No delimiter but with 'initial_content'
    init = b'abcd'
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'x', 1, initial_content=init,
                                     exception=False)
    assert tr.read(100) == (init + content)[:100]
    assert tr.read() == (init + content)[100:]

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'x', 1, initial_content=init,
                                     exception=False)
    assert tr.read() == init + content

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'x', 1, initial_content=init,
                                     exception=False)
    assert tr.read(2) == init[:2]
    assert tr.read() == init[2:] + content

    # Some tests of a single character delimiter
    # Add some trailing data after the delimiter
    fd.seek(0, 2)
    fd.write(b'ffff')

    # Delimiter not included in read
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'b', 1)
    assert tr.read(100) == content[:100]
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'b', 1)
    assert tr.read() == content[:100]

    # Delimiter included
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'b', 1, include=True)
    assert tr.read() == content[:101]
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'b', 1, include=True)
    assert tr.read(101) == content[:101]
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'b', 1, include=True)
    assert tr.read(102) == content[:101]
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, b'b', 1, include=True)
    assert tr.read(100) == content[:100]
    assert tr.read(1) == content[100:101]
    assert tr.read() == b''

    # Longer delimiter with variable length
    content = b'a' * 100 + b'\n...\n' + b'ffffff'
    delimiter = br'\r?\n\.\.\.((\r?\n)|$)'
    readahead = 7

    fd = generic_io.RandomAccessFile(io.BytesIO(), 'rw')
    fd.write(content)

    # Delimiter not included in read
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead)
    assert tr.read() == content[:100]
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead)
    assert tr.read(100) == content[:100]
    assert tr.read() == b''

    # (read just up to the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead)
    assert tr.read(99) == content[:99]
    assert tr.read() == content[99:100]
    assert tr.read() == b''

    # (read partway into the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead)
    assert tr.read(99) == content[:99]
    assert tr.read(2) == content[99:100]
    assert tr.read() == b''

    # (read well past the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead)
    assert tr.read(99) == content[:99]
    assert tr.read(50) == content[99:100]
    assert tr.read() == b''

    # Same as the previous set of tests, but including the delimiter
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True)
    assert tr.read() == content[:105]
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True)
    assert tr.read(105) == content[:105]
    assert tr.read() == b''

    # (read just up to the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True)
    assert tr.read(99) == content[:99]
    assert tr.read() == content[99:105]
    assert tr.read() == b''

    # (read partway into the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True)
    assert tr.read(99) == content[:99]
    assert tr.read(2) == content[99:101]
    assert tr.read() == content[101:105]
    assert tr.read() == b''

    # (read well past the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True)
    assert tr.read(99) == content[:99]
    assert tr.read(50) == content[99:105]
    assert tr.read() == b''

    # Same sequence of tests but with some 'initial_content'
    init = b'abcd'

    # Delimiter not included in read
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead,
                                     initial_content=init)
    assert tr.read() == (init + content[:100])
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead,
                                     initial_content=init)
    assert tr.read(100) == (init + content[:96])
    assert tr.read() == content[96:100]
    assert tr.read() == b''

    # (read just up to the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead,
                                     initial_content=init)
    assert tr.read(99) == (init + content[:95])
    assert tr.read() == content[95:100]
    assert tr.read() == b''

    # (read partway into the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead,
                                     initial_content=init)
    assert tr.read(99) == (init + content[:95])
    assert tr.read(6) == content[95:100]
    assert tr.read() == b''

    # (read well past the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead,
                                     initial_content=init)
    assert tr.read(99) == (init + content[:95])
    assert tr.read(50) == content[95:100]
    assert tr.read() == b''

    # Same as the previous set of tests, but including the delimiter
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True,
                                     initial_content=init)
    assert tr.read() == (init + content[:105])
    assert tr.read() == b''

    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True,
                                     initial_content=init)
    assert tr.read(105) == (init + content[:101])
    assert tr.read() == content[101:105]
    assert tr.read() == b''

    # (read just up to the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True,
                                     initial_content=init)
    assert tr.read(103) == (init + content[:99])
    assert tr.read() == content[99:105]
    assert tr.read() == b''

    # (read partway into the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True,
                                     initial_content=init)
    assert tr.read(99) == (init + content[:95])
    assert tr.read(6) == content[95:101]
    assert tr.read() == content[101:105]
    assert tr.read() == b''

    # (read well past the delimiter)
    fd.seek(0)
    tr = generic_io._TruncatedReader(fd, delimiter, readahead, include=True,
                                     initial_content=init)
    assert tr.read(99) == (init + content[:95])
    assert tr.read(50) == content[95:105]
    assert tr.read() == b''

def test_is_asdf(tmpdir):
    # test fits
    fits = pytest.importorskip('astropy.io.fits')

    hdul = fits.HDUList()
    phdu= fits.PrimaryHDU()
    imhdu= fits.ImageHDU(data=np.arange(24).reshape((4,6)))
    hdul.append(phdu)
    hdul.append(imhdu)
    path = os.path.join(str(tmpdir), 'test.fits')
    hdul.writeto(path)
    assert not is_asdf_file(path)
    assert is_asdf_file(asdf.AsdfFile())


 2*f - 2. Let l be c(5). Let b = l - -9. Sort b, 4, i in increasing order.
b, i, 4
Suppose 32*o = -67*o + 495. Suppose -5*s + 30 = -5*v, s + 2*s + 6 = -5*v. Put -2, s, o in descending order.
o, s, -2
Let r = -178 + 175. Let a = 0 + 5. Let z be 10/(-25) + 12/a. Sort 4, r, z in increasing order.
r, z, 4
Suppose 154 = 2*l - 4*l - 2*h, -4*h = -4. Let j = l + 82. Put -1/4, j, -0.4 in descending order.
j, -1/4, -0.4
Let c = 415 - 416. Sort -3, -14, c.
-14, -3, c
Let n = 285 - 281. Sort -3, -4, n, 2.
-4, -3, 2, n
Let h = -8 - -5. Let p = 0.101 + -3.901. Let l = p - -3.81. Put -1/6, h, l in ascending order.
h, -1/6, l
Let q = 28 - 49. Let z be q - (2 - (4 - 6)). Let o = 25 + z. Put -10, o, 5 in descending order.
5, o, -10
Suppose 2 = -5*m - 3. Suppose -3*w + 5*g + 38 = w, 14 = w + g. Let b = w - 19. Sort 4, m, b.
b, m, 4
Let v = 3017/3 + -1006. Sort -2, -3/20, 5, v in descending order.
5, -3/20, v, -2
Let p = 399.5 + -400. Suppose 4*z - 33 = -13. Suppose -g - 3*m + 23 = 3*g, z*g - 30 = -5*m. Sort p, g, 2.
p, 2, g
Suppose 16*o - 56 = 44*o. Let a be 1/(-2)*(2 + 1). Sort -1/3, a, o in ascending order.
o, a, -1/3
Let o = 4.38 + 0.52. Let p = o + -5.1. Let r(s) = -s - 5. Let d be r(-3). Put 2, d, p in decreasing order.
2, p, d
Let a(d) = -26*d**2 - 1453*d + 169. Let r be a(-56). Let j(p) = -p. Let y = 7 - 4. Let l be j(y). Put -1, l, r in descending order.
r, -1, l
Let a be (-32)/24*(-3)/2. Suppose 4 = 4*i - a*d, i - d + 6*d = 1. Put i, 5, -4 in decreasing order.
5, i, -4
Let d be ((-161)/(-14) + -12)*(-130)/1. Put -5, d, -2, 3 in decreasing order.
d, 3, -2, -5
Let s = -2897 + 211484/73. Let z = s + -173/657. Let o be (244/915)/(((-120)/(-9))/4). Sort 5, z, o.
z, o, 5
Let c = -7.3 - -7. Let z be ((64/96)/(4/3))/(-4). Sort c, 4/7, z in ascending order.
c, z, 4/7
Suppose -2*w = h - 9, 7*w = 6*w - 2*h + 3. Suppose 5*l + 23 = 3*u, 0 = -0*l + 5*l + w. Sort 2, u, 5 in increasing order.
2, 5, u
Let i be ((-28)/(-49))/((-34)/(-14) + -2). Sort i, 2, -0.2 in descending order.
2, i, -0.2
Let k(l) = -l**3 - 6*l**2 - 3*l + 7. Let s(z) = -6*z - 2. Let n be s(3). Let v be 0 - (n - 0)/(-4). Let f be k(v). Sort 4, -5, f in decreasing order.
4, f, -5
Let y be 234/(-12) + 1/(-2). Sort 1, 2, -4, y.
y, -4, 1, 2
Let r = -184 + 184.4. Let w = 3/8 + 1/8. Sort 0.3, w, r in descending order.
w, r, 0.3
Let x = 1 - 0. Let p be (10/(-6))/(1/(-3)). Suppose -153 + 161 = 2*c. Sort x, c, p in ascending order.
x, c, p
Let z be 6/3*(-3)/2. Let k = -1 + 0.6. Let p = 2460 - 2454. Sort p, z, k in ascending order.
z, k, p
Let w be 0/(-9) + (-8)/(-5). Let s = w + -37/20. Let n be (-3 - -1) + 6/8. Put s, n, -4 in decreasing order.
s, n, -4
Let f = 2067 - 2068. Put -0.3, 0.02, -15, f in decreasing order.
0.02, -0.3, f, -15
Suppose 4*x + x = 20. Suppose 30 = 33*j - 32*j - 4*b, -4*j = -3*b - 16. Sort -21, j, 3, x in ascending order.
-21, j, 3, x
Let p be (-2)/8 - (-3)/(-4). Suppose 0 = -2*b - 2 + 4. Let w(a) = 41*a - 324. Let x be w(8). Put b, x, p in descending order.
x, b, p
Let j = 45 + -47. Let y be (5/j)/(20/(-24)). Put y, -2, -21 in decreasing order.
y, -2, -21
Let k(h) = 6*h**2 - 8*h - 6. Let f be k(7). Let y = -2090/9 + f. Put y, -1, 0.2 in descending order.
0.2, y, -1
Let q be ((-8)/(-2))/(-2 - (-3 + 0)). Suppose -5*g + 8 = -0*l - q*l, 2*g + 4 = 4*l. Sort 1, l, 2.
1, 2, l
Let q be ((-536)/402)/(2/(-3)). Sort 19, 5, -3, q in increasing order.
-3, q, 5, 19
Let i be ((-4)/(-6))/((-36)/(-162)). Suppose 0 = -3*b - b + 36. Sort i, b, 4 in decreasing order.
b, 4, i
Suppose 281*q - 283*q = 8. Put 3, -7, q, 1 in descending order.
3, 1, q, -7
Let h(j) = -j**2 - 3*j + 6. Let l be h(-5). Let k(o) = 2*o**2 + 4*o - 1. Let y be k(-3). Let d be -1*4 + (-16)/(-1) + -10. Sort d, y, l.
l, d, y
Suppose -360 = 2*q - 7*q. Let t = q - 40. Suppose x - 7 = 4*i, 0 = 4*x + 3*i + i + t. Sort x, 2, 4 in ascending order.
x, 2, 4
Suppose 0 = -13*x - 26. Put x, -3, -93 in increasing order.
-93, -3, x
Let v(a) = -a**2 + 8*a - 3. Let s be v(0). Sort s, 4, -30, 2 in increasing order.
-30, s, 2, 4
Suppose -4*f = -0*f - 8. Suppose 0 = -t - 3*t. Sort -3, f, t.
-3, t, f
Let z(f) = f**2 - 8*f + 18. Let c be z(2). Sort -5, c, 87 in descending order.
87, c, -5
Suppose 29*r = 12*r + 17. Let g = 6 + -7. Sort 4, g, r in decreasing order.
4, r, g
Suppose -2*c - 36 = -8*c. Suppose c*o - 4 = 5*o. Let b = -1 + 0. Sort o, b, 0 in descending order.
o, 0, b
Suppose -19*z + 22*z + 5*b + 20 = 0, -12 = -z + 3*b. Let l = -14 - -8. Let s(v) = -v**2 - 5*v + 3. Let x be s(l). Sort -1, z, x in descending order.
z, -1, x
Let o = -4 + 3. Suppose 142*z + 861 = 151. Put 0, -3, z, o in increasing order.
z, -3, o, 0
Let i = -153 + 125.8. Let q = i - -27. Let r = 5.6 - 6. Sort 2/11, q, r in decreasing order.
2/11, q, r
Suppose 4*q = 2*r + 3*r + 13, -r - 11 = -5*q. Let u(w) = w + 8. Let l be u(0). Let j = -8 + l. Put 4, r, j in descending order.
4, j, r
Suppose i - 2*o + 15 = -0*i, 15 = -i + 3*o. Sort -4, 5, i in descending order.
5, -4, i
Let p = -358 - -359.63. Let x = p + -1.23. Sort 3, x, 2/27, 0.3 in descending order.
3, x, 0.3, 2/27
Suppose -5*t + 5*l + 50 = 0, 5*t = -3*l - 2*l. Let q(n) = n + 7. Let o be q(-6). Sort -2, o, t in increasing order.
-2, o, t
Suppose 5*r + 9 = 2*r. Let l = 13.261 - 13.2. Let c = l + 0.139. Sort -0.1, r, c in decreasing order.
c, -0.1, r
Let q = 130 + -128. Sort 1, q, 0, -2 in ascending order.
-2, 0, 1, q
Let k = 21 + -15. Suppose 5*p = -2*l - 21, -2*l + k*p + 6 = 2*p. Put 10, 5, l, 0 in ascending order.
l, 0, 5, 10
Suppose -24*i + 18 = -4*n - 25*i, -10 = 4*n - 3*i. Let c(l) = l**3 + 5*l**2 - 5*l + 1. Let b be c(-6). Put -3, -8, n, b in descending order.
-3, n, b, -8
Let q = 129 - 129. Sort 29, 1, q in increasing order.
q, 1, 29
Suppose 0 = 5*h - 3*t - 36, 2*t + 10 = h - 0*t. Let i(w) = w**2 - 7*w + 9. Let p be i(h). Put -3, -4, p in decreasing order.
p, -3, -4
Suppose 5*n + 40 = 15*n. Let d = 31 - 47. Put d, n, 3, -1 in decreasing order.
n, 3, -1, d
Let z be 1/(-2)*30/5. Sort -18, -9, z in increasing order.
-18, -9, z
Let r be (6 - 7) + 15/9. Let z = -7.13 - -0.13. Put 0, z, r in ascending order.
z, 0, r
Let u = 2 - -3. Suppose -5*m - 45 = u*k, -4*m + 7 = k + 34. Suppose 26 - 67 = 32*g + 23. Put g, m, -4 in increasing order.
m, -4, g
Suppose -25 = -53*d + 28*d. Put -5, -1, d in increasing order.
-5, -1, d
Let o = 0.03 + 0.47. Let w = -0.01 + -0.99. Sort w, -1/5, o in decreasing order.
o, -1/5, w
Let f(p) = -8*p**3 + 4*p**2 - 4*p + 3. Let b be f(2). Let c = 48 + b. Let v(q) = q**3 - 3*q**2 + q + 1. Let m be v(3). Sort c, m, -4 in decreasing order.
m, -4, c
Let n be (-4 - (-7 + 1)) + -1 + -5. Sort n, 2, -9, 5 in increasing order.
-9, n, 2, 5
Let y(l) = -l**3 + 5*l**2 - 5*l + 2. Let v be y(3). Let c = 9 + -10. Sort v, c, 2/7, -0.4.
c, -0.4, 2/7, v
Let o be (-216)/(-30) + 12/(-10). Sort o, -8, -5.
-8, -5, o
Let t = -2.9 - -3. Let y = t - 0.2. Let d = 1216 + -1216. Sort -1/3, y, d in ascending order.
-1/3, y, d
Let g be (-318)/371 - (-16)/(-14). Put g, 4, -16 in ascending order.
-16, g, 4
Let f = -61 + 50. Let x be 240/825 + 1/f. Put 2/37, x, 2/11 in ascending order.
2/37, 2/11, x
Suppose 3*v - 7*v + 72 = 0. Let w = -22 + v. Suppose 0 = -5*n - 0 - 5. Put -3, n, w in increasing order.
w, -3, n
Let o = 12 + -19. Let p = -60 + 64. Suppose 5*l - p*l = -2*l. Sort 4, l, o in ascending order.
o, l, 4
Let m = 1.5 + -1.4. Let t = -5 + 5. Let b = 12 + t. Sort -0.3, m, b in increasing order.
-0.3, m, b
Let y = -0.239 + 97.239. Let f = 97.2 - y. Sort f, -0.3, 31 in descending order.
31, f, -0.3
Let n = 10 - 6. Let j = n - 4.4. Let k = 119/3 + -40. Put 2/3, k, j in decreasing order.
2/3, k, j
Let t = 0.287 + -4.287. Sort -2, 0, -0.2, t in descending order.
0, -0.2, -2, t
Let x = -7328 - -7327.7. Let o(i) = -i**3 + 2*i**2 + 2*i - 1. Let k be o(2). Let v(h) = h**3 - 4*h**2 + 2*h. Let t be v(k). Put x, 1, t in descending order.
1, x, t
Suppose 2*s - 2*y - 3*y = 8, -5*s + 20 = 4*y. Let r = 72932/7 - 10436. Let p = r + 1052/63. Sort p, s, -0.3 in descending order.
s, -0.3, p
Suppose -4*x + 5*l - 5 = 0, x + 5*l - 10 = 20. Sort -4, x, -156, -2.
-156, -4, -2, x
Let j(l) = -l + 11. Let i be j(7). Suppose -i*f = -3*o - 0 - 1, 3*f + o + 9 = 0. Let u = -2 + 5. Sort f, u, 5.
f, u, 5
Let b be 1/((-14)/(-21) - 1). Put b, 1/4, -0.5, 1/2 in ascending


Stormwater

Water Run-Off

In a natural environment, most rainwater soaks into the ground or is captured by trees and other plants. As land is developed, it is covered by hard surfaces - roads, parking lots and rooftops – that prevent natural infiltration, and allow water to quickly run downstream. This runoff, known as stormwater, carries dirt, fertilizer, pet waste, pesticides and debris into lakes, streams and wetlands. Polluted stormwater runoff is the number one water quality problem in Minnesota and across the country.

Stormwater Best Management Practices (BMPs) are the primary method for dealing with polluted runoff. BMPs may include ponds, raingardens, porous pavement, green roofs, or other practices that temporarily hold, filter, or reduce stormwater. Slowing down or reducing the flow of water minimizes flooding and reduces the amount of pollution reaching downstream water bodies.

Changing Landscapes

The changes in the landscape that occur during the transition from rural and open space to urbanized land use have a profound effect on the movement of water off of the land. The problems associated with urbanization originate in the changes in landscape, the increased volume of runoff, and the quickened manner in which it moves. Urban development within a watershed has a number of direct impacts on downstream waters and waterways, including changes to stream flow behavior and stream geometry, degradation of aquatic habitat, and extreme water level fluctuation. The cumulative impact of these changes should be recognized as a stormwater management approach is assembled.


I can finally feature an amazing author friend with a new release again... been suffering from withdrawal symptoms on my blog. ;-) Ladies and gents, give it up for this fantastic novel by Amanda Ward, "Viva Pann Vegas"!

About the Book

TAGLINEGetting plastered at a wedding is the sign a good time has been had, but not when it’s the bride!BLURBThe fun and games continue as Pann Haggerty travels around America with her ‘average’ Joe on their way to Las Vegas.This time, Joe thinks he’s the one in charge, and able to handle his beloved quirky English rose.Apparently not.Surprises, secrets and wedding bells are in store.Has Pann given Joe the answer to his big question? Read on in the second MisAdventure of Pann Haggerty.Laugh at Pann’s antics, thrill to the romance, indulge in copious mugs of tea and try out the delicious recipes! Above all…enjoy.EXCERPT TWOPandora Haggerty, sorry…Harper sat in the back of the ambulance in a wheelchair all forlorn and feeling decidedly sorry for herself. Her plastered right leg was elevated, and despite Joe’s hand resting on hers comforting her, Pann’s spirits were low. She was jostled several times, wincing as the vehicle rode over several mountains in the road. Perhaps the pain medication was wearing off. Avoiding looking out the window, Pann kept her gaze on Joe’s steadfast one and the gleaming rings of gold that adorned her left hand. Beside her on the floor lay several packages, and from what she could make out, there was a Zimmer frame ready to be constructed. “A zimmer frame, my arse,” Pann grumbled.“What was that, darlin’?”“Just talking out loud,” she murmured. “Are you in any pain, honey?” Pann shook her head. “Actually I’m starting to feel like a total prat,” she told him bluntly. “I cannot believe I managed to break my sodding ankle, and now I’m totally reliant on someone else to help me do everything. And I am not using a sodding Zimmer frame. What do they think I am, an elderly geriatric?” Then, turning her head…she noticed a chair behind her.“That’s not a commode is it?” She asked incredulously in a high squeak. Joe nodded.“You have to be taking the royal piss,” she exclaimed.“No, that’s what the commode is for. So that you can—” Joe’s voice broke off. “No chuffing way am I using a commode.”“The doctor said you had to stay off that leg. This way you can use the toilet by simply lifting yourself from one chair to another,” he said soothingly.Pann’s temper finally got the better of her. Humiliation, frustration and that nagging ache from her leg took over her usually sane-ish temperament. She squeezed Joe’s hand digging her nails in, almost breaking the skin. At this point, she really didn’t care if she hurt him or not. She was hurting. Why couldn’t he sympathize? It really wasn’t fair.Pann sat complacently as Joe wheeled her into the now widened doorway of their motorhome. A strange smell assailed her nostrils. What on earth…could she smell? “There’s a cat in here,” Pann announced, her eyes darting around the kitchen area. It had been widened for accessibility. As Joe closed the door, she caught a glimpse of a tray.“What makes you think that?” Joe murmured, putting the brake on. He busied himself by putting the kettle on and preparing a drink for them.“The litter tray behind me, and the two bowls on a mat just over there,” Pann pointed out. “You do know I still have a cat back in England, even if it is living with Mum now.” She sniffed again, wafting her hand in front of her nose. Several pots of fragrant violets lined the middle of the dining table. She hoped Joe had secured them with Velcro strips.“Interesting and beautiful flowers, but no matter how many pots of violets you use, there is no cure for the niff of a farting feline,” she told him with a grin, using as many English terms as she could fit in. It was ridiculous, but in a way Joe had diffused her temper by diverting her attention onto something else. “So where is it?”Joe put two steaming mugs on the table, fetched a plate of digestive biscuits and sat down next to her on the seat.“Look up,” he suggested.Pann’s head tilted back. On what had been her bed, two white fluffy paws and a nose with two black splotches were all she could see. All those awful feel sorry for herself feelings disappeared. Joe handed her the tea mug.“So how did we end up with whats-his-face up there?”“I have no idea. I picked up the van yesterday after the refit, and well, there he was,” Joe explained.“He?”Joe nodded. “I took him to the vet with every intention of handing him to a rescue center, but, I don’t know. There was something about him. It turns out he is a pedigree Ragdoll.”Pann melted. “The ones that go limp in your arms. They are so soft and fluffy…Oh, Joe. Look at the splotches on his cute little nosey. Bloody hell. Is that the cat?” Her nose wrinkled. “Oh God, that’s foul,” she breathed.“There is nothing wrong with that cat’s stomach. Apparently, some cats are prone to gas and this is one of them I’m afraid.” Joe chuckled. “So are we gonna keep him? I had him vaccinated, micro chipped and everything.”“What have you called him?”“I thought I’d let you name him,” Joe replied with a smile. “It’s taken you out of your bad mood hasn’t it?”“Yes, you rat, it has.” Pann couldn’t take her eyes off the two fluffy paws and now emerging face over the edge of what had been her bed. “I’m still not using that commode, you know.”

About the Author

Amanda Ward lives in Bedfordshire, England with her husband, three children and two insane cats. The expression ‘What you see is what you get’, sums her up perfectly. She is the author of the novel Without Saying A Word with Books To Go Now and The MisAdventures of Pann Haggerty with Secret Cravings Publishing.She is a member of the Romance Novelists Association (RNA). There is always some moment waiting around the corner to be written into a novel.

Her interests include a passion for history and the royal families of Europe, romance novels, cooking, and science fiction including Doctor Who. Of course not forgetting the great and wonderful Doris Day musicals and English costume dramas.


"The terrorists got away with the list." "One of the men was Jadalla, Bin-Khalid's son." "We have the list." "It's a sign we're on a righteous path." "Rebecca, the list of sleeper cells, the terrorists have it." "My God." "You got anywhere with Nilaa Mizrani?" "Right now, she's our best hope to stop Jadalla from activating those sleeper cells." "You're coming with us to CTU." "You speak up before any more Americans lose their lives." "I didn't leak the identity of those Rangers." "There's a problem with Drew." "I know I have to kill him, Khasan." "I just need you to tell me how to do it." "You need to get your hands on a syringe." "Isaac, Royo's not there to make a deal." "He's there to kill you." "He planned this with Aisha." "Get out of there, Isaac." "You need to let her go." "I already put her in the system." "She's important to me." "Son, I made a terrible choice." "So you sacrificed those Rangers' names." "To save your campaign." "I weighed all the good that your Presidency could do against those six lives..." "It's not just six lives." "God knows how many people could be lost if Jadalla Bin-Khalid launches those attacks." "I can fix this, Eric." "What?" "I can fix this." "I can make it right." "You ever heard of an arms smuggler, goes by the name Gabriel?" "He's a ghost." "I can get us to him." "See if he knows where Bin-Khalid's people are." "Carter, you're an Army Ranger, you're not a CTU agent, and I cannot authorize this mission." "What are you doing?" "Exactly what we talked about." "Let's go." "You better be telling me the truth about Gabriel." "I am." "'Cause if you're not I'm gonna kill you myself." "We took a closer look at the security tape from campaign headquarters." "It looks as if it may have been tampered with." "You mean it was faked?" "Like I told you from the beginning?" "That appears to be the case." "It's over." "You're in the clear." "Was someone else arrested?" "That's classified." "You accused me of doing some terrible things." "You really believed it." "I was just following the evidence." "People inside the campaign were already whispering about me before the Gage ad." "Now they will never stop." "My reputation's destroyed." "How do I go back to my job now?" "How do I just go back to my life knowing what you and John really think of me?" "You should know that John never thought that you were guilty." "In fact, he was the one who uncovered the additional evidence." "I'll have someone start to process you out as soon as possible." "Nilaa..." "I'm sorry for everything you've been through." "Truly." "Mariana, can you track Carter's SUV?" "No signal." "He must've disabled the transponder." "Rebecca, I have to ask, did you know anything about this?" "No." "Carter's operating on his own." "I want your team ready to intercept once we locate Carter and Grimes." "It's him." "Put him on speaker." "Eric, I'm here with Keith Mullins." "Turn around now before this gets any worse for you." "Ben is taking me to Gabriel." "And I'm using the Onyx missile schematics as bait." "And hopefully we can find out what he knows about Jadalla Bin-Khalid." "You stole those schematics?" "When I've identified Gabriel," "I'll look for a chance to lock him down." "Have a TAC team standing by." "Carter, you're predicating this entire plan on what Grimes told you." "He's proven he can't be trusted." "This is the only chance we have right now to find Jadalla." "I'm sending you location where the TAC team should stage." "He's wrong about me." "Everything I told you is the truth." "You can trust me." "Shut up, Ben." "This is where he wants us to stage." "Locke can chopper his team there and back Carter when the time comes." "Keith, it's the only play we've got." "Be ready to move as soon as we get Carter's signal." "Understood." "I've been trying to reconstruct the list." "So far, I've been able to recover the contact information and activation codes for one of the cells." "What's the time frame for recovering the rest of the list?" "Honestly, I don't think I'll be able to do it." "Too many of the partitions are corrupted." "It's impossible." "Then we should activate the one cell." "Have them launch the attack right away." "My father's plan was to have all 15 cells launch their attacks at once." "Hey." "That's how we bring this country to its knees." "How we change things." "But Hamid said he doesn't know if we'll recover the rest of the list." "We have to have faith." "Every minute we wait, we show kindness to these people..." "There were 15 cells, Kusuma." "We launch 15 attacks." "If we can retrieve one, we can retrieve the rest." "Keep working." "I know that it's hard, Amira." "But you had to do it." "You had no choice." "You and I are going to be part of something greater than ourselves." "We are changing the world." "And when it's over, everyone will know our names." "Princess." "Don't cry, little one." "I'm happy to see you, too." "Khasan." "How are you, son?" "What are you doing here?" "I'm just here on business." "And you?" "How is work?" "It's fine." "You're not there now?" "An early day?" "Always try to leave in time to pick up Amira from school." "And how's school, Amira?" "You studying hard?" "Of course." "Good." "Don't want you to drop out like your brother." "Why didn't you tell us you were coming?" "I just wanted to surprise you." "Why?" "Can't a father surprise his children anymore?" "Are you hungry, Papa?" "Always." "Okay, I'll make you something." "What are you doing?" "Feeding our father." "He shouldn't even be here." "Something's not right." "This isn't the first time he's come here on business." "But he told us." "He always tells us when he's coming." "He knows something." "How could he?" "He just wants to see us." "You feed him, but once he's done eating, we need to get him to leave." "Fine." "You got everybody inside?" "Yeah." "Oh, y'all just chilling." "I almost got killed today." "Right?" "Royo tried to play me." "And he got help from Aisha and Jerome." "More of y'all got to be involved." "Here's how we're gonna do this." "Bring Kevin." "Jerome tried to sell me out." "And you're his little brother." "So don't tell me you know nothing about it." "I don't." "No, listen, Kevin, you're gonna tell me who Jerome is working with." "But I don't know anything, man." "You still don't know anything?" "I swear, Jerome never said nothing, man." "I don't know what you talking about." "Take him downstairs." "Isaac, Isaac, no!" "No, please, listen." "Please, Isaac..." "No, you gotta believe me." "No!" "The rest of y'all, get your phones out." "I wanna know who you've been talking to." "I said get your phones out!" "Yeah, yeah, I'm gonna see you then." "Just calling ahead." "Gabriel's people have real hair triggers." "You don't wanna show up unannounced." "Here's your stuff." "Gabriel and his men, they..." "They like things high and tight." "Besides, my mom never liked me with a beard anyway." "Just hurry up, Ben." "You think you get to see 'em when you die?" "See who?" "People you love." "The ones you lost, like my mom and sister." "I don't know, Ben." "Maybe you get to say the things you meant to say when they were around." "Or maybe this life's all you got." "So maybe you shouldn't waste it with what-ifs." "Let's just do what we gotta do." "Hello?" "Eric?" "It's safe for me to get out of here, right?" "Leave Isaac's?" "Yeah." "Why, you okay?" "I just..." "I don't wanna be here anymore." "Okay, listen..." "I want you to go to Christine's." "Christine's?" "Why can't you just pick me up?" "I want to." "More than you know, but, I just..." "I'm still in the middle of this." "Still?" "I thought it was almost over." "Yeah, right." "I thought so, too." "Eric, what's going on?" "Listen, I want you to go to Christine's and I'm gonna come and get you as soon as I can, okay?" "I love you, Nicole." "I love you, too." "Hey, Nicole." "Andre." "Can I come in for a minute?" "Yeah." "You gotta talk to Isaac." "This is none of my business." "I left to get away from all this." "I just wanna get back to my husband." "You think anybody here wouldn't kill to get out of here like you did?" "We don't have that choice." "We're here." "Trying to do what we gotta do..." "Look, I'm asking you to talk to him." "And say what?" "I've never seen him like this before." "That's 'cause he wasn't like this when you and Eric were around." "Once you two bounced, everything changed." "I know Eric leaving was rough for him." "It wasn't Eric." "It was you leaving that broke him." "And now, you're the only one who might be able to set him straight." "Is that kharcho?" "It smells just like your mother's." "It always reminds me of home." "Mmm." "So good." "And what about you?" "How's work, Khasan?" "Work is good." "Is it?" "I said it's good." "Because before I came here," "I stopped by the construction site, and your boss said that you haven't been there in weeks." "They didn't need me." "Don't lie to me, boy." "What are you talking about?" "Your friend Timur, the one with the drunk father, he was arrested two weeks ago trying to plant a bomb in Grozny Square." "The police never got anything out of him." "But in the village, people talk." "There were rumors he trained in Pakistan, that he wasn't alone." "You were there with him." "Tell me what you're doing here." "Nothing." "I already told you..." "I told you, don't lie to me." "Tell me what you two have done." "Fine, you don't want to talk, then pack your bags." "You're coming home with me." "You too, boy." "We're not going anywhere." "You think you're a man because you can shoot a gun?" "Huh?" "I fought the Russians while you hid under the bed in your pajamas, crying like girl." "Papa, please, please..." "You're not a soldier, you're not a man, you're nothing but a coward!" "Stop!" "Help me, Amira." "Get the duct tape." "Princess, help me." "Amira, now!" "Please." "Bind his wrists." "Bind his wrists." "Don't let your brother control you." "I raised you to be better." "It's your father, Amira!" "Amira!" "Please." "What are you going to do to him?" "We just got to the staging area" "Carter gave us." "Team's ready to go when we get the signal." "Copy." "You wanted to see me?" "I know you helped Carter access the ONIX schematics." "You have no proof of that." "Only because you're good at what you do." "Which means I can't fire you for cause." "Yet." "But I don't trust you." "I understood siding with Rebecca when all this started, but Carter's gone off the reservation, and you helped him do it." "I'm revoking all your clearances effective immediately." "Turn all your files over to Mariana." "You're benched." "This is Andy." "What happened with Keith?" "He knows I helped Carter." "I thought you covered your tracks." "I did, but he doesn't care if he can prove it." "He took away my clearance, and he'll fire me as soon as he figures out how." "I shouldn't have gotten involved." "Andy, you did the right thing." "Listen, I have to go and interrogate Henry Donovan." "I'll talk to Keith." "I'll get you reinstated." "It'll work out." "Ben..." "If there's something you wanna tell me, now would be the time." "Let's do this." "You got some balls coming back here again." "I got business." "Something for Gabriel." "You think he's gonna do business with you again?" "He'll want what I got." "It's just my phone." "Who's this guy?" "Eric Carter, we served together." "He brought me those." "These real?" "I took them from DOD myself." "Where's the rest?" "Locked with an access code." "So unlock it." "Only for the guy who can greenlight the deal." "Gabriel." "If you're screwing with me, I promise you," "I will splatter your brains all over this asphalt." "Let's go." "Isaac." "What the hell do you want?" "To talk." "I'm busy." "Just for a minute." "Please." "Make it quick, Nicole." "You're gonna go through every call on every one of those phones?" "Uh-huh." "If that's what it takes." "Isaac, look, I know you don't trust anyone right now." "You think?" "But you can trust me." "Oh, really?" "Can I?" "I just saved your life." "And you let Aisha and Jerome bounce." "Yeah." "What would you gain by killing them?" "Set an example." "And what about the example you're setting right now?" "What's that supposed to mean?" "Isaac, these men, they respect you." "Yeah." "They revere you." "But you're losing them." "You're out of control." "You'll end up making them do something they'd never think of doing." "Like what?" "If you keep going like this, they're gonna turn on you." "What?" "Did somebody say something?" "Did somebody..." "No." "Who you been talking to?" "Nobody." "No, you lying." "Who you been talking to?" "Nobody, Isaac." "You're no better than the rest of 'em." "What y'all looking at?" "Nothing, man." "Cool." "Come here." "Ben Grimes." "I didn't expect to see you again." "But I'm delighted you decided to stop by." "Gabriel, Gabriel." "I came here to make things right." "Mr. Carter, isn't it?" "Something tells me your partner here hasn't been entirely forthcoming about our history." "Ben?" "Bring him up to speed." "Gabriel fronted me some money for an arms deal." "Tell him how much." "50K." "But I was robbed before I could make it right." "Uh-huh." "I was..." "They knocked me out." "I swear, when I came to, the money was gone." "Right into your veins." "That's not true." "That's not true." "Gabriel, this deal will net you many times that." "I won't take a cut." "Not a penny." "Mr. Carter, a man is entrusted with a significant amount of money." "That money disappears, doesn't matter how, the man's responsible for his money." "It's gone." "What do you think the consequences should be?" "I'm here to make a deal." "So whatever happened between you two doesn't matter." "Oh, it matters to me." "Quite a bit, actually." "Stand up." "You know..." "I'll never do business with him." "The question on the table is can I do business with you?" "I just need to know we're on the same page." "Kill him." "Then we can talk." "Ben and I fought together." "And we swore an oath to our country." "No." "And to each other." "I'm not doing it." "Eric..." "You might wanna reconsider." "No." "That's what I like to see." "Loyalty." "Maybe we can do business." "We'll run background on you." "Everything checks out, we'll continue the conversation." "If not..." "Where are you going?" "Anywhere but here." "Nicole, I'm sorry." "Excuse me." "Come on." "Look, I mean it, right?" "I'm sorry." "I put my hands on you." "That was wrong." "I shouldn't have did that." "You're done?" "Well, come on." "Everything's been crazy." "My business is falling apart." "I got dudes out there that's trying to kill me." "I'm losing my mind here." "Let me say it again, I'm sorry." "And I'm glad you let her go." "I didn't want to kill Aisha, not really." "Yeah, well, I'm glad that worked out for you." "And you coming to me like that." "Right, telling me I'm bugging," "I'm out of control." "You're right." "What about Kevin?" "I'll let him go, too." "Like, he probably don't know anything anyway." "Listen, thanks for saving my life earlier." "You're welcome." "It's just been real hard lately, you know." "I know." "It hasn't been the same since you left." "So, what, he's waiting for you now?" "He's not quite finished yet." "Right." "So, look, why don't you stay here, let me make it up to you." "At least till your man's done saving the world." "You see how things are." "I need you." "Please." "Don't you ever touch me again." "Have a seat, sir." "John." "Are you okay?" "Did he say anything else to you?" "Anything I should know before I go in?" "Um..." "Just what I told you over the phone." "That he gave up the Army Rangers to the terrorists." "That he framed Nilaa for it." "He said he's doing it all for me." "To protect my campaign." "I'm so sorry." "He's ready." "Henry." "Becca." "Can I get you anything?" "Something to drink?" "I would just like to understand what's going on, why John would do this to me." "I know he's told you some story about my working with terrorists but I swear to you, I don't have the least clue what he's talking about." "And I keep going over it in my head." "I know that John is under pressure." "I don't know, maybe he overheard a conversation I had, misinterpreted something." "I just..." "I don't know." "You told John you gave the identities of the Army Rangers to Jadalla Bin-Khalid." "I swear on my wife's grave," "I've never even heard of this Jaballa person." "And how would I get the identities of those Rangers?" "Rebecca, you know me, we're family." "We've spent Christmases together." "You and John were married in my backyard." "Now, do you honestly think that I would cooperate with terrorists?" "That I would help them to kill service men?" "Does that make any sense to you at all?" "What the hell are you doing?" "Son, please." "You have signed those Rangers' death warrants, you understand?" "You have a chance here to make this right, to save people from dying, and you're pulling this?" "I don't know what you're talking about." "Tell her the truth." " Son of a bitch!" " John." "Don't." "You should leave." "Looks like you check out." "It's a good thing." "Give me the phone." "So how do you know they're genuine?" "Because I know where I stole them from." "Let me ask you something." "What's to stop me killing you?" "Keeping the plans anyway?" "'Cause someone who I trust told me you were a stand-up guy." "All right, let's take a look." "What's the code?" "Three, seven, alpha, tango, four, four, hotel, six, two." "Looks like the real deal." "I'll have to have someone authenticate them." "Yeah." "Of course." "Move." "Don't." "Put your hands behind your head." "And move over there." "Hands above your head now." "You have a gun around your waist." "Put it on the floor and slide it over to me." "Slowly." "What do you want?" "You sold guns to a terrorist named Jadalla Bin-Khalid." "I also think you helped smuggle him and his men into this country." "I need to know where they are." "I don't know what you're talking about." "You're lying." "It's Carter." "Carter, what's your status?" "I have Gabriel." "Lock on to my GPS and send your men in." "Got him." "Sending choppers now." "Tell the TAC teams they'll be dealing with at least six highly-trained ex-military." "Approach from the east." "Understood." "Locke's ETA's less than 10." "Copy that." "My blood sugar." "I am diabetic." "What?" "Please." "Diabetic?" "Why didn't you tell us?" "I didn't want to worry my children." "What does it matter, anyway?" "Of course it matters." "Here, take some more." "How can you do this to your own father?" "We don't want to hurt you." "If you go through with this, whatever you're thinking of doing," "my life will be over." "Amira, do you not remember your childhood?" "How we played together?" "How we used to sing you to sleep?" "What would your mother say if she were to see you treat me like this?" "Please, untie me." "Khasan would never allow it." "Just go to police." "The police?" "Yes." "Untie me and I'll talk to Khasan again." "Amira, please." "Amira." "Jadalla." "I don't understand, an activation code was sent out." "Meaning what?" "The sleeper cell whose information we received from the list, someone in our system sent out the code." "I swear it wasn't me." "Can you stop it?" "Uh..." "No." "It's been encrypted." "You did this?" "Stop the activation code." "Now!" "It's too late." "The code was received." "At least this way, we strike a blow." "You've never taken a man's life, Jadalla." "You would start with mine?" "You're a good man, Kusuma." "But you lack faith." "And a man without faith is dangerous." "How can it be a great war, Khasan, if it makes us do this to our own father?" "What does that mean?" "It means maybe we should think about this." "Khasan." "There's nothing to think about." "We've gotten the activation code." "We're launching the attack." "No." "Khasan..." "Call Harris." "Tell him to be here with the rest of the material." "Khasan." "Do it right away." "Now!" "You should know I don't do business with terrorists." "I'm a patriot." "Yeah." "So those modified semis that you sell," "Jadalla just found them lying around." "You'd have to ask him about that." "Son of a bitch." "Listen up!" "Move, move, move!" "We got an alert." "Hostiles ahead, prepare to take fire." "Here we go." "Stay put or I will shoot you in the other knee." "Go right." "Copy that!" " Clear." " Clear." "Clear!" "Carter, it's Locke." "I'm in here, I got Gabriel." "No, you don't." "Son of a bitch." "No." "Move!" "Medic!" "Over here, come on." "Medic right here." "All right." "Let me take over." "He cut the artery." "He's gone." "What about his computer?" "He's already on it." "Okay, well, his men might know something." "Most went down fighting." "We're interrogating the others now." "I'm in." "No, no, no, no!" "Data wipe!" "Move!" "This may be our only lead." "Get what you can, and quickly."


The impact of the halogen bonding on D2 and 5-HT1A/5-HT7 receptor activity of azinesulfonamides of 4-[(2-ethyl)piperidinyl-1-yl]phenylpiperazines with antipsychotic and antidepressant properties.
A series of azinesulfonamides of long-chain arylpiperazine derivatives with semi-rigid alkylene spacer was designed, synthesized, and biologically evaluated using in vitro methods for their affinity for dopaminergic D2 and serotoninergic 5-HT1A, 5-HT2A, 5-HT6 and 5-HT7 receptors. Docking to homology models revealed a possible halogen bond formation in complexes of the most potent ligands and the target receptors. The study allowed for the identification of compound 5-({4-(2-[4-(2,3-dichlorophenyl)piperazin-1-yl]ethyl)piperidin-1-yl}sulfonyl)quinoline (21), which behaved as D2, 5-HT1A and 5-HT7 receptor antagonist. In preliminary in vivo studies, compound 21 displayed distinct antipsychotic properties in the MK-801-evoked hyperactivity test in mice at a dose of 10mg/kg, and exerted antidepressant-like effect in a forced swim test in mice (MED=0.625mg/kg, i.p.).


Relationship between receptor occupancy at 37 degrees C and the anticonvulsant effect of flunitrazepam in rats.
In this investigation an attempt was made to evaluate quantitatively the relationship between benzodiazepine receptor occupancy and the anticonvulsant effect of flunitrazepam in rats. A graded measure of anticonvulsant effect was obtained on the basis of an elevation of pentylenetetrazol (PTZ) threshold concentrations. The concentration-anticonvulsant effect relationship could be described by the Emax model with an EC50 in cerebrospinal fluid of 2.9 +/- 0.8 micrograms/liter and an Emax of 227 +/- 22 mg/liter PTZ (mean +/- SE). In vitro receptor occupancy was determined in a crude brain homogenate at 0 and 37 degrees C, which yielded KD values of 2.2 +/- 0.2 and 26 +/- 2 micrograms/liter, respectively. The results obtained in both experiments were combined by focusing on free flunitrazepam concentrations. This strategy resulted in a nonlinear relationship between receptor occupancy and anticonvulsant effect of flunitrazepam, with 90% of the maximum response achieved at a degree of receptor occupancy of approximately 50% at 37 degrees C.


Q:

Building Mesa 3d 7.10 with llvmpipe on MSVC10

Has anybody successfully build Mesa 7.10 with llvmpipe driver using LLVM 2.8 on Windows with the Visual Studio 2010 toolchain?
The official release files contain no SConscript, so I got the 7.10 branch from their git repository and tried to build it. I get weird link errors about __fopen, __exit and other standard libraries.
Update:
Got the problem. Both had to compile with the same runtime libraries, but LLVM was compiled with MD and Mesa with MT. So I switched both to MT. But still have a problem - it gives me a link error about __va_copy. I can see it is called from the Mesa code, and the code compiles properly but DOES NOT LINK. I don't understand why :/

A:

va_copy is not provided by all compilers. You might get away with adding a simple #define macro in the mesa code. See va_copy -- porting to visual C++? for a discussion about va_copy.


Liberal activist and documentary filmmaker Michael Moore joined Democrat Senator Elizabeth Warren (D-Mass) and Senator Bernie Sanders of Vermont in a live-streamed “Inequality in America” town hall in Washington, DC, on Monday night.

The discussion, which was centered around inequality and income inequality, also saw Moore addressing what he called the media’s obsessive coverage of Russian election interference and President Donald Trump’s alleged relationship with porn actress Stormy Daniels.

Warren, Sanders, and Michael Moore broached the topic after Moore began hailing a teacher’s strike conducted by the West Virginia Education Association. According to Moore, the teacher’s group scored an “amazing victory” which “brought down the state’s apparatus,” and resulted in a 5 percent pay increase.

But while addressing Sanders directly, Moore complained that he “didn’t see hardly anything” in the “corporate media” about the demonstration.

Read more

The Emergency Election Sale is now live! Get 30% to 60% off our most popular products today!


Ferrovie della Sardegna

The Ferrovie della Sardegna (Railways of Sardinia), known also as ARST Gestione FdS between 2008 and 2010 and with the abbreviation FdS, was an Italian public company that managed the regional railway network in the island of Sardinia, Italy. In 2010 it was totally integrated with the main regional public transport company, ARST (Azienda Regionale Sarda Trasporti).

It was the second railway operator in Sardinia, after Ferrovie dello Stato, having 203 kilometers of railways used for public transport, plus another four tourist lines, known as Trenino Verde, which run through the wildest parts of the island.

The company was founded in 1989. It is a narrow gauge railway system, using diesel locomotives and multiple units, electrified tram-trains in the metropolitan areas of Sassari and Cagliari and vintage diesel and steam locomotives on the tourist lines.

Today works are in progress to modernise several lines with the electrification of routes around the metropolitan areas of Sassari and Cagliari.

Lines

Public Transport Lines

Line Macomer-Tirso-Nuoro
Line Sassari-Sorso (work is in progress converting the line to a light rail transit)
Line Sassari-Alghero (planned conversion to light rail transit)
Line Monserrato-Isili
Metro-tramway of Sassari
Metro-tramway of Cagliari

Tourist Lines (Trenino Verde)
''
Line Macomer-Bosa
Line Sassari-Nulvi-Tempio Pausania-Luras-Palau
Line Mandas-Gairo-Arbatax
Line Mandas-Isili-Sorgono

Dismantled Lines

Line Siliqua-San Giovanni Suergiu-Calasetta (Ferrovie Meridionali Sarde)
Line Iglesias-Monteponi-San Giovanni Suergiu  (Ferrovie Meridionali Sarde)
Line Gairo-Jerzu
Line Isili-Villamar-Villacidro
Line Villamar-Ales
Line Tirso-Ozieri
Line Luras-Monti

Gallery

See also
Sassari Tram-train
 Cagliari Metro-tramway

References

Category:Transport in Sardinia
Category:Railway companies of Italy
Category:950 mm gauge railways in Italy
Category:Railway companies established in 1989
Category:Railway companies disestablished in 2010


Top 1% Now Own Half World's Wealth: Credit Suisse

Millennials are unlikely to attain their parents' level of wealth, report finds.

Global wealth inequality has reached yet another record high, and the richest one per cent now own slightly more than half of the world's wealth, says a new report from global banking giant Credit Suisse.

The latest edition of the bank's Global Wealth Report also comes with a warning that millennials are unlikely to attain their parents' levels of wealth.

The amount of wealth held by the top one per cent rose from 42.5 per cent in 2008, at the height of the financial crisis, to 50.1 per cent this year, Credit Suisse said. It has hit a new record high every year since 2013.

Patrick Aventurier via Getty Images
Luxury yachts are displayed at the Hercules Port in Monaco for the 27th edition of the International Monaco Yacht Show, Sept. 28, 2017 in Monaco. The world's richest one per cent now control slightly more than half the world's wealth, according to a new report from Credit Suisse.

Meanwhile, 3.5 billion people, corresponding to 70 per cent of the world's adults, each own less than US$10,000 in wealth, the report found. Together, they hold just 2.7 per cent of the world's wealth.

"Inequality has continued to edge upwards, so that ... median wealth fell again this year in Africa, Asia-Pacific and Latin America," the report said.

"Our projections for 2022 suggest more pessimistic scenarios for the immediate years ahead."

The world's household wealth grew by 6.4 per cent over the past year, in U.S. dollar terms, the fastest rate in five years. The world minted 2.3 million new U.S.-dollar millionaires in that time, almost half of them in the U.S.

Credit Suisse

Wealth in Canada grew somewhat more slowly than the world average, up 4.4 per cent in a year in Canadian dollar terms.

The number of U.S.-dollar millionaires in Canada has surpassed one million in recent years. Credit Suisse estimates there are 1,078,000 millionaires in Canada, up about 9.5 per cent in two years, from 984,000 in 2015.

'Particularly challenging circumstances' for millennials

The report devotes considerable space to assessing young adults' wealth situation, and suggests millennials are unlikely to achieve their parents' levels of wealth.

"With the baby boomers occupying most of the top jobs and much of the housing, millennials are doing less well than their parents at the same age, especially in relation to income, home ownership and other dimensions of well-being...."

More from HuffPost Canada:

The report lists a litany of reasons for younger adults' poorer prospects: the destruction of wealth during the financial crisis of 2008-09, and higher unemployment rates since then; rising house prices; increasing inequality and lower income mobility; and less access to retirement pensions.

"We expect only a minority of high achievers and those in high-demand sectors such as technology or finance to effectively overcome the 'millennial disadvantage,'" Rohner wrote.


Yamaha Chrome Covered Plastic Virago Side Coversmake for a brilliant custom touch. Fits 1984-1997 XV700/750/1000 and 1986-1999 XV1100. Price is for both sides as shown. NOTE: Chromed stock plastic side covers. DOES NOT INCLUDE A "VIRAGO" LOGO nor can the Virago logo be purchased,

Product Reviews

Cheap plastic broke and was stained on delivery

Michael J.(Las Vegas, NV)1/30/2018 11:11 AM

Rebuilt my '97 XV1100 and after a month of use the only thing to break were these cheap plastic covers. Right out the package the chrome had some imprinted "film" on them from packaging or a chemical maybe. The stain wouldn't come off with washing so I let it go. But weeks in to use the front clip on the right hand side snapped just from pulling it straight off. Pulled it 3 times in total, once a week, to trickle the battery. After it snapped the damn thing failed and flew right off the highway never to be seen again. Not worth the money at all. These may not be cheap but they absolutely were so I suggest you find an alternative.

Great Item & Service

William Swanson(Fort Meyers Fl)9/12/2016 4:35 PM

These solved my issue of a missing side cover and less money than my local dealer wanted he wanted over $99 plus tax and needed to order in from Yamaha, Parker had these in stock when i called to check and they arrived in a timely manor, Yes as listed they are Chrome plated plastic which it clearly states but so were my original stock set!
Great price and service on mine! William

PLASTIC!!!!

Kristy Foote(Dayton, OH)9/8/2016 2:45 PM

I can't believe I didn't read the fine print. Who pays that much for PLASIC!!! Apparently I do. You certainly don't get what you pay for. So be aware what you order. Waayyyyyy over pried for a piece of plastic and one side doesn't even match up. I am from Ohio so I waited 9 days for....did I mention, PLASTIC! Gonna cost me even more to ship it back. I'm already deep in the hole with it now so not even going to bother. Thats probably the scheme anyway.

Mailorder OEM Parts & Accessories for SeaDoo, Polaris, Yamaha, Kawasaki, Can-Am, Honda, OEM Certified Dealer, Prices herein are not valid on walk-in or retail store sales and may vary from phoned in prices. Web or Mailorders cannot be picked up at store. We reserve the right to change prices without notice. A complete list of our policies can be viewed on our policy page. We are not responsible for errors relating to any product or prices listed herein and in no way offer to make restitution for any such errors. Any pictures herein may be for reference only and may not depict the actual part in some cases. Some orders may not ship the day your order was submitted. Our website does not list if items are in stock, Please do not ASSUME that if it is shown here we have it in stock and ready to ship since not all items shown herein are in stock and as such will be special ordered as needed to fill your order.

California Prop 65 WARNING:

Certain products for sale on this website can expose you to chemicals which are known

to the State of California to cause cancer, birth defects or reproductive Harm – www.P65Warnings.ca.gov


What has changed in the treatment of ST-segment elevation myocardial infarction in Poland in 2003-2009? Data from the Polish Registry of Acute Coronary Syndromes (PL-ACS).
A substantial progress has been made in Poland in the field of acute coronary syndromes (ACS) management over the last 10 years. To present the data from the Polish Registry of Acute Coronary Syndromes (PL-ACS) collected between 2003 and 2009. Changes in treatment strategies and outcomes in ST-segment myocardial infarction (STEMI) were analysed. We analysed patients enrolled to the PL-ACS Registry - a nationwide multicenter, prospective observational study of consecutive patients hospitalised with ACS in Poland. Overall, 284,162 patients with ACS were enrolled in 512 centres including 88 invasive cardiology centres. The STEMI was diagnosed in 35-36% of these patients in 2003-2005, and this proportion remained stable at 30% to 32% in 2006-2009. The mean age of STEMI patients increased from 62.5 years in 2003 to 64.5 in 2009. During this period, women represented 32.7% to 34.6% of the STEMI patients. Proportion of patients presenting with pulmonary oedema or cardiogenic shock decreased with time, from 15.5% in 2003 to 8% in 2009. Delays to reperfusion tended to reduce over time: pain-to- -admission time was 240 min in 2005 and 229 min in 2009 and door-to-balloon time was 32 and 25 min in 2005 and 2009, respectively, with the delay being longer in the elderly population. The proportion of patients undergoing coronary angiography showed a constant increase, from 55% in 2003 to 84% in 2009. Percutaneous coronary intervention was performed in 51% and 78% of patients in 2003 and 2009, respectively. At the same time, the proportion of patients undergoing thrombolysis declined from 14% to 1%. Aspirin, beta-blocker, statin and ACE inhibitor use was constantly high, while nitrate use declined from 82% to 15%. The proportion of patients receiving clopidogrel increased from 40% to 97% over the analysed period. Significant reductions in mortality rates were observed: in-hospital mortality decreased from 11.9% to 6.4%; 30-day mortality from 13.5% to 9.6%; and 12-month mortality from 19.8% to 15.4% in 2003 and 2009, respectively. Invasive treatment strategy was associated with better in-hospital and long-term patient survival. The PL-ACS Registry results demonstrate low short- and long-term mortality rates in STEMI patients, mainly due to frequent use of interventional strategy, satisfactory logistics and appropriate drug therapy used. As a consequence, hospitalisation time has shortened. However, there are several issues that need to be improved such as shortening of pre- -hospital delays and increasing the rate of invasive treatment in patients presenting with cardiogenic shock.


Q:

Java: Why does the compiler complain here?

  0          int specialFuncStart;
  1          String[] specialFunctions= {"sum","ddx","integral"};
  2          for(String element: specialFunctions){
  3              specialFuncStart = finalMath.lastIndexOf("sum");
  4          }
  5          while (specialFuncStart != -1) {   code  }

Why does line 5 say that specialFuncStart might not have been initialized? Strings are final and fixed, so the for loop will always run. Does the compiler not know that or am I missing something? I understand that initializing specialFuncStart = -1; is how to fix it, but why?

A:

You declared it but you didn't initialize it. You need to set a value to it:
int specialFuncStart; // declare
specialFuncStart = 0; // initialize

int specialFuncStart = 0; // both

Your compiler thinks that sometimes specialFuncStart will not be initialized since a for loop doesn't have to execute.