text:
Fabulous flowers: rain, rich soil yield blooming bonanza in the Beartooths
The lavender flowers of the lilac are associated with refinement, grace, elegance and grief.
Walt Whitman's poem, "When Lilacs Last in the Dooryard Bloom'd" mourns the death of Lincoln.
The poppy bloomed on much of the Western Front in World War I, and is
a symbol of remembrance in the United States, Canada and elsewhere.
PRETTY PETALS, SWAYING STEMS, BOUNTY OF BLOOMS ARE TREATS OF SUMMER
Gran planted the thrift, this one "joystick red."
That which we call a rose
--from "Romeo and Juliet"
WHEN IT RAINS, we stay indoors and accomplish plenty: writing, repairing, tidying, packing for the next adventure. But when the sun's out in Montana, who can stay inside?
Nature's call is seductive, with a bonanza of blooming wonders. Housework be damned. That can happen when it rains.
The iris has come to be a symbol of hope, valor and friendship.
When Mr. Sol shines, we answer the call. We drink in the fresh mountain air, stroll about the yard and admire the iris, peony, poppies, lilacs, columbine, daisies, snapdragons and bluebells.
My grandmother Olive, a lifelong lover of flowers, quoted James Russell Lowell's "The Vision of Sir Launfal in this much loved poem:
"What is so rare as a day in June? Then, if ever, come perfect days; Then Heaven tries the earth if it be in tune, And over it softly her warm ear lays...So is my memory thrilled and stirred...."
It's hard not to be stirred and thrilled by a day in the Beartooth Mountains of Big Sky Country. Poets and historians, travel writers and nature
The columbine are spectacular this year,
lovers have waxed about Montana's beauty. John Steinbeck's homage is my favorite: "I'm in love with Montana. For other states I have admiration, respect, recognition, even some affection. But with Montana it is love."And love it is for me. My paternal grandfather Gustav Nystul came West in 1912, purchasing property now known as the Beartooth Ranch between Columbus and Absarokee.
He named it Sunnyside Ranch, and sunny it was. I remember lilacs blooming through spring snow, daisies in June, snapdragons in July, a haven of hollyhocks in August.
John Lennon said "Love is the flower you've got to let grow" and those of us in love with Montana know that feeling. Buddha loved nature and its transformative powers: "If we could see the miracle of a single flower
Remembrance is what we think of with the poppy.
clearly our whole life would change."
I remember my grandmother's love of the sea pink thrift, a beautiful bundle of blooms, and her affection for the poppy. For her and other Victorians, the poppy was an enduring symbol of remembrance of World War One. Winnipeg born, Gran's strong ties to Canada were lifelong. She and millions of North Americans wore poppies on Remembrance Day.
Lady Bird Johnson, championing her wonderful beautification projects said, "Where flowers bloom, so does hope."
The iris, whose botanical name is iris xiphium, symbolizes hope. It is my favorite flower blooming this time of year. My grandmother said it represents cherished friendship and valor. She taught us that her beloved iris is the inspiration for the fleur-de-lis, symbolizing the royal family of France.
A court jester's hat does come to mind with columbine.
The columbine, she believed, resembles the hat of a court jester. Indeed it does.
My late sister Peny named her only daughter Amarylla, inspired by her love of the amaryllis, a brilliant symbol of pride.
The daffodils were waning when we arrived at High Chaparral, but I love that this flower indicates rebirth, new beginnings and eternal life. It also symbolizes unrequited love.
I like to think, though, that we are worthy stewards of the land and that our love for Montana is reciprocated.
Jake Shimobokuru is perhaps the most famous ukulele player.
UP NEXT: Come learn the ukulele with us, explore its rich and fascinating history and discover how much fun it is to play Hawaii's famous instrument. The trusty little wonder of a stringed instrument came to the Islands with Portuguese fishermen and has become a much loved part of the allure of Hawaii. Most famous of its players today is Jake Shimobokuru. Meanwhile, remember to explore, learn and live and catch us each Friday for a unique take on travel, the arts, nature, family and more.
Posted by Bruce at 5:00 PM 7 comments, Post a Comment
Labels: Art, Mental health, Montana, Natural world, Travel, Wildlife
Hawaii by helicopter: Blue Hawaiian adventure soars above the clouds for hidden treasures
Honolulu's distinctive skyline is even more impressive when viewed from a helicopter.
STUNNING HAWAII VIEWS FROM A HELICOPTER MAKE FOR FABULOUS WAY TO SEE THE ISLANDS
Dole Plantation's pineapple fields make striking patterns from the air.
SOARING HIGH above the Pacific, Keller leaned over to me in our ringside seats. "We're flying with the birds," he whispered. It's true. Blue Hawaiian Helicopters delivers a thrilling experience, the closest we'll ever come to flying. Because we're so much closer to the ground than in an airplane, we see the pineapple fields, the motion of the waves hitting the beach, the high-rise hotels and waterfalls that seem almost touchable.
HAWAII is meant to be seen from as many vantage points as possible. The beach is an essential, and a mountain hike is a must. Snorkeling or scuba, definitely. But flying with the professionals
Blue Hawaiian Helicopters delivers fine views.
high above the land, looking down to admire the jungles and waterfalls that make Hawaii famous, is a treat to be experienced at least once in a lifetime.
"Keller and Cookie" about to board a Blue Hawaiian 'copter.
For decades, Hollywood studios have used Blue Hawaiian to make their films on the islands. "Pirates of the Caribbean" is one of the most famous films shot on Oahu, followed by a trio of the "Jurassic Park" blockbusters, several films about Pearl Harbor, "George of the Jungle" "Flight of the Intruder," "Crimson Tide" and many more.
So we boarded one of Blue Hawaiian's T2Eco-
Stars, with seven seats, including the pilot. The comfy, quiet ride was an hour of bliss and fascination with our expert pilot-guide pointing out movie locations, famous mountains and valleys, familiar buildings and of course, Diamond Head and the Pearl Harbor Arizona Memorial, Honolulu's two most famous landmarks.
"Pirates of the Caribbean" was shot in the lush forests of Oahu.
WE'VE TOURED several times with Blue Hawaiian Helicopters during its 34-year tenure, but not recently, and never on Oahu. The highly rated company serves all four principal islands. Hawaii's legendary archipelago has been attracting nature lovers, artists, hikers and adventurers for decades to explore the verdant rainforests and admire its
Diamond Head looms spectacularly.
cascading waterfalls. We loved seeing the white-sand and black-sand beaches from the air, and sweeping over the turquoise blue Pacific then up to the craters of Hawaii's volcanic badlands.
The helicopter is a great way to compare the differences of the islands, too.
OUR PILOT pointed out historic landings, and explained how Tahitians established permanent settlements on Oahu in about 500 ce. In 1795 Kamehameha I, king of the island of Hawaii, conquered Oahu and united the Hawaiian Islands. In 1845 the royal capital was moved from Lahaina, on Maui, to Honolulu, on Oahu. It is now the state capital. We viewed the buildings from on high.
WE ENJOYED a bird's eye view of Iolani Palace, the United State's only royal palace, with its revered history. Across the street is Hawaii's judicial system, with a building made famous in episodes of "Hawaii Five-O." (More on that next week.)
It was fun to watch the pilot at his controls, as we lifted off and arose, soaring over one of the country's most beautiful states.
Fun watching the pilot at his command station.
With seven of us in the vehicle, he skillfully circled at important sightings, making sure everyone had an opportunity to see everything.
Our favorites were the gorgeous pineapple fields, and the cone-shaped outcroppings of lava off Kualoa Point. Ka'a'awa Valley was beautiful, too, where many fun movies have been shot, including "Pirates of the Caribbean." The North Shore with its famous surfing beaches delighted my surfer.
Having been to Pearl Harbor the day before, it was thrilling seeing the Arizona memorial from the air. The snazzy orange and yellow "Magnum" helicopters were lifting off near us, so that was fun, too. We opted for the doors of Blue Hawaiian, though.
Our ride was smooth and unencumbered. Only one criticism could we offer: it was too short.
The beautiful and fast disappearing blooms of a poppy adorn the
hillside of High Chaparral, in south-central Montana.
UP NEXT: Flower power. We're soaking up an inordinate amount of summer moisture, and with that come beautiful blooms, in fact, a real gardener's bonanza. We'll share some of the photos from the past two weeks of floral abundance, and a few favorite lines of poetry about gardening. Meanwhile, remember to explore, learn and live, while you catch us each Friday for a novel look at the arts, travel, nature and family.
Labels: Adventure, Airlines, Famous Cities, History, Natural world, Road tripping, Travel
Swimming with sting rays on idyllic Antigua
The sting rays we swam with were friendly and enjoy people. The creature has one or more large sharp barbed dorsal spines near the base of the whiplike tail and is capable of inflicting severe wounds, and even death. We braved an encounter recently.
Christene Meyers, right, holds a sting ray with help from a naturalist.
GENTLE GIANTS OF THE SEA MAKE HUMAN CONTACT ON BEAUTIFUL ISLAND
The man in blue is the naturalist, guiding tourists
from Germany, Australia and the U.S.
IF YOU have never taken a swim with a sting ray, why not stretch yourself a bit, widen your horizons, try something new.
I am not a water baby like much of my family or my part-amphibian partner.
But I love nature and enjoy the bonds I've made with other species.
So I entered the water and for a brief, happy time, making friends with a pair of sting rays off Antigua.
Southern rays are the brightest rays in the
It's believed to be good luck to kiss a ray as they snorkelers do.
Caribbean. As promised, we found them friendly, gentle and as interested in us as we were in them.
According to my partner, photographer Bruce Keller, they have learned to trust humans because they get food from them, and because people treat them with respect.
WE FOUND the experience "a thrill of a lifetime," to use an overworked but accurate cliche. The cruise line billed it as "a unique opportunity to interact and feed the rays." What do these graceful guys and gals eat? Animals that are smaller and live on the bottom of the sea: worms, clams, oysters, shrimp, squid and fish smaller than they are. They're carnivors, like lions and tigers. Speaking of tigers, a segue to the incident with naturalist Steve Irwin. His bizarre death by a sting ray was caused because the creature believed his shadow was that of the tiger shark, the ray's greatest predator. That was a fluke. But the byword is still be careful and make slow movements.
The sting rays are friendly and swim up to humans.
The lure to visiting Stingray City is two-fold: besides the sting ray opportunity, Antigua offers some of the most magnificent snorkeling with brilliantly colored coral reefs and wildly colorful tropical fish.
WE TOOK a bus from our cruise
Captain Keller
on the boat to
swim with the rays.
You will be in a group when you venture out to swim with the sting rays.
ship terminal, then boarded a speedboat for a 15-minute ride which whisked us to a shallow pool with a white sand bottom surrounded by beautiful coral reef. You may stand up or swim with the rays. After feeding, snorkeling and taking pictures with our new friends, we returned to our land base for punch and a rinse off. The "city" has a small bird zoo, with disappointing small cages. The sting ray experience is the highlight.
TO CHECK on Antigua travel given recent safety issues, use a free service for travelers or nationals living abroad: Smart Travel Enrollment Program, or STEP, issues updated advisory on global travel safety, sanctioned by the U.S. State Department: step.state.gov.; stingraycityantigua.com
UP NEXT: Blue Hawaii beckons. That's Blue Hawaii Helicopter. Ride with us high above the clouds for a breathtaking adventure. The top-rated helicopter tour of the islands is waiting for you and we'll take you along on our journey above volcanic mountain tops, the city skyline of bustling Honolulu, the gorgeous canyons and beaches that make Hawaii famous -- and beautiful from a bird's eye view. Remember to explore, learn and live and catch us each Friday for a novel look at travel, art, nature and family.
Labels: Adventure, Cruising, Natural world, Personal History, Travel, Wildlife
Magical Montana: Big Sky Country beckons road warriors
The approach to the place we cherish, tucked away in the Beartooths.
"Montana has the kind of mountains I'd create if mountains were put on my agenda."
-- John Steinbeck in "My Travels with Charley"
Our little corner of the world, with clouds, trees,
mountains and the sound of the water.
BASKING IN BEAUTY OF BIG SKY COUNTRY
NO MATTER HOW far we wander -- to the fjords of Norway or the deserts Down Under -- we are no more excited than when we answer the call of the Big Sky sirens and return to Montana.
I'm a fourth generation native of the Treasure State and I love traveling the world.
But my heart soars and my breathing quickens when I glimpse the meandering Yellowstone River out the airplane window and see the Rimrocks framing the town of Billings.
And it's no more beautiful than this time of year, when the lilacs are still pretty in the high country and the lupine and mountain phlox are about to bloom.
Yes, it's a real cowboy -- not a rhinestone one. Working ranches mean
working cowboys to move cattle, deliver feed, check for problems.
OUR LITTLE corner of the Beartooths is dear to my heart. As a kid growing up in the 1950s, I traveled with my parents on regular trips "up country" to visit cousins in Roscoe and friends in Red Lodge. My grandparents played bridge with chums at a cabin on the West Fork of the Stillwater River near where 30 years later I'd buy property.
I rode my first horse on the Beartooth Ranch between Columbus and Absarokee, which my grandfather Gus owned a few proprietors back. (He called it "Sunnyside Ranch" and I have photos of me on the ancient horse, Peanuts, riding down the same road we see from Highway 78.)
Red Lodge boasts many restored Victorian homes, a treasure
to behold in Livingston, Billings, and other Montana towns.
For those of us grounded in the natural world, there's nothing more pleasing than spring after a brutal winter. While I can't claim to have suffered through the snow and chill, I've kept up on the miseries, stress and hard work of our rancher neighbors, and I feel grateful for their endurance and spirit. Nothing makes me happier than to have to stop the car while a cowboy moves cattle to summer pasture. "These are my people; this is my country." Corny, but true. Sometimes I even belt out the state song: "Montana, Montana, glory of the west....... M-O-N-T-A-N-A, Montana I love you."
YES, OF ALL the states from coast to coast, it's easily the best. I love my part-time California life, world travels and regular visits to Seattle, San Francisco, New York, Atlanta, Miami and Boston. But there's no place like home. The aging Yorkies love Montana, too. Nick and Nora romp and hike and get in shape, just as we do. Home on the range will always be dear to our hearts.
Cookie and Keller, Nick and Nora hike the East Rosebud.
Sioux Charley splendor
We love our Montana based road trips to Glacier and Yellowstone National Parks, forays to Red Lodge, Livingston, Bozeman, Butte,
Glacier Park is part of our summer itinerary, with an annual road trip.
Missoula, Harlowton, to visit friends and catch up on theater and dining. I spent the first years of my life in Bozeman where my parents were university students, and it's been fun to watch the Gallatin Valley grow and change, still feeling like part of the real West.
The little western towns in between are fun, too. Big Timber, Roundup, White Sulphur Springs, Harlowton, Lewistown, Cody, Wyo.
ONE OF OUR recent thrills is the opening of an internationally known art and music center just a few miles away. Tippet Rise, built by the heirs to the Grey Goose vodka fortune, is a masterful creation presenting concerts by world-renowned classical musicians. The patron Halsteads commissioned stunning contemporary outdoor sculptures by famous artists to enhance the connection between land and art. More on Tippet Rise
We've written about this grand accomplishment for national venues and are fortunate to score a few cherished tickets each season. Places to stay if you come visit?
Mark di Suvero's "Beethoven's Quartet" is inspired by the string quartets of the great composer.
The fascinating piece is one of several world class sculptures at Tippet Rise Art Center.
Yes! Many gorgeous digs await visitors. Blue Ribbon Run Fishery, for instance, offers a tranquil, handsomely appointed vista on the Stillwater, fine fishing, abundant birds and wildlife (check it out at airbnb.com).
Montana is a place where people still greet one another on the streets. When we mow the front lawn, neighbors wave and honk. Our love of nature bonds us to Montana where we have cherished family and friends. "Summer people" arrive and that's fun, too -- from Texas, Oklahoma, New Mexico, Washington, Florida, New York. And we catch up with the "locals," those tough people who stick out the winter there.
DO I MISS city life? The ocean, plays, nightlife, tango shows, watching Gustavo Dudamel conduct the Los Angeles Philharmonic, Greek food, sushi on demand, ocean hikes, Macy's and Nordstrom's within walking distance. Yes, I suffer temporary withdrawal. But we have Shakespeare in the Parks, Tippet Rise Art Center, my pianos, guitars, saxophones and talented voices to sing show tunes. Peace and joy, happiness in the mountains, reunions, contentment in the serenity,, plus the bonus of reading and reflection. Lucky are we.
Swimming with the sting rays made for a memorable afternoon recently.
UP NEXT: Manta rays! Come with us to swim with the rays in Sting Ray City, Antigua. We booked a day with these fascinating and beautiful creatures, escorted by trained nature guides. What evolved was an exciting encounter with some of the ocean's most graceful inhabitants. The carefully choreographed aquatic adventure made one of our most memorable days, happily spent with southern stingrays, as we snorkeled and even fed them. Remember to explore, learn and live and catch us each Friday.
Labels: Architecture, Art, Family, Famous Cities, History, Holidays and celebrations, Montana, Music, Natural world, Travel
Fabulous flowers: rain, rich soil yield blooming b...
Hawaii by helicopter: Blue Hawaiian adventure soa...
Magical Montana: Big Sky Country beckons road warr...


text:
Q: difference in logging mechanism: API and application(python) I am currently writing an API and an application which uses the API. I have gotten suggestions from people stating that I should perform logging using handlers in the application and use a "logger" object for logging from the API.
In light of the advice I received above, is the following implementation correct?
class test:
    def __init__(self, verbose):
        self.logger = logging.getLogger("test")
        self.logger.setLevel(verbose)

    def do_something(self):
        # do something
        self.logger.log("something")
        # by doing this i get the error message "No handlers could be found for logger "test"

The implementation i had in mind was as follows:
 #!/usr/bin/python

 """
 ....
 ....
 create a logger with a handler
 ....
 ....

 """

 myobject = test()
 try:
     myobject.do_something()
 except SomeError:
     logger.log("cant do something")

I'd like to get my basics strong, I'd be grateful for any help and suggestions for code you might recommend I look up.
Thanks!

A: The danger with the pattern that you are thinking about is that you may end up effectively hiding exceptions by putting them in a log. Many exceptions really should crash your program because they represent a problem that needs to be fixed. Generally, it is more useful to be able to step into code with a debugger to find out what caused the exception.
If there are cases that an exception represents an expected condition that does not affect the stability of the app or the correctness of its behavior, doing nothing but writing a notation to the log is OK. But be very, very careful about how you use this.

A: It's not very clear whether your question is about the specifics of how to use logging or about logging exceptions, but if the latter, I would agree with Adam Crossland that log-and-swallow is a pattern to be avoided.
In terms of the mechanics of logging, I would make the following observations:

*

*You don't need to have a logger as an instance member. It's more natural to declare loggers at module level using logger = logging.getLogger(__name__), and this will also work as expected in sub-packages.

*Your call logger.log("message") would likely fail anyway because the log method has a level as the first argument, rather than a message.

You should declare handlers, and if your usage scenario is fairly simple you can do this in your main method or if __name__ == '__main__': clause by adding for example
logging.basicConfig(filename='/tmp/myapp.log', level=logging.DEBUG,
                    format='%(asctime)s %(levelname)s %(name)s %(message)s')

and then elsewhere in your code, just do for example
import logging
logger = logging.getLogger(__name__)

once at the top of each module where you want to use logging, and then
logger.debug('message with %s', 'arguments') # or .info, .warning, .error etc.

in your code wherever needed.

A: I usually do the following:
import logging
import logging.config
logging.config.fileConfig('log.congig')

# for one line log records
G_LOG = logging.getLogger(__name__)
# for records with stacktraces
ST_LOG = logging.getLogger('stacktrace.' + __name__)

try:
    # some code
    G_LOG.info('some message %s %s', param1, param2)
except (StandardError,):
    message = 'some message'
    G_LOG.error(message)
    # exc_info appends stacktrace to the log message
    ST_LOG.error(message, exc_info=True)

Format of the config file can be seen in the python manual

redpajama_set_name: RedPajamaStackExchange


text:
<!DOCTYPE html>

<meta charset="iso-8859-1">
<link rel="stylesheet" href="../doc/doc_brython.css">

<link rel="stylesheet" href="console.css">

Brython version:

Theme:
 <select id="ace_theme" onChange="change_theme(event)">
<optgroup label="Bright">
<option value="ace/theme/chrome">Chrome</option>
<option value="ace/theme/clouds">Clouds</option>
<option value="ace/theme/crimson_editor">Crimson Editor</option>
<option value="ace/theme/dawn">Dawn</option>
<option value="ace/theme/dreamweaver">Dreamweaver</option>
<option value="ace/theme/eclipse">Eclipse</option>
<option value="ace/theme/github">GitHub</option>
<option value="ace/theme/solarized_light">Solarized Light</option>
<option value="ace/theme/textmate">TextMate</option>
<option value="ace/theme/tomorrow">Tomorrow</option>
<option value="ace/theme/xcode">XCode</option>
</optgroup>
<optgroup label="Dark">
<option value="ace/theme/ambiance">Ambiance</option>
<option value="ace/theme/chaos">Chaos</option>
<option value="ace/theme/clouds_midnight">Clouds Midnight</option>
<option value="ace/theme/cobalt">Cobalt</option>
<option value="ace/theme/idle_fingers">idleFingers</option>
<option value="ace/theme/kr_theme">krTheme</option>
<option value="ace/theme/merbivore">Merbivore</option>
<option value="ace/theme/merbivore_soft">Merbivore Soft</option>
<option value="ace/theme/mono_industrial">Mono Industrial</option>
<option value="ace/theme/monokai">Monokai</option>
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
<option value="ace/theme/solarized_dark">Solarized Dark</option>
<option value="ace/theme/twilight">Twilight</option>
<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
</optgroup>
</select>

Test suite:
<select name="filename" id="files">
  <optgroup label="Core language features">
    <option value="test_suite.py">basic test suite</option>
    <option value="classes_tests.py">built-in classes</option>
    <option value="test_rmethods.py">reflected methods</option>
    <option value="test_classes.py">classes</option>
    <option value="test_decorators.py">decorators</option>
    <option value="test_descriptors.py">descriptors</option>
    <option value="test_dict.py">dicts</option>
    <option value="test_import.py">imports</option>
    <option value="test_iterators.py">iterators</option>
    <option value="test_generators.py">generators</option>
    <option value="test_list_methods.py">lists</option>
    <option value="test_numbers.py">numbers</option>
    <option value="test_print.py">print</option>
    <option value="test_set.py">sets</option>
    <option value="test_strings.py">strings</option>
    <option value="test_string_format.py">string format</option>
    <option value="test_string_methods.py">string methods</option>
  </optgroup>
  <optgroup label="Issues">
    <option value="issues_gc.py">issues (GC)</option>
    <option value="issues_bb.py">issues (BB)</option>
    <option value="issues.py">issues</option>
  </optgroup>
  <optgroup label="Modules">
    <option value="test_re.py">re</option>
    <option value="test_unittest.py">unittest</option>
    <option value="test_bisect.py">bisect</option>
    <option value="test_collections.py">collections</option>
    <option value="test_datetime.py">datetime</option>
    <option value="test_hashlib.py">hashlib</option>
    <option value="test_indexedDB.py">indexedDB</option>
    <option value="test_itertools.py">itertools</option>
    <option value="test_json.py">JSON</option>
    <option value="test_math.py">math</option>
  </optgroup>
</select>

<button id="test_all">Run all tests</button>

    <button id="run">run</button>
    <button id="clear_text">clear</button>

    <button id="show_console">Console</button>
    <button id="show_js">Javascript</button>

<textarea id="console"></textarea>

redpajama_set_name: RedPajamaGithub


text:
import logging
from collections import deque
from decimal import Decimal
from itertools import chain, combinations
from operator import attrgetter, itemgetter

import numpy as np
from django.core.validators import MinValueValidator
from django.db import models
from django.urls import reverse
from django.utils.functional import cached_property
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy as _
from scipy.sparse.csgraph._shortest_path import dijkstra
from shapely import prepared
from shapely.affinity import scale
from shapely.geometry import JOIN_STYLE, LineString, MultiPolygon
from shapely.geometry.polygon import orient
from shapely.ops import unary_union

from c3nav.mapdata.fields import GeometryField, I18nField
from c3nav.mapdata.grid import grid
from c3nav.mapdata.models import Level
from c3nav.mapdata.models.access import AccessRestrictionMixin
from c3nav.mapdata.models.geometry.base import GeometryMixin
from c3nav.mapdata.models.locations import SpecificLocation
from c3nav.mapdata.utils.cache.changes import changed_geometries
from c3nav.mapdata.utils.geometry import (assert_multilinestring, assert_multipolygon, clean_cut_polygon,
                                          cut_polygon_with_line)

class LevelGeometryMixin(GeometryMixin):
    level = models.ForeignKey('mapdata.Level', on_delete=models.CASCADE, verbose_name=_('level'))

    class Meta:
        abstract = True

    def get_geojson_properties(self, *args, instance=None, **kwargs) -> dict:
        result = super().get_geojson_properties(*args, **kwargs)
        result['level'] = self.level_id
        if hasattr(self, 'get_color'):
            color = self.get_color(instance=instance)
            if color:
                result['color'] = color
        if hasattr(self, 'opacity'):
            result['opacity'] = self.opacity
        return result

    def _serialize(self, level=True, **kwargs):
        result = super()._serialize(**kwargs)
        if level:
            result['level'] = self.level_id
        return result

    def details_display(self, **kwargs):
        result = super().details_display(**kwargs)
        result['display'].insert(3, (
            _('Level'),
            {
                'id': self.level_id,
                'slug': self.level.get_slug(),
                'title': self.level.title,
                'can_search': self.level.can_search,
            },
        ))
        result['level'] = self.level_id
        return result

    @property
    def subtitle(self):
        base_subtitle = super().subtitle
        level = getattr(self, '_level_cache', None)
        if level is not None:
            return format_lazy(_('{category}, {level}'),
                               category=base_subtitle,
                               level=level.title)
        return base_subtitle

    def register_change(self, force=False):
        force = force or self.all_geometry_changed
        if force or self.geometry_changed:
            changed_geometries.register(self.level_id, self.geometry if force else self.get_changed_geometry())

    def register_delete(self):
        changed_geometries.register(self.level_id, self.geometry)

    @classmethod
    def q_for_request(cls, request, prefix='', allow_none=False):
        return (
            super().q_for_request(request, prefix=prefix, allow_none=allow_none) &
            Level.q_for_request(request, prefix=prefix+'level__', allow_none=allow_none)
        )

    def save(self, *args, **kwargs):
        self.register_change()
        super().save(*args, **kwargs)

class Building(LevelGeometryMixin, models.Model):
    """
    The outline of a building on a specific level
    """
    geometry = GeometryField('polygon')

    class Meta:
        verbose_name = _('Building')
        verbose_name_plural = _('Buildings')
        default_related_name = 'buildings'

class Space(LevelGeometryMixin, SpecificLocation, models.Model):
    """
    An accessible space. Shouldn't overlap with spaces on the same level.
    """
    geometry = GeometryField('polygon')
    height = models.DecimalField(_('height'), max_digits=6, decimal_places=2, null=True, blank=True,
                                 validators=[MinValueValidator(Decimal('0'))])
    outside = models.BooleanField(default=False, verbose_name=_('only outside of building'))
    enter_description = I18nField(_('Enter description'), blank=True, fallback_language=None)
    base_mapdata_accessible = models.BooleanField(default=False,
                                                  verbose_name=_('always accessible (overwrites base mapdata setting)'))

    class Meta:
        verbose_name = _('Space')
        verbose_name_plural = _('Spaces')
        default_related_name = 'spaces'

    def _serialize(self, geometry=True, **kwargs):
        result = super()._serialize(geometry=geometry, **kwargs)
        result['outside'] = self.outside
        result['height'] = None if self.height is None else float(str(self.height))
        return result

    @property
    def grid_square(self):
        return grid.get_squares_for_bounds(self.geometry.bounds) or ''

    def details_display(self, editor_url=True, **kwargs):
        result = super().details_display(**kwargs)
        result['display'].extend([
            (_('height'), self.height),
            (_('outside only'), _('Yes') if self.outside else _('No')),
        ])
        if editor_url:
            result['editor_url'] = reverse('editor.spaces.detail', kwargs={'level': self.level_id, 'pk': self.pk})
        return result

class Door(LevelGeometryMixin, AccessRestrictionMixin, models.Model):
    """
    A connection between two spaces
    """
    geometry = GeometryField('polygon')

    class Meta:
        verbose_name = _('Door')
        verbose_name_plural = _('Doors')
        default_related_name = 'doors'

class ItemWithValue:
    def __init__(self, obj, func):
        self.obj = obj
        self._func = func

    @cached_property
    def value(self):
        return self._func()

class AltitudeArea(LevelGeometryMixin, models.Model):
    """
    An altitude area
    """
    geometry = GeometryField('multipolygon')
    altitude = models.DecimalField(_('altitude'), null=False, max_digits=6, decimal_places=2)
    altitude2 = models.DecimalField(_('second altitude'), null=True, max_digits=6, decimal_places=2)
    point1 = GeometryField('point', null=True)
    point2 = GeometryField('point', null=True)

    class Meta:
        verbose_name = _('Altitude Area')
        verbose_name_plural = _('Altitude Areas')
        default_related_name = 'altitudeareas'
        ordering = ('altitude', )

    def get_altitudes(self, points):
        points = np.asanyarray(points).reshape((-1, 2))
        if self.altitude2 is None:
            return np.full((points.shape[0], ), fill_value=float(self.altitude))

        slope = np.array(self.point2.coords) - np.array(self.point1.coords)
        distances = (np.sum(((points - np.array(self.point1.coords)) * slope), axis=1) / (slope ** 2).sum()).clip(0, 1)

        if self.altitude2 < self.altitude:
            min_altitude = float(self.altitude2)
            max_altitude = float(self.altitude)
        else:
            min_altitude = float(self.altitude)
            max_altitude = float(self.altitude2)

        return np.clip(
            float(self.altitude) + distances*(float(self.altitude2)-float(self.altitude)),
            a_min=min_altitude, a_max=max_altitude
        )

    @classmethod
    def recalculate(cls):
        # collect location areas
        all_areas = []
        all_ramps = []
        space_areas = {}
        spaces = {}
        levels = Level.objects.prefetch_related('buildings', 'doors', 'spaces', 'spaces__columns',
                                                'spaces__obstacles', 'spaces__lineobstacles', 'spaces__holes',
                                                'spaces__stairs', 'spaces__ramps', 'spaces__altitudemarkers')
        logger = logging.getLogger('c3nav')

        for level in levels:
            areas = []
            ramps = []
            stairs = []

            # collect all accessible areas on this level
            buildings_geom = unary_union(tuple(building.geometry for building in level.buildings.all()))
            for space in level.spaces.all():
                spaces[space.pk] = space
                space.orig_geometry = space.geometry
                if space.outside:
                    space.geometry = space.geometry.difference(buildings_geom)
                space_accessible = space.geometry.difference(
                    unary_union(tuple(c.geometry for c in space.columns.all() if c.access_restriction_id is None) +
                                tuple(o.geometry for o in space.obstacles.all() if o.altitude == 0) +
                                tuple(o.buffered_geometry for o in space.lineobstacles.all() if o.altitude == 0) +
                                tuple(h.geometry for h in space.holes.all()))
                )

                space_ramps = unary_union(tuple(r.geometry for r in space.ramps.all()))
                areas.append(space_accessible.difference(space_ramps))
                for geometry in assert_multipolygon(space_accessible.intersection(space_ramps)):
                    ramp = AltitudeArea(geometry=geometry, level=level)
                    ramp.geometry_prep = prepared.prep(geometry)
                    ramp.space = space.pk
                    ramps.append(ramp)

            areas = tuple(orient(polygon) for polygon in assert_multipolygon(
                unary_union(areas+list(door.geometry for door in level.doors.all()))
            ))

            # collect all stairs on this level
            for space in level.spaces.all():
                space_buffer = space.geometry.buffer(0.001, join_style=JOIN_STYLE.mitre)
                for stair in space.stairs.all():
                    stairs.extend(assert_multilinestring(
                        stair.geometry.intersection(space_buffer)
                    ))

            # divide areas using stairs
            for stair in stairs:
                areas = cut_polygon_with_line(areas, stair)

            # create altitudearea objects
            areas = [AltitudeArea(geometry=clean_cut_polygon(area), level=level)
                     for area in areas]

            # prepare area geometries
            for area in areas:
                area.geometry_prep = prepared.prep(area.geometry)

            # assign spaces to areas
            space_areas.update({space.pk: [] for space in level.spaces.all()})
            for area in areas:
                area.spaces = set()
                area.geometry_prep = prepared.prep(area.geometry)
                for space in level.spaces.all():
                    if area.geometry_prep.intersects(space.geometry):
                        area.spaces.add(space.pk)
                        space_areas[space.pk].append(area)

            # give altitudes to areas
            for space in level.spaces.all():
                for altitudemarker in space.altitudemarkers.all():
                    for area in space_areas[space.pk]:
                        if area.geometry_prep.contains(altitudemarker.geometry):
                            area.altitude = altitudemarker.altitude
                            break
                    else:
                        logger.error(
                            _('AltitudeMarker #%(marker_id)d in Space #%(space_id)d on Level %(level_label)s '
                              'is not placed in an accessible area') % {'marker_id': altitudemarker.pk,
                                                                        'space_id': space.pk,
                                                                        'level_label': level.short_label})

            # determine altitude area connections
            for area in areas:
                area.connected_to = []
            for area, other_area in combinations(areas, 2):
                if area.geometry_prep.intersects(other_area.geometry):
                    area.connected_to.append(other_area)
                    other_area.connected_to.append(area)

            # determine ramp connections
            for ramp in ramps:
                ramp.connected_to = []
                buffered = ramp.geometry.buffer(0.001)
                for area in areas:
                    if area.geometry_prep.intersects(buffered):
                        intersection = area.geometry.intersection(buffered)
                        ramp.connected_to.append((area, intersection))
                if len(ramp.connected_to) != 2:
                    if len(ramp.connected_to) == 0:
                        logger.warning('A ramp in space #%d has no connections!' % ramp.space)
                    elif len(ramp.connected_to) == 1:
                        logger.warning('A ramp in space #%d has only one connection!' % ramp.space)
                    else:
                        logger.warning('A ramp in space #%d has more than two connections!' % ramp.space)

            # add areas to global areas
            all_areas.extend(areas)
            all_ramps.extend(ramps)

        # give temporary ids to all areas
        areas = all_areas
        ramps = all_ramps
        for i, area in enumerate(areas):
            area.tmpid = i
        for area in areas:
            area.connected_to = set(area.tmpid for area in area.connected_to)
        for space in space_areas.keys():
            space_areas[space] = set(area.tmpid for area in space_areas[space])
        areas_without_altitude = set(area.tmpid for area in areas if area.altitude is None)

        # interpolate altitudes
        logger.info('Interpolating altitudes...')

        areas_with_altitude = [i for i in range(len(areas)) if i not in areas_without_altitude]
        for i, tmpid in enumerate(areas_with_altitude):
            areas[tmpid].i = i

        csgraph = np.zeros((len(areas), len(areas)), dtype=bool)
        for area in areas:
            for connected_tmpid in area.connected_to:
                csgraph[area.tmpid, connected_tmpid] = True

        repeat = True

        while repeat:
            repeat = False
            # noinspection PyTupleAssignmentBalance
            distances, predecessors = dijkstra(csgraph, directed=False, return_predecessors=True, unweighted=True)
            np_areas_with_altitude = np.array(areas_with_altitude, dtype=np.uint32)
            relevant_distances = distances[np_areas_with_altitude[:, None], np_areas_with_altitude]
            # noinspection PyTypeChecker
            for from_i, to_i in np.argwhere(np.logical_and(relevant_distances < np.inf, relevant_distances > 1)):
                from_area = areas[areas_with_altitude[from_i]]
                to_area = areas[areas_with_altitude[to_i]]
                if from_area.altitude == to_area.altitude:
                    continue

                path = [to_area.tmpid]
                while path[-1] != from_area.tmpid:
                    path.append(predecessors[from_area.tmpid, path[-1]])

                from_altitude = from_area.altitude
                delta_altitude = (to_area.altitude-from_altitude)/(len(path)-1)

                if set(path[1:-1]).difference(areas_without_altitude):
                    continue

                for i, tmpid in enumerate(reversed(path[1:-1]), start=1):
                    area = areas[tmpid]
                    area.altitude = Decimal(from_altitude+delta_altitude*i).quantize(Decimal('1.00'))
                    areas_without_altitude.discard(tmpid)
                    area.i = len(areas_with_altitude)
                    areas_with_altitude.append(tmpid)

                for from_tmpid, to_tmpid in zip(path[:-1], path[1:]):
                    csgraph[from_tmpid, to_tmpid] = False
                    csgraph[to_tmpid, from_tmpid] = False

                repeat = True

        # remaining areas: copy altitude from connected areas if any
        repeat = True
        while repeat:
            repeat = False
            for tmpid in tuple(areas_without_altitude):
                area = areas[tmpid]
                connected_with_altitude = area.connected_to-areas_without_altitude
                if connected_with_altitude:
                    area.altitude = areas[next(iter(connected_with_altitude))].altitude
                    areas_without_altitude.discard(tmpid)
                    repeat = True

        # remaining areas which belong to a room that has an altitude somewhere
        for contained_areas in space_areas.values():
            contained_areas_with_altitude = contained_areas - areas_without_altitude
            contained_areas_without_altitude = contained_areas - contained_areas_with_altitude
            if contained_areas_with_altitude and contained_areas_without_altitude:
                altitude_areas = {}
                for tmpid in contained_areas_with_altitude:
                    area = areas[tmpid]
                    altitude_areas.setdefault(area.altitude, []).append(area.geometry)

                for altitude in altitude_areas.keys():
                    altitude_areas[altitude] = unary_union(altitude_areas[altitude])
                for tmpid in contained_areas_without_altitude:
                    area = areas[tmpid]
                    area.altitude = min(altitude_areas.items(), key=lambda aa: aa[1].distance(area.geometry))[0]
                areas_without_altitude.difference_update(contained_areas_without_altitude)

        # last fallback: level base_altitude
        for tmpid in areas_without_altitude:
            area = areas[tmpid]
            area.altitude = area.level.base_altitude

        # prepare per-level operations
        level_areas = {}
        for area in areas:
            level_areas.setdefault(area.level, set()).add(area.tmpid)

        # make sure there is only one altitude area per altitude per level
        for level in levels:
            areas_by_altitude = {}
            for tmpid in level_areas.get(level, []):
                area = areas[tmpid]
                areas_by_altitude.setdefault(area.altitude, []).append(area.geometry)

            level_areas[level] = [AltitudeArea(level=level, geometry=unary_union(geometries), altitude=altitude)
                                  for altitude, geometries in areas_by_altitude.items()]

        # renumber joined areas
        areas = list(chain(*(a for a in level_areas.values())))
        for i, area in enumerate(areas):
            area.tmpid = i

        # finalize ramps
        for ramp in ramps:
            if not ramp.connected_to:
                for area in space_areas[ramp.space]:
                    ramp.altitude = areas[area].altitude
                    break
                else:
                    ramp.altitude = ramp.level.base_altitude
                continue

            if len(ramp.connected_to) == 1:
                ramp.altitude = ramp.connected_to[0][0].altitude
                continue

            if len(ramp.connected_to) > 2:
                ramp.connected_to = sorted(ramp.connected_to, key=lambda item: item[1].area)[-2:]

            ramp.point1 = ramp.connected_to[0][1].centroid
            ramp.point2 = ramp.connected_to[1][1].centroid
            ramp.altitude = ramp.connected_to[0][0].altitude
            ramp.altitude2 = ramp.connected_to[1][0].altitude

            ramp.tmpid = len(areas)
            areas.append(ramp)
            level_areas[ramp.level].append(ramp)

        #
        # we have altitude areas, but they only cover accessible space for now
        # however, we need obstacles to be part of altitude areas too.
        # this is where we do that.
        #
        for level in levels:
            logger.info('Assign remaining space (%s)...' % level.title)
            for space in level.spaces.all():
                space.geometry = space.orig_geometry

            buildings_geom = unary_union(tuple(b.geometry for b in level.buildings.all()))
            doors_geom = unary_union(tuple(d.geometry for d in level.doors.all()))
            space_geom = unary_union(tuple((s.geometry if not s.outside else s.geometry.difference(buildings_geom))
                                           for s in level.spaces.all()))

            # accessible area on this level is doors + spaces - holes
            accessible_area = unary_union((doors_geom, space_geom))
            for space in level.spaces.all():
                accessible_area = accessible_area.difference(space.geometry.intersection(
                    unary_union(tuple(h.geometry for h in space.holes.all()))
                ))

            # areas mean altitude areas (including ramps) here
            our_areas = level_areas.get(level, [])
            for area in our_areas:
                area.orig_geometry = area.geometry
                area.orig_geometry_prep = prepared.prep(area.geometry)
                area.polygons_to_add = deque()

            stairs = []
            for space in level.spaces.all():
                space_geom = space.geometry
                if space.outside:
                    space_geom = space_geom.difference(buildings_geom)
                space_geom_prep = prepared.prep(space_geom)
                holes_geom = unary_union(tuple(h.geometry for h in space.holes.all()))

                # remaining_space means remaining space (=obstacles) that still needs to be added to altitude areas
                remaining_space = (
                    tuple(o.geometry for o in space.obstacles.all()) +
                    tuple(o.buffered_geometry for o in space.lineobstacles.all())
                )
                # make sure to remove everything outside the space the obstacles are in as well as holes
                remaining_space = tuple(g.intersection(space_geom).difference(holes_geom)
                                        for g in remaining_space
                                        if space_geom_prep.intersects(g))
                # we need this to be a list of simple normal polygons
                remaining_space = tuple(chain(*(
                    assert_multipolygon(g) for g in remaining_space if not g.is_empty
                )))
                if not remaining_space:
                    # if there are no remaining spaces? great, we're done here.
                    continue

                cuts = []
                for cut in chain(*(assert_multilinestring(stair.geometry) for stair in space.stairs.all()),
                                 (ramp.geometry.exterior for ramp in space.ramps.all())):
                    for coord1, coord2 in zip(tuple(cut.coords)[:-1], tuple(cut.coords)[1:]):
                        line = space_geom.intersection(LineString([coord1, coord2]))
                        if line.is_empty:
                            continue
                        factor = (line.length + 2) / line.length
                        line = scale(line, xfact=factor, yfact=factor)
                        centroid = line.centroid
                        line = min(assert_multilinestring(space_geom.intersection(line)),
                                   key=lambda l: l.centroid.distance(centroid), default=None)
                        cuts.append(scale(line, xfact=1.01, yfact=1.01))

                remaining_space = tuple(
                    orient(polygon) for polygon in remaining_space
                )

                for cut in cuts:
                    remaining_space = tuple(chain(*(cut_polygon_with_line(geom, cut)
                                                    for geom in remaining_space)))
                remaining_space = MultiPolygon(remaining_space)

                for polygon in assert_multipolygon(remaining_space):
                    polygon = clean_cut_polygon(polygon).buffer(0)
                    buffered = polygon.buffer(0.001)

                    center = polygon.centroid
                    touches = tuple(ItemWithValue(area, lambda: buffered.intersection(area.orig_geometry).area)
                                    for area in our_areas
                                    if area.orig_geometry_prep.intersects(buffered))
                    if len(touches) == 1:
                        area = touches[0].obj
                    elif touches:
                        min_touches = sum((t.value for t in touches), 0)/4
                        area = max(touches, key=lambda item: (item.value > min_touches,
                                                              item.obj.altitude2 is not None,
                                                              item.obj.altitude,
                                                              item.value)).obj
                    else:
                        area = min(our_areas,
                                   key=lambda a: a.orig_geometry.distance(center)-(0 if a.altitude2 is None else 0.6))
                    area.polygons_to_add.append(polygon)

            for i_area, area in enumerate(our_areas):
                if area.polygons_to_add:
                    area.geometry = unary_union((area.geometry.buffer(0), *area.polygons_to_add))
                del area.polygons_to_add

        for level in levels:
            level_areas[level] = set(area.tmpid for area in level_areas.get(level, []))

        # save to database
        areas_to_save = set(range(len(areas)))

        all_candidates = AltitudeArea.objects.select_related('level')
        for candidate in all_candidates:
            candidate.area = candidate.geometry.area
            candidate.geometry_prep = prepared.prep(candidate.geometry)
        all_candidates = sorted(all_candidates, key=attrgetter('area'), reverse=True)

        num_modified = 0
        num_deleted = 0
        num_created = 0

        field = AltitudeArea._meta.get_field('geometry')

        for candidate in all_candidates:
            new_area = None

            if candidate.altitude2 is None:
                for tmpid in level_areas.get(candidate.level, set()):
                    area = areas[tmpid]
                    if area.altitude2 is None and area.altitude == candidate.altitude:
                        new_area = area
                        break
            else:
                potential_areas = [areas[tmpid] for tmpid in level_areas.get(candidate.level, set())]
                potential_areas = [area for area in potential_areas
                                   if (candidate.altitude, candidate.altitude2) in ((area.altitude, area.altitude2),
                                                                                (area.altitude2, area.altitude))]
                potential_areas = [(area, area.geometry.intersection(candidate.geometry).area)
                                   for area in potential_areas
                                   if candidate.geometry_prep.intersects(area.geometry)]
                if potential_areas:
                    new_area = max(potential_areas, key=itemgetter(1))[0]

            if new_area is None:
                candidate.delete()
                num_deleted += 1
                continue

            if not field.get_final_value(new_area.geometry).equals_exact(candidate.geometry, 0.00001):
                num_modified += 1

            candidate.geometry = new_area.geometry
            candidate.altitude = new_area.altitude
            candidate.altitude2 = new_area.altitude2
            candidate.point1 = new_area.point1
            candidate.point2 = new_area.point2
            candidate.save()
            areas_to_save.discard(new_area.tmpid)
            level_areas[new_area.level].discard(new_area.tmpid)

        for tmpid in areas_to_save:
            num_created += 1
            areas[tmpid].save()

        logger = logging.getLogger('c3nav')
        logger.info(_('%d altitude areas built.') % len(areas))
        logger.info(_('%(num_modified)d modified, %(num_deleted)d deleted, %(num_created)d created.') %
                    {'num_modified': num_modified, 'num_deleted': num_deleted, 'num_created': num_created})


I wanted to make a graduation card, but decided to have it be a little different than the usual gown and mortar image. I have those characters floating away on a balloon string in the Carried Away stamp set from Mama Elephant and I found "The Sky's the limit" in Stampin' Up!'s Up, Up & Away stamp set (now retired), for a different option.
The design was inspired by Sunday Stamps sketch #148.My #foreveryoung paper pad included a blue sky baclground, which was perfect for my floating balloon. The finished card is a little bigger than the usual standard size: 4" x 6". I used some 12" x 12" cardstock so that I could have the fold at the top, which I always prefer with a vertical design.
I wasn't sure which of the characters I would like best for the card front, so I colored a couple and put the images I wasn't using inside the card.
Wow, what a detailed graduation card! Love the scene you created for the adorable little guy. Super cute with the "real" DSP, and washi tape. Fantastic card! Thank so much for joining us at Sunday Stamps!


Semiconductor science is a phenomenally broad area of research that underpins many of the current activities in Photonics, Nanoscience, Optoelectronics and Energy Research. The Semiconductors group brings together the heads of several research groups at Oxford who between them share an exceptional portfolio of semiconductor research across a variety of scientific disciplines. The group members have an interest both in the fundamental science and the potential for applications of a range of materials and composites made of organic and inorganic semiconductors and their nanostructures.
Our group is part of the interdisciplinary SMND research network across several departments within the University of Oxford's Mathematical, Physical and Life Sciences Division.
DP McMeekin, S Mahesh, NK Noel et al.
PK Nayak, S Mahesh, HJ Snaith et al.
SY Son, G Kang, M Kim et al.
A Hazarika, Q Zhao, A Gaulding et al.
P Kaienburg, P Hartnage, BE Pieters et al.
Y Cho, B Hou, J Lim et al.
AJ Ramadan, NK Noel, S Fearn et al.
LM Wheeler, EM Sanehira, AR Marshall et al.
K Peng, P Parkinson, L Fu et al.
The Phosphine Oxide Route toward Lead Halide Perovskite Nanocrystals.
G Almeida, OJ Ashton, L Goldoni et al.
D Ramirez, K Schutt, JF Montoya et al.


text:
Honningsvåg és una ciutat de la regió administrativa o filke de Troms og Finnmark, a Noruega, centre administratiu del municipi de Nordkapp. Situada al cap Nord, és la ciutat més septentrional d'aquest país i de tot el món. La legislació noruega del 1997 estableix que una ciutat ha de tenir com a mínim 5.000 habitants, però Honningsvåg, amb la seva població de 2.575, va ser declarada ciutat just abans, el 1996. Està situada en una badia al costat sud de l'illa de Mageroy, mentre que el cap Nord i els seus visitants se centren al costat nord. És port d'escala per a vaixells de creuer, especialment els mesos d'estiu. L'aeroport de Honningsvåg és a 4 quilòmetres de la ciutat.

Aquesta zona tan llunyana ha estat habitada des de fa més de 10.000 anys. El mar era probablement la principal font d'aliment per als assentaments prehistòrics. Com que és a la part sud-oest del mar de Barentsz, on no hi ha gel, la pesca és abundant. També gràcies a aquest efecte, les temperatures d'hivern a Honningsvåg són molt més suaus del que es podria esperar en aquesta latitud (la mitjana de gener a les 24 h és de -4 °C). Avui dia, la pesca i el turisme són les activitats més importants

Galeria

Clima

Entitats de població de Troms og Finnmark

redpajama_set_name: RedPajamaWikipedia


Health and wellbeing are holistic concepts, and physical and mental health are intimately connected. CYPHP's Mind and Body approach to care means focusing on the whole child or young person. Truly CYP-centred care means considering physical and mental health together, as standard practice.
Physical and mental health are too often considered separately in healthcare. This makes it harder to deliver CYP-centred care. This fragmentation particularly affects CYP with long-term conditions.
CYPHP has developed a model of care for CYP with long-term conditions which starts by looking at the whole child, considering their physical, mental, and social needs. Care can then be delivered according to need.
CYP with long-term conditions will have more comprehensive care which accounts for their physical, mental, and social needs. Holistic care will start becoming standard practice. CYP will be healthier.


text:
Q: Clone folders from Git Repository - TFS using Python 2.7 without installing Windows Git I'm working on a Python script (2.7) which will clone specific folders from a Git Online TFS Repository. Looking to make it work only using Python packages (as needed) or through Rest API as provided in https://www.visualstudio.com/en-us/docs/integrate/api/git/pull-requests/pull-requests
Trying to avoid installing Git in the machine, as there will not be any commits from the machine, also it will be OS independent this way. Just need to clone latest code from Git and execute it. No challenges in anyway w.r.t access privileges (assume I have full access to the TFS repository and its contents). Any pointers towards a solution would be gladly accepted :)
Thanks in Advance !

A: The way that without OS independent is the REST API, however there isn't the REST API in TFS/VSTS to clone TFS/VSTS repository to local machine.
If you just need to get the files, you can use this REST API below to download the files (compressed in a zip file): Zip a folder

A: You can use pygit2 to clone Git repository via Python.


Finally managed to get one from Mandarake which was still in stock.
I'm sorry, but due to this new 'rule' I had to delete 6 of the 11 photos I uploaded. I also uploaded them somewhere on my Photobucket account, but they're in one folder among other artbooks.
I bought this book at Mandarake. You may find some here, at this moment there is one left.
That sure looks interesting! I don't like it as much as ITEM #175053 , but they make a nice pair.
Yupa (5 jaar geleden) #2035008Thanks! Could you give the link?


I have very nearly finished it and will of course share the results but I can't wait to start another picture and maybe have a go at something 3D! As I type this, I am waiting for the postman to arrive with a nice little collection of fibres for me to get in some more practice.
This is just another way for me to add another texture into our home decor and I can't wait to explore what else I can make that is functional and pretty.
Oh, this week I also spray painted a pot really randomly but more about that another time.
Here are some links* to the very basics that you would need to get started with some needle felting. If you want to create a flat piece, you will need some felt sheets too. I will pop up a little tutorial soon.
*These are affiliate links which means that I may earn a couple of pence if you use them but it won't cost you a penny extra.
Have you ever tried needle felting? What have you made? Can you recommend any good publications for guidance or suppliers of tools? Do you have a post about a project you have done that you could link this week?
Love needle felting , I know thehomemakery.couk do kits & supplies & there is another lady on Etsy , of course I can't remember her name ! Some of the stuff people do with it is just stunning but I tend to stick to little projects, all that jabbing with the neddle is very therapeutic alright!
It totally is. I will have to check out that Etsy shop. Thanks for the tip off.


text:
Ibrahim Index: Democracy in Africa remains stagnant as Zimbabwe makes progress
(Last Updated on October 6, 2015 by Editor)
ZIMBABWE – The survey rates 54 African nations on issues focusing on democracy, stability and human rights. It also rates countries on how they address the issue of corruption, free elections, infrastructure, poverty, health and education.
However, the survey also rated Zimbabwe as one of the six countries that made strides in addressing governance issues, despite its leader Robert Mugabe being one of Africa's longest serving leaders. DW spoke to Pedzisai Ruhanya, the director for Zimbabwe Democracy Institute (ZDI).
DW: What is your reaction to Zimbabwe's latest ranking by the Ibrahim survey? Is it a true reflection of what is on the ground?
Pedzisai Ruhanya: The report is a bit superficial in the sense that its analytic length is focused on civil and political rights. Whereas we agree that there has been a recession and some kind of stability, there is great abuse of civil and political rights. Because of the economic recession that the country is facing is that there has also been substantive violation of social economic rights. There is an appalling failure in the issue to do with the protection of social economic rights stated in chapter four of the new constitution: the bill of rights that talks of issues of provision of clean water the right to health, the right to education. All those social economic rights are not being realized. We are also seeing a monumental loss of jobs. That also violates citizens' capacity to access health, clean water and education. So there is a problem in the analytic framework that the Mo Ibrahim uses to analyze the situation in Harare because in the long run the lack of social economic rights in terms of health delivery will impact on the realization of civil and political rights when citizens start to demand those rights. Currently in the city of Harare, they (authorities), are demolishing citizens' houses where as in the constitution citizens have the right to housing.
DW: In your opinion how can you rate Zimbabwe's state of governance?
Zimbabwe's state of governance is very appalling in the sense that efforts to liberalize the economy are not being matched with efforts to liberalize our politics. Our politics is authoritarian and because of that it is failing to steer economic liberalization and because of that Zimbabwe continues to have a huge democratic governance deficit.
DW: What can be done to rectify the situation in Zimbabwe?
The ruling party has to change. They have to reform or they die. Without political reforms it is going to be very difficult to unlock economic reforms, to realize economic growth, to attract foreign direct investment, to attract international partners and to do business in Zimbabwe under an authoritarian regime. They want to have what I would call authoritarian capitalism in a world that is moving towards democratization. There are a lot of contradictions within the ruling party associated with President Robert Mugabe and associated with lack of political reform and lack of predictable future of the state.
DW: How important is the governance peer review for African countries particularly like the case of Zimbabwe by this foundation?
It is important but, it must be solid and based on evidence based research that they can use them to make whatever pronouncement they make on Zimbabwe. They were looking at I think minimized procedural democratic index instead of looking at also substantive democratization, which deals with the question of livelihoods. In order to make meaning in developing countries like Zimbabwe it is not good enough to just look at civil and because human rights are indivisible.
Dr. Pedzisai Ruhanya is the Director for Zimbabwe Democracy Institute a politically independent and not for profit public policy think-tank based in Zimbabwe.
Tags: Zimbabwe
Previous PostZim rolled over
Next PostZimbabwe not 'hungry enough', says batting coach
Great TUKU to be Honoured
Mugabe aita wabunge kuwapa hotuba sahihi
US plane impounded in Zimbabwe; body and cash found on board
ZIMBABWE - The survey rates 54 African nations on issues focusing on democracy, stability and human rights. It also rates countries on how they address the issue of corruption, free elections, infrastructure, poverty, health and education. However, the sur...

redpajama_set_name: RedPajamaCommonCrawl


games by google : Google built an online HTML5 game inspired by the classic arcade game Snake to welcome Chinese 2013 New Year. Not just any drawing — it is an actual game ready to play!Sign in - Google AccountsDoodle 4 Google More Doodles. October 31, 2016 ... Halloween 2016. ... The inspiration for this year's cat spell-casting game came from a real-life black cat named Momo that belongs to Doodler ...Games are more fun with the Google Play Games app. Discover your new favorite game, then challenge your friends and track your achievements. As you master more games, show off your skills in your gamer profile. Plus, you can pick up where you left off from any device. Play the world, anywhere in the world, all from one place. KEY FEATURES • Gamer profile: Create your custom Gamer ID, earn XP ...Free games in the Google app! For more doodles and games, visit google.com/doodlesThousands of online games to play in your browser. This app category includes arcade games, action games, RPG games, strategy games, sports games, board games and card games.Google Play Instant is now available for all game developers. Players can just tap a link to play, instead of having to download and install your game first. Google Play Instant experiences are available on the Google Play Store, on the Google Play Games app, or wherever game links are shared.Valentine's Day 2017. Google's Valentine's Day 2017 doodle lets you play a side-scrolling game with plenty of red and hearts to go around. The game lets you control the character with just ...Enjoy millions of the latest Android apps, games, music, movies, TV, books, magazines & more. Anytime, anywhere, across your devices.This is a game built with machine learning. You draw, and a neural network tries to guess what you're drawing. Of course, it doesn't always work. But the more you play with it, the more it will learn. So far we have trained it on a few hundred concepts, and we hope to add more over time.


Echinocereus chloranthus var. cylindricus "corellii"
Echinocereus chloranthus v. cylindricus "corellii"
Nice plant with Shiny yellowish spines and brown yellowish flowers.
Description: Usually grows singly or forms two or more stems , but never forms large clusters or mounds.
Stems: as much as 7,5 cm in diameter and 15 (25) cm tall.
Spines: This species has short shiny yellowish spines but show a considerable variability in spine shape, some plants has only radials while other have a variable number of short centrals.
Flowers: Smaller than others in this genus about 2,5 cm long and 2,5 cm inch broad. Brown yellowish, and grow well down on the sides, often forming a band around the middle. Blooms in March or April.
Fruit: The fruit is small about the size of a small grape, green at first and later turning a purplish red and spiny.
and have a very spiny calyx. Flowering March June.
Cultivation: Rot easily it is sensitive to overwatering (rot prone) needs a very good drainage to avoid rotting, Keep drier and cool in winter. Need full sun. Cold resistant above approx - 12C or less for short periods of time.
Propagation: It can be grown from seeds.
Scientific Name: Echinocereus russanthus cylindricus "corellii"
Origin: S. Marathon, Brewster CO, Davis Mts, Texas.
Plant with and without central spine.


text:
Q: Can we add\attach security group to Terraform aws_cloudformation_stack resource I am using Terraform to provision emr . In order to do so i am calling
resource "aws_cloudformation_stack" and then attaching cloudformation template to launch an EMR. its working now i want my EMR to have 22 inbound port open for ssh connection.
please see reference
https://www.terraform.io/docs/providers/aws/r/cloudformation_stack.html
i can do this by attaching a security group . could somebody please let me know how can i do this?

A: You should probably be able to handle this by creating the security group via Terraform, referencing it as a dependency to make sure it's created before the cloudformation stack and then providing the security group ID to the cloudformation template as a variable.


We just couldn't leave this pup at the Indianapolis shelter. Her foster family named her Toskah, which means White Bear in Sioux. She had a short stay in foster and found her forever home in Bloomington, IN!


If you want specific LSAT books and explanations, you're in the right place.
Otherwise, I strongly suggest my LSAT packages. They include my full curriculum for each section, including video courses, guides, and study plans to keep you on track. You can save hundreds of dollars with an LSAT package.
Quick-reference guides for Logic Games, Logical Reasoning, Reading Comprehension, and Law School Admissions. Get all 4, or just get the 3 LSAT ones.
Find out the basics of Logic Games, Logical Reasoning, Reading Comprehension, and Law School Admissions without reading hundreds of pages. Get all 4 or just get the 3 LSAT ones.
All the little items and details students don't usually think of. They hold you accountable and help you make sure you're not missing anything for Logic Games, Logical Reasoning, Reading Comprehension, and Test Day. Get all 4 or just get the 3 LSAT ones.
A handbook that guides you through confusing LSAT language, but not by forcing you to memorize hundreds of words. Instead, this comprehensive guide focuses on the LSAT's most commonly-used words and phrases and gives you their meanings on the LSAT. Click here to get it now.
Get the explanations that SHOULD have come with the LSAT.
These don't just fall back on "out of scope," but actually tell you WHY the wrong answers are wrong, why the right answers are right, and the easiest way to get the correct answer.
This guide to Logic Games is by a former writer of actual LSAT questions.
This contains 40 difficult practice questions I've written, 1 to accompany each of the 40 Logic Games in LSAT PrepTests 29-38.
I put together a book of 208 sudoku puzzles, along with a brief introduction to sudoku. Solving a sudoku puzzle just requires deductive reasoning. For this reason, it's a great tool for developing the skills needed for LSAT Logic Games.
Famous sudoku-writer DJAPE and I put together a book of 350 sudoku puzzles and sudoku variants, along with a brief introduction to sudoku and each of the included sudoku variants.
A workbook to help you to review basic LSAT concepts necessary to succeed on the Logic Games and Logical Reasoning sections.
Need RC help? Check out the RC cheat sheet, guide, checklist, and explanations.
This guide provides tips on conceptualizing, planning, writing, and editing the law school personal statement.
Quick-reference guides on Optional Essays and Addenda and Law School Recommendations. Get both.


Erehwon Retreat was the first Vacation Rental to open within our Historic District in 2010 and we've seen many other home owners join in making Seminole Heights a vibrant community. Over the last eight years the vacation rental industry has made a real economic impact that is both significant and largely taken for granted. In February 2017, we approached 1/3 of our former guests by Email and asked them to respond to our economic survey. We're sharing the results and have added an underscore for this presentation of a wonderful Jerome Kern and P G Wodehouse song from 1917 for your added enjoyment.


In this episode: Star of wonder.
The Gospel account of St. Matthew includes a peculiar episode: Magi or wise men who followed a star to the place of Jesus' birth. A Notre Dame astrophysicist details the astronomical phenomenon he believes led them to Bethlehem.


10 May L78xxAB, L78xxAC. Positive voltage regulator ICs. Datasheet − production data. Features. □ Output current up to A. □ Output voltages of 5;. STMicroelectronics LCV: available from 31 distributors. Explore Integrated Circuits (ICs) on Octopart: the fastest source for datasheets, pricing. LCV from STMICROELECTRONICS >> Specification: Linear Voltage Regulator, , Manufacturer Part No: LCV Technical Datasheet: (EN) .
In one digital package you will gain access to video footage, technical documentation, training and marketing collateral.
Price Each In a Pack of The three terminal positive linear l7806cv datasheet regulators can remove problems that are related with single point regulation by providing local on-card regulation. These regulators can provide local on-card regulation, k7806cv l7806cv datasheet distribution problems associated with single point regulation.
L7806cv datasheet in touch with the latest news Standard Pack Production Pack. The product detailed below complies with the specifications published by RS Components.
View our Featured Product Technologies:. The product has been added to the cart.
The voltage regulator offers safe area protection with the addition of internal thermal shutdown and current limiting. By Keyword By Part. STMicroelectronics L78 Series of fixed output voltage regulators are useful in a wide range l7806cv datasheet applications within l7806cv datasheet electronics Industry.
If l7806cv datasheet heat sinking is provided, they can deliver over 1 A output current. For more information, please call Sign up today and stay dataeheet of your competition. You have been subscribed with the provided email address. The product does not contain any of the restricted substances in concentrations and applications banned by the L7806cv datasheet, and l7806cv datasheet components, the product is capable of being worked on at the higher temperatures required by lead—free soldering The restricted substances and maximum allowed concentrations in the homogenous material are, by weight: Each type employs internal current limiting, thermal shut-down and safe area protection, making it essentially indestructible.
The L78M series positive linear voltage regulators by STMicroelectronics all have fixed voltage outputs from 5V up to 24 V with a mA current output. Flange Mount Package Style: Although designed primarily as fixed l7806cv datasheet regulators, these l806cv can be used with external components to l7806cv datasheet adjustable voltage and currents.
The product does not contain any of the l7806cv datasheet substances in concentrations and applications banned by the Directive, and for components, the product is capable of being worked on at the higher temperatures required by lead—free soldering. Be the first to write a review for this product. Range of fixed output voltages, output current l7806cv datasheet to datasneet.


text:
Where is your 604?
Celebrate Being Canadian With This Week-Long Poutine Festival
Monday February 1st, 2021 - Sunday February 7th, 2021
Act Fast, One Of The Largest Local Spas Is Offering 50% Off Gift Cards
This Seaside Resort Is Offering $99 Rooms For a Getaway In White Rock
Thanksgiving at 75 West Coast Grill
Sunday October 11th, 2020
Monday October 12th, 2020
Notable 2021 Restaurants Opening In Vancouver To Look Out For
Meagan Gill | December 30, 2020
Ringing in the New Year also means the countdown to a plethora of new restaurants set to open up shop in Vancouver sometime in 2021....
The Annual Vancouver Hot Chocolate Festival Will Return This Month
Christina Chandra | January 7, 2021
Without a doubt, one of the most anticipated annual winter festivals is the Hot Chocolate Festival in Vancouver. Every year, coffee shops, bakeries and chocolatiers...
The Keefer Bar Has Opened An Epic Winter Patio Featuring Mini Putt
Chinatown has an all-new hangout spot to brighten your spirits during the dark and dreary days of winter. The Keefer Bar has made some amendments...
Get More 604 ...
8 B.C. Cities Rank In Top 25 Most Dangerous Places in Canada
Christina Chandra | December 30, 2020
Following the same trajectory as last year, MacLean's annual report on Canada's crime data lists the most dangerous Canadian cities in 2020, with 8 from...
People Are Upset At Traffic Line Ups To Cypress and Seymour Mountain
Due to the most recent restrictions, BC snow lovers have been asked to hit their local mountains vs. visiting resorts in other areas of the...
RCMP Releases Annual List of Surrey's Most Wanted Criminals
The Surrey RCMP do their best to stop criminals and apprehend them, in efforts to keep us safe. Each year, they provide a list of...
5 Best Outdoor Winter Activities To Check Off Your Holiday Bucket List
Celebrate the holiday season (while staying safe) with one of these must-try outdoor winter activities near Vancouver. You Might Also Like: Impressive Waterfront Skywalk Attraction...
9 Beautiful Light Displays in Surrey This Holiday Season (PHOTOS)
The city of Surrey held a contest to #LightWhereYouLive where residents were asked to jazz up their homes for the holidays and take photos. Entries...
Stay At This Seaside Cabin On A Farm With Horses For Under $70 A Night
Searching for a secluded getaway with nature as your nearest neighbour? Add this quaint cabin to your BC bucket list once travel in the province...
5 Abandoned Ghost Towns In British Columbia
Meagan Gill | January 14, 2021
Empty streets and tattered houses with only remnants of the place it used to be, ghost towns are eerie and filled with history. Here's a...
Prince Harry & Meghan Markle's Prospective Vancouver Home Sold, Guess How Much?
Early in 2020, there was a lot of speculation surrounding Prince Harry and Meghan Markle's interest in a BC home, specifically in Vancouver's West End....
Here's Everything Coming To And Leaving Netflix Canada In January 2021
Netflix Canada is here to brighten up your days spent in quarantine with an all-new line-up of shows to binge. Here's all the Netflix originals...
Vancouver Contests
Free in Vancouver
Best of Metro Vancouver
Advertise FacebookTwitterPinterestInstagramYouTube
Canucks Fans Can Go To The SportsBar At Rogers Arena During Games This Season
Photo: Canucks Sportsbar
Even though there will be no fans in the stadium, Canuck fans can still go to Rogers Arena. Well, in the SportsBar, anyways.
The SportsBar at Rogers Arena is reopening to kick off the new hockey season, starting January 13 when they open their season against the Edmonton Oilers.
RELATED: Notable 2021 Restaurants Opening In Vancouver To Look Out For
How Are Fans Able To Watch Games Right Now?
Although the stadium is closed, the restaurant is allowed to remain open, as are other restaurants in the city. The SportsBar has its own separate entrance, off the Georgia Viaduct. So, no one will be allowed to technically enter Rogers Arena itself.
If you are expecting a loophole to watch the game live though, you are out of luck.
The curtains will be drawn, and all views of the ice will be completely blocked. The games will simply be broadcasted on the many screens inside the restaurant.
When Is This Happening?
The SportsBar will be open for every single Canucks game, regardless if it's a home or away game. People can come in as early as 1-hour before the puck drops.
The Canucks will play their first game in Edmonton on January 13, at 7pm PST. They are in Edmonton again on the 14th then play Calgary on the 16th. The game against Calgary will mark the first Saturday Hockey Night in Canada game for the Canucks, which tends to be a big deal for fans and typically generate much business (pre-pandemic).
The Canucks will be home for a 6-game stretch on January 20th, against the Montreal Canadians and then the Ottawa Senators.
Reservations are encouraged, as it's expected it will be busy. In fact, you can book a table all the way until the end of the season, in September.
For more updates on restaurants news in Vancouver, check out our Food section.
Log in or create an account to save content
Get more 604, delivered to your inbox
Plan your next night out, enter contests, and stay connected.
This BC Farmhouse Airbnb Makes For a Great Seaside Escape
Once travel restrictions ease up, treat yourself to a unique BC getaway with a stay at this adorable seaside farmhouse. It's just a short ferry...
Treat Yourself To This Metro Vancouver Shop's New Crunchy Milk Tea
One of Metro Vancouver's top bubble tea shops is whipping up an all-new treat. Feast your eyes on the Crunchy Milk Tea, now available at...
Here's The Latest COVID-19 Hot Spots Map For British Columbia
Christina Chandra | January 18, 2021
The B.C. Centre for Disease Control (BCCDC) released a map on Saturday showing the confirmed COVID-19 cases from January 3 – 9. This latest map...
604 Now is dedicated to metro Vancouver, the southwest corner of British Columbia, and the province's most urban division. Daily, we engage a diverse community and excite our readers to explore the best of their city within the metropolis.
© 2021 604 Now
Sign up for 604 Now to save events, landmarks, and articles to your profile.
Select Your Username*
Your Birthday*
Your 604*


text:
Category Archives: Pakistan
Joe Biden's Account of Stance on Bin Laden Raid Conflicts With Others – First Draft. Political News, Now. – The New York Times
Posted on January 6, 2020 by David Lindsay Jr
On Tuesday, Mr. Biden suggested that he had not opposed the raid, saying he told the president in a one-on-one conversation "that I thought he should go but to follow his own instincts." That seemed to conflict with the public memories of others who were involved in the decision and who suggested that Mr. Biden was against the raid.
Mr. Panetta, who was the director of the C.I.A. at the time and strongly supported the raid, wrote in his memoir, "Worthy Fights," that Mr. Biden "argued that we still did not have enough confidence that bin Laden was in the compound, and he came out firmly in favor of waiting for more information."
Mr. Gates, then the defense secretary, wrote in his book, "Duty: Memoirs of a Secretary at War," that he and Mr. Biden were the "two primary skeptics, although everyone was asking tough questions. Biden's primary concern was the political consequences of failure."
Michael Morell
In his book, "The Great War of Our Time," Mr. Morell, then a deputy to Mr. Panetta, characterized Mr. Biden as "unconvinced about the intelligence and concerned about what a failed mission would do" to the United States' relationship with Pakistan.
In her memoir as secretary of state, "Hard Choices," released last year, Mrs. Clinton described Mr. Biden as being among the skeptics of a raid, although she touched on his role only lightly. But on the public-speaking circuit before the book's release, Mrs. Clinton described herself as steadfastly in Mr. Panetta's corner in support of the raid.
Yet there were several meetings leading up to the surprise attack in Pakistan, and some people appeared to give weight to different factors at different points. Mr. Panetta, for instance, wrote in his book that Mrs. Clinton "acknowledged that more time might give us better intelligence, a sentiment others advanced as well, but she concluded that this was a rare opportunity and believed we should seize it."
Posted in India Pakistan Afganistan et cetera stans, Pakistan, Presidential Politics	| Tagged Joe Biden's Account of Stance on Bin Laden Raid Conflicts With Others	| Leave a reply
Biden Says He Didn't Oppose Raid That Killed Bin Laden – 10/20/2015- The New York Times
"When asked specifically whether he had advised against the raid, Mr. Biden said: "Let me put it this way: My advice was, follow your instincts, knowing what his instinct was."
On Tuesday, Mr. Biden's evolution continued. Before an audience at George Washington University, Mr. Biden said he never gave Mr. Obama definitive advice on controversial issues in front of other officials, mindful that he did not want the rest of the team to see a difference between his opinion and that of the president. With others around them, Mr. Biden said he suggested one more pass over the Abbottabad compound with an unmanned aerial vehicle, or drone.
After the meeting in the Situation Room, though, Mr. Biden said he privately gave the president his real view. "As we walked out of the room and went upstairs, I told him my opinion, that I said that I thought he should go but to follow his own instincts," Mr. Biden said Tuesday."
Posted in India Pakistan Afganistan et cetera stans, Middle East, Pakistan, Presidential Politics	| Tagged Biden Says He Didn't Oppose Raid That Killed Bin Laden	| Leave a reply
Editorial | End the War in Afghanistan – The New York Times
Posted on February 5, 2019 by David Lindsay Jr
The editorial board represents the opinions of the board, its editor and the publisher. It is separate from the newsroom and the Op-Ed section.
Feb. 3, 2019, 632
On Sept. 14, 2001, Congress wrote what would prove to be one of the largest blank checks in the country's history. The Authorization for Use of Military Force against terrorists gave President George W. Bush authority to attack the Taliban, the Sunni fundamentalist force then dominating Afghanistan that refused to turn over the mastermind of the attacks perpetrated three days earlier, Osama bin Laden.
In the House of Representatives and the Senate combined, there was only one vote in opposition: Barbara Lee, a Democratic representative from California, who warned of another Vietnam. "We must be careful not to embark on an open-ended war with neither an exit strategy nor a focused target," she said. "We cannot repeat past mistakes."
Days later, Mr. Bush told a joint session of Congress just how broadly he planned to use his new war powers. "Our war on terror begins with Al Qaeda, but it does not end there," Mr. Bush declared. "It will not end until every terrorist group of global reach has been found, stopped and defeated."
More than 17 years later, the United States military is engaged in counterterrorism missions in 80 nations on six continents. The price tag, which includes the wars in Afghanistan and Iraq and increased spending on veterans' care, will reach $5.9 trillion by the end of fiscal year 2019, according to the Costs of War project at Brown University. Since nearly all of that money has been borrowed, the total cost with interest will be substantially higher.
The war on terror has been called the "forever war," the "long war," a "crusade gone wrong." It has claimed an estimated half a million lives around the globe.
It is long past time for a reappraisal."
via Opinion | End the War in Afghanistan – The New York Times
Posted in Afghanistan, Foreign Affairs and U.S.ForeignPolicy, Pakistan, Uncategorized	| Tagged Editorial | End the War in Afghanistan, The New York Times	| Leave a reply
Oscar Win Shines Light on Pakistan Efforts to Stop 'Honor Killings' – The New York Times
Posted on March 3, 2016 by David Lindsay Jr
"KARACHI, Pakistan — The latest Academy Award for a filmmaker from Pakistan is focusing attention on so-called honor killings of women in the country, with the prime minister and other senior officials vowing to strengthen laws against the practice.From Our AdvertisersOn Sunday, the filmmaker, Sharmeen Obaid-Chinoy, won the Oscar for best documentary short for her film "A Girl in the River: The Price of Forgiveness," which depicts the survivor of an attempted honor killing who was forced to publicly forgive her family for trying to murder her.Human rights activists in Pakistan have been pressing the state for decades to halt the attacks, in which family members believe they are restoring their honor by killing women who have eloped or had an unsanctioned relationship outside marriage. But such attacks have remained common, with more than 700 women killed in Pakistan in 2014 alone, according to statistics by the Aurat Foundation, a women's rights advocacy group."
Source: Oscar Win Shines Light on Pakistan Efforts to Stop 'Honor Killings' – The New York Times
Posted in Pakistan	| Tagged Honor Killings in Pakistan	| Leave a reply


text:
Q: angular - generate formGroup and formControl from endpoint i would like to generate formGontrols with what send me the endpoint,
the endpoint send me that:
[
    {
        "objectName": 23,
        "fields": [
            {
                "id": 1,
                "field": "nom",
                "type": "nom",
            {
                "id": 2,
                "field": "nom",
                "type": "nom",
            } ,
   {
        "objectName": 23,
        "fields": [
            {
                "id": 1,
                "field": "nom",
                "type": "nom",
            {
                "id": 2,
                "field": "nom",
                "type": "nom",
            }
        ]
    }
]

For now i can only generate FormControl with the id name, but inside my loop i canot acces to the new formGroupe to add to him formControl
i tried this
 this.store.select(selectLotList).subscribe( lots => {
  this.lots = lots
})

for (let i = 0; i< this.lots.length; i++) {
  this.lotsFormControl.push(new FormGroup(this.lots[i].idLot))

for(const fieldItem of this.lots[i].fields! ){
    let formGroup = this.formGroupesGenere.get("lots") as FormArray )

here i can create the formControle, but i can't create inside control new formGroup with his own controls

A: Based on the limited information you have given, I would suggest typing your data then mapping it to the corresponding form group/array/control hierarchy.
type Field = {
  id: number;
  field: string;
  type: string;
};

type ResponseItem = {
  objectName: number;
  fields: Field[]
};

createForm(responseItems: ResponseItem[]) {
    return new FormGroup({items: ( new FormArray(responseItems.map(
      (item) =>
        new FormGroup({
          [item.objectName]: new FormArray(
            item.fields.map((field) => new FormControl(field.field))
          ),
        })
    )))});
  }

You can adjust the mapping logic above to fine tune the resulting Form structure.
Stackblitz: https://stackblitz.com/edit/angular-snsjzp?file=src%2Fmain.ts


Go Maggie Go Springs Upset in Gulfstream Park Oaks: Making just her second career start and first in stakes company, Mike Tarp homebred Go Maggie Go took the lead on the far turn and held off graded stakes-winning favorite Off the Tracks the length of the stretch to win Saturday's $250,000 Gulfstream Park Oaks (G2).
Making just her second career start and first in stakes company, Mike Tarp homebred Go Maggie Go took the lead on the far turn and held off graded stakes-winning favorite Off the Tracks the length of the stretch to win Saturday's $250,000 Gulfstream Park Oaks (G2).
The 46th running of the 1 1/16-mile Oaks for 3-year-old fillies was the second of eight stakes, seven of them graded, on a blockbuster 14-race program anchored by the $1 million Xpressbet.com Florida Derby (G1) featuring a matchup between undefeated Triple Crown prospects Mohaymen and Nyquist.
An impressive maiden winner March 13 at Gulfstream, Go Maggie Go ($10) gave trainer Dale Romans his second straight Oaks victory, following Birdatthewire's triumph last year. The winning time was 1:43.74 over a good, sealed main track.
Breaking from post three under Luis Saez, also aboard in her debut, Go Maggie Go settled to the outside of pacesetter Paola Queen through a quarter-mile in 23.09 seconds and a half in 46.70, with Grade 2 winner Off the Tracks, the 4-5 favorite in a field of seven, in close pursuit.
Saez and Go Maggie Go surged to the lead midway around the turn as Off the Tracks revved up on the outside under Hall of Famer John Velazquez to launch their bid. Go Maggie Go held firm to the lead as they straightened for home after going a mile in 1:37.07 to win by 2 ½ lengths over Paola Queen, who surged up the rail for second.
Off the Tracks was a half-length back in third, 5 ½ lengths ahead of Grade 1 winner Gomo. Double Entendre, Mo' Green and Hold On Momma completed the order of finish.
Romans gave greater consideration to his horse over the competition despite the wide disparity in seasoning and stakes experience.
Off the Tracks was making her second start of the Championship Meet following her victory in the Feb. 21 Margate Handicap, and first since being purchased privately and moved to trainer Todd Pletcher.
Second choice at 7-2, Gomo was running for the first time since her victory over a sloppy, sealed track in the Alcibiades (G1) Oct. 2 at Keeneland. She had an ankle chip removed following the race.