Herodotus and Thucydides – the original fathers of Greek Historiography – are regarded as the first two historians.
Writing hundreds of years after Homer, Herodotus compiled his History (1) based on oral accounts and myth. A genial storyteller, Herodotus did not regard his writing as epic poetry. The History, which explores centuries of dramatic interaction between the ancient Greeks and the Persian Empire, culminating with the Persian Wars in the early fifth century BC, is a vast compilation of the history, customs and beliefs of the Greeks and "barbarians". Herodotus' historical reliability depends on that of his predecessors, as his historical account is a composition that includes their notions of history, geography, natural history and anthropology, in a political and literary context.
A generation after Herodotus, Thucydides, who strove for objectivity, wrote about political and military events that occurred during his lifetime, with a close account of the war between Athens and Sparta in late fifth century BC. Thucydides' history of The Peloponnesian War (2) is the composition of an astute political and military historian. In a disciplined and methodical style, his work analyzes issues related to the wars, with little digression into other areas.
Similarities and differences between Herodotus' and Thucydides' histories have been the topic of much research and dissertation in classic scholarship analyzing their work on issues of historical truth and interpretation, history's relation to myth, the fascination with origins, the differences between chronicle and narrative history.
In order to compare and contrast the historical methods, interests, and objectives of Herodotus and Thucydides we must examine the characteristics of their literary method, including the narrative, description, authorial analysis, interest in accuracy, etc., and their historical inquiry – the authors' objectives in writing the history.
Herodotus' and Thucydides' innovative methods of conveying the experience of historical events and their interpretation have emerged in the context of traditionally vibrant ancient Greek culture. A range of literary allusions to myth and folklore, to earlier epic, to lyric and epigram, the pervasive influence of Homer found in the work of Herodotus, "the broad lines of The History shaped like those of a Greek tragedy" (5), are explicitly relevant with regard to the historian's connection with his cultural and literary milieu – "for this History of mine has from the beginning sought out the supplementary to the main argument". (6) Scholarly investigation of the Peloponnesian War has revealed plausible "intertextual" connections between the dense text of Thucydides and the epic of his predecessors. (7) One relevant example of such connection is said to occur in structuring some of Thucydides' plot-patterns, like the similarities between Nikias' letter and Agamemnon's speech, in Homer or that between the Athenians' expedition to Sicily and Homer's Odysseus' return to Ithaca. (8) Another "intertextual" connection has been noted in the similar choice of words and structuring of the accounts between Herodotus' narrative of the Persian invasion of Greece and Thucydides' narrative of the Sicilian expedition (9) One particular characteristic of Thucydides writing style is the pervasive interspersing of speeches within the body of his work. A very famous one is Pericles Funeral Oration, which became the model for many later speeches, and was very well known in antiquity.
A major distinction between Herodotus' and Thucydides' writings consists in their different assessment of what history is. Herodotus' concept of history, focusing on the diversity of the universal human experience, contains an expansive field of human inquiry that, later, became to be known as Cultural History. Thucydides, who presented history in context, focusing on political and military facts and events of his times, has been credited with writing the original "scientific" history. Herodotus and Thucydides employ different strategies in recounting the story of history. Herodotus narrates centuries of history within the mystery of cultures while Thucydides employs a reductionist and analytical strategy.
Herodotus' and Thucydides' works, which differ in many ways, also share many characteristics like the magnitude of their prose, the elusiveness with respect to meanings, the contribution to the understanding of ancient societies, their subject matter dealing with causes and course of war, their fascination with "origins", or their vision of "civilization" and "barbarians." Although Herodotus' eclectic manner of gathering information stands in contrast to Thucydides' problem-oriented style, they both regard telling the truth as mandatory to historical method.
When comparing Herodotus' method with that of Thucydides we notice that Herodotus appears throughout The History as an uncommitted Homeric observer, famously taking the risk of reporting hearsay as evidence, and occasionally crediting the gods with causes and outcomes of historical events. By contrast, Thucydides' historical method is based on precise, verifiable evidence and reflects a systematic understanding of the human and military politics. He devoted most of his adult life to the chronicles of the Peloponnesian War and sought all available evidence, in the form of written documents and eyewitness reports, to construct his account.
The difference between Herodotus' introduction and that of Thucydides is as remarkable as the difference in their method of historical inquiry.
Herodotus' method of inquiry consisted of relying on other peoples' testimony, customs and laws to speculate about the sincerity and motives of the sources upon which he compiled the accounts of his History. For example, Herodotus challenges Homer's assertion that the breaking of guest-friend taboo and the abduction of Helen were at the root of the Trojan conflict. But Herodotus does not completely reject Homer's story.He only calls into question Homer's story by invoking different versions of that story. But the speculations about the original story cast sufficient enough doubt to annihilate its merits, similarly to the way in which, throughout the Histories, seemingly small events cause colossal disasters.
Contrary to Herodotus, Thucydides offers rational explanations as evidence for his claims and for the causes of later events that could be reasonably expected on the basis of that evidence. For example, Thucydides attempts to justify the authoritative claim made in the introduction about the Peloponnesian war – that had just started – being more important than the wars before it – a real turning point in history. Thucydides investigates the Trojan War and the Persian wars for evidence that supports his views.His method of inquiry consists in rigorous investigation attempting to provide rational accounts through an innovative use of empirical data, simulating the methods used by Greek sciences of the time in the investigation of natural phenomena.
Thucydides rejects Herodotus' invocations of supernatural explanation when accounting for historical conflict. Instead, Thucydides uses a scientific, inductive method of inquiry to construct his theory of history. He considers the actual events, examines the constraints and options available to the protagonists, and then searches for possible consequences of the events in order to speculate about the causes of the initial event. His notions are always open to revision, without necessarily rejecting his previous explanations, but rather expanding his explanation in order to include this new information.


A church here was repaired in 1493 so that the inhabitants would not have to walk to Wimborne for services, which they were finding trying in bad weather. It was completely rebuilt in brick in 1836 to a design by John Tulloch, who was responsible for two or three other churches in the county. T.H.Wyatt was responsible for the chancel of 1875, which hugely improves the otherwise rather plain interior. The pulpit is early 17c and was brought from Wimborne Minster in 1858.


This has to be the easiest of recipes with ground beef or mince as it's known in UK and Australia. Best of all, these are low fat meat balls. These easy meat balls are mixed together and popped in a hot pan to fry. This recipe makes 50 medium sized meat balls so that half can be frozen to be reheated for another meal.
1. Buy only premium grade ground beef. This meat will have less fat in it and there's less waste.
2. As you know, very few of my recipes use oil and it is the same with these easy ground beef meat balls. Use a non-stick electric fry pan so that there's no need for oil AND so you can cook 25 of the meat balls in one go.
Removing oil for cooking from your diet means you keep your slim hips for a little longer!
3. While other recipes call for sour cream, it is much better to replace it with low fat cream cheese and increase the amount of stock.
4. You won't have the bother of pouring off excess fat with this recipe with ground beef using these low fat instructions.
Makes 50 medium sized meat balls.
This makes 50 medium sized low fat meat balls, which is enough for 8 - 10 servings.
Always use PREMIUM grade ground beef or mince. There is no substitute for quality.
It is best to use little to no oil in your cooking.
An electric fry pan will cook 25 medium sized meat balls.
Once cooled, store the surplus low fat meat balls in an airtight container and freeze.


Becky Selengut is a private chef, author (Washington Local and Seasonal Cookbook, Good Fish), columnist (Edible Seattle) and cooking teacher. She worked for 3 years at the internationally acclaimed Herbfarm Restaurant under her mentor, Chef Jerry Traunfeld before setting out on her own to start Cornucopia, her private chef and education business.
She's at work on her third cookbook, "Shroom: Mind-bendingly good recipes for wild and cultivated mushrooms" (Andrews McMeel Fall 2014).
A veteran restaurant chef, recipe developer and editor, private chef and menu consultant, Myra Kornfeld is the author of great cookbooks, including The Healthy Hedonist: More than 200 Delectable Flexitarian Recipes, available at MyraKornfeld.com.
She's also the Head Chef & Content Manager of MyFoodMyHealth.com, and teaches at the three top U.S. schools focused on healthy cuisine.
A nationally-recognized expert on the role of food in supporting health during cancer treatment, Rebecca Katz has a Masters of Science degree in Health & Nutrition Education, and received her culinary training from New York's Natural Gourmet Institute for Health & Culinary Arts.
Her most recent cookbook is The Longevity Kitchen, featuring the top 16 power foods, including wild salmon. Visit RebeccaKatz.com.


text:
Israel/ Palestine
Israel Blocks Coronavirus Respirators, Aid, to Gaza until Remains of 2 Israeli Invaders are Returned
Middle East Monitor 04/06/2020
By Motasem A Dalloul | @abujomaaGaza |
'The Israeli defence minister must know that the Palestinians in the Gaza Strip put all their hostilities with the Israeli occupation aside and provided Israel with millions of medical face masks, while it faces an increasing outbreak of the coronavirus'
( Middle East Monitor ) – In response to a humanitarian appeal launched by the Palestinian Ministry of Health in Gaza to obtain $23 million in urgent aid, in addition to medicine and medical equipment including 250 respirators in order to deal with the coronavirus in the besieged enclave, Israeli Defence Minister Naftali Bennett announced that no humanitarian aid will be allowed into Gaza, until the release of Israeli soldiers, or their remains, captured by the Palestinian resistance movement Hamas.
"There is talk of the humanitarian world in Gaza – Israel also has humanitarian needs, which are mainly the recovery of the fallen," Bennett disclosed. "I think that we need to enter a broad dialogue about Gaza's and our humanitarian needs. It would not be right to disconnect these things… and certainly, our hearts would be open to many things," he added.
Linking the issue of the Israeli soldiers, or remains of soldiers, to the issue of the urgent humanitarian needs for the Gaza Strip related to the fight against the coronavirus, is nothing short of deceptive. It is nothing more than an attempt by Bennett to paint a glowing image of himself and his country, and convey that they are concerned with humanity, while the Gazan rulers are portrayed as savages due to withholding two, or the remains of two, Israelis in Gaza.
The two Israeli soldiers were captured or killed while they were in their tanks bombing Palestinian homes and killing civilians in 2014, when the 51-day Israeli offensive killed more than 2,260 Palestinians, including more than 400 children and nearly the same number of women, wounding more than 11,000 others.
If two Israeli soldiers are being held by the Palestinians and the Israeli defence minister wanted them to be released on a humanitarian grounds, why did not he release 5,000 Palestinian prisoners living in dire conditions in Israeli jails, including 43 women and girls, 250 boys and over 1,000 patients, with at least 250 suffering from serious conditions?
Several rights groups have warned that the Palestinian prisoners inside Israeli jails are vulnerable to contracting coronavirus, given the overcrowded prisons and bad ventilation, with a severe lack of hygiene. On Thursday, the Israeli Prison Service let out six Palestinian prisoners from Ofer Prison. They must have contracted the coronavirus because a prisoner from the same prison had been recently released and tested positive for the virus. Rights groups have reiterated several times that Israel is imposing a media blackout regarding the news about the coronavirus among prisoners, in order not to underscore their humanitarian crimes.
Meanwhile, if the Israeli defence minister wanted the release of the Israeli soldiers captured in Gaza on humanitarian grounds, why did he not lift his country's strict and illegal siege imposed on the Gaza Strip in 2007? Why did he not look at the number of Palestinians who died due to the lack of medical equipment, proper healthcare and medicine as a result of his country's siege? Why did he not look at the thousands of Palestinians who are still displaced because they could not rebuild their homes which were destroyed by his army in 2014? Why did he not consider the hundreds of children, mothers and fathers who have been waiting to be reunited with their loved ones who have been imprisoned by his country?
Despite all of this, the Israeli defence minister must know that the Palestinians in the Gaza Strip put all their hostilities with the Israeli occupation aside and provided Israel with millions of medical face masks, while it faces an increasing outbreak of the coronavirus.
Hassan Shehata, owner of a sewing factory in Gaza, told AFP that the Israeli companies sent materials to him, and his factory is to make millions of medical masks for Israel. The owner of another factory in Gaza revealed that he has already signed contracts with Israeli business partners to provide one million masks and 50,000 protective suits by the end of April.
Mr Bennett, we do not want people like you, with the blood of innocent people on their hands, to teach us, the Palestinians, lessons about humanity and morals. Please, do not paint an innocent image of you and your unscrupulous country at the expense of our suffering inflicted by you and your violent state. Enough of your merchandising of humanity on the world, while you remain inhumane.
The views expressed in this article belong to the author and do not necessarily reflect the editorial policy of Middle East Monitor or Informed Comment.
Via Middle East Monitor
This work by Middle East Monitor is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
RT UK "Hamas Health Ministry asks for $20m to help with COVID-19"
Filed Under: Israel/ Palestine
Middle East Monitor is a not-for-profit press monitoring organization, founded on 1 July 2009, and based in London. Journalists who have written for it include Amelia Smith, Diana Alghoul, Ben White, Jehan Alfarra and Jessica Purkiss. The editorial line straddles the British left and the British Muslim religious Right.

redpajama_set_name: RedPajamaCommonCrawl


text:
Samnanger je občina v administrativni regiji Hordaland na Norveškem.

Občine Norveške

redpajama_set_name: RedPajamaWikipedia


There's this telling bit when the writer, Rebecca Johnson, is allowed to look at Abedin's Black Berry—but only if she agrees not to write who's in it.) But then, why the non sequitur about John Cusack and Lance Armstrong?Looking through Abedin's closet, you can see the progression from a young college graduate who wore Ann Taylor suits, thrilled to land a job as an intern in the White House, to, eleven years later, a Chanel-wearing, deeply confident 32-year-old woman whose Black Berry contains some of the most famous names in America—she lets me look only if I agree not to say who.2004 - 2004Rebecca Romijn and John Cusack were rumored to be an item after she announced her separation from hubby John Stamos in 2004. Sources are saying that his love life isn't currently his priority!The 53-year-old actor is, instead, focusing on his social life and rekindling old friendships amid his split from Angelina Jolie. "Old friends are back in his life, and he seems happy about it." Brad is also taking care of his body! "He's in very good shape." "He seems much happier," they added.The word has only leaked here and there, but as you read this, the likelihood is quite high that anyone associated with NYLON who has a Raya account is probably getting flayed by folks in black trench coats. However, the approval process is not exactly clear-cut.Do not worry: The so-called Tinder for Illuminati has built its cache by flying under the radar. )Here's what we know: The app has been around for over a year—and though it bills itself as a connector for "creative types," it mostly has very beautiful folks with 5,000-plus Instagram followers. From what we can glean, you need to meet at least four out of the five following criteria in order to be accepted: Fortunately, a few of us have been blessed to have encountered some of these denizens of Raya (or, hey, maybe even got accepted to Raya ourselves, though rule number one prevents us from actually admitting that), and after being slightly starstruck by the company, we started compiling a list of famous people that popped up.
Raya, the dating app used by the lead singer of Weezer.The second rule of Raya: You do not talk about Raya, so much so that the app punishes you for even taking screen grabs. Exclusivity works.)So why would the super famous need a dating app to meet new people?


text:
Q: Get highest en lowest value from attribute On the category page I have an attribute showing values, that attribute can have multiple values and will show all the values separated by commas. Is there a way to get the highest value from the attribute and also the lowest?
What is have to display the values:
<?php if ($_product->getResource()->getAttribute('scherm_breedte')->getFrontend()->getValue($_product)): ?>
    Breedte: <?php echo $_product->getResource()->getAttribute('scherm_breedte')->getFrontend()->getValue($_product); ?>
<?php endif; ?>

A: Basically its not a Magento question rather a PHP question.
Try like this
$attribtesData = $_product->getResource()->getAttribute('scherm_breedte')->getFrontend()->getValue($_product);
    $attributeDataArray = explode(",",$attribtesData);

    echo 'Max attribute Value = '.max($attributeDataArray);
    echo 'Min attribute Value = '.min($attributeDataArray);

Hope this helps you.

redpajama_set_name: RedPajamaStackExchange


text:
Science Science News
A real scorcher: NASA probe to fly into sun's atmosphere
The Parker Solar Probe is set to orbit within 3.9 million miles of the sun's surface, where temperatures exceed 2,500 Fahrenheit (1,377 Celsius)
A new NASA mission aims to brush by the sun, coming closer than any spacecraft in history to its scorching heat and radiation in order to reveal how stars are made, the US space agency said Wednesday.
After liftoff from Kennedy Space Center in Florida in July 2018, the Parker Solar Probe will become the first to fly directly into the sun's atmosphere, known as the corona.
The plan for the unmanned spacecraft is to orbit within 3.9 million miles (6.3 million kilometers) of the sun's surface.
Temperatures in that region exceed 2,500 Fahrenheit (1,377 Celsius), for which the spacecraft is equipped with a 4.5-inch-thick (11.43 cm) carbon-composite shield.
Roughly the size of a small car, the probe will make seven flybys of the sun over a seven-year period, in what NASA described as a "mission of extremes."
Traveling at a speed of 430,000 mph, the spacecraft will move fast — like going from New York City to Tokyo in less than a minute.
Scientists hope its data will improve forecasts of solar storms and space weather events that affect life on Earth, satellites and astronauts in space.
– Time for a visit –
The spacecraft will measure plasma waves and high-energy particles, and carry a white light imager to capture images of the structures through which it is flying, according to Nicola Fox, mission project scientist at the Johns Hopkins University Applied Physics Laboratory in Laurel, Maryland.
"We will brush closely by it," she said at an event in Chicago to unveil the mission, which NASA has touted as promising to provide humanity's closest-ever observations of a star.
"You can learn so much from looking out the window," Fox said. "You can see the sun is shining, you can see the birds are singing. But until you actually go out, you have no idea quite how hot it is out there or how windy it is, or what the conditions are like."
"I think we have really come as far as we can with looking at things and now it is time to go up and pay it a visit," she added.
A 20-day launch window for the spacecraft's liftoff atop a Delta IV Heavy rocket opens July 31, 2018.
– Re-named after astrophysicist –
Initially called Solar Probe Plus, the mission was renamed after the astrophysicist Eugene Parker, 89, professor emeritus at the University of Chicago.
He published the first paper to describe solar wind — the high-speed matter and magnetism constantly escaping the sun — in 1958.
"This is the first time NASA has named a spacecraft for a living individual," said Thomas Zurbuchen, associate administrator for NASA's Science Mission Directorate in Washington.
"It's a testament to the importance of his body of work, founding a new field of science that also inspired my own research and many important science questions NASA continues to study and further understand every day."
Parker, who is days away from his 90th birthday, described the mission as "very exciting."
"One would like to have some more detailed measurements of what's going on in the solar wind," he said.
"I'm sure that there will be some surprises," he added. "There always are."
Report by Kerry SHERIDAN; AFP
Tags atmosphere NASA solar energy solar probe sun sun surface


text:
"""
Test helper functions from numba.numpy_support.
"""

import sys
from itertools import product

import numpy as np

import unittest
from numba.core import types
from numba.core.errors import NumbaNotImplementedError
from numba.tests.support import TestCase
from numba.tests.enum_usecases import Shake, RequestError
from numba.np import numpy_support

class TestFromDtype(TestCase):

    def test_number_types(self):
        """
        Test from_dtype() and as_dtype() with the various scalar number types.
        """
        f = numpy_support.from_dtype

        def check(typechar, numba_type):
            # Only native ordering and alignment is supported
            dtype = np.dtype(typechar)
            self.assertIs(f(dtype), numba_type)
            self.assertIs(f(np.dtype('=' + typechar)), numba_type)
            self.assertEqual(dtype, numpy_support.as_dtype(numba_type))

        check('?', types.bool_)
        check('f', types.float32)
        check('f4', types.float32)
        check('d', types.float64)
        check('f8', types.float64)

        check('F', types.complex64)
        check('c8', types.complex64)
        check('D', types.complex128)
        check('c16', types.complex128)

        check('O', types.pyobject)

        check('b', types.int8)
        check('i1', types.int8)
        check('B', types.uint8)
        check('u1', types.uint8)

        check('h', types.int16)
        check('i2', types.int16)
        check('H', types.uint16)
        check('u2', types.uint16)

        check('i', types.int32)
        check('i4', types.int32)
        check('I', types.uint32)
        check('u4', types.uint32)

        check('q', types.int64)
        check('Q', types.uint64)
        for name in ('int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32',
                     'int64', 'uint64', 'intp', 'uintp'):
            self.assertIs(f(np.dtype(name)), getattr(types, name))

        # Non-native alignments are unsupported (except for 1-byte types)
        foreign_align = '>' if sys.byteorder == 'little' else '<'
        for letter in 'hHiIlLqQfdFD':
            self.assertRaises(NumbaNotImplementedError, f,
                              np.dtype(foreign_align + letter))

    def test_string_types(self):
        """
        Test from_dtype() and as_dtype() with the character string types.
        """
        def check(typestring, numba_type):
            # Only native ordering and alignment is supported
            dtype = np.dtype(typestring)
            self.assertEqual(numpy_support.from_dtype(dtype), numba_type)
            self.assertEqual(dtype, numpy_support.as_dtype(numba_type))

        check('S10', types.CharSeq(10))
        check('a11', types.CharSeq(11))
        check('U12', types.UnicodeCharSeq(12))

    def check_datetime_types(self, letter, nb_class):
        def check(dtype, numba_type, code):
            tp = numpy_support.from_dtype(dtype)
            self.assertEqual(tp, numba_type)
            self.assertEqual(tp.unit_code, code)
            self.assertEqual(numpy_support.as_dtype(numba_type), dtype)
            self.assertEqual(numpy_support.as_dtype(tp), dtype)

        # Unit-less ("generic") type
        check(np.dtype(letter), nb_class(''), 14)

    def test_datetime_types(self):
        """
        Test from_dtype() and as_dtype() with the datetime types.
        """
        self.check_datetime_types('M', types.NPDatetime)

    def test_timedelta_types(self):
        """
        Test from_dtype() and as_dtype() with the timedelta types.
        """
        self.check_datetime_types('m', types.NPTimedelta)

    def test_struct_types(self):
        def check(dtype, fields, size, aligned):
            tp = numpy_support.from_dtype(dtype)
            self.assertIsInstance(tp, types.Record)
            # Only check for dtype equality, as the Numba type may be interned
            self.assertEqual(tp.dtype, dtype)
            self.assertEqual(tp.fields, fields)
            self.assertEqual(tp.size, size)
            self.assertEqual(tp.aligned, aligned)

        dtype = np.dtype([('a', np.int16), ('b', np.int32)])
        check(dtype,
              fields={'a': (types.int16, 0, None, None),
                      'b': (types.int32, 2, None, None)},
              size=6, aligned=False)

        dtype = np.dtype([('a', np.int16), ('b', np.int32)], align=True)
        check(dtype,
              fields={'a': (types.int16, 0, None, None),
                      'b': (types.int32, 4, None, None)},
              size=8, aligned=True)

        dtype = np.dtype([('m', np.int32), ('n', 'S5')])
        check(dtype,
              fields={'m': (types.int32, 0, None, None),
                      'n': (types.CharSeq(5), 4, None, None)},
              size=9, aligned=False)

    def test_enum_type(self):

        def check(base_inst, enum_def, type_class):
            np_dt = np.dtype(base_inst)
            nb_ty = numpy_support.from_dtype(np_dt)
            inst = type_class(enum_def, nb_ty)
            recovered = numpy_support.as_dtype(inst)
            self.assertEqual(np_dt, recovered)

        dts = [np.float64, np.int32, np.complex128, np.bool_]
        enums = [Shake, RequestError]

        for dt, enum in product(dts, enums):
            check(dt, enum, types.EnumMember)

        for dt, enum in product(dts, enums):
            check(dt, enum, types.IntEnumMember)

class ValueTypingTestBase(object):
    """
    Common tests for the typing of values.  Also used by test_special.
    """

    def check_number_values(self, func):
        """
        Test *func*() with scalar numeric values.
        """
        f = func
        # Standard Python types get inferred by numpy
        self.assertIn(f(1), (types.int32, types.int64))
        self.assertIn(f(2**31 - 1), (types.int32, types.int64))
        self.assertIn(f(-2**31), (types.int32, types.int64))
        self.assertIs(f(1.0), types.float64)
        self.assertIs(f(1.0j), types.complex128)
        self.assertIs(f(True), types.bool_)
        self.assertIs(f(False), types.bool_)
        # Numpy scalar types get converted by from_dtype()
        for name in ('int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32',
                     'int64', 'uint64', 'intc', 'uintc', 'intp', 'uintp',
                     'float32', 'float64', 'complex64', 'complex128',
                     'bool_'):
            val = getattr(np, name)()
            self.assertIs(f(val), getattr(types, name))

    def _base_check_datetime_values(self, func, np_type, nb_type):
        f = func
        for unit in [
            '', 'Y', 'M', 'D', 'h', 'm', 's',
            'ms', 'us', 'ns', 'ps', 'fs', 'as',
        ]:
            if unit:
                t = np_type(3, unit)
            else:
                # "generic" datetime / timedelta
                t = np_type('Nat')
            tp = f(t)
            # This ensures the unit hasn't been lost
            self.assertEqual(tp, nb_type(unit))

    def check_datetime_values(self, func):
        """
        Test *func*() with np.datetime64 values.
        """
        self._base_check_datetime_values(func, np.datetime64, types.NPDatetime)

    def check_timedelta_values(self, func):
        """
        Test *func*() with np.timedelta64 values.
        """
        self._base_check_datetime_values(func, np.timedelta64,
                                         types.NPTimedelta)

class TestArrayScalars(ValueTypingTestBase, TestCase):

    def test_number_values(self):
        """
        Test map_arrayscalar_type() with scalar number values.
        """
        self.check_number_values(numpy_support.map_arrayscalar_type)

    def test_datetime_values(self):
        """
        Test map_arrayscalar_type() with np.datetime64 values.
        """
        f = numpy_support.map_arrayscalar_type
        self.check_datetime_values(f)
        # datetime64s with a non-one factor shouldn't be supported
        t = np.datetime64('2014', '10Y')
        with self.assertRaises(NotImplementedError):
            f(t)

    def test_timedelta_values(self):
        """
        Test map_arrayscalar_type() with np.timedelta64 values.
        """
        f = numpy_support.map_arrayscalar_type
        self.check_timedelta_values(f)
        # timedelta64s with a non-one factor shouldn't be supported
        t = np.timedelta64(10, '10Y')
        with self.assertRaises(NotImplementedError):
            f(t)

class FakeUFunc(object):
    __slots__ = ('nin', 'nout', 'types', 'ntypes')
    __name__ = "fake ufunc"

    def __init__(self, types):
        self.types = types
        in_, out = self.types[0].split('->')
        self.nin = len(in_)
        self.nout = len(out)
        self.ntypes = len(types)
        for tp in types:
            in_, out = self.types[0].split('->')
            assert len(in_) == self.nin
            assert len(out) == self.nout

# Typical types for np.add, np.multiply, np.isnan
_add_types = ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I',
              'll->l', 'LL->L', 'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d',
              'gg->g', 'FF->F', 'DD->D', 'GG->G', 'Mm->M', 'mm->m', 'mM->M',
              'OO->O']

_mul_types = ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I',
              'll->l', 'LL->L', 'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d',
              'gg->g', 'FF->F', 'DD->D', 'GG->G', 'mq->m', 'qm->m', 'md->m',
              'dm->m', 'OO->O']

# Those ones only have floating-point loops
_isnan_types = ['e->?', 'f->?', 'd->?', 'g->?', 'F->?', 'D->?', 'G->?']
_sqrt_types = ['e->e', 'f->f', 'd->d', 'g->g', 'F->F', 'D->D', 'G->G', 'O->O']

class TestUFuncs(TestCase):
    """
    Test ufunc helpers.
    """

    def test_ufunc_find_matching_loop(self):
        f = numpy_support.ufunc_find_matching_loop
        np_add = FakeUFunc(_add_types)
        np_mul = FakeUFunc(_mul_types)
        np_isnan = FakeUFunc(_isnan_types)
        np_sqrt = FakeUFunc(_sqrt_types)

        def check(ufunc, input_types, sigs, output_types=()):
            """
            Check that ufunc_find_matching_loop() finds one of the given
            *sigs* for *ufunc*, *input_types* and optional *output_types*.
            """
            loop = f(ufunc, input_types + output_types)
            self.assertTrue(loop)
            if isinstance(sigs, str):
                sigs = (sigs,)
            self.assertIn(loop.ufunc_sig, sigs,
                          "inputs=%s and outputs=%s should have selected "
                          "one of %s, got %s"
                          % (input_types, output_types, sigs, loop.ufunc_sig))
            self.assertEqual(len(loop.numpy_inputs), len(loop.inputs))
            self.assertEqual(len(loop.numpy_outputs), len(loop.outputs))
            if not output_types:
                # Add explicit outputs and check the result is the same
                loop_explicit = f(ufunc, list(input_types) + loop.outputs)
                self.assertEqual(loop_explicit, loop)
            else:
                self.assertEqual(loop.outputs, list(output_types))
            # Round-tripping inputs and outputs
            loop_rt = f(ufunc, loop.inputs + loop.outputs)
            self.assertEqual(loop_rt, loop)
            return loop

        def check_exact(ufunc, input_types, sigs, output_types=()):
            """
            Like check(), but also ensure no casting of inputs occurred.
            """
            loop = check(ufunc, input_types, sigs, output_types)
            self.assertEqual(loop.inputs, list(input_types))

        def check_no_match(ufunc, input_types):
            loop = f(ufunc, input_types)
            self.assertIs(loop, None)

        # Exact matching for number types
        check_exact(np_add, (types.bool_, types.bool_), '??->?')
        check_exact(np_add, (types.int8, types.int8), 'bb->b')
        check_exact(np_add, (types.uint8, types.uint8), 'BB->B')
        check_exact(np_add, (types.int64, types.int64), ('ll->l', 'qq->q'))
        check_exact(np_add, (types.uint64, types.uint64), ('LL->L', 'QQ->Q'))
        check_exact(np_add, (types.float32, types.float32), 'ff->f')
        check_exact(np_add, (types.float64, types.float64), 'dd->d')
        check_exact(np_add, (types.complex64, types.complex64), 'FF->F')
        check_exact(np_add, (types.complex128, types.complex128), 'DD->D')

        # Exact matching for datetime64 and timedelta64 types
        check_exact(np_add, (types.NPTimedelta('s'), types.NPTimedelta('s')),
                    'mm->m', output_types=(types.NPTimedelta('s'),))
        check_exact(np_add, (types.NPTimedelta('ms'), types.NPDatetime('s')),
                    'mM->M', output_types=(types.NPDatetime('ms'),))
        check_exact(np_add, (types.NPDatetime('s'), types.NPTimedelta('s')),
                    'Mm->M', output_types=(types.NPDatetime('s'),))
        check_exact(np_add, (types.NPDatetime('s'), types.NPTimedelta('')),
                    'Mm->M', output_types=(types.NPDatetime('s'),))
        check_exact(np_add, (types.NPDatetime('ns'), types.NPTimedelta('')),
                    'Mm->M', output_types=(types.NPDatetime('ns'),))
        check_exact(np_add, (types.NPTimedelta(''), types.NPDatetime('s')),
                    'mM->M', output_types=(types.NPDatetime('s'),))
        check_exact(np_add, (types.NPTimedelta(''), types.NPDatetime('ns')),
                    'mM->M', output_types=(types.NPDatetime('ns'),))
        check_exact(np_mul, (types.NPTimedelta('s'), types.int64),
                    'mq->m', output_types=(types.NPTimedelta('s'),))
        check_exact(np_mul, (types.float64, types.NPTimedelta('s')),
                    'dm->m', output_types=(types.NPTimedelta('s'),))

        # Mix and match number types, with casting
        check(np_add, (types.bool_, types.int8), 'bb->b')
        check(np_add, (types.uint8, types.bool_), 'BB->B')
        check(np_add, (types.int16, types.uint16), 'ii->i')
        check(np_add, (types.complex64, types.float64), 'DD->D')
        check(np_add, (types.float64, types.complex64), 'DD->D')
        # Integers, when used together with floating-point numbers,
        # should cast to any real or complex (see #2006)
        int_types = [types.int32, types.uint32, types.int64, types.uint64]
        for intty in int_types:
            check(np_add, (types.float32, intty), 'ff->f')
            check(np_add, (types.float64, intty), 'dd->d')
            check(np_add, (types.complex64, intty), 'FF->F')
            check(np_add, (types.complex128, intty), 'DD->D')
        # However, when used alone, they should cast only to
        # floating-point types of sufficient precision
        # (typical use case: np.sqrt(2) should give an accurate enough value)
        for intty in int_types:
            check(np_sqrt, (intty,), 'd->d')
            check(np_isnan, (intty,), 'd->?')

        # With some timedelta64 arguments as well
        check(np_mul, (types.NPTimedelta('s'), types.int32),
              'mq->m', output_types=(types.NPTimedelta('s'),))
        check(np_mul, (types.NPTimedelta('s'), types.uint32),
              'mq->m', output_types=(types.NPTimedelta('s'),))
        check(np_mul, (types.NPTimedelta('s'), types.float32),
              'md->m', output_types=(types.NPTimedelta('s'),))
        check(np_mul, (types.float32, types.NPTimedelta('s')),
              'dm->m', output_types=(types.NPTimedelta('s'),))

        # No match
        check_no_match(np_add, (types.NPDatetime('s'), types.NPDatetime('s')))
        # No implicit casting from int64 to timedelta64 (Numpy would allow
        # this).
        check_no_match(np_add, (types.NPTimedelta('s'), types.int64))

    def test_layout_checker(self):
        def check_arr(arr):
            dims = arr.shape
            strides = arr.strides
            itemsize = arr.dtype.itemsize
            is_c = numpy_support.is_contiguous(dims, strides, itemsize)
            is_f = numpy_support.is_fortran(dims, strides, itemsize)
            expect_c = arr.flags['C_CONTIGUOUS']
            expect_f = arr.flags['F_CONTIGUOUS']
            self.assertEqual(is_c, expect_c)
            self.assertEqual(is_f, expect_f)

        arr = np.arange(24)
        # 1D
        check_arr(arr)
        # 2D
        check_arr(arr.reshape((3, 8)))
        check_arr(arr.reshape((3, 8)).T)
        check_arr(arr.reshape((3, 8))[::2])
        # 3D
        check_arr(arr.reshape((2, 3, 4)))
        check_arr(arr.reshape((2, 3, 4)).T)
        # middle axis is shape 1
        check_arr(arr.reshape((2, 3, 4))[:, ::3])
        check_arr(arr.reshape((2, 3, 4)).T[:, ::3])

        # leading axis is shape 1
        check_arr(arr.reshape((2, 3, 4))[::2])
        check_arr(arr.reshape((2, 3, 4)).T[:, :, ::2])
        # 2 leading axis are shape 1
        check_arr(arr.reshape((2, 3, 4))[::2, ::3])
        check_arr(arr.reshape((2, 3, 4)).T[:, ::3, ::2])
        # single item slices for all axis
        check_arr(arr.reshape((2, 3, 4))[::2, ::3, ::4])
        check_arr(arr.reshape((2, 3, 4)).T[::4, ::3, ::2])
        # 4D
        check_arr(arr.reshape((2, 2, 3, 2))[::2, ::2, ::3])
        check_arr(arr.reshape((2, 2, 3, 2)).T[:, ::3, ::2, ::2])
        # outer zero dims
        check_arr(arr.reshape((2, 2, 3, 2))[::5, ::2, ::3])
        check_arr(arr.reshape((2, 2, 3, 2)).T[:, ::3, ::2, ::5])

if __name__ == '__main__':
    unittest.main()

redpajama_set_name: RedPajamaGithub


New York, George H. Doran Co., 1917, 1st ed. 263 pp, 20 b/w photos, mapped end papers. Green cloth pictorial hardcover - no dust jacket issued. Book's only flaw is a slightly faded spine and minor corner bumps, else in remarkably fine condition for a book this age with bright cover image and cloth covers in excellent condition. Fine condition.
"Our design in the following pages is to direct the attention and interest of nature-lovers to one of the newer play-grounds of our country, Glacier National Park, in the Rocky Mountains of Montana." - From the Foreword.
The book's chapters include, Nature's Great Playground; Hotels and Chalets; On the Mount Henry Trail; Trails and Roads; The Old Travois Trail; The Flower Fields of Glacier National Park, and many more.


#BrightSchools Competition Your Middle Schooler Could Win a $5,000 STEM Award!
Comments Off on #BrightSchools Competition Your Middle Schooler Could Win a $5,000 STEM Award!
Any kiddo sleeping in a car strapped into seat belt inevitably ends up cranking their neck in most horrible position while sleeping. SOLUTION? SNECK PIllow!
Win One of 4 $1,000 Fundraising Kits for your School or Non-Profit from See's Candies!
There are 3 types of back to school clothes shoppers. Which type are you?
Comments Off on Thinking Summer Travel Solutions? Think Skype.
5 Travel Hacks from Skype to Keep YOUR Family Travel Plans on Track this Summer!
Do you feel like you have educated your kids surrounding emergencies that can happen in vehicles? Not just the big-HUGE-CRASH type emergencies.


The Carrot Asian New Kurodo Daucus carota var staivus is popular in the Orient. The New Kurodo is one of the sweetest carrots you will ever eat. Late planting your garden? Kurodo is quite heat resistant so dont hesitate to plant in the late sprin.