text
stringlengths 1
22.8M
|
|---|
```html+erb
<div class="ltag__stackexchange--container">
<div class="ltag__stackexchange--title-container">
<header>
<div class="ltag__stackexchange--title">
<% logo_to_use = site == "stackoverflow" ? "stackoverflow-logo.svg" : "stackexchange-logo.svg" %>
<div class="ltag__stackexchange--header">
<img src="<%= ActionController::Base.helpers.asset_path(logo_to_use) %>" alt="">
<a href="<%= post_url %>" target="_blank" rel="noopener noreferrer">
<%= post_type == "question" ? CGI.unescapeHTML(title) : t("views.liquids.stackexchange.answer.text_html", answer: tag.span(t("views.liquids.stackexchange.answer.answer"), class: "title-flare"), title: CGI.unescapeHTML(title)) %>
</a>
</div>
<div class="ltag__stackexchange--post-metadata">
<span><%= Time.zone.at(created_at).strftime(t("time.formats.stackexchange")) %></span>
<% if post_type == "question" %>
<span><%= t("views.liquids.stackexchange.comments", count: comment_count) %></span>
<span><%= t("views.liquids.stackexchange.answers", count: answer_count) %></span>
<% end %>
</div>
</div>
<a class="ltag__stackexchange--score-container" href="<%= post_url %>" target="_blank" rel="noopener noreferrer">
<img src="<%= ActionController::Base.helpers.asset_path("stackexchange-arrow-up.svg") %>" alt="">
<div class="ltag__stackexchange--score-number">
<%= score %>
</div>
<img src="<%= ActionController::Base.helpers.asset_path("stackexchange-arrow-down.svg") %>" alt="">
</a>
</header>
</div>
<div class="ltag__stackexchange--body">
<p>
<%= (HTML_Truncator.truncate body, 50).html_safe %>
</p>
</div>
<div class="ltag__stackexchange--btn--container">
<a href="<%= post_url %>" class="ltag__stackexchange--btn" target="_blank" rel="noopener noreferrer"><%= t("views.liquids.stackexchange.open.#{post_type}") %></a>
</div>
</div>
```
|
```python
# -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.
"""
def __init__(self, *args, **kwargs):
"""Initialize RequestException with `request` and `response` objects."""
response = kwargs.pop('response', None)
self.response = response
self.request = kwargs.pop('request', None)
if (response is not None and not self.request and
hasattr(response, 'request')):
self.request = self.response.request
super(RequestException, self).__init__(*args, **kwargs)
class HTTPError(RequestException):
"""An HTTP error occurred."""
class ConnectionError(RequestException):
"""A Connection error occurred."""
class ProxyError(ConnectionError):
"""A proxy error occurred."""
class SSLError(ConnectionError):
"""An SSL error occurred."""
class Timeout(RequestException):
"""The request timed out.
Catching this error will catch both
:exc:`~requests.exceptions.ConnectTimeout` and
:exc:`~requests.exceptions.ReadTimeout` errors.
"""
class ConnectTimeout(ConnectionError, Timeout):
"""The request timed out while trying to connect to the remote server.
Requests that produced this error are safe to retry.
"""
class ReadTimeout(Timeout):
"""The server did not send any data in the allotted amount of time."""
class URLRequired(RequestException):
"""A valid URL is required to make a request."""
class TooManyRedirects(RequestException):
"""Too many redirects."""
class MissingSchema(RequestException, ValueError):
"""The URL schema (e.g. http or https) is missing."""
class InvalidSchema(RequestException, ValueError):
"""See defaults.py for valid schemas."""
class InvalidURL(RequestException, ValueError):
"""The URL provided was somehow invalid."""
class InvalidHeader(RequestException, ValueError):
"""The header value provided was somehow invalid."""
class InvalidProxyURL(InvalidURL):
"""The proxy URL provided is invalid."""
class ChunkedEncodingError(RequestException):
"""The server declared chunked encoding but sent an invalid chunk."""
class ContentDecodingError(RequestException, BaseHTTPError):
"""Failed to decode response content"""
class StreamConsumedError(RequestException, TypeError):
"""The content for this response was already consumed"""
class RetryError(RequestException):
"""Custom retries logic failed"""
class UnrewindableBodyError(RequestException):
"""Requests encountered an error when trying to rewind a body"""
# Warnings
class RequestsWarning(Warning):
"""Base warning for Requests."""
pass
class FileModeWarning(RequestsWarning, DeprecationWarning):
"""A file was opened in text mode, but Requests determined its binary length."""
pass
class RequestsDependencyWarning(RequestsWarning):
"""An imported dependency doesn't match the expected version range."""
pass
```
|
The Oregon missionaries were pioneers who settled in the Oregon Country of North America starting in the 1830s dedicated to bringing Christianity to local Native Americans. There had been missionary efforts prior to this, such as those sponsored by the Northwest Company with missionaries from the Church of England starting in 1819. The Foreign Mission movement was already 15 years underway by 1820, but it was difficult to find missionaries willing to go to Oregon, as many wanted to go to the east, to India or China. It was not until the 1830s, when a schoolmaster from Connecticut, Hall Jackson Kelley, created his "American Society for the Settlement of the Oregon Country," that more interest and support for Oregon missionaries grew. Around the same time, four Nez Perce arrived in St. Louis in the fall of 1831, with accounts differencing as to if these travelers were asking for “the book of life,” an idea used by Protestant missionaries, or if they asked for “Blackrobes,” meaning Jesuits, thus Catholic missionaries. Either way this inspired Christian missionaries to travel to the Oregon Territory. Oregon missionaries played a political role, as well as a religious one, as their missions established US political power in an area in which the Hudson’s Bay Company, operating under the British government, maintained a political interest in the Oregon country. Such missionaries had an influential impact on the early settlement of the region, establishing institutions that became the foundation of United States settlement of the Pacific Northwest.
Wyeth-Lee Party
In 1834, New York Methodist minister Jason Lee came to the Oregon Country as the first of these missionaries, to establish the first American settlement and to convert the native population. The party was called the Wyeth-Lee Party as Lee had contracted with Nathaniel Jarvis Wyeth, who was going on his second trading expedition, to accompany him. The party set out on April 28, 1834, traveling independently from the American Fur Company's caravan headed for the same destination. Lee built a mission school for Indians in the Willamette Valley at the site of present-day Salem, Oregon. The school evolved from a mission school to a secondary school called the Oregon Institute, eventually becoming Willamette University, the oldest university on the West Coast.
Whitman-Spalding Party
In 1835, Dr. Marcus Whitman made his initial journey west from New York, past the Rocky Mountains and into California. 1836, Marcus Whitman made the same trip, this time with his new wife, Narcissa Whitman, and another missionary couple, Henry Harmon Spalding (who had been jilted by Narcissa) and his wife Eliza Spalding. Narcissa and Eliza were the first white women to cross the Rocky Mountains.
The Whitman’s reached Fort Walla Walla on October 26, 1838, and founded a mission at Waiilatpu, about 25 miles east of Fort Wallo Wallo in the Walla Walla Valley, then the territory of the Cayuse Indians, in the present-day state of Washington. The Spalding’s founded a mission among the Nez Perce Indians at Lapwai, at the foot of Thunder Mountain, in present-day Idaho. Henry Spalding is credited with the creation of the Protestant Ladder, used to teach natives history from Creation to ascent into Heaven. This style of teaching, using a long strip of paper or cloth, was based on the Catholic Ladder used by Catholic Missionaries in the region.
Catholic Missionaries
Catholic missionaries in Oregon Territory followed two paths into the region, with missionaries, such as Father Francis Norbert Blanchet and Father Modeste Demers, coming from Quebec in 1837 and a later group of missionaries following a path similar to the Protestant missionaries coming from the Eastern America, such as Father Pierre-Jean De Smet in 1841.
Catholic missionary work in Oregon Territory officially began when Fr. Francis Norbert Blanchet was appointed Vicar-General of Oregon Country by Archbishop Joseph Signay of Quebec in April 1838. Fr. Blanchet and Fr. Modest Demers arrived in the region at Fort Vancouver on November 24 1838. Originally the missionaries used hymns and books which had been translated into the Chinook Jargon, a language used commonly among different native groups of the region for trade, in their conversion efforts. Realizing that the ideas and concepts within Catholicism were not coming across to their audiences, Fr. Blanchet began using carved shale sticks in his conversion efforts in April 1839, during a visit to the Cowlitz settlement. The shale stick, referred to as the Catholic Ladder, was carved with representations of Christian History. These shale sticks were then distributed to Native chiefs, starting in October 1839, to teach Catholicism. Soon after, the Catholic Ladder began to be produced in paper copies and later massed produced for distribution in the Pacific Northwest with Quebec church leaders arranging for the printing and shipping of 2,000 to the region. Later, Protestant missionaries began using their own version of the ladder, with Henry Spalding being credited with creating the Protestant Ladder using some images from the Catholic Ladder and adding his own. Both the Catholic and Protestant ladders would also represent the opposing domination as heathens.
In 1841, The Rocky Mountain Mission in the Pacific Northwest was started by Fr. Pierre-Jean De Smet and became the most sought-after mission post among Jesuits. The majority of Jesuit missionaries were Italian, owing to instability at home during the period, but missionaries from other nations came to region as well.
Blanchet was made Bishop in 1843, along with the region being made into an Apostolic Vicariate which reached from the Arctic in the North, the Rockies in the East, and the US-Mexican border in the South. Later, in 1846, the region was made into the Ecclesiastical Province of Oregon with Blanchet becoming the archbishop of the archiepiscopal see of Oregon City. This made Oregon the second Ecclesiastical Province created in the US.
Catholics in the region faced persecution by the majority Protestant white settlers, with Father Augustin Magliore Blanchet, Francis Blanchet’s brother, being blamed for the Whitman Massacre in 1847, despite only arriving in Walla Walla three months prior to the events.
Legacy of Early Oregon Missionaries
Missionary work in the Oregon country continued into the 1850s, though in 1853, the Washington territory was established, separate from the Oregon territory to which it had previously belonged. The success in converting Native Americans to Christianity was varied. In some cases, the Indians were very suspicious of the missionaries, and this suspicion only increased when many of the Indians contracted diseases that were introduced by missionaries and White settlers.
As tensions between native tribes and White missionaries rose during the 1850s, resulting in small-scale wars between settlers and natives, like the Rogue River War, missionary work in Oregon was increasingly targeted at White immigrants from the eastern parts of the US, rather than native populations.
References
External links
Oregon Methodist Missions Papers 1835-1858
Blaine Family papers 1849-1864
Walker Family Papers. Yale Collection of Western Americana, Beinecke Rare Book and Manuscript Library, Yale University.
Christianity in Oregon
History of Washington (state)
Oregon Country
Oregon pioneers
|
Milan ( ) is a village in Rock Island County, Illinois, United States. The population was 5,099 at the 2010 census.
The village is located near the Quad Cities of Illinois and Iowa.
History
The village is on the Rock River in northwest Illinois, about 4 miles upstream of its outlet to the Mississippi. The village is the site of the south campsites which comprised the Sauk and Fox village of Saukenuk, once the second-largest Native American inhabitation in North America.
Originally platted along the right-of-way for the Hennepin Canal, in 1837, the village site was called in land speculation papers "Hampton" (not the town in Illinois, approximately 13 miles north-northeast, on the Mississippi River—see Hampton, Illinois for more). "Hampton's" land speculators, George Camden and Franklin Vandruff, sold land along the Rock River, along a north-west flowing creek, which was re-routed north into the Rock's main channel. Along Mill Creek, the industries of wool-carding and (river clamshell) "pearl" button-making helped rename the village by 1841 as Camden Mills.
The village has "sister cities" in Missouri, Tennessee, and Michigan.
Geography
Milan is located at (41.446333, -90.565487).
According to the 2010 census, Milan has a total area of , of which (or 90.82%) is land and (or 9.18%) is water.
Demographics
As of the census of 2000, there were 5,348 people, 2,310 households, and 1,457 families residing in the village. The population density was . There were 2,378 housing units at an average density of . The racial makeup of the village was 92.46% White, 4.32% African American, 0.22% Native American, 0.45% Asian, 0.04% Pacific Islander, 1.08% from other races, and 1.42% from two or more races. Hispanic or Latino of any race were 2.92% of the population.
There were 2,310 households, out of which 28.5% had children under the age of 18 living with them, 45.7% were married couples living together, 13.3% had a female householder with no husband present, and 36.9% were non-families. 31.1% of all households were made up of individuals, and 13.5% had someone living alone who was 65 years of age or older. The average household size was 2.31 and the average family size was 2.88.
In the village, the population was spread out, with 23.3% under the age of 18, 9.6% from 18 to 24, 27.5% from 25 to 44, 24.7% from 45 to 64, and 14.9% who were 65 years of age or older. The median age was 38 years. For every 100 females, there were 93.5 males. For every 100 females age 18 and over, there were 89.2 males.
The median income for a household in the village was $34,556, and the median income for a family was $43,802. Males had a median income of $31,875 versus $22,747 for females. The per capita income for the village was $17,608. About 6.2% of families and 10.7% of the population were below the poverty line, including 13.9% of those under age 18 and 8.6% of those age 65 or over.
Economy
Milan is home to the John Deere North American Parts Distribution Center, one of the largest warehouses in the world.
Before ceasing operations in 2003, Eagle Food Centers was based out of Milan.
Notable people
Ken Bowman, pro football center, winner of three NFL championships with Green Bay Packers, was born in Milan.
Ethan Happ, Wisconsin Badgers basketball player
Ralph Fletcher Seymour, book publisher, artist, author
Joe Frisco, jazz dancer, vaudevillian and comic
Therese Anne Fowler, author, television producer
References
External links
Official Website
Villages in Illinois
Cities in the Quad Cities
Populated places established in 1837
|
```php
<?php
namespace Orchid\Tests\Unit\Screen;
use Illuminate\Contracts\View\View;
use Orchid\Platform\Models\User;
use Orchid\Screen\TD;
use Orchid\Tests\App\Components\SimpleShowValue;
use Orchid\Tests\App\Components\SimpleShowValueWithArguments;
use Orchid\Tests\TestUnitCase;
class TDComponentAsValueTest extends TestUnitCase
{
/**
* @var \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|mixed
*/
protected $user;
protected function setUp(): void
{
parent::setUp();
$this->user = User::factory()->make();
}
public function testTdSimpleComponent(): void
{
$view = TD::make('email')
->asComponent(SimpleShowValue::class)
->buildTd($this->user);
$this->assertStringContainsString($this->user->email, $view);
}
public function testTdWithoutArgumentComponent()
{
$view = TD::make('email')
->asComponent(SimpleShowValueWithArguments::class)
->buildTd($this->user);
$this->assertStringContainsString("Hello {$this->user->email} from Alexandr", $view);
$this->assertStringContainsString(app()->version(), $view);
}
public function testTdArgumentComponent(): void
{
$view = TD::make('email')
->asComponent(SimpleShowValueWithArguments::class, [
'from' => 'Sasha',
])
->buildTd($this->user);
$this->checkedArgument($view);
}
public function testTdArgumentView(): void
{
$view = TD::make('email')
->asComponent(SimpleShowValueWithArguments::class, [
'from' => 'Sasha',
])
->buildTd($this->user);
$this->checkedArgument($view);
}
public function testTdArgumentViewUsingComponent(): void
{
$view = TD::make('email')
->usingComponent(SimpleShowValueWithArguments::class, from: 'Sasha')
->buildTd($this->user);
$this->checkedArgument($view);
}
public function testTdArgumentViewWithClosureArgument(): void
{
$view = TD::make('email')
->asComponent(SimpleShowValueWithArguments::class, [
'from' => fn () => 'Sasha',
])
->buildTd($this->user);
$this->checkedArgument($view);
}
public function testTdAnonymousComponentWithClosureArguments(): void
{
$view = TD::make('email')
->asComponent('exemplar::simple-anonymous-component', [
'property1' => fn ($email) => $email.'3333',
'property2' => fn ($email) => $email.'4444',
])
->buildTd($this->user);
$this->assertStringContainsString($this->user->email.'3333', $view);
$this->assertStringContainsString($this->user->email.'4444', $view);
}
protected function checkedArgument(View $view)
{
$this->assertStringContainsString("Hello {$this->user->email} from Sasha", $view);
$this->assertStringContainsString(app()->version(), $view);
}
}
```
|
```c++
#pragma once
#include <steem/plugins/json_rpc/utility.hpp>
#include <steem/plugins/follow/follow_objects.hpp>
#include <steem/plugins/database_api/database_api_objects.hpp>
#include <steem/plugins/reputation_api/reputation_api.hpp>
#include <steem/protocol/types.hpp>
#include <fc/optional.hpp>
#include <fc/variant.hpp>
#include <fc/vector.hpp>
namespace steem { namespace plugins { namespace follow {
using steem::protocol::account_name_type;
using steem::plugins::reputation::account_reputation;
namespace detail
{
class follow_api_impl;
}
struct feed_entry
{
account_name_type author;
string permlink;
vector< account_name_type > reblog_by;
time_point_sec reblog_on;
uint32_t entry_id = 0;
};
struct comment_feed_entry
{
database_api::api_comment_object comment;
vector< account_name_type > reblog_by;
time_point_sec reblog_on;
uint32_t entry_id = 0;
};
struct blog_entry
{
account_name_type author;
string permlink;
account_name_type blog;
time_point_sec reblog_on;
uint32_t entry_id = 0;
};
struct comment_blog_entry
{
database_api::api_comment_object comment;
string blog;
time_point_sec reblog_on;
uint32_t entry_id = 0;
};
struct api_follow_object
{
account_name_type follower;
account_name_type following;
vector< follow::follow_type > what;
};
struct reblog_count
{
account_name_type author;
uint32_t count;
};
struct get_followers_args
{
account_name_type account;
account_name_type start;
follow::follow_type type;
uint32_t limit = 1000;
};
struct get_followers_return
{
vector< api_follow_object > followers;
};
typedef get_followers_args get_following_args;
struct get_following_return
{
vector< api_follow_object > following;
};
struct get_follow_count_args
{
account_name_type account;
};
struct get_follow_count_return
{
account_name_type account;
uint32_t follower_count = 0;
uint32_t following_count = 0;
};
struct get_feed_entries_args
{
account_name_type account;
uint32_t start_entry_id = 0;
uint32_t limit = 500;
};
struct get_feed_entries_return
{
vector< feed_entry > feed;
};
typedef get_feed_entries_args get_feed_args;
struct get_feed_return
{
vector< comment_feed_entry > feed;
};
typedef get_feed_entries_args get_blog_entries_args;
struct get_blog_entries_return
{
vector< blog_entry > blog;
};
typedef get_feed_entries_args get_blog_args;
struct get_blog_return
{
vector< comment_blog_entry > blog;
};
typedef reputation::get_account_reputations_args get_account_reputations_args;
typedef reputation::get_account_reputations_return get_account_reputations_return;
struct get_reblogged_by_args
{
account_name_type author;
string permlink;
};
struct get_reblogged_by_return
{
vector< account_name_type > accounts;
};
struct get_blog_authors_args
{
account_name_type blog_account;
};
struct get_blog_authors_return
{
vector< reblog_count > blog_authors;
};
class follow_api
{
public:
follow_api();
~follow_api();
DECLARE_API(
(get_followers)
(get_following)
(get_follow_count)
(get_feed_entries)
(get_feed)
(get_blog_entries)
(get_blog)
(get_account_reputations)
/**
* Gets list of accounts that have reblogged a particular post
*/
(get_reblogged_by)
/**
* Gets a list of authors that have had their content reblogged on a given blog account
*/
(get_blog_authors)
)
private:
std::unique_ptr< detail::follow_api_impl > my;
};
} } } // steem::plugins::follow
FC_REFLECT( steem::plugins::follow::feed_entry,
(author)(permlink)(reblog_by)(reblog_on)(entry_id) );
FC_REFLECT( steem::plugins::follow::comment_feed_entry,
(comment)(reblog_by)(reblog_on)(entry_id) );
FC_REFLECT( steem::plugins::follow::blog_entry,
(author)(permlink)(blog)(reblog_on)(entry_id) );
FC_REFLECT( steem::plugins::follow::comment_blog_entry,
(comment)(blog)(reblog_on)(entry_id) );
FC_REFLECT( steem::plugins::follow::api_follow_object,
(follower)(following)(what) );
FC_REFLECT( steem::plugins::follow::reblog_count,
(author)(count) );
FC_REFLECT( steem::plugins::follow::get_followers_args,
(account)(start)(type)(limit) );
FC_REFLECT( steem::plugins::follow::get_followers_return,
(followers) );
FC_REFLECT( steem::plugins::follow::get_following_return,
(following) );
FC_REFLECT( steem::plugins::follow::get_follow_count_args,
(account) );
FC_REFLECT( steem::plugins::follow::get_follow_count_return,
(account)(follower_count)(following_count) );
FC_REFLECT( steem::plugins::follow::get_feed_entries_args,
(account)(start_entry_id)(limit) );
FC_REFLECT( steem::plugins::follow::get_feed_entries_return,
(feed) );
FC_REFLECT( steem::plugins::follow::get_feed_return,
(feed) );
FC_REFLECT( steem::plugins::follow::get_blog_entries_return,
(blog) );
FC_REFLECT( steem::plugins::follow::get_blog_return,
(blog) );
FC_REFLECT( steem::plugins::follow::get_reblogged_by_args,
(author)(permlink) );
FC_REFLECT( steem::plugins::follow::get_reblogged_by_return,
(accounts) );
FC_REFLECT( steem::plugins::follow::get_blog_authors_args,
(blog_account) );
FC_REFLECT( steem::plugins::follow::get_blog_authors_return,
(blog_authors) );
```
|
```shell
#!/usr/bin/env bash
# Run this script simply as ./bench/perf.sh from the root directory.
set -e
TEST_REPO=path_to_url
TEST_COMMIT=b6bfaf2974ec8ee1eea92c4316ec37b9966322e3
# Some alternative benchmarks:
# TEST_REPO=path_to_url
# TEST_COMMIT=002edc11f4e0a57f11d5226cb2497c8b406027b5
# TEST_REPO=path_to_url
# TEST_COMMIT=b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c
dune() {
TIMEFORMAT=$'real %Rs\nuser %Us\nsys %Ss\n'; time ../_build/default/bin/main.exe "$@" > /dev/null 2>&1
}
setup_test() {
mkdir -p _perf
cd _perf
if [ ! -f README.md ]; then
echo "Cloning $TEST_REPO..."
wget $TEST_REPO/archive/$TEST_COMMIT.tar.gz
tar -xzf $TEST_COMMIT.tar.gz --strip-components=1
fi
cd ..
}
pad () {
while IFS='' read -r x; do printf "%-$1s\n" "$x"; done
}
run_test() {
echo "Building Dune..."
# [make release] is used for bootstrapping, but the real binary to benchmark is
# then produced by a separate dune invocation.
# This is done mainly because [make release] won't rebuild dune if it's stale.
make release > /dev/null
./dune.exe build _build/default/bin/main.exe
cd _perf
rm -rf _build
echo "Running full build..."
dune build --release --cache=disabled 2>> $1
echo "Running zero build..."
dune build --release --cache=disabled 2>> $1
cd ..
}
setup_test
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
rm -f _perf/rows _perf/current _perf/main
echo " " >> _perf/rows
echo " " >> _perf/rows
echo " |" >> _perf/rows
echo "Full build |" >> _perf/rows
echo " |" >> _perf/rows
echo " " >> _perf/rows
echo " |" >> _perf/rows
echo "Zero build |" >> _perf/rows
echo " |" >> _perf/rows
echo "Current branch" >> _perf/current
echo "==============" >> _perf/current
echo "Testing the current branch ($CURRENT_BRANCH)"
run_test current
echo " Main branch " >> _perf/main
echo "=============" >> _perf/main
git checkout main
echo "Testing main"
run_test main
git checkout $CURRENT_BRANCH
echo ""
echo "Summary for building $TEST_REPO:"
echo ""
paste -d ' ' <(pad 10 < _perf/rows) <(pad 14 < _perf/current) _perf/main
```
|
Lawrence Hill (born September 4, 1971) better known by his stage name Larry Larr is an American rapper and businessman. He first came in the music wave with other Philadelphia rappers such as Schooly D, Steady B and DJ Jazzy Jeff & The Fresh Prince in the mid eighties. He first signed his deal with Ruffhouse Records and released his debut album entitled "Da Wizzard Of Odds" in 1991 with the lead single "Larry, That’s What They Call Me" which only charted on the Hot Rap Songs at the position 7 and his second single "Confused" only made it at 10 on the Hot Rap Songs as well. However the album didn't sell well only making 67 on Top R&B/Hip-Hop Albums chart.
Studio albums
References
1971 births
African-American male rappers
American male rappers
Living people
Businesspeople from Philadelphia
Rappers from Philadelphia
Ruffhouse Records artists
Columbia Records artists
East Coast hip hop musicians
Gangsta rappers
21st-century American rappers
21st-century American male musicians
21st-century African-American musicians
20th-century African-American people
|
```python
# -*- coding: utf-8 -*-
from .._common import *
from .idconvertor import *
__all__ = ['av2bv', 'sign_api_url', 'get_media_data']
def sign_api_url(api_url, params, skey):
params = sorted(params.items())
params.append(('sign', hash.md5(urlencode(params) + skey)))
params_str = urlencode(params)
return '{api_url}?{params_str}'.format(**vars())
def get_media_data(bvid):
data = get_response('path_to_url
params={'bvid': bvid}).json()
assert data['code'] == 0, "can't play this video!!"
return data['data']
```
|
```html
<div *ngFor="let pony of ponies | slice:0:4">
<h2>{{ pony.name }}</h2>
</div>
```
|
Tanishq is an Indian jewellery brand and a division of Titan Company. Founded in 1994, Tanishq is headquartered in Bangalore, and has 410 retail stores across more than 240 cities.
History
By the end of the 1980s, Titan launched Tanishq, focused largely on exports to European and American markets, in an attempt to increase its foreign exchange reserves. In the early 1990s, India's exchange crisis was resolved, and Titan Company shifted the focus of the brand to Indian market. A pilot plant was set up in August 1992 and the production began in 1994, and Tanishq's first store opened in 1996. Tanishq was the first jewellery retail chain in India.
The first years of Tanishq recorded consistent losses. In 2000, Managing Director Xerxes Desai chose Bhaskar Bhat to succeed him. Starting in 2000, its net worth started to grow, and by 2003, Tanishq was among the top 5 retailers in India, and made up 40% of the Titan Company's revenue.
In the early 2000s, Tanishq opened stores internationally, in the Middle East and in the United States (Chicago and New Jersey), but closed them before the end of the decade.
Tanishq made the beauty pageant crowns for the Femina Miss India 2007. By 2008, Tanishq had 105 stores in 71 cities in India. In 2011, the Tanishq group launched the sub-brand called Mia for working women. In November 2012, Tanishq reached a landmark when it opened its 150th showroom in India
In April 2014, the brand started to export to the United Arab Emirates. In July 2014, Tanishq announced it ceased its gold deposit schemes to comply with the Companies Act 2013, schemes that enabled its clients to save up to buy gold, but launched it back just a few months later in a format that complied with the new laws.
By December 2022, Tanishq had 385 retail stores nationwide, and announced the opening of 45-50 stores by the end of 2023.
In 2017, Tanishq launched a sub-brand called Rivaah targeting the wedding segment. In January 2017, the Titan group merged its Gold Plus stores with the larger Tanishq retail brand. In April 2017, Tanishq launched the sub-brand Mirayah to cater to women under their 40s. In December 2017, Tanishq launched the Aveer line, its first line of products for men.
In 2023, the brand opened its U.S. flagship store on Oak Tree Road, a popular East Coast shopping district for South Asian goods and services.
Activities
Tanishq is a brand of jewellery retail stores in India. The brand is the property of Titan Company, which is back by Tata Group and TIDCO.
The name Tanishq was chosen by Titan's first managing director Xerxes Desai. The name was formed by combining the first two letters from "Tan" (means body) and निष्क "NIṢK" (meaning gold coin or necklace in Sanskrit), although the क k has been modified into a क़ q. According to another sources, the name is formed with the two words Tan (body) and Nishk (gold ornament) in the Sanskrit language, a name synonymous to superior craftsmen or absolute design.
Controversies
In October 2020, a Tanishq commercial depicting an interfaith couple's baby shower sparked controversy on social media. As calls for a boycott intensified, the company stated that it had withdrawn the ad "keeping in mind hurt sentiments & well being of our employees". A month later, it withdrew another ad which had called for Diwali to be celebrated without firecrackers, owing to criticism on social media.
References
External links
Official website
Design companies established in 1994
Luxury brands
Companies based in Bangalore
Indian jewellery designers
Indian brands
Jewellery retailers of India
Jewellery companies of India
Titan Company
1984 establishments in Karnataka
|
Edwin Burket Twitmyer (1873–1943) was professor of Psychology and director of the Psychological Laboratory and Clinic at the University of Pennsylvania. He is a little-known figure in the history of psychology, but he independently discovered classical conditioning at approximately the same time as the famous Russian physiologist, Ivan Pavlov, who is normally given credit for this achievement.
Twitmyer initially studied the patellar tendon reflex, and devised an apparatus that delivered a light tap below the knees of his research subjects in order to elicit this reflex. Twitmyer warned his subjects that the tap was about to be delivered with a bell. During the course of his research, the sound of the bell was accidentally presented to one of his subjects without the tap below the knee. In a serendipitous discovery much like Pavlov's, Twitmyer realized that the auditory stimulus was sufficient to produce the now conditioned reflexive response.
Twitmyer replicated the experiment with six more subjects and found that all of them learned to associate the bell with the hammer, and would produce the response to the sound of the bell alone. This typically took several dozen trials and the conditioned response was not only unintentional, but several of his subjects found themselves unable to prevent the response even when they attempted to do so. This finding is the first experimental demonstration of classical conditioning in a human being.
Twitmyer published this research in his doctoral dissertation in 1902, one year before Pavlov announced the results of his research with dogs at the 1903 International Medical Congress in Madrid. He also presented his work at a meeting of the American Psychological Association in 1904, presided over by William James. His paper, "Knee jerks without stimulation of the patellar tendon", was given late in the session, well-past the scheduled lunch break, and drew little response from the crowd.
No one at the time realized the significance of the discovery, possibly because it did not fit in with existing work in psychology. Twitmyer faded into obscurity, but only a few years later John B. Watson had great success popularizing classical conditioning as part of the growing behaviorist movement in psychology.
References
External links
Edward B. Twitmyer at www.psych.upenn.edu
Tale of the Almost Was: E.B. Twitmyer at www1.appstate.edu
20th-century American psychologists
1873 births
1943 deaths
|
This is a list of cities/towns in South Australia by urban centre population.
Largest Urban Centres and Localities by population
Urban Centres and Localities (UCLs) represent areas of concentrated urban development with populations of 200 people or more. Areas in a state or territory that are not included in an UCL are considered to be ‘rural’. UCLs are not an official definition of towns.
Suburbs of Adelaide are not included, with the exception of Gawler, Mount Barker, Crafers-Bridgewater and Nairne, which can all be seen as semi-rural suburbs but also as separate towns.
*Uraidila and Summertown are recorded separately until 2011 when they are merged.
25 largest local government areas by population
Local government areas are the main units of local government in Australia. They may be termed cities, shires, councils or other names, but they all function similarly.
See also
Demographics of Australia
List of cities in Australia
List of places in New South Wales by population
List of places in the Northern Territory by population
List of places in Queensland by population
List of places in Tasmania by population
List of places in Victoria by population
List of places in Western Australia by population
Notes and references
South Australia
South Australia, Places by population
Places by population
Demographics of South Australia
|
```javascript
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Try to get a GC because of a heap number allocation while we
// have live values (o) in a register.
function f(o) {
var x = 1.5;
var y = 2.5;
for (var i = 1; i < 100000; i+=2) o.val = x + y + i;
return o;
}
var o = { val: 0 };
for (var i = 0; i < 100; i++) f(o);
```
|
Andover is a planned New Jersey Transit passenger railroad station in Andover Township, in Sussex County, New Jersey, United States, providing service on its Lackawanna Cut-Off line. The line remains under construction. The station will be built at a site on Andover's Roseville Road, about from U.S. Route 206 and about from County Route 517. On the rail line, it will be located about west of Port Morris Junction.
Anticipated construction at the site includes a station and platform between the track and Roseville Road with 65 parking spaces initially, with room to expand to 125 spaces. Preparation to restore trackage between Port Morris and Andover was originally to begin in 2010 but was delayed until early 2011 due to a dispute over the exact location of the Andover Station area. Another delay was caused while environmental permits were sought. In August 2017, an agreement with a local landowner appeared to have cleared the way for the necessary environmental permits. At the time, service was projected to start in 2020, though in March 2020 it was pushed back to 2025, and it has since been delayed to 2026.
The Andover station will be the terminus of the line, but plans exist for extending the Lackawanna Cut-Off line west of Andover as far as Scranton.
History
Early history
From 1908 to 1911, the Delaware, Lackawanna and Western Railroad (DL&W) built a level-graded railroad line. This route, known as the Lackawanna Cut-Off, ran west from Port Morris Junction in Roxbury Township near the south end of Lake Hopatcong in northwestern New Jersey (about west-northwest of New York City) and to Slateford Junction near the Delaware Water Gap in northeastern Pennsylvania. With its rural landscape, tall fills, deep rock cuts, and two large viaducts, the line became renowned as a scenic highlight of the railroad's main line between Hoboken, New Jersey, and Buffalo, New York. Through the use of fewer and less-sharp curves, no steep hills, and no grade crossings, the route was faster and shorter than the Lackawanna Old Road, the rail line it replaced. The DL&W constructed structures on the new line of reinforced concrete, and the roadbed itself required the movement of millions of tons of fill material using techniques similar to those on the Panama Canal.
The Cut-Off route passed through Andover Township in northwestern New Jersey's Sussex County between Greendell Station in Green Township and the Roseville Tunnel in Byram Township. It did not stop in Andover at this time and passed over rail lines operated by the Lehigh & Hudson River Railroad and the Sussex Branch, and over U.S. Route 206 and county roads.
The Lackawanna Cut-Off route opened for passenger service on December 24, 1911, and was operated by the Lackawanna Railroad until October 17, 1960, when the Lackawanna merged with the Erie Railroad. The resulting Erie Lackawanna Railroad (EL) operated the line until April 1, 1976, when the EL was conveyed into Conrail, which would operate it until January 1979. The line was abandoned in 1983 and the track was removed the following year. Conrail sold the right-of-way to two land developers in 1985, and the State of New Jersey acquired it in 2001.
Planning and restoration
New Jersey Transit's Board of Directors authorized consultant work for conceptual design, completion of the environmental assessment (EA) and preparation of the documentation required by the Federal Transit Administration for new transit lines to open service to northwestern New Jersey and northeastern Pennsylvania. The State of New Jersey completed the purchase of the Lackawanna Cut-Off right-of-way and property within the state in May 2001.
In May 2008, the North Jersey Transportation Planning Authority (NJTPA) approved funding to rebuild the first segment of track for restored service along the Cut-Off route between Andover and Port Morris Junction. After review of the submitted environmental assessment, the Federal Transit Administration issued a Finding of No Significant Impact (FONSI) for the first phase of the project to Andover on September 12, 2008. Preparation to restore trackage between Port Morris and Andover was originally slated to begin in 2010 but was delayed until early 2011 due to environmental concerns and questions over the exact location of the Andover Station area. In September 2011, the first new track was laid at Port Morris; three months later, Norfolk Southern delivered of continuously welded rail to Port Morris, enough to re-lay a single track to Andover. As of 2021, much of the right-of-way between Port Morris and Lake Lackawanna had been cleared of trees and debris. A total of of track has been laid west of Port Morris Junction in three disconnected sections.
As of 2021, New Jersey Transit intends to resume rail service between Andover and Hoboken, New Jersey and to New York Penn Station via transfer to Midtown Direct service, by connecting to the existing NJT Montclair-Boonton Line and Morris & Essex Lines. Service is projected to start in 2026. Construction began in 2011 to restore passenger service in phases, and the first phase includes opening service along of track to Andover. Extension of service via Amtrak has also been proposed, including the potential of restoring service to Blairstown, New Jersey, and stations in Pennsylvania with a proposed terminus in Scranton, Pennsylvania.
On April 13, 2022, the NJ Transit board announced the approval of an approximated $32.5 million contract for completion of repairs to the Roseville Tunnel and construction of the new Andover station. It is anticipated that work will be completed in the latter part of 2026.
Construction
A disagreement over the replacement of a culvert on private property near the proposed station has delayed progress on the resumption of construction., but as of early August 2017, an agreement has been made to replace the culvert with the property owner and continue building track to Andover.
References
External links
Lackawanna Cut-Off map
External links
New Jersey Transit (main homepage)
New Jersey Transit train schedules and rail service information
Andover Township, New Jersey
Lackawanna Cut-Off
Proposed NJ Transit rail stations
Railway stations scheduled to open in 2026
|
Gary Drzewiecki (born October 29, 1954) is an American businessman, tree farmer and former politician.
Born in Pulaski, Wisconsin, Drzewiecki went to University of Wisconsin–Stout. Drzewiecki is an investment counselor and tree farmer. He served on the Pulaski Board of Trustees and was the Pulaski village president.
He served in the Wisconsin State Senate as a Republican from 1993 to 2001. In November 2000, Drzewiecki was defeated in the general election. In 2006, Drewiecki ran for the Wisconsin State Assembly Republican primary election and narrowly lost the election.
References
1954 births
Living people
People from Pulaski, Wisconsin
Businesspeople from Wisconsin
University of Wisconsin–Stout alumni
Republican Party Wisconsin state senators
Mayors of places in Wisconsin
Wisconsin city council members
American politicians of Polish descent
|
Byblis ( ) is a small genus of carnivorous plants, sometimes termed the rainbow plants for the attractive appearance of their mucilage-covered leaves in bright sunshine. Native to Australia and New Guinea, it is the only genus in the family Byblidaceae. The first species in the genus was described by the English botanist Richard Anthony Salisbury in 1808. Eight species are now recognized (see below).
Byblis species look very similar to Drosera and Drosophyllum, but are distinguished by their zygomorphic flowers, with five curved stamens off to one side of the pistil. These genera are in fact not closely related; modern classifications place Byblis in the Lamiales, while the sundews and Drosophyllum are now placed in the Caryophyllales.
Plant characteristics
All species of the genus form upright growth supported by a weak, fibrous root system. The genus can be divided into two groups or "complexes": The B. liniflora complex and the B. gigantea complex (see below).
Leaves
The leaves of all species are round in cross section and highly elongated, tapering at the end. The surface of the leaves is densely studded with glandular hairs which secrete a mucilaginous substance from their tip. These serve to attract small insects, which upon touching the sticky secretions are ensnared. Unless they are strong enough to escape, the insect prey either die of exhaustion or asphyxiate as the mucilage envelops them and clogs their spiracles. Unlike the sundews, however, Byblis can move neither their tentacles nor the leaves themselves to aid trapping or digestion. As a result, they are grouped among the "passive flypaper traps" along with Pinguicula, Drosophyllum, Roridula, Stylidium and Triphyophyllum peltatum.
Along with the stalked mucilaginous glands, the leaves are also equipped with sessile glands, which assumedly are responsible for the secretion of the digestive juices. Sessile glands are five to ten times as numerous as the stalked glands.
Flowers
Flowers in this genus are borne singly at the end of unbranching, leaf-like inflorescences which emerge from the leaf axils. The five-petaled flowers are generally purple to pale violet, though B. gigantea and B. filifolia can sometimes produce white flowers. Except for the self-fertile B. liniflora, all species require pollen from other individuals for fertilization. The pollen release of B. gigantea and B. lamellata is only triggered by the resonance frequency of the wings of a landing pollinator, helping ensure cross-pollination with other individuals. The flowers of Byblis start to bloom in early spring and last until late summer.
Fruit and seeds
Fertilized flowers mature to form an egg-shaped, two-parted seed capsule. As the seed capsule dries out it cracks open (dehisces), dropping the seed on the ground (see gravity dispersal). The black seeds are generally round and often bear webbed surface markings, although those of B. lamellata are strongly ridged (see ). The germination of many species is brought on by bush fires after the dry period; pyrogenic chemicals in the smoke are responsible for triggering germination.
Distribution and habitat
All Byblis species are native to Australia. B. gigantea and B. lamellata are endemic to the Perth region of southwest Australia, while the species making up the B. liniflora complex are found only in north Australia. The exception here is B. liniflora itself, whose distribution extends into southern Indonesia and Papua New Guinea.
Like many carnivorous plants, Byblis species usually grow in bogs and marshes. They generally prefer seasonally wet sandy soil in partial or direct sunlight with temperatures between ~ 5-40 °C (40-105 °F).
Environmental status
As native plants of Australia, all Byblis species are protected. Until the year 2000, they were also given international protection under CITES appendix II, but were removed from the list when Australia entered the CITES agreement. Since then trade of the genus has been unregulated outside of Australia. However, due to the sensitivity of the plant, interest in the genus has been restricted to a small portion of the carnivorous plant hobbyist community. The majority of plant material sold today is produced in cultivation, with the annual B. filifolia and B. liniflora being the most common. Most of the other species must be grown from seed, which is often collected from the wild for this purpose.
The West Australian species B. gigantea und B. lamellata are being threatened by habitat destruction for urban sprawl from cities such as Perth. Particularly damaging is the draining of wet habitats to produce arable land. B. gigantea is on the International Union for Conservation of Nature's Red List of Threatened Species and is considered critically endangered.
Carnivorous or protocarnivorous
The status of the genus as a truly carnivorous plant has been repeatedly put into question. In their natural habitat, all species have been observed playing host to live bugs of the genus Setocoris, which nourished themselves by eating prey caught by the plants. Following this discovery it was assumed that, as with the genus Roridula, the plants do not actually digest their prey themselves, rather relying on the bugs to do that. The plants, it was reasoned, benefited by absorbing nutrients from the excrements of the bugs, either through their leaves or through the ground. An indirect digestion of these nutrients by a chitinase producing fungus was even proposed. It was not until 2005 that direct digestion of insect prey by enzymes secreted by the sessile glands of B. filifolia was proven. Soon thereafter similar results were found with B. liniflora. These results clearly place this genus among the true carnivorous plants.
Systematics
Molecular genetics studies have placed the genus in the order Lamiales. While its placement within the order is still unclear, it is closely related to Martyniaceae, Lentibulariaceae as well as Gesneriaceae.
For a time, the genus Roridula was also assigned to the family Byblidaceae. Since that time, however, it has been placed into its own family, Roridulaceae.
Traditionally the genus was divided into only two species, namely B. gigantea and B. liniflora. Further species were described in the 1980s, particularly through the work of the Australian botanist Allen Lowrie. Eight species are currently recognized:
Byblis aquatica (annual, scrambling stem up to , semiaquatic habitats)
Byblis filifolia (annual, up to , anthers longer than filaments)
Byblis gigantea (perennial, up to , seeds with honeycomb pattern)
Byblis guehoi
Byblis lamellata (perennial, up to , deeply ridged seeds)
Byblis liniflora (annual, up to , anthers shorter than filaments)
Byblis pilbarana
Byblis rorida (annual, up to , heavily set with glandular tentacles)
Subdivision of the genus
Byblis liniflora complex
The four species of this complex, B. liniflora, B. rorida, B. filifolia and B. aquatica, are annual herbaceous plants that reach a height of and a maximum leaf length of . These species grow from seedlings to flowering plants in only a few months, setting seed and dying with the onset of the dry season. The original haploid chromosome count of this complex is x=8. The diploid number is therefore 2n=16, whereas the tetraploid species B. liniflora is 2n=32.
Byblis gigantea complex
The remaining two species, B. lamellata und B. gigantea, make up what is known as the B. gigantea complex. These perennial species are both endemic to Southwest Australia, and reach heights of . Unlike the annual members of the B. liniflora complex, these species survive the dry season by dying back to an underground rhizome, out of which they emerge come fall. The leaves of this complex can reach in length. The base chromosome count of the complex is x=9; since both species are diploid, their chromosome count is 2n=18.
Paleobotany
In the year 2004 a single fossil of a seed, resembling that of members of the modern day B. liniflora complex, was discovered in south Australia dating from the middle of the Eocene epoch. The species was assigned to the Byblidaceae as a parataxon of the genus. The sole specimen was unfortunately destroyed in a lab accident shortly after being photographed.
Etymology
The Latin generic name "Byblis" originates from a goddess from Greek mythology, of whom Ovid wrote in his Metamorphoses (IX, l. 454–664). Byblis, niece of Apollo, fell deeply in love with her twin brother Caunus. At his rejection of her advances, she let forth an endless stream of glistening tears, eventually literally transforming into a spring. The droplets lining the leaves of the Byblis are said to resemble those tears.
The English vernacular name - "rainbow plants" - also denotes the mucilaginous droplets which, under the right lighting conditions and viewing angle, sparkle in a rainbow of colors.
See also
Carnivorous plants of Australia
References
Much of the content of this article comes from the equivalent German-language Wikipedia article (retrieved 1 December 2006).
Barthlott, Wilhelm; Porembski, Stefan; Seine, Rüdiger; Theisen, Inge: Karnivoren, Stuttgart, 2004,
Lowrie, Allen: Carnivorous Plants of Australia - Vol. 3, Nedlands, Western Australia, 1998
Lowrie, Allen; Conran, John G.: A Taxonomic Revision of the Genus Byblis (Byblidaceae) In Northern Australia, Nuytsia 12(1):59-74, 1998
Lowrie, Allen; Conran, John G.; Moyle-Croft, Jessica: A Revision of Byblis (Byblidaceae) In South-Western Australia, Nuytsia 15(1):11-19, 2002
Conran, John G.; Houben, Andreas; Lowrie, Allen: Chromosome numbers in Byblidaceae, Aust. J. Bot., 2002, 50, 583-586
Hartmeyer, Siegfried: Carnivory of Byblis Revisited—A Simple Method for Enzyme Testing on Carnivorous Plants, Carnivorous Plant Newsletter, 26, 39–45, 1997
Hartmeyer, Siegfried: Carnivory in Byblis Revisited II: The Phenomenon of Symbiosis on Insect Trapping Plants, Carnivorous Plant Newsletter, 27, 110–113, 1998
Plachno, B. J.; Jankun, A.: Phosphatase Activity in Glandular Structures of Carnivorous Plant Traps., Internationaler Botanischer Kongress 2005 in Wien, P1716, The Jagiellonian Univ., Inst. of Botany, Dept. of Plant Cytology and Embryology, Kraków,Poland.
Further reading
Conran, John G.: The embryology and relationships of the Byblidaceae, Australian Syst. Bot. 9, 243–254, 1996
Conran, John G.; Carolin, R.: Byblidaceae, in: Kadereit, J. (ed.): The Families and Genera of Vascular Plants, Vol. VII: Flowering Plants: Dicotyledons: Lamiales (except Acanthaceae including Avicenniaceae), Springer, 2004, 45–49.
Fukushima, K., K. Imamura, K. Nagano & Y. Hoshi (2011). Journal of Plant Research 124(2): 231–244.
External links
Carnivorous Plant FAQ on Byblis
Cultivation notes
The family Byblidaceae at the Angiosperm Phylogeny Website
The family Byblidaceae in Delta.
Photos of Byblis in the wild
Botanical Society of America, Byblis - the Rainbow Plants
Lamiales genera
Australasian realm flora
|
```c++
/*
* Question Description:
* (Question 58 in <Coding Intervies>) How do you print a binary tree by level, in top down order,
* with each level in a line? Nodes in a level should be printed from left to right.
*/
#include <stdio.h>
#include "..\Utilities\BinaryTree.h"
#include <queue>
void Print(BinaryTreeNode* pRoot)
{
if(pRoot == NULL)
return;
std::queue<BinaryTreeNode*> nodes;
nodes.push(pRoot);
int nextLevel = 0;
int toBePrinted = 1;
while(!nodes.empty())
{
BinaryTreeNode* pNode = nodes.front();
printf("%d ", pNode->m_nValue);
if(pNode->m_pLeft != NULL)
{
nodes.push(pNode->m_pLeft);
++nextLevel;
}
if(pNode->m_pRight != NULL)
{
nodes.push(pNode->m_pRight);
++nextLevel;
}
nodes.pop();
--toBePrinted;
if(toBePrinted == 0)
{
printf("\n");
toBePrinted = nextLevel;
nextLevel = 0;
}
}
}
// ==================== Test Code ====================
// 8
// 6 10
// 5 7 9 11
void Test1()
{
BinaryTreeNode* pNode8 = CreateBinaryTreeNode(8);
BinaryTreeNode* pNode6 = CreateBinaryTreeNode(6);
BinaryTreeNode* pNode10 = CreateBinaryTreeNode(10);
BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);
BinaryTreeNode* pNode7 = CreateBinaryTreeNode(7);
BinaryTreeNode* pNode9 = CreateBinaryTreeNode(9);
BinaryTreeNode* pNode11 = CreateBinaryTreeNode(11);
ConnectTreeNodes(pNode8, pNode6, pNode10);
ConnectTreeNodes(pNode6, pNode5, pNode7);
ConnectTreeNodes(pNode10, pNode9, pNode11);
printf("====Test1 Begins: ====\n");
printf("Expected Result is:\n");
printf("8 \n");
printf("6 10 \n");
printf("5 7 9 11 \n\n");
printf("Actual Result is: \n");
Print(pNode8);
printf("\n");
DestroyTree(pNode8);
}
// 5
// 4
// 3
// 2
void Test2()
{
BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);
BinaryTreeNode* pNode4 = CreateBinaryTreeNode(4);
BinaryTreeNode* pNode3 = CreateBinaryTreeNode(3);
BinaryTreeNode* pNode2 = CreateBinaryTreeNode(2);
ConnectTreeNodes(pNode5, pNode4, NULL);
ConnectTreeNodes(pNode4, pNode3, NULL);
ConnectTreeNodes(pNode3, pNode2, NULL);
printf("====Test2 Begins: ====\n");
printf("Expected Result is:\n");
printf("5 \n");
printf("4 \n");
printf("3 \n");
printf("2 \n\n");
printf("Actual Result is: \n");
Print(pNode5);
printf("\n");
DestroyTree(pNode5);
}
// 5
// 4
// 3
// 2
void Test3()
{
BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);
BinaryTreeNode* pNode4 = CreateBinaryTreeNode(4);
BinaryTreeNode* pNode3 = CreateBinaryTreeNode(3);
BinaryTreeNode* pNode2 = CreateBinaryTreeNode(2);
ConnectTreeNodes(pNode5, NULL, pNode4);
ConnectTreeNodes(pNode4, NULL, pNode3);
ConnectTreeNodes(pNode3, NULL, pNode2);
printf("====Test3 Begins: ====\n");
printf("Expected Result is:\n");
printf("5 \n");
printf("4 \n");
printf("3 \n");
printf("2 \n\n");
printf("Actual Result is: \n");
Print(pNode5);
printf("\n");
DestroyTree(pNode5);
}
void Test4()
{
BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);
printf("====Test4 Begins: ====\n");
printf("Expected Result is:\n");
printf("5 \n\n");
printf("Actual Result is: \n");
Print(pNode5);
printf("\n");
DestroyTree(pNode5);
}
void Test5()
{
printf("====Test5 Begins: ====\n");
printf("Expected Result is:\n");
printf("Actual Result is: \n");
Print(NULL);
printf("\n");
}
// 100
// /
// 50
// \
// 150
void Test6()
{
BinaryTreeNode* pNode100 = CreateBinaryTreeNode(100);
BinaryTreeNode* pNode50 = CreateBinaryTreeNode(50);
BinaryTreeNode* pNode150 = CreateBinaryTreeNode(150);
ConnectTreeNodes(pNode100, pNode50, NULL);
ConnectTreeNodes(pNode50, NULL, pNode150);
printf("====Test6 Begins: ====\n");
printf("Expected Result is:\n");
printf("100 \n");
printf("50 \n");
printf("150 \n\n");
printf("Actual Result is: \n");
Print(pNode100);
printf("\n");
}
int main(int argc, char* argv[])
{
Test1();
Test2();
Test3();
Test4();
Test5();
Test6();
return 0;
}
```
|
Tony Cascio (born March 28, 1990) is an American soccer player.
Career
College and Amateur
Tony begin his soccer career playing for Hamilton High School in his home town of Chandler, Arizona. Cascio played college soccer at the University of Connecticut between 2008 and 2011. During his time at UConn, Cascio was named 2010 NSCAA First Team All-American, Big East Offensive Player of the Year in 2010, and was a two-time All-Big East First Team selection in both 2009 and 2010. During his junior year, he was named NSCAA/Performance Subaru Division I First Team All-American, Soccer America MVP Second Team, and was a MAC Hermann Trophy Semifinalist. As a sophomore, was named to the Northeast Region Second Team and selected to the All-Big east First team.
Professional
Colorado Rapids
The Colorado Rapids selected Cascio in the first round (No. 14 overall) of the 2012 MLS SuperDraft.
Cascio made his debut during a 2–0 win over Columbus Crew on March 10, 2012. Cascio recorded his first professional goal against the Philadelphia Union on March 18, 2012, by beating defender Chris Albright to fire home past Zac MacMath.
Houston Dynamo
Cascio was loaned to the Houston Dynamo for the 2014 season in exchange for a season's use of an international roster spot. He was the first player to be loaned within MLS.
Orlando City SC
Cascio was selected in the 2nd round of the 2014 Expansion draft by Orlando City SC.
Started and played 57 minutes in preseason game and was on the bench for the first two games of 2015 but missed the next six months due to a bulging disc in his back.
Arizona United SC
Cascio signed with Arizona United on March 8, 2016.
Sporting Arizona FC
Cascio signed with Sporting Arizona FC of the UPSL on March 7, 2018.
References
External links
1990 births
Living people
Sportspeople from Gilbert, Arizona
Soccer players from Arizona
American men's soccer players
Men's association football midfielders
UConn Huskies men's soccer players
All-American college men's soccer players
Colorado Rapids draft picks
Colorado Rapids players
Houston Dynamo FC players
Orlando City SC players
Phoenix Rising FC players
Major League Soccer players
USL Championship players
|
{{Infobox musical artist
| name = Absinthe Green
| image =
| image_size =
| landscape =
| alt =
| caption =
| birth_name = Eirini
| native_name = Ειρήνη
| native_name_lang =
| alias = Absinthe Green
| birth_date =
| birth_place = Attica, Greece
| origin = Greek
| death_date =
| death_place =
| genre = Rock, Heavy Metal, Gothic Metal, Industrial Metal , Thrash Metal, Death Metal, Alternative Rock, Dark Metal
| occupation = Musician, Singer, Song writer
| instrument = Electric bass, voice, keyboards
| years_active =
| label = Massacre Records, The End Records, I for an I Records and Media
| associated_acts = Enemy of the Sun, RandomWalk, Mora, Art of Negation, Deranged
| website =
}}Eirini “Absinthe Green” Papadopoulou' (born August 13, 1986, in Athens, Greece) is a female singer and bassist.
Early life
Growing up in a small country town in Peloponnese where musical activities were limited, Green got her initial music incentives from her father, and she started being interested in learning music at an early age. By the age of four, she started taking music education classes; she had her first live performance as a singer in a town's conservatory event; and by the age of six, she had already composed her first keyboard pieces.
Musical career
Her musical career goes back to 2000, when she started singing and playing keyboards in a classic rock and heavy metal cover band. In 2003, she formed the thrash metal band Deranged. After 2 years of performances and the release of their Full Blown Madness EP, the band was disbanded due to the studies and military obligations of its members. During this time, she joined the old-school metal act Art of Negation as a singer and songwriter, while she continued her classical and modern singing classes as well as music studies at the university. After that, she collaborated with various acts in the Greek metal scene. In 2007, she joined the industrial Gothic metal band Mora as a bass player and backing vocalist. A year later, she joined the Athenian dark metal band Randomwalk as a bassist. She remained in RandomWalk until after the release of their second studio album, entitled Absolution. In 2011, Green decided to leave the band as she relocated to Germany to join Enemy of the Sun, the thrash metal band of the metal producer Waldemar Sorychta. In 2012, Green decided to leave the band, citing personal reasons as well as differences with the band's philosophy.
Discography
with Deranged
Full Blown Madness (EP) (2004)
with Mora
Left Behind (EP) (2008)
with RandomWalk
Redemption (2008)
Absolution (2010)
Bands
Member
Deranged Art of Negation MORA RandomWalk Enemy of the Sun Guest member
Stellar Lake (EP vocals) (2008)
Revolution Eve'' (Arise video clip guest bassist) (2012)
References
External links
Absinthe Green on Facebook
1986 births
Living people
Musicians from Athens
21st-century Greek women singers
Women bass guitarists
Singers from Athens
21st-century bass guitarists
|
```cmake
#.rst:
#
# .. cmake:command:: usFunctionEmbedResources
#
# Embed resources in a library or executable.
#
# .. code-block:: cmake
#
# usFunctionEmbedResources(TARGET target [BUNDLE_NAME bundle_name] [APPEND | LINK]
# [WORKING_DIRECTORY dir] [COMPRESSION_LEVEL level]
# [FILES res1...] [ZIP_ARCHIVES archive1...])
#
# This CMake function uses an external command line program to generate a ZIP archive
# containing data from external resources such as text files or images or other ZIP
# archives. External resources can be added to a bundle using the
# :cmake:command:`usFunctionAddResources` function or directly using this function
# using similar parameters. The created archive file is appended or embedded as a
# binary blob to the target file.
#
# .. note::
#
# To set-up correct file dependencies from your bundle target to your resource
# files, you have to add a special source file to the source list of the target.
# The source file name can be retrieved by using :cmake:command:`usFunctionGetResourceSource`.
# This ensures that changed resource files will automatically be re-added to the
# bundle.
#
# There are two differend modes for including resources: *APPEND* and *LINK*. In *APPEND* mode,
# the generated zip file is appended at the end of the target file. In *LINK* mode, the
# zip file is compiled / linked into the target using platform specific techniques. *LINK*
# mode is necessary if certain tools make additional assumptions about the object layout
# of the target file (e.g. codesign on MacOS). *LINK* mode may result in slower bundle
# initialization and bigger object files. The default mode is *LINK* mode on MacOS and
# *APPEND* mode on all other platforms.
#
# .. code-block:: cmake
# :caption: Example
#
# usFunctionEmbedResources(TARGET mylib
# BUNDLE_NAME org_me_mylib
# FILES config.properties logo.png
# )
#
# **One-value keywords**
# * ``TARGET`` (required): The target to which the resource files are added.
# * ``BUNDLE_NAME`` (required/optional): The bundle name of the target, as specified in
# the ``US_BUNDLE_NAME`` pre-processor definition of that target. This parameter
# is optional if a target property with the name ``US_BUNDLE_NAME`` exists, containing
# the required bundle name.
#
# **Options**
# * ``APPEND``: Append the resources zip file to the target file.
# * ``LINK``: Link (embed) the resources zip file if possible.
#
# For the ``WORKING_DIRECTORY``, ``COMPRESSION_LEVEL``, ``FILES``, ``ZIP_ARCHIVES`` parameters see the
# documentation of the usFunctionAddResources macro which is called with these parameters if set.
#
# .. seealso::
#
# | :cmake:command:`usFunctionAddResources`
# | :cmake:command:`usFunctionGetResourceSource`
# | :any:`concept-resources`
#
function(usFunctionEmbedResources)
cmake_parse_arguments(US_RESOURCE "APPEND;LINK" "TARGET;BUNDLE_NAME;WORKING_DIRECTORY;COMPRESSION_LEVEL" "FILES;ZIP_ARCHIVES" ${ARGN})
if(NOT US_RESOURCE_TARGET)
message(SEND_ERROR "TARGET argument not specified.")
endif()
if(US_RESOURCE_FILES OR US_RESOURCE_ZIP_ARCHIVES)
usFunctionAddResources(TARGET ${US_RESOURCE_TARGET}
BUNDLE_NAME ${US_RESOURCE_BUNDLE_NAME}
WORKING_DIRECTORY ${US_RESOURCE_WORKING_DIRECTORY}
COMPRESSION_LEVEL ${US_RESOURCE_COMPRESSION_LEVEL}
FILES ${US_RESOURCE_FILES}
ZIP_ARCHIVES ${US_RESOURCE_ZIP_ARCHIVES}
)
endif()
get_target_property(_res_zips ${US_RESOURCE_TARGET} _us_resource_zips)
if(NOT _res_zips)
return()
endif()
if(US_RESOURCE_APPEND AND US_RESOURCE_LINK)
message(WARNING "Both APPEND and LINK options specified. Falling back to default behaviour.")
set(US_RESOURCE_APPEND 0)
set(US_RESOURCE_LINK 0)
endif()
if(US_RESOURCE_LINK AND NOT US_RESOURCE_LINKING_AVAILABLE)
message(WARNING "Resource linking not available. Falling back to APPEND mode.")
set(US_RESOURCE_LINK 0)
set(US_RESOURCE_APPEND 1)
endif()
# Set default resource mode
if(NOT US_RESOURCE_APPEND AND NOT US_RESOURCE_LINK)
if(US_DEFAULT_RESOURCE_MODE STREQUAL "LINK")
set(US_RESOURCE_LINK 1)
else()
set(US_RESOURCE_APPEND 1)
endif()
endif()
set(_mode )
if(US_RESOURCE_LINK)
set(_mode LINK)
elseif(US_RESOURCE_APPEND)
set(_mode APPEND)
endif()
usFunctionGetResourceSource(TARGET ${US_RESOURCE_TARGET} OUT _source_output ${_mode})
if(NOT US_RESOURCE_WORKING_DIRECTORY)
set(US_RESOURCE_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT IS_ABSOLUTE ${US_RESOURCE_WORKING_DIRECTORY})
set(US_RESOURCE_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${US_RESOURCE_WORKING_DIRECTORY}")
endif()
if(CMAKE_CROSSCOMPILING)
# Cross-compiled builds need to use the imported host version of usResourceCompiler
include(${IMPORT_EXECUTABLES})
set(resource_compiler native-${US_RCC_EXECUTABLE_TARGET})
else()
set(resource_compiler ${US_RCC_EXECUTABLE})
if(TARGET ${US_RCC_EXECUTABLE_TARGET})
set(resource_compiler ${US_RCC_EXECUTABLE_TARGET})
elseif(NOT resource_compiler)
message(FATAL_ERROR "The CppMicroServices resource compiler was not found. Check the US_RCC_EXECUTABLE CMake variable.")
endif()
endif()
set(_zip_archive )
get_target_property(_counter ${US_RESOURCE_TARGET} _us_resource_counter)
if(_counter EQUAL 0)
set(_zip_archive ${_res_zips})
else()
set(_zip_archive ${CMAKE_CURRENT_BINARY_DIR}/${US_RESOURCE_TARGET}/res.zip)
if(_res_zips)
set(_zip_args )
foreach(_file ${_res_zips})
list(APPEND _zip_args -z)
list(APPEND _zip_args ${_file})
endforeach()
endif()
add_custom_command(
OUTPUT ${_zip_archive}
COMMAND ${resource_compiler} -o ${_zip_archive} -n dummy ${_zip_args}
DEPENDS ${_res_zips} ${resource_compiler}
COMMENT "Creating resources zip file for ${US_RESOURCE_TARGET}"
VERBATIM
)
endif()
get_filename_component(_zip_archive_name ${_zip_archive} NAME)
get_filename_component(_zip_archive_path ${_zip_archive} PATH)
if(US_RESOURCE_LINK)
if(APPLE)
# This resolves an issue where passing in CMAKE_CXX_FLAGS using
# -D CMAKE_CXX_FLAGS:STRING="..." results in a quoted string being passed to
# the command below which results in the command being:
# >> clang "..." -c ... -o stub.o
# when it should really be:
# >> clang ... -c ... -o stub.o
# (pardon the elipsis for abbreviation)
separate_arguments(_us_resource_cxx_flags UNIX_COMMAND ${CMAKE_CXX_FLAGS})
# section name is "us_resources" because max length for section names in Mach-O format is 16 characters.
add_custom_command(
OUTPUT ${_source_output}
COMMAND ${CMAKE_CXX_COMPILER} ${_us_resource_cxx_flags} -c ${US_CMAKE_RESOURCE_DEPENDENCIES_CPP} -o stub.o
COMMAND ${CMAKE_LINKER} -r -sectcreate __TEXT us_resources ${_zip_archive_name} stub.o -o ${_source_output}
DEPENDS ${_zip_archive}
WORKING_DIRECTORY ${_zip_archive_path}
COMMENT "Linking resources zip file for ${US_RESOURCE_TARGET}"
VERBATIM
)
set_source_files_properties(${_source_output} PROPERTIES EXTERNAL_OBJECT 1 GENERATED 1)
elseif(WIN32 AND CMAKE_RC_COMPILER)
set(US_RESOURCE_ARCHIVE ${_zip_archive})
# If the file generated in "Configure" step is specified as the OUTPUT of add_custom_command,
# "Clean" target will delete the file and subsequent build will fail. To avoid failures in
# "ReBuild", generate the resource file in the "Configure" step and copy it in "Build" step
configure_file(${US_RESOURCE_RC_TEMPLATE} ${_source_output}_autogen)
add_custom_command(
OUTPUT ${_source_output}
COMMAND ${CMAKE_COMMAND} -E copy ${_source_output}_autogen ${_source_output}
DEPENDS ${_zip_archive}
WORKING_DIRECTORY ${_zip_archive_path}
COMMENT "Linking resources zip file for ${US_RESOURCE_TARGET}"
VERBATIM
)
set_source_files_properties(${_source_output} PROPERTIES GENERATED 1)
elseif(UNIX)
add_custom_command(
OUTPUT ${_source_output}
COMMAND ${CMAKE_LINKER} -r -b binary -o ${_source_output} ${_zip_archive_name}
COMMAND objcopy --rename-section .data=.rodata,alloc,load,readonly,data,contents ${_source_output} ${_source_output}
DEPENDS ${_zip_archive}
WORKING_DIRECTORY ${_zip_archive_path}
COMMENT "Linking resources zip file for ${US_RESOURCE_TARGET}"
VERBATIM
)
set_source_files_properties(${_source_output} PROPERTIES EXTERNAL_OBJECT 1 GENERATED 1)
else()
message(WARNING "Internal error: Resource linking not available. Falling back to APPEND mode.")
set(US_RESOURCE_LINK 0)
set(US_RESOURCE_APPEND 1)
endif()
endif()
if(US_RESOURCE_APPEND)
# This command depends on the given resource files and creates a source
# file which must be added to the source list of the related target.
# This way, the following command is executed if the resources change
# and it just touches the created source file to force a (actually unnecessary)
# re-linking and hence the execution of POST_BUILD commands.
add_custom_command(
OUTPUT ${_source_output}
COMMAND ${CMAKE_COMMAND} -E copy ${US_CMAKE_RESOURCE_DEPENDENCIES_CPP} ${_source_output}
DEPENDS ${_zip_archive}
COMMENT "Checking resource dependencies for ${US_RESOURCE_TARGET}"
VERBATIM
)
add_custom_command(
TARGET ${US_RESOURCE_TARGET}
POST_BUILD
COMMAND objcopy --add-section .note.sgx.aesm_resource=${_zip_archive} $<TARGET_FILE:${US_RESOURCE_TARGET}>
WORKING_DIRECTORY ${US_RESOURCE_WORKING_DIRECTORY}
COMMENT "Appending zipped resources to ${US_RESOURCE_TARGET}"
VERBATIM
)
endif()
endfunction()
```
|
```c
/* edit_packet_comment_dlg.c
* Dialog box for editing or adding packet comments.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
*
* This program is free software; you can redistribute it and/or
* as published by the Free Software Foundation; either version 2
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "ui/main_statusbar.h"
#include "ui/gtk/dlg_utils.h"
#include "ui/gtk/expert_comp_dlg.h"
#include "ui/gtk/gui_utils.h"
#include "ui/gtk/main.h"
#include "ui/gtk/packet_list.h"
#include "ui/gtk/edit_packet_comment_dlg.h"
static GtkWidget *edit_or_add_pkt_comment_dlg = NULL;
static GtkWidget *edit_or_add_capture_comment_dlg = NULL;
static void
pkt_comment_text_buff_ok_cb(GtkWidget *w _U_, GtkWidget *view)
{
GtkTextBuffer *buffer;
GtkTextIter start_iter;
GtkTextIter end_iter;
gchar *new_packet_comment;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_get_start_iter (buffer, &start_iter);
gtk_text_buffer_get_end_iter (buffer, &end_iter);
new_packet_comment = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE /* whether to include invisible text */);
/*g_warning("The new comment is '%s'",new_packet_comment);*/
packet_list_update_packet_comment(new_packet_comment);
expert_comp_packet_comment_updated();
status_expert_update();
window_destroy(edit_or_add_pkt_comment_dlg);
}
static void
capture_comment_text_buff_ok_cb(GtkWidget *w _U_, GtkWidget *view)
{
GtkTextBuffer *buffer;
GtkTextIter start_iter;
GtkTextIter end_iter;
gchar *new_capture_comment;
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_get_start_iter (buffer, &start_iter);
gtk_text_buffer_get_end_iter (buffer, &end_iter);
new_capture_comment = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE /* whether to include invisible text */);
/*g_warning("The new comment is '%s'",new_capture_comment);*/
cf_update_capture_comment(&cfile, new_capture_comment);
/* Update the main window as appropriate */
main_update_for_unsaved_changes(&cfile);
status_capture_comment_update();
window_destroy(edit_or_add_capture_comment_dlg);
}
void
edit_packet_comment_dlg (GtkAction *action _U_, gpointer data _U_)
{
GtkWidget *vbox;
GtkWidget *view;
GtkWidget *scroll;
GtkWidget *bbox;
GtkWidget *ok_bt, *cancel_bt, *help_bt;
GtkTextBuffer *buffer;
gchar *opt_comment;
edit_or_add_pkt_comment_dlg = dlg_window_new ("Edit or Add Packet Comments");
gtk_widget_set_size_request (edit_or_add_pkt_comment_dlg, 500, 160);
gtk_window_set_resizable (GTK_WINDOW (edit_or_add_pkt_comment_dlg), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (edit_or_add_pkt_comment_dlg), DLG_OUTER_MARGIN);
vbox = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_UNRELATED_SPACING, FALSE);
gtk_container_add (GTK_CONTAINER (edit_or_add_pkt_comment_dlg), vbox);
gtk_widget_show (vbox);
view = gtk_text_view_new ();
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(view), GTK_WRAP_WORD);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_widget_show (view);
scroll = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(scroll), view);
gtk_widget_show(scroll);
gtk_box_pack_start(GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
/* Get the comment */
opt_comment = packet_list_get_packet_comment();
/*g_warning("Fetched comment '%s'",opt_comment);*/
if(opt_comment){
gtk_text_buffer_set_text(buffer, opt_comment, -1);
g_free(opt_comment);
}
/* Button row. */
bbox = dlg_button_row_new (GTK_STOCK_OK, GTK_STOCK_CANCEL, GTK_STOCK_HELP, NULL);
gtk_box_pack_end (GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
ok_bt = (GtkWidget *)g_object_get_data (G_OBJECT(bbox), GTK_STOCK_OK);
g_signal_connect (ok_bt, "clicked", G_CALLBACK(pkt_comment_text_buff_ok_cb), view);
gtk_widget_set_sensitive (ok_bt, TRUE);
cancel_bt = (GtkWidget *)g_object_get_data (G_OBJECT(bbox), GTK_STOCK_CANCEL);
window_set_cancel_button (edit_or_add_pkt_comment_dlg, cancel_bt, window_cancel_button_cb);
help_bt = (GtkWidget *)g_object_get_data (G_OBJECT(bbox), GTK_STOCK_HELP);
#if 0
g_signal_connect (help_bt, "clicked",/* G_CALLBACK(topic_cb)*/NULL, /*(gpointer)HELP_MANUAL_ADDR_RESOLVE_DIALOG*/NULL);
#endif
gtk_widget_set_sensitive (help_bt, FALSE);
gtk_widget_grab_default (ok_bt);
g_signal_connect (edit_or_add_pkt_comment_dlg, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
gtk_widget_show (edit_or_add_pkt_comment_dlg);
}
static void
edit_capture_comment_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_)
{
/* Note that we no longer have an "Edit Capture Comment" dialog box. */
edit_or_add_capture_comment_dlg = NULL;
}
void
edit_capture_comment_dlg_launch (GtkAction *action _U_, gpointer data _U_)
{
GtkWidget *vbox;
GtkWidget *view;
GtkWidget *scroll;
GtkWidget *bbox;
GtkWidget *ok_bt, *cancel_bt, *help_bt;
GtkTextBuffer *buffer = NULL;
const gchar *comment_str = NULL;
if (edit_or_add_capture_comment_dlg != NULL) {
/* There's already an "Edit Capture Comment" dialog box; reactivate it. */
reactivate_window(edit_or_add_capture_comment_dlg);
return;
}
edit_or_add_capture_comment_dlg = dlg_window_new ("Edit or Add Capture Comments");
gtk_widget_set_size_request (edit_or_add_capture_comment_dlg, 500, 160);
gtk_window_set_resizable (GTK_WINDOW (edit_or_add_capture_comment_dlg), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (edit_or_add_capture_comment_dlg), DLG_OUTER_MARGIN);
g_signal_connect(edit_or_add_capture_comment_dlg, "destroy",
G_CALLBACK(edit_capture_comment_destroy_cb), NULL);
vbox = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_UNRELATED_SPACING, FALSE);
gtk_container_add (GTK_CONTAINER (edit_or_add_capture_comment_dlg), vbox);
gtk_widget_show (vbox);
view = gtk_text_view_new ();
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(view), GTK_WRAP_WORD);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_widget_show (view);
scroll = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(scroll), view);
gtk_widget_show(scroll);
gtk_box_pack_start(GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
/* Get the comment */
comment_str = cf_read_shb_comment(&cfile);
if(comment_str != NULL){
gtk_text_buffer_set_text (buffer, comment_str, -1);
}
/* Button row. */
bbox = dlg_button_row_new (GTK_STOCK_OK, GTK_STOCK_CANCEL, GTK_STOCK_HELP, NULL);
gtk_box_pack_end (GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
ok_bt = (GtkWidget *)g_object_get_data (G_OBJECT(bbox), GTK_STOCK_OK);
g_signal_connect (ok_bt, "clicked", G_CALLBACK(capture_comment_text_buff_ok_cb), view);
gtk_widget_set_sensitive (ok_bt, TRUE);
cancel_bt = (GtkWidget *)g_object_get_data (G_OBJECT(bbox), GTK_STOCK_CANCEL);
window_set_cancel_button (edit_or_add_capture_comment_dlg, cancel_bt, window_cancel_button_cb);
help_bt = (GtkWidget *)g_object_get_data (G_OBJECT(bbox), GTK_STOCK_HELP);
#if 0
g_signal_connect (help_bt, "clicked",/* G_CALLBACK(topic_cb)*/NULL, /*(gpointer)HELP_MANUAL_ADDR_RESOLVE_DIALOG*/NULL);
#endif
gtk_widget_set_sensitive (help_bt, FALSE);
gtk_widget_grab_default (ok_bt);
g_signal_connect (edit_or_add_capture_comment_dlg, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
gtk_widget_show (edit_or_add_capture_comment_dlg);
}
void
edit_capture_comment_dlg_hide(void)
{
window_destroy(edit_or_add_capture_comment_dlg);
}
/*
* Editor modelines - path_to_url
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/
```
|
Thophini is a tribe of cicadas in the family Cicadidae, found in Australia. There are at least two genera and about nine described species in Thophini.
Genera
These two genera belong to the tribe Thophini:
Arunta Distant, 1904
Thopha Amyot & Audinet-Serville, 1843
References
Further reading
Cicadinae
Hemiptera tribes
|
```python
# @package homotopy_weight
# Module caffe2.fb.python.layers.homotopy_weight
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, schema
from caffe2.python.layers.layers import ModelLayer
import numpy as np
import logging
logger = logging.getLogger(__name__)
'''
Homotopy Weighting between two weights x, y by doing:
alpha x + beta y
where alpha is a decreasing scalar parameter ranging from [min, max] (default,
[0, 1]), and alpha + beta = max + min, which means that beta is increasing in
the range [min, max];
Homotopy methods first solves an "easy" problem (one to which the solution is
well known), and is gradually transformed into the target problem
'''
class HomotopyWeight(ModelLayer):
def __init__(
self,
model,
input_record,
name='homotopy_weight',
min_weight=0.,
max_weight=1.,
half_life=1e6,
quad_life=3e6,
atomic_iter=None,
**kwargs
):
super(HomotopyWeight,
self).__init__(model, name, input_record, **kwargs)
self.output_schema = schema.Scalar(
np.float32, self.get_next_blob_reference('homotopy_weight')
)
data = self.input_record.field_blobs()
assert len(data) == 2
self.x = data[0]
self.y = data[1]
# TODO: currently model building does not have access to iter counter or
# learning rate; it's added at optimization time;
self.use_external_iter = (atomic_iter is not None)
self.atomic_iter = (
atomic_iter if self.use_external_iter else self.create_atomic_iter()
)
# to map lr to [min, max]; alpha = scale * lr + offset
assert max_weight > min_weight
self.scale = float(max_weight - min_weight)
self.offset = self.model.add_global_constant(
'%s_offset_1dfloat' % self.name, float(min_weight)
)
self.gamma, self.power = self.solve_inv_lr_params(half_life, quad_life)
def solve_inv_lr_params(self, half_life, quad_life):
# ensure that the gamma, power is solvable
assert half_life > 0
# convex monotonically decreasing
assert quad_life > 2 * half_life
t = float(quad_life) / float(half_life)
x = t * (1.0 + np.sqrt(2.0)) / 2.0 - np.sqrt(2.0)
gamma = (x - 1.0) / float(half_life)
power = np.log(2.0) / np.log(x)
logger.info(
'homotopy_weighting: found lr param: gamma=%g, power=%g' %
(gamma, power)
)
return gamma, power
def create_atomic_iter(self):
self.mutex = self.create_param(
param_name=('%s_mutex' % self.name),
shape=None,
initializer=('CreateMutex', ),
optimizer=self.model.NoOptim,
)
self.atomic_iter = self.create_param(
param_name=('%s_atomic_iter' % self.name),
shape=[1],
initializer=(
'ConstantFill', {
'value': 0,
'dtype': core.DataType.INT64
}
),
optimizer=self.model.NoOptim,
)
return self.atomic_iter
def update_weight(self, net):
alpha = net.NextScopedBlob('alpha')
beta = net.NextScopedBlob('beta')
lr = net.NextScopedBlob('lr')
comp_lr = net.NextScopedBlob('complementary_lr')
scaled_lr = net.NextScopedBlob('scaled_lr')
scaled_comp_lr = net.NextScopedBlob('scaled_complementary_lr')
if not self.use_external_iter:
net.AtomicIter([self.mutex, self.atomic_iter], [self.atomic_iter])
net.LearningRate(
[self.atomic_iter],
[lr],
policy='inv',
gamma=self.gamma,
power=self.power,
base_lr=1.0,
)
net.Sub([self.model.global_constants['ONE'], lr], [comp_lr])
net.Scale([lr], [scaled_lr], scale=self.scale)
net.Scale([comp_lr], [scaled_comp_lr], scale=self.scale)
net.Add([scaled_lr, self.offset], [alpha])
net.Add([scaled_comp_lr, self.offset], [beta])
return alpha, beta
def add_ops(self, net):
alpha, beta = self.update_weight(net)
# alpha x + beta y
net.WeightedSum([self.x, alpha, self.y, beta], self.output_schema())
```
|
```c++
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#include "paddle/fluid/eager/amp_auto_cast.h"
#include "paddle/fluid/eager/api/manual/fluid_manual/dygraph_forward_api.h"
#include "paddle/fluid/eager/api/manual/fluid_manual/nodes/nodes.h"
#include "paddle/fluid/eager/api/utils/global_utils.h"
#include "paddle/fluid/imperative/amp_utils.h"
#include "paddle/fluid/platform/profiler/event_tracing.h"
std::tuple<paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor,
paddle::Tensor>
fused_feedforward_dygraph_function(
const paddle::Tensor& X,
const paddle::Tensor& Dropout1Seed,
const paddle::Tensor& Dropout2Seed,
const paddle::Tensor& Linear1Weight,
const paddle::Tensor& Linear1Bias,
const paddle::Tensor& Linear2Weight,
const paddle::Tensor& Linear2Bias,
const paddle::Tensor& Ln1Scale,
const paddle::Tensor& Ln1Bias,
const paddle::Tensor& Ln2Scale,
const paddle::Tensor& Ln2Bias,
const paddle::framework::AttributeMap& attr_map) {
phi::RecordEvent dygraph_entrance_record_event(
"fused_feedforward dygraph", phi::TracerEventType::Operator, 1);
VLOG(3) << "Running Eager Forward Op: fused_feedforward";
// Dygraph Forward Pass
if (egr::Controller::Instance().GetAMPLevel() !=
paddle::imperative::AmpLevel::O0) {
VLOG(5) << "Check and Prepare For AMP";
paddle::small_vector<std::vector<paddle::Tensor>, egr::kSlotSmallVectorSize>
amp_tensors_vector = {{X}, {Linear1Weight}, {Linear2Weight}};
if (Dropout1Seed.initialized())
amp_tensors_vector.push_back({Dropout1Seed});
if (Dropout2Seed.initialized())
amp_tensors_vector.push_back({Dropout2Seed});
if (Linear1Bias.initialized()) amp_tensors_vector.push_back({Linear1Bias});
if (Linear2Bias.initialized()) amp_tensors_vector.push_back({Linear2Bias});
if (Ln1Scale.initialized()) amp_tensors_vector.push_back({Ln1Scale});
if (Ln1Bias.initialized()) amp_tensors_vector.push_back({Ln1Bias});
if (Ln2Scale.initialized()) amp_tensors_vector.push_back({Ln2Scale});
if (Ln2Bias.initialized()) amp_tensors_vector.push_back({Ln2Bias});
auto amp_dst_dtype = paddle::imperative::GetAmpDestDtype(
"fused_feedforward", amp_tensors_vector);
auto NEW_X = egr::AmpAutoCast("X", X, amp_dst_dtype, "fused_feedforward");
auto NEW_Linear1Weight = egr::AmpAutoCast(
"Linear1Weight", Linear1Weight, amp_dst_dtype, "fused_feedforward");
auto NEW_Linear2Weight = egr::AmpAutoCast(
"Linear2Weight", Linear2Weight, amp_dst_dtype, "fused_feedforward");
auto NEW_Dropout1Seed =
((Dropout1Seed.initialized()) ? egr::AmpAutoCast("Dropout1Seed",
Dropout1Seed,
amp_dst_dtype,
"fused_feedforward")
: Dropout1Seed);
auto NEW_Dropout2Seed =
((Dropout2Seed.initialized()) ? egr::AmpAutoCast("Dropout2Seed",
Dropout2Seed,
amp_dst_dtype,
"fused_feedforward")
: Dropout2Seed);
auto NEW_Linear1Bias =
((Linear1Bias.initialized()) ? egr::AmpAutoCast("Linear1Bias",
Linear1Bias,
amp_dst_dtype,
"fused_feedforward")
: Linear1Bias);
auto NEW_Linear2Bias =
((Linear2Bias.initialized()) ? egr::AmpAutoCast("Linear2Bias",
Linear2Bias,
amp_dst_dtype,
"fused_feedforward")
: Linear2Bias);
auto NEW_Ln1Scale =
((Ln1Scale.initialized())
? egr::AmpAutoCast(
"Ln1Scale", Ln1Scale, amp_dst_dtype, "fused_feedforward")
: Ln1Scale);
auto NEW_Ln1Bias =
((Ln1Bias.initialized())
? egr::AmpAutoCast(
"Ln1Bias", Ln1Bias, amp_dst_dtype, "fused_feedforward")
: Ln1Bias);
auto NEW_Ln2Scale =
((Ln2Scale.initialized())
? egr::AmpAutoCast(
"Ln2Scale", Ln2Scale, amp_dst_dtype, "fused_feedforward")
: Ln2Scale);
auto NEW_Ln2Bias =
((Ln2Bias.initialized())
? egr::AmpAutoCast(
"Ln2Bias", Ln2Bias, amp_dst_dtype, "fused_feedforward")
: Ln2Bias);
{
paddle::imperative::AutoCastGuard guard(
egr::Controller::Instance().GetCurrentAmpAttrs(),
paddle::imperative::AmpLevel::O0);
return fused_feedforward_dygraph_function(NEW_X,
NEW_Dropout1Seed,
NEW_Dropout2Seed,
NEW_Linear1Weight,
NEW_Linear1Bias,
NEW_Linear2Weight,
NEW_Linear2Bias,
NEW_Ln1Scale,
NEW_Ln1Bias,
NEW_Ln2Scale,
NEW_Ln2Bias,
attr_map);
}
}
std::map<std::string, std::vector<std::shared_ptr<egr::EagerVariable>>> ins =
{{"X", egr::EagerUtils::TrySyncToVars(X)},
{"Linear1Weight", egr::EagerUtils::TrySyncToVars(Linear1Weight)},
{"Linear2Weight", egr::EagerUtils::TrySyncToVars(Linear2Weight)}};
if (Dropout1Seed.initialized())
ins["Dropout1Seed"] = egr::EagerUtils::TrySyncToVars(Dropout1Seed);
if (Dropout2Seed.initialized())
ins["Dropout2Seed"] = egr::EagerUtils::TrySyncToVars(Dropout2Seed);
if (Linear1Bias.initialized())
ins["Linear1Bias"] = egr::EagerUtils::TrySyncToVars(Linear1Bias);
if (Linear2Bias.initialized())
ins["Linear2Bias"] = egr::EagerUtils::TrySyncToVars(Linear2Bias);
if (Ln1Scale.initialized())
ins["Ln1Scale"] = egr::EagerUtils::TrySyncToVars(Ln1Scale);
if (Ln1Bias.initialized())
ins["Ln1Bias"] = egr::EagerUtils::TrySyncToVars(Ln1Bias);
if (Ln2Scale.initialized())
ins["Ln2Scale"] = egr::EagerUtils::TrySyncToVars(Ln2Scale);
if (Ln2Bias.initialized())
ins["Ln2Bias"] = egr::EagerUtils::TrySyncToVars(Ln2Bias);
std::map<std::string, std::vector<std::shared_ptr<egr::EagerVariable>>> outs =
{{"Out",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Dropout1Mask",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Dropout2Mask",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Ln1Mean",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Ln1Variance",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Ln2Mean",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Ln2Variance",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Linear1Out",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Ln1Out",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Dropout1Out",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}},
{"Dropout2Out",
{std::make_shared<egr::EagerVariable>(
egr::Controller::Instance().GenerateUniqueName())}}};
// Prepare Autograd Meta
egr::AutogradMeta* p_autograd_X = egr::EagerUtils::nullable_autograd_meta(X);
egr::AutogradMeta* p_autograd_Dropout1Seed =
egr::EagerUtils::nullable_autograd_meta(Dropout1Seed);
egr::AutogradMeta* p_autograd_Dropout2Seed =
egr::EagerUtils::nullable_autograd_meta(Dropout2Seed);
egr::AutogradMeta* p_autograd_Linear1Weight =
egr::EagerUtils::nullable_autograd_meta(Linear1Weight);
egr::AutogradMeta* p_autograd_Linear1Bias =
egr::EagerUtils::nullable_autograd_meta(Linear1Bias);
egr::AutogradMeta* p_autograd_Linear2Weight =
egr::EagerUtils::nullable_autograd_meta(Linear2Weight);
egr::AutogradMeta* p_autograd_Linear2Bias =
egr::EagerUtils::nullable_autograd_meta(Linear2Bias);
egr::AutogradMeta* p_autograd_Ln1Scale =
egr::EagerUtils::nullable_autograd_meta(Ln1Scale);
egr::AutogradMeta* p_autograd_Ln1Bias =
egr::EagerUtils::nullable_autograd_meta(Ln1Bias);
egr::AutogradMeta* p_autograd_Ln2Scale =
egr::EagerUtils::nullable_autograd_meta(Ln2Scale);
egr::AutogradMeta* p_autograd_Ln2Bias =
egr::EagerUtils::nullable_autograd_meta(Ln2Bias);
bool trace_backward = egr::Controller::Instance().HasGrad();
bool require_any_grad =
egr::EagerUtils::ComputeRequireGrad(trace_backward,
p_autograd_X,
p_autograd_Dropout1Seed,
p_autograd_Dropout2Seed,
p_autograd_Linear1Weight,
p_autograd_Linear1Bias,
p_autograd_Linear2Weight,
p_autograd_Linear2Bias,
p_autograd_Ln1Scale,
p_autograd_Ln1Bias,
p_autograd_Ln2Scale,
p_autograd_Ln2Bias);
paddle::framework::AttributeMap attrs = attr_map;
paddle::framework::AttributeMap default_attrs;
egr::Controller::Instance().GetCurrentTracer()->TraceOp(
"fused_feedforward",
ins,
outs,
attrs,
egr::Controller::Instance().GetExpectedPlace(),
&default_attrs,
true,
{});
paddle::Tensor Out;
egr::EagerUtils::GetOutput(outs["Out"][0], &Out);
paddle::Tensor Dropout1Mask;
egr::EagerUtils::GetOutput(outs["Dropout1Mask"][0], &Dropout1Mask);
paddle::Tensor Dropout2Mask;
egr::EagerUtils::GetOutput(outs["Dropout2Mask"][0], &Dropout2Mask);
paddle::Tensor Ln1Mean;
egr::EagerUtils::GetOutput(outs["Ln1Mean"][0], &Ln1Mean);
paddle::Tensor Ln1Variance;
egr::EagerUtils::GetOutput(outs["Ln1Variance"][0], &Ln1Variance);
paddle::Tensor Ln2Mean;
egr::EagerUtils::GetOutput(outs["Ln2Mean"][0], &Ln2Mean);
paddle::Tensor Ln2Variance;
egr::EagerUtils::GetOutput(outs["Ln2Variance"][0], &Ln2Variance);
paddle::Tensor Linear1Out;
egr::EagerUtils::GetOutput(outs["Linear1Out"][0], &Linear1Out);
paddle::Tensor Ln1Out;
egr::EagerUtils::GetOutput(outs["Ln1Out"][0], &Ln1Out);
paddle::Tensor Dropout1Out;
egr::EagerUtils::GetOutput(outs["Dropout1Out"][0], &Dropout1Out);
paddle::Tensor Dropout2Out;
egr::EagerUtils::GetOutput(outs["Dropout2Out"][0], &Dropout2Out);
{
phi::RecordEvent node_creation_record_event(
"fused_feedforward node_creation", phi::TracerEventType::Operator, 1);
egr::AutogradMeta* p_autograd_Out = egr::EagerUtils::autograd_meta(&Out);
egr::AutogradMeta* p_autograd_Dropout1Mask =
egr::EagerUtils::autograd_meta(&Dropout1Mask);
egr::AutogradMeta* p_autograd_Dropout2Mask =
egr::EagerUtils::autograd_meta(&Dropout2Mask);
egr::AutogradMeta* p_autograd_Ln1Mean =
egr::EagerUtils::autograd_meta(&Ln1Mean);
egr::AutogradMeta* p_autograd_Ln1Variance =
egr::EagerUtils::autograd_meta(&Ln1Variance);
egr::AutogradMeta* p_autograd_Ln2Mean =
egr::EagerUtils::autograd_meta(&Ln2Mean);
egr::AutogradMeta* p_autograd_Ln2Variance =
egr::EagerUtils::autograd_meta(&Ln2Variance);
egr::AutogradMeta* p_autograd_Linear1Out =
egr::EagerUtils::autograd_meta(&Linear1Out);
egr::AutogradMeta* p_autograd_Ln1Out =
egr::EagerUtils::autograd_meta(&Ln1Out);
egr::AutogradMeta* p_autograd_Dropout1Out =
egr::EagerUtils::autograd_meta(&Dropout1Out);
egr::AutogradMeta* p_autograd_Dropout2Out =
egr::EagerUtils::autograd_meta(&Dropout2Out);
if (require_any_grad) {
VLOG(6) << " Construct Grad for fused_feedforward ";
egr::EagerUtils::PassStopGradient(false,
p_autograd_Out,
p_autograd_Dropout1Mask,
p_autograd_Dropout2Mask,
p_autograd_Ln1Mean,
p_autograd_Ln1Variance,
p_autograd_Ln2Mean,
p_autograd_Ln2Variance,
p_autograd_Linear1Out,
p_autograd_Ln1Out,
p_autograd_Dropout1Out,
p_autograd_Dropout2Out);
// Create GradOpNode
auto grad_node =
std::shared_ptr<fused_feedforwardGradNodeCompat>( // NOLINT
new fused_feedforwardGradNodeCompat(11, 11));
bool pre_layer_norm = false;
if (attrs.count("pre_layer_norm")) {
pre_layer_norm = PADDLE_GET_CONST(bool, attrs.at("pre_layer_norm"));
}
// Set Attributes
grad_node->SetAttrMap(std::move(attrs));
grad_node->SetDefaultAttrMap(std::move(default_attrs));
grad_node->SetTensorWrapper_X(X);
grad_node->SetTensorWrapper_Linear1Weight(Linear1Weight);
grad_node->SetTensorWrapper_Linear1Bias(Linear1Bias);
grad_node->SetTensorWrapper_Linear2Weight(Linear2Weight);
grad_node->SetTensorWrapper_Dropout1Mask(Dropout1Mask);
grad_node->SetTensorWrapper_Dropout2Mask(Dropout2Mask);
grad_node->SetTensorWrapper_Linear1Out(Linear1Out);
grad_node->SetTensorWrapper_Dropout1Out(Dropout1Out);
grad_node->SetTensorWrapper_Dropout2Out(Dropout2Out);
grad_node->SetGradOutMeta(X, 0);
grad_node->SetGradOutMeta(Linear1Weight, 3);
grad_node->SetGradOutMeta(Linear1Bias, 4);
grad_node->SetGradOutMeta(Linear2Weight, 5);
if (pre_layer_norm) {
grad_node->SetTensorWrapper_Ln1Scale(Ln1Scale);
grad_node->SetTensorWrapper_Ln1Bias(Ln1Bias);
grad_node->SetTensorWrapper_Ln1Out(Ln1Out);
grad_node->SetTensorWrapper_Ln1Mean(Ln1Mean);
grad_node->SetTensorWrapper_Ln1Variance(Ln1Variance);
grad_node->SetGradOutMeta(Ln1Scale, 7);
grad_node->SetGradOutMeta(Ln1Bias, 8);
} else {
grad_node->SetTensorWrapper_Ln2Scale(Ln2Scale);
grad_node->SetGradOutMeta(Ln2Scale, 9);
grad_node->SetTensorWrapper_Ln2Bias(Ln2Bias);
grad_node->SetGradOutMeta(Ln2Bias, 10);
grad_node->SetTensorWrapper_Ln2Mean(Ln2Mean);
grad_node->SetTensorWrapper_Ln2Variance(Ln2Variance);
}
if (Linear2Bias.initialized()) {
grad_node->SetTensorWrapper_Linear2Bias(Linear2Bias);
grad_node->SetGradOutMeta(Linear2Bias, 6);
}
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Out, 0);
egr::EagerUtils::SetHistory(p_autograd_Out, grad_node);
grad_node->SetGradInMeta(Out, 0);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Dropout1Mask, 1);
grad_node->SetGradInMeta(Dropout1Mask, 1);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Dropout2Mask, 2);
grad_node->SetGradInMeta(Dropout2Mask, 2);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Ln1Mean, 3);
grad_node->SetGradInMeta(Ln1Mean, 3);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Ln1Variance, 4);
grad_node->SetGradInMeta(Ln1Variance, 4);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Ln2Mean, 5);
grad_node->SetGradInMeta(Ln2Mean, 5);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Ln2Variance, 6);
grad_node->SetGradInMeta(Ln2Variance, 6);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Linear1Out, 7);
grad_node->SetGradInMeta(Linear1Out, 7);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Ln1Out, 8);
grad_node->SetGradInMeta(Ln1Out, 8);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Dropout1Out, 9);
grad_node->SetGradInMeta(Dropout1Out, 9);
egr::EagerUtils::SetOutRankWithSlot(p_autograd_Dropout2Out, 10);
grad_node->SetGradInMeta(Dropout2Out, 10);
}
}
return std::make_tuple(Out,
Dropout1Mask,
Dropout2Mask,
Ln1Mean,
Ln1Variance,
Ln2Mean,
Ln2Variance,
Linear1Out,
Ln1Out,
Dropout1Out,
Dropout2Out);
}
```
|
Kettle of fish can refer to:
Kettle of Fish, a 1998 compilation album by Derek William Dick
Kettle of Fish (bar), a bar in New York City
Kettle of Fish (film), a 2006 film
|
Holdenby House is a historic country house in Northamptonshire, traditionally pronounced, and sometimes spelt, Holmby. The house is situated in the parish of Holdenby, six miles (10 km) northwest of Northampton and close to Althorp. It is a Grade II* listed building.
History
The house was completed in 1583 by the Elizabethan Lord Chancellor, Sir Christopher Hatton, who refused to sleep a night in the mansion until Queen Elizabeth I had slept there. It was one of the largest prodigy houses of the Tudor period, rivalling in size both Audley End and Theobalds, and was reputed to occupy approximately 78,750 square feet (7,300 m²), although this probably included the two great courtyards around which it was built. The facades were symmetrical, with mullioned windows and open Doric arcades, reflecting the Renaissance style of architecture gradually spreading from Italy. Hatton died in 1591.
In 1607 the mansion was bought by Elizabeth's successor James I. His wife Anne of Denmark stayed in August 1608.
In February 1647, after the First English Civil War, Charles I was brought to Holdenby by the Scots and handed over to the English Long Parliament. He remained a prisoner there until June 1647 when Cornet George Joyce seized him and took him to Newmarket in the name of the New Model Army. Parliament later sold the estate to Captain Adam Baynes, who demolished the house almost entirely except for a small domestic wing.
In 1709, Holdenby was bought by the Marlborough family who in turn sold it to their kin the Clifden family whose descendants in the female line, the Lowthers, still own the property . The Clifdens had a new house built in the style of the older mansion, incorporating the older mansion's remains but being only about one eighth of its size. The first phase of the new house was designed by the architects Richard Carpenter and William Slater and built in 1873–75. A second phase was designed by Walter Mills and built in 1877–78.
, all that remains of Hatton's great house are two Grade I listed archways and the kitchen wing incorporated into the Victorian rebuild, now standing on a lawn, which once gave access to the courtyards; a near-identical third arch bears the date 1659 and so must have been built for Baynes, the Cromwellian owner.
The gardens are listed Grade I.
A door salvaged from the demolition of Holdenby palace is believed to be inside Morningside Cottage, a grade II listed building in the nearby village of Creaton.
Filming location
In July 2011, the exterior of Holdenby House was transformed as the location of Satis House in BBC One’s adaptation of Charles Dickens’s Great Expectations. Parts of the film Biggles (1986) were filmed at Holdenby. The house featured in a 2020 episode of An American Aristocrat's Guide to Great Estates.
Functions and visits
The estate is a private residence which is available as a corporate and wedding venue and is opened to the public on a limited and paid basis. Other activities include a falconry centre.
References
Further reading
Whyte Melville G. J. 'Holby House' Ch.XXVII of the historical novel Holby House: a Tale of Old Northamptonshire, written in 1859, reconstructs the house's appearance during the captivity of Charles I.
External links
Holdenby House Official Website
1583 establishments in England
Houses completed in 1583
Country houses in Northamptonshire
Gardens in Northamptonshire
Grade II* listed buildings in Northamptonshire
James VI and I
Charles I of England
|
Sancho IV can refer to:
Duke Sancho IV Garcés of Gascony (d. 950x955)
King Sancho IV of Navarre (d. 1076)
King Sancho IV of Castile (c. 1257 – 1295)
|
```html
<bit-section>
<h2 *ngIf="!selfHosted" bitTypography="h2">{{ "goPremium" | i18n }}</h2>
<bit-callout
type="info"
*ngIf="canAccessPremium$ | async"
title="{{ 'youHavePremiumAccess' | i18n }}"
icon="bwi bwi-star-f"
>
{{ "alreadyPremiumFromOrg" | i18n }}
</bit-callout>
<bit-callout type="success">
<p>{{ "premiumUpgradeUnlockFeatures" | i18n }}</p>
<ul class="bwi-ul">
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpStorage" | i18n }}
</li>
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpTwoStepOptions" | i18n }}
</li>
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpEmergency" | i18n }}
</li>
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpReports" | i18n }}
</li>
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpTotp" | i18n }}
</li>
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpSupport" | i18n }}
</li>
<li>
<i class="bwi bwi-check tw-text-success bwi-li" aria-hidden="true"></i>
{{ "premiumSignUpFuture" | i18n }}
</li>
</ul>
<p bitTypography="body1" [ngClass]="{ 'tw-mb-0': !selfHosted }">
{{
"premiumPriceWithFamilyPlan" | i18n: (premiumPrice | currency: "$") : familyPlanMaxUserCount
}}
<a
bitLink
linkType="primary"
routerLink="/create-organization"
[queryParams]="{ plan: 'families' }"
>{{ "bitwardenFamiliesPlan" | i18n }}</a
>
</p>
<a
bitButton
href="{{ this.cloudWebVaultUrl }}/#/settings/subscription/premium"
target="_blank"
rel="noreferrer"
buttonType="secondary"
*ngIf="selfHosted"
>
{{ "purchasePremium" | i18n }}
</a>
</bit-callout>
</bit-section>
<bit-section *ngIf="selfHosted">
<form [formGroup]="licenseForm" [bitSubmit]="submit">
<bit-form-field>
<bit-label>{{ "licenseFile" | i18n }}</bit-label>
<div>
<button bitButton type="button" buttonType="secondary" (click)="fileSelector.click()">
{{ "chooseFile" | i18n }}
</button>
{{ this.licenseFile ? this.licenseFile.name : ("noFileChosen" | i18n) }}
</div>
<input
bitInput
#fileSelector
type="file"
formControlName="file"
(change)="setSelectedFile($event)"
hidden
class="tw-hidden"
/>
<bit-hint>{{ "licenseFileDesc" | i18n: "bitwarden_premium_license.json" }}</bit-hint>
</bit-form-field>
<button type="submit" buttonType="primary" bitButton bitFormButton>
{{ "submit" | i18n }}
</button>
</form>
</bit-section>
<form [formGroup]="addonForm" [bitSubmit]="submit" *ngIf="!selfHosted">
<bit-section>
<h2 bitTypography="h2">{{ "addons" | i18n }}</h2>
<div class="tw-grid tw-grid-cols-12 tw-gap-4">
<bit-form-field class="tw-col-span-6">
<bit-label>{{ "additionalStorageGb" | i18n }}</bit-label>
<input
bitInput
formControlName="additionalStorage"
type="number"
step="1"
placeholder="{{ 'additionalStorageGbDesc' | i18n }}"
/>
<bit-hint>{{
"additionalStorageIntervalDesc"
| i18n: "1 GB" : (storageGbPrice | currency: "$") : ("year" | i18n)
}}</bit-hint>
</bit-form-field>
</div>
</bit-section>
<bit-section>
<h2 bitTypography="h2">{{ "summary" | i18n }}</h2>
{{ "premiumMembership" | i18n }}: {{ premiumPrice | currency: "$" }} <br />
{{ "additionalStorageGb" | i18n }}: {{ additionalStorage || 0 }} GB ×
{{ storageGbPrice | currency: "$" }} =
{{ additionalStorageTotal | currency: "$" }}
<hr class="tw-my-3" />
</bit-section>
<bit-section>
<h3 bitTypography="h2">{{ "paymentInformation" | i18n }}</h3>
<app-payment [hideBank]="true"></app-payment>
<app-tax-info></app-tax-info>
<div id="price" class="tw-my-4">
<div class="tw-text-muted tw-text-sm">
{{ "planPrice" | i18n }}: {{ subtotal | currency: "USD $" }}
<br />
<ng-container>
{{ "estimatedTax" | i18n }}: {{ taxCharges | currency: "USD $" }}
</ng-container>
</div>
<hr class="tw-my-1 tw-w-1/4 tw-ml-0" />
<p bitTypography="body1">
<strong>{{ "total" | i18n }}:</strong> {{ total | currency: "USD $" }}/{{ "year" | i18n }}
</p>
</div>
<p bitTypography="body2">{{ "paymentChargedAnnually" | i18n }}</p>
<button type="submit" bitButton bitFormButton>
{{ "submit" | i18n }}
</button>
</bit-section>
</form>
```
|
Cory Wade (born May 6, 1936) is a former record producer, director of A&R, songwriter, publisher, and recording studio manager. He has produced more than 35 gold and platinum records from 1973 to 1982 and has won numerous music industry awards, a Grammy Award nomination, and two American Music Award nominations.
Early life and career
Wade was born in Indianapolis, Indiana, United States. He is best known for producing various hits within the disco genre in the 1970s and 1980s. As producer for TK Records, Wade produced the 1977 single "Do Ya Wanna Get Funky with Me," by Peter Brown, which became the first 12-inch single to sell a million copies.
Early in his career, Wade himself became a self-produced recording artist with several regional hits in 1962. In August of 1963, he entered the United States Army. After returning from his military service, Wade re-entered the music field, recording "Letter From a Teenage Son", which was released on Mercury Records.
After pursuing his songwriting career from 1983 to 1991, Wade made a sudden comeback with a successful remake of Peter Brown's hit, "Crank it Up", recorded by singer and dancer Lawrence Leritz, which hit the dance market.
As a record producer, Wade has covered music in many fields such as disco, pop, R&B, funk, Christian, rock, and multiple instrumentals, including "Disco Magic" by T-Connection.
During his long career in the entertainment industry, Wade produced music for the following music recording labels worldwide: TK Records, Atlantic Records, Columbia Records, RCA, Epic Records, Phillips, Mercury, Priority, 20th Century Fox Records, Odyssey, Capitol Records, K-Tel, Polygram, MCA, Ariola, and Polydor.
Wade later worked on several music soundtracks for motion picture film projects, while also writing the screenplays. He resides in Walls, Mississippi, and hosted two radio shows broadcast on WCET Radio and syndicated in over 24 major markets worldwide.
Achievements
Cory Wade also produced hit recordings for Foxy, including "Get Off", which sold more than a million 12-inch and album copies. T-Connection also sold into the millions with a number of their disco-funk singles and albums. Wade also produced a hit album for local artists, Tiger, two brothers and their group, who came from the Florida Everglades-based Miccosukee Native American Tribe. He worked with other TK artists such as George and Gwen McCrae, Betty Wright, Wildflower, Timmy Thomas, Funk Machine, KC and the Sunshine Band, Steve Gordon, and Aaron Dey. Wade produced over 100 top-selling records. Notably, his first gold record came from the newly formed 20th Century Fox Records in 1972, when he produced the Brighter Side of Darkness track "Love Jones".
References
External links
Disco-Disco
MSN Music
Discogs.com listing
Crank It Up
1936 births
Living people
Record producers from Indiana
Songwriters from Indiana
American disco musicians
People from Indianapolis
|
```kotlin
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package com.marktony.zhihudaily.data
/**
* Created by lizhaotailang on 2017/6/19.
*
* Content types of in annotation type.
*/
enum class PostType {
ZHIHU,
DOUBAN,
GUOKR
}
```
|
Miraclathurella is a genus of sea snails, marine gastropod mollusks in the family Pseudomelatomidae.
Species
Species within the genus Miraclathurella include:
† Miraclathurella amica (Pilsbry & Johnson, 1917)
Miraclathurella bicanalifera (Sowerby I, 1834)
† Miraclathurella darwini (Philippi, 1887)
† Miraclathurella entemma Woodring, 1928
† Miraclathurella eucharis Woodring, 1970
† Miraclathurella gracilis (Gabb, 1866)
Miraclathurella herminea (Bartsch, 1934)
Miraclathurella mendozana Shasky, 1971
† Miraclathurella vittata Woodring, 1928
Species brought into synonymy
Miraclathurella acapulcanum Pilsbry & Lowe, 1932 : synonym of Miraclathurella bicanalifera (G.B. Sowerby I, 1834)
Miraclathurella aguadillana (Dall & Stimpson, 1901): synonym of Lioglyphostoma aguadillanum (Dall & Stimpson, 1901)
Miraclathurella clendenini García, 2008: synonym of Darrylia clendenini (García, 2008) (original combination)
Miraclathurella gracillima Carpenter, 1856:synonym of Miraclathurella bicanalifera (G.B. Sowerby I, 1834)
Miraclathurella kleinrosa (Nowell-Usticke, 1969): synonym of Darrylia kleinrosa (Nowell-Usticke, 1969)
Miraclathurella nitida Sowerby I, 1834:synonym of Miraclathurella bicanalifera (G.B. Sowerby I, 1834)
Miraclathurella peggywilliamsae Fallon, 2010: synonym of Darrylia peggywilliamsae (Fallon, 2010) (original combination)
Miraclathurella variculosa Sowerby I, 1834 :synonym of Miraclathurella bicanalifera (G.B. Sowerby I, 1834)
References
W. P. Woodring. 1928. Miocene Molluscs from Bowden, Jamaica. Part 2: Gastropods and discussion of results. Contributions to the Geology and Palaeontology of the West Indies
External links
Fallon, Phillip J , Descriptions and illustrations of some new and poorly known turrids of the tropical northwestern Atlantic. Part 1. Genera Buchema Corea, 1934 and Miraclathurella Woodring, 1928 (Gastropoda: Turridae: Crassispirinae); Nautilus 124, 2010
Bouchet, P.; Kantor, Y. I.; Sysoev, A.; Puillandre, N. (2011). A new operational classification of the Conoidea (Gastropoda). Journal of Molluscan Studies. 77(3): 273-308
Worldwide Mollusc Species Data Base: Pseudomelatomidae
Pseudomelatomidae
Gastropod genera
|
Frullania nisquallensis, commonly known as hanging millipede liverwort, is a reddish-brown species of liverwort in the family Frullaniaceae. It is found in western Washington and British Columbia, including Vancouver Island. The plant grows in mats, sometimes in mats that hang from tree branches (particularly those of alders, or maples), or growing close to the substrate. The leaves are small (1 mm long) and flat, with the lower leaves being slightly smaller than those growing farther up the stem.
Secondary metabolites
This species contains the tridepside compound tenuiron, and the sesquiterpenes (-)-frullanolide and costunolide, the latter of which has been shown to be damaging to DNA.
References
Frullaniaceae
|
Dean Kolstad (born June 16, 1968) is a Canadian former professional ice hockey player. He was drafted in the second round, 33rd overall, by the Minnesota North Stars in the 1986 NHL Entry Draft. He played forty games in the National Hockey League: thirty with the North Stars in the 1988–89 and 1990–91 seasons, and ten with the San Jose Sharks (who selected him in the 1991 NHL Dispersal Draft) in the 1992–93 season.
Kolstad was born in Edmonton, Alberta.
Career statistics
Awards
WHL East Second All-Star Team – 1988
External links
1968 births
Living people
Binghamton Rangers players
Canadian ice hockey defencemen
Central Texas Stampede players
Ice hockey people from Edmonton
Kalamazoo Wings (1974–2000) players
Kansas City Blades players
Minnesota Moose players
Minnesota North Stars draft picks
Minnesota North Stars players
New Westminster Bruins players
Portland Pirates players
Prince Albert Raiders players
San Jose Sharks players
|
```java
/*
* FindBugs - Find Bugs in Java programs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*
* You should have received a copy of the GNU Lesser General Public
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package edu.umd.cs.findbugs.ba;
import java.security.MessageDigest;
import java.util.Arrays;
import org.apache.bcel.classfile.Method;
import edu.umd.cs.findbugs.util.Util;
/**
* Compute a hash of the bytecode for given method. This can find methods which
* have not been changed other than accessing different constant pool entries.
*
* @author David Hovemeyer
*/
public class MethodHash implements Comparable<MethodHash> {
public static final String METHOD_HASH_ELEMENT_NAME = "MethodHash";
private byte[] hash;
private String methodName;
private String methodSig;
private boolean isStatic;
/**
* Constructor. computeHash(Method) must be used to initialize the contents.
*/
public MethodHash() {
}
/**
* Constructor.
*
* @param methodName
* method name
* @param methodSig
* method signature
* @param isStatic
* true if the method is static, false if not
* @param hash
* the pre-computed hash
*/
public MethodHash(String methodName, String methodSig, boolean isStatic, byte[] hash) {
this.methodName = methodName;
this.methodSig = methodSig;
this.isStatic = isStatic;
this.hash = new byte[hash.length];
System.arraycopy(hash, 0, this.hash, 0, hash.length);
}
/**
* @return Returns the method name.
*/
public String getMethodName() {
return methodName;
}
/**
* @return Returns the method signature.
*/
public String getMethodSig() {
return methodSig;
}
/**
* @return Returns whether the method is static.
*/
public boolean isStatic() {
return isStatic;
}
/**
* Get the computed method hash.
*
* @return the method hash
*/
public byte[] getMethodHash() {
return hash;
}
/**
* Compute hash on given method.
*
* @param method
* the method
* @return this object
*/
public MethodHash computeHash(Method method) {
final MessageDigest digest = Util.getMD5Digest();
byte[] code;
if (method.getCode() == null || method.getCode().getCode() == null) {
code = new byte[0];
} else {
code = method.getCode().getCode();
}
BytecodeScanner.Callback callback = (opcode, index) -> digest.update((byte) opcode);
BytecodeScanner bytecodeScanner = new BytecodeScanner();
bytecodeScanner.scan(code, callback);
hash = digest.digest();
return this;
}
/**
* Return whether or not this method hash has the same value as the one
* given.
*
* @param other
* another MethodHash
* @return true if the hash values are the same, false if not
*/
public boolean isSameHash(MethodHash other) {
return Arrays.equals(this.hash, other.hash);
}
/*
* (non-Javadoc)
*
* @see java.lang.Comparable#compareTo(T)
*/
@Override
public int compareTo(MethodHash other) {
return MethodHash.compareHashes(this.hash, other.hash);
}
@Override
public boolean equals(Object o) {
if (o instanceof MethodHash) {
return isSameHash((MethodHash) o);
}
return false;
}
@Override
public int hashCode() {
int result = 0;
for (byte b : hash) {
result = result * 17 + b;
}
return result;
}
public static int compareHashes(byte[] a, byte[] b) {
int pfxlen = Math.min(a.length, b.length);
for (int i = 0; i < pfxlen; ++i) {
int cmp = toUnsigned(a[i]) - toUnsigned(b[i]);
if (cmp != 0) {
return cmp;
}
}
return a.length - b.length;
}
/**
* Convert a byte to an unsigned int.
*
* @param b
* a byte value
* @return the unsigned integer value of the byte
*/
private static int toUnsigned(byte b) {
int value = b & 0x7F;
if ((b & 0x80) != 0) {
value |= 0x80;
}
return value;
}
}
```
|
```python
from datetime import datetime
from unittest import mock
from tests.providers.gcp.gcp_fixtures import (
GCP_PROJECT_ID,
GCP_US_CENTER1_LOCATION,
set_mocked_gcp_provider,
)
class Test_iam_sa_no_user_managed_keys:
def test_iam_no_sa(self):
iam_client = mock.MagicMock
with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_gcp_provider(),
), mock.patch(
"prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys.iam_client",
new=iam_client,
):
from prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys import (
iam_sa_no_user_managed_keys,
)
iam_client.project_ids = [GCP_PROJECT_ID]
iam_client.region = GCP_US_CENTER1_LOCATION
iam_client.service_accounts = []
check = iam_sa_no_user_managed_keys()
result = check.execute()
assert len(result) == 0
def test_iam_sa_no_keys(self):
iam_client = mock.MagicMock
with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_gcp_provider(),
), mock.patch(
"prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys.iam_client",
new=iam_client,
):
from prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys import (
iam_sa_no_user_managed_keys,
)
from prowler.providers.gcp.services.iam.iam_service import ServiceAccount
iam_client.project_ids = [GCP_PROJECT_ID]
iam_client.region = GCP_US_CENTER1_LOCATION
iam_client.service_accounts = [
ServiceAccount(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com",
email="my-service-account@my-project.iam.gserviceaccount.com",
display_name="My service account",
keys=[],
project_id=GCP_PROJECT_ID,
)
]
check = iam_sa_no_user_managed_keys()
result = check.execute()
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Account {iam_client.service_accounts[0].email} does not have user-managed keys."
)
assert result[0].resource_id == iam_client.service_accounts[0].email
assert result[0].project_id == GCP_PROJECT_ID
assert result[0].location == GCP_US_CENTER1_LOCATION
assert result[0].resource_name == iam_client.service_accounts[0].name
def test_iam_sa_no_user_managed_keys(self):
iam_client = mock.MagicMock
with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_gcp_provider(),
), mock.patch(
"prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys.iam_client",
new=iam_client,
):
from prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys import (
iam_sa_no_user_managed_keys,
)
from prowler.providers.gcp.services.iam.iam_service import (
Key,
ServiceAccount,
)
iam_client.project_ids = [GCP_PROJECT_ID]
iam_client.region = GCP_US_CENTER1_LOCATION
iam_client.service_accounts = [
ServiceAccount(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com",
email="my-service-account@my-project.iam.gserviceaccount.com",
display_name="My service account",
keys=[
Key(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com/keys/90c48f61c65cd56224a12ab18e6ee9ca9c3aee7c",
origin="GOOGLE_PROVIDED",
type="SYSTEM_MANAGED",
valid_after=datetime.strptime("2024-07-10", "%Y-%m-%d"),
valid_before=datetime.strptime("9999-12-31", "%Y-%m-%d"),
)
],
project_id=GCP_PROJECT_ID,
)
]
check = iam_sa_no_user_managed_keys()
result = check.execute()
assert len(result) == 1
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Account {iam_client.service_accounts[0].email} does not have user-managed keys."
)
assert result[0].resource_id == iam_client.service_accounts[0].email
assert result[0].project_id == GCP_PROJECT_ID
assert result[0].location == GCP_US_CENTER1_LOCATION
assert result[0].resource_name == iam_client.service_accounts[0].name
def test_iam_sa_user_managed_keys(self):
iam_client = mock.MagicMock
with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_gcp_provider(),
), mock.patch(
"prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys.iam_client",
new=iam_client,
):
from prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys import (
iam_sa_no_user_managed_keys,
)
from prowler.providers.gcp.services.iam.iam_service import (
Key,
ServiceAccount,
)
iam_client.project_ids = [GCP_PROJECT_ID]
iam_client.region = GCP_US_CENTER1_LOCATION
iam_client.service_accounts = [
ServiceAccount(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com",
email="my-service-account@my-project.iam.gserviceaccount.com",
display_name="My service account",
keys=[
Key(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com/keys/90c48f61c65cd56224a12ab18e6ee9ca9c3aee7c",
origin="GOOGLE_PROVIDED",
type="USER_MANAGED",
valid_after=datetime.strptime("2024-07-10", "%Y-%m-%d"),
valid_before=datetime.strptime("9999-12-31", "%Y-%m-%d"),
)
],
project_id=GCP_PROJECT_ID,
)
]
check = iam_sa_no_user_managed_keys()
result = check.execute()
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Account {iam_client.service_accounts[0].email} has user-managed keys."
)
assert result[0].resource_id == iam_client.service_accounts[0].email
assert result[0].project_id == GCP_PROJECT_ID
assert result[0].location == GCP_US_CENTER1_LOCATION
assert result[0].resource_name == iam_client.service_accounts[0].name
def test_iam_sa_mixed_keys(self):
iam_client = mock.MagicMock
with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=set_mocked_gcp_provider(),
), mock.patch(
"prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys.iam_client",
new=iam_client,
):
from prowler.providers.gcp.services.iam.iam_sa_no_user_managed_keys.iam_sa_no_user_managed_keys import (
iam_sa_no_user_managed_keys,
)
from prowler.providers.gcp.services.iam.iam_service import (
Key,
ServiceAccount,
)
iam_client.project_ids = [GCP_PROJECT_ID]
iam_client.region = GCP_US_CENTER1_LOCATION
iam_client.service_accounts = [
ServiceAccount(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com",
email="my-service-account@my-project.iam.gserviceaccount.com",
display_name="My service account",
keys=[
Key(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com/keys/90c48f61c65cd56224a12ab18e6ee9ca9c3aee7c",
origin="GOOGLE_PROVIDED",
type="SYSTEM_MANAGED",
valid_after=datetime.strptime("2024-07-10", "%Y-%m-%d"),
valid_before=datetime.strptime("9999-12-31", "%Y-%m-%d"),
),
Key(
name="projects/my-project/serviceAccounts/my-service-account@my-project.iam.gserviceaccount.com/keys/e5e3800831ac1adc8a5849da7d827b4724b1fce8",
origin="GOOGLE_PROVIDED",
type="USER_MANAGED",
valid_after=datetime.strptime("2024-07-10", "%Y-%m-%d"),
valid_before=datetime.strptime("9999-12-31", "%Y-%m-%d"),
),
],
project_id=GCP_PROJECT_ID,
)
]
check = iam_sa_no_user_managed_keys()
result = check.execute()
assert len(result) == 1
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Account {iam_client.service_accounts[0].email} has user-managed keys."
)
assert result[0].resource_id == iam_client.service_accounts[0].email
assert result[0].project_id == GCP_PROJECT_ID
assert result[0].location == GCP_US_CENTER1_LOCATION
assert result[0].resource_name == iam_client.service_accounts[0].name
```
|
Pushing Daisies is an American comedy-drama television series created by Bryan Fuller that aired on ABC from October 3, 2007, to June 13, 2009. The series stars Lee Pace as Ned, a pie-maker with the ability to bring dead things back to life with his touch, an ability that comes with stipulations. Together with his formerly deceased childhood crush Chuck (Anna Friel), co-worker Olive Snook (Kristin Chenoweth), and private investigator Emerson Cod (Chi McBride), Ned uses his abilities to solve murder cases. The cast also includes Ellen Greene, Swoosie Kurtz and Field Cate, with Jim Dale acting as narrator.
Touted as a "forensic fairy tale", the series is known for its unusual visual style, eccentric production design, quirky characters, fast-paced dialogue and grotesque situations. The series often uses wordplay, metaphor and double entendre, while Jim Dale's narration is very similar to that of a fairytale.
The series received critical acclaim, with praises going towards the cast, direction, writing, tone, and set design, and won numerous awards. The series received 17 Primetime Emmy Award nominations, with seven wins, including Outstanding Directing for a Comedy Series for Barry Sonnenfeld and Outstanding Supporting Actress in a Comedy Series for Kristin Chenoweth. TV Guide included the series in their 2013 list of 60 shows that were "Cancelled Too Soon". In 2015, Pushing Daisies was voted first in Esquires "TV Reboot Tournament" that asked fans to vote for the show they would most like to see return to television.
Plot
Pushing Daisies centers on the life of Ned, a pie-maker gifted with the ability to reanimate the dead by touching them. If something is revived for more than one minute, a similar "life value" in the vicinity drops dead as a form of balance. If he touches the revived person or thing a second time, they die permanently.
As a child, he brings back his mother when she dies of an aneurysm. This causes the death of the father of his neighbor and childhood sweetheart, Charlotte "Chuck" Charles. That night, Ned's mother falls dead permanently when she kisses him goodnight. Chuck's agoraphobic aunts, Vivian and Lily, move in to care for her and Ned is sent by his father to a boarding school, separating the children.
Ned becomes a pie-maker and opens a restaurant called The Pie Hole. He is aided by waitress Olive Snook, who pines for him. The restaurant is failing financially when private investigator Emerson Cod accidentally discovers Ned's powers and offers a proposal: Ned will temporarily bring murder victims back to life, allowing Emerson to inquire about the circumstances of their death, quickly solve the case, and split the reward money with him.
The scheme succeeds without issue until they learn that Chuck, whom Ned has not seen since childhood, was murdered. Ned revives her, but he cannot bring himself to let her die permanently. Ned and Chuck fall in love again, and although they can never touch each other, she moves into his home. Chuck joins Ned and Emerson in investigating deaths for reward money, beginning with her own murder.
Over the course of the series, Emerson searches for his missing daughter who was taken away by her mother, a con woman. After meeting a publisher of pop-up books, he is inspired to create and publish his own pop-up book, hoping that his daughter will read the book and find her way back to him. Chuck struggles to keep the secret of her revival from Vivian and Lily, and Vivian and Lily slowly accept the death of their niece. It is discovered that Chuck is Lily's daughter from an infidelity with Chuck's father while he was engaged to Vivian. Ned revives Chuck's father to ask him questions, and Chuck tricks Ned into thinking he touched her father a second time so that she can keep her father in her life. Chuck's father and Ned have an antagonistic relationship, and Chuck's father asks her to travel the world with him. When she tells him she would rather remain in town, he leaves alone.
The epilogue reveals that Emerson's daughter returns to him, Chuck is able to let her mother Lily and aunt Vivian know she is alive, and Olive has fallen in love with Randy Mann, a taxidermist friend of the group, and opens The Intrepid Cow, a restaurant dedicated to macaroni and cheese.
Cast and characters
Main
Lee Pace as Ned, also known as "The Piemaker", the owner of the Pie Hole restaurant who has the power to bring dead people back to life.
Anna Friel as Charlotte "Chuck" Charles, Ned's childhood sweetheart, murdered, but brought back to life by Ned.
Chi McBride as Emerson Cod, a private investigator and Ned's business partner.
Kristin Chenoweth as Olive Snook, the Pie Hole waitress who is obsessed and hopelessly in love with Ned.
Ellen Greene as Vivian Charles, Chuck's agoraphobic aunt.
Swoosie Kurtz as Lily Charles, Chuck's other agoraphobic birth mother, who Chuck thought was her aunt.
Jim Dale as the narrator of the series.
Field Cate as Young Ned (season 2; recurring season 1), who appears in flashbacks.
Recurring
Sy Richardson as the Coroner, the man in charge of the morgue where most of the murder victims' bodies are stored.
Sammi Hanratty as Young Chuck, who appears in flashbacks.
Stephen Root as Dwight Dixon, a mysterious man connected to both Ned's father and Chuck's father.
David Arquette as Randy Mann, a taxidermist and client of the Pie Hole who is in love with Olive.
Nicholas Khayyat as Eugene Mulchandani, Ned's childhood friend who appears in flashbacks.
Diana Scarwid as Mother Superior, in charge of the monastery where Olive spends the first episodes of season two.
Leyna Nguyen as a newscaster for Channel 9.
Christine Adams as Simone Hundin, originally a murder suspect in season one, who becomes Emerson Cod's love interest.
Jon Eric Price (season one) and George Hamilton (season two) as Ned's father
Raúl Esparza as Alfredo Aldarisio, a traveling homeopathic antidepressant salesman.
Josh Randall as Charles Charles, Chuck's father. The character was portrayed by several extras in season one.
Paul Reubens as Oscar Vibenius, a murder suspect with an incredible sense of smell.
Brad Grunberg as Lawrence and Louis Schatz, the man in charge of Chuck's funeral and his twin brother.
Alex Miller and Graham Miller as Maurice and Ralston, Ned's twin half-brothers.
Marc Raducci and Diana Costa as Olive's parents in flashbacks.
Guest
Production
Development
The series was greenlit and given a 13-episode order by ABC on May 11, 2007. On October 23, 2007, the show received a full season order. However, scripts for nine episodes were completed before the start of the 2007–2008 Writers Guild of America strike. Bryan Fuller reportedly made last-minute changes to the ninth episode to allow it to serve as a season finale, adjusting the episode to be a cliffhanger.
Because of the Writers Guild strike, the show completed just nine episodes of a 22-episode season. Instead of attempting to complete the first season, the writers planned to begin work on the second season with production resuming around March to June 2008. Although ABC picked Pushing Daisies up for the 2008–09 television season, when ratings quickly declined ABC opted not to order additional episodes beyond the second season's initial thirteen. By November 20, 2008, creator Bryan Fuller had confirmed that Pushing Daisies had been cancelled by ABC and expressed the possibility of wrapping up lingering plotlines in a comic book or movie sequel.
The last scheduled episode was broadcast in the United States on December 17, 2008, leaving three episodes unaired, although those episodes were screened at the 2009 Paley Fest. ABC was negotiating at one time to forfeit broadcast rights to the shows and make the unaired episodes available exclusively online, but announced on April 3, 2009 the final three episodes would be broadcast on ABC Saturdays at 10:00 pm beginning May 30. According to Chenoweth, these episodes do not provide a narrative conclusion to the series.
The final three episodes aired on ABC on successive Saturdays at 10:00 pm from Saturday, May 30, 2009 to June 13, 2009, having aired elsewhere around the world. In India, the last episode aired on February 27, 2009 as a world premiere. In Germany, the television network ProSieben showed the last three episodes of Pushing Daisies on March 4, 2009 ("Window Dressed to Kill") and March 11, 2009 ("Water and Power", "Kerplunk"). The three remaining unaired episodes were broadcast in the UK as ITV announced it would be showing the complete season in its run on the channel.
The original concept of Pushing Daisies was rooted from Dead Like Me. The show's creator, Bryan Fuller, intended for Pushing Daisies to be a spinoff of Dead Like Me.
Visual design
Production designer Michael Wylie told TV Guide that "My goal was a storybook come to life. I wanted everything to look almost like an illustration." He achieved this by "concentrating on conflicting patterns in different colors, particularly reds and oranges, but per director Barry Sonnenfeld, virtually no blues." Cinematographer Michael Weaver told Variety that he and the producers decided the visuals should "feel somewhere between Amélie and a Tim Burton film — something big, bright and bigger than life."
The distinctive storybook-esque style is continued within the overall design of the visual aspects. Circular background shapes, circular windows, and framing shots within circles was a theme seen consistently throughout the series. Symmetry is a common theme used in the visual style, and characters are often framed in windows, doors, or background props. A heavy use of patterns within a location was often used, where a similar pattern would be used in almost the entire location—the wallpaper, window blinds, bedsheets, pillows, furniture, and even clothing, such as Olive's apartment. The series would often use top-down perspectives and over-head shots would showcase its overall visual style. Regardless of the fact that the show focuses on murder investigations, the morgue is painted in candy-cane stripes and many outfits worn by the characters are vibrantly colored, bright, and cheery (for example, Olive's work uniforms alternate between bright orange and lime-green pinstriped dresses, and Emerson is often seen wearing shades of purple). Only Ned consistently wears black.
CGI is prominent in the series, with much use of blue screen technology (the shop window, similar set pieces and outdoor scenery outside often cast a blue halo tinge) and 3D set-extensions (streets, grass and landscape, the pie shop façade). The use of matte painting backdrops are used to complete the look.
Automobiles are often mint-condition vintage vehicles, though some newer vehicles were used (such as a mid-1990s Chevrolet Lumina APV minivan, a Hummer, or a 2006 Toyota Prius). Emerson drives a mid-1960s Lincoln Continental with suicide doors in new condition. Ned is seen driving an old, like-new Mercedes-Benz W108. Other characters drive decades-old vehicles as well. 1959 Cadillac Miller-Meteor cars in ambulance and hearse configurations figure frequently. Old-fashioned trolley cars can be seen in several shots panning in to the Pie Hole.
Quirkiness
Critics noted the Pushing Daisies distinctive visual style. A NYTimes critic describes it as a "candy-colored, computer-generated bucolic scenery" and another describes a "Technicolor world that seems to exist at right angles to our own" and note "bizarre dialogue" and the use of alliterative and near-duplicate names of both characters (such as Deedee Duffield, Billy Balsam, the Darling Mermaid Darlings, Charles Charles, Charlotte "Chuck" Charles, John Joseph Jacobs, etc.) and locations (Boutique Travel Travel Boutique, Über Life Life Insurance, Coeur d'Coeurs, etc.). Some narration is done in the poetic style of Dr. Seuss.
Music
The show contains original music composed and arranged by Jim Dooley. The first six minutes of the series pilot, "Pie-lette", were composed by Blake Neely. Dooley describes the musical score as having an Amélie type of sound (Yann Tiersen), which is a "wide-angled, adult fairy tale, with a narrator and this super-real world". It was announced on Jim Dooley's website that the soundtrack of the first season was originally to be released by Varèse Sarabande on October 21, 2008, but was delayed until December 23, 2008, with the album available in the iTunes Store on December 10, 2008. A soundtrack for the second season was released on April 5, 2011, also composed by Jim Dooley and released by Varèse Sarabande.
Both Kristin Chenoweth and Ellen Greene have backgrounds in musical theater, and have performed musical numbers in some episodes. In "Dummy", Chenoweth sings "Hopelessly Devoted to You" from the movie musical Grease. In "Pigeon", Chenoweth and Greene harmonize on the They Might Be Giants hit "Birdhouse in Your Soul". Also, in "Smell of Success", Greene sings "Morning Has Broken". Chenoweth asked to sing "Eternal Flame" in an episode, which Bryan Fuller agreed to accommodate. The song is sung in "Comfort Food". She performs a cover of Lionel Richie's "Hello" in "Window Dressed to Kill".
Series continuation
Comics
The show's official website included a comic book that was distributed at the 2007 San Diego Comic-Con International, with new mysteries and background information not seen on the televised episodes. The book also contained recaps of aired episodes.
When the show struggled in the ratings during its second season, Bryan Fuller said that, should ABC not pick up additional episodes, he would release comic books and maybe a movie based on the show to wrap up outstanding stories for fans. Warner Bros. gave Fuller permission to produce comic books of the series.
Fuller stated that the "third season" comic book series would be twelve issues long, with a fresh take on the zombie genre starring all of the characters from the show. It was to have been published by DC Comics' WildStorm imprint. On October 13, 2009, Entertainment Weekly reported that Bryan Fuller had turned in the script for the first comic issue, featuring recurring character Oscar Vibenius, and continued to work with the show's writers on the next three comic scripts. In January 2010, a rumor leaked that the comic series could potentially become a graphic novel instead.
On September 23, 2010, Entertainment Weekly reported the first issue of "season 3" was expected in early 2011. Further, Fuller stated that he and the show's composer Jim Dooley had talked about giving the audience a multimedia experience with a Pushing Daisies comic soundtrack, to be released officially or streamed for free online when the comic book was published. Fuller stated that Dooley had started composing musical cues, and that the cast had agreed to sing on the soundtrack, though licensing fees for the actors may have prevented such performances from being included.
In late 2010, DC Comics shut down its WildStorm imprint. On April 23, 2011, Fuller confirmed that release of the comic had been postponed by the loss of its publisher. At the same time, Fuller released the first page of the uncolored version of the comic book.
Mini-series/film
On April 1, 2011, at WonderCon in San Francisco, Bryan Fuller was quoted as saying "I am really emboldened by what Starz is doing with Torchwood and I would love to do a Pushing Daisies mini-series on Starz", Fuller said. "This would be a great way to wrap up the show properly. [We could] do six great episodes or even a Pushing Daisies movie. But I kind of like the idea of a Starz mini-series since they really embraced Torchwood."
After his success on Kickstarter for raising money for a Veronica Mars movie in March 2013, Veronica Mars creator Rob Thomas said that Bryan Fuller approached him to "talk to [me] about how this thing works" in relation to continuing Pushing Daisies. Fuller later commented that a Kickstarter campaign would be harder for Pushing Daisies due to the budget differences. He said that $12–15 million would be required.
In the wake of Roseanne Barr's dismissal from the ABC Network in May 2018, Fuller pitched a Pushing Daisies revival on Twitter to take the spot left by the now-canceled Roseanne on its schedule.
Broadway musical
On July 16, 2012, when asked about a potential stage adaptation of the show by TVLine's Michael Ausiello, Fuller responded "Perhaps!" and continued with "I can't really say until it's confirmed, but perhaps. We're working on something that is definitely a 'Pushing Daisies' revival, and the idea would be to have as many cast [members] as we can to participate in it." In February 2014, Fuller revealed he had discussions with Warner Bros. studios and director Barry Sonnenfeld about reviving the series as either a film or a Broadway musical starring Kristin Chenoweth.
Reception
Critical response
Both seasons of Pushing Daisies received critical acclaim. On the review aggregation website Rotten Tomatoes, the overall series holds a 96% rating. The first season received a rating of 92% based on 25 reviews with an average rating of 8.4 out of 10. The site's critical consensus reads, "A gloriously strange fairy tale, Pushing Daisies oddball charms are brought to life with warmth and whimsy in large part thanks to the chemistry of its charismatic leads." Meanwhile, the second season received a rating of 100% based on 21 reviews with an average rating of 7.9 out of 10. The site's critical consensus reads, "Pushing Daisies tawdry quirks continue to bloom in a deliciously inventive second season that rises to the high bar set by its predecessor." On Metacritic, which uses a weighted average, the overall series received a score of 85 out of 100. The first season garnered a score of 86 out of 100, based on 30 reviews, indicating "universal acclaim". Meanwhile, the second season garnered a score of 83 out of 100, based on 14 reviews, also indicating "universal acclaim".
Critics responded well to the series, comparing the style and direction to that of director Tim Burton. The pilot, before it officially aired, was well received by critics who were able to screen it. TV Guide'''s Michael Ausiello claimed that "ABC has found its next Lost!" upon review and the series has been touted as "the fall show with the most spring buzz" by many, including the trade publication Variety. New York Magazine also provided a rave review, calling it "funny, imaginative and smart" while claiming it "boasts Gilmore Girls-speed wit." Television Without Pity declared it "one of the most original, most genuinely entertaining shows on TV. It's filled with tongue-tying turns of phrase, fabulous set design and a fantastic cast." Time magazine's James Poniewozik named it one of the Top 10 New TV Series of 2007, ranking it at #5.
Awards and nominations
The show was nominated for 57 awards, and won 18 of them, including 7 Primetime Emmy Awards.
In 2008, the series received 12 Primetime Emmy Award nominations, including 2 wins. Barry Sonnenfeld won for Outstanding Directing for a Comedy Series for "Pie-lette". James Dooley won for Outstanding Music Composition for a Series for "Pigeon". Other notable nominations included Lee Pace for Outstanding Lead Actor in a Comedy Series, Kristin Chenoweth for Outstanding Supporting Actress in a Comedy Series, and Bryan Fuller for Outstanding Writing for a Comedy Series for "Pie-lette". The series also received 3 Golden Globe Award nominations for Best Television Series – Musical or Comedy, Best Performance by an Actor in a Television Series – Musical or Comedy (Lee Pace), and Best Performance by an Actress in a Television Series – Musical or Comedy (Anna Friel). Barry Sonnenfeld also won the Directors Guild of America Award for Outstanding Directing – Comedy Series for "Pie-lette".
In 2009, the series received 5 Primetime Emmy Award nominations, including 4 wins. Kristin Chenoweth won for Outstanding Supporting Actress in a Comedy Series while the series won 3 Creative Arts Emmy Awards.
U.S. ratings
The heavily promoted pilot episode ("Pie-lette") attracted 13 million viewers in the United States. It was the most-watched new series and 14th in overall viewership for the week.
Home media
SyndicationPushing Daisies premiered in syndication on Chiller on March 5, 2013. In 2015, Pushing Daisies was added to The CW's streaming service CW Seed. The CW is partly owned by Warner Bros. who owns the distribution rights. Pushing Daisies'' became available to stream on HBO Max in January 2021.
References
External links
2007 American television series debuts
2009 American television series endings
2000s American black comedy television series
2000s American comedy-drama television series
2000s American mystery television series
2000s American romantic comedy television series
2000s American workplace comedy television series
2000s American workplace drama television series
American Broadcasting Company original programming
American fantasy comedy television series
Emmy Award-winning programs
English-language television shows
Primetime Emmy Award-winning television series
Fiction about resurrection
Magic realism television series
Romantic fantasy television series
Television series by Warner Bros. Television Studios
Television series created by Bryan Fuller
Television series set in restaurants
Television shows set in the United States
American fantasy drama television series
|
The Commissioners for the Victualling of the Navy, often called the Victualling Commissioners or Victualling Board, was the body responsible under the Navy Board for victualling ships of the British Royal Navy. It oversaw the vast operation of providing naval personnel (140,000 men in 1810) with enough food, drink and supplies to keep them fighting fit, sometimes for months at a time, in whatever part of the globe they might be stationed.
It existed from 1683 until 1832 when its function was first replaced by the Department of the Comptroller of Victualling and Transport Services until 1869 then that office was also abolished and replaced by the Victualling Department.
History
Under Elizabeth I, a General Surveyor of Victuals had been appointed in 1550 a principal officer of the Navy Board to oversee contracts for food and other provisions for the Navy. In 1550 he was listed as one of the seven members of the Board of Principal Officers and Commissioners of the Navy; he was required to 'take care always to have in store a stock of victuals to supply a thousand men at sea for one month at a fortnight's notice'. At first the Victualling Office was accommodated in the Tower of London, but it soon spread outside the precincts to the east (on to the site of the recently dissolved and demolished Abbey of St Mary Graces). The complex included storehouses, ovens, brewhouses and bakeries. (Milling took place across the river at Rotherhithe, and in 1650 a slaughterhouse was acquired in Deptford). Officials of the Victualling Board were to remain accommodated here until the nineteenth century; however, the constraints of the site (and difficult riverside access) led to the establishment of a new manufacturing facility at the Deptford site (the future Deptford Victualling Yard) in 1672.
By the mid-seventeenth century the established arrangement was for a single contractor to be engaged to make all necessary victualling provisions, with the Navy Board laying down strict criteria on the quality of the provisions it required. In the 1660s, Samuel Pepys, who was then Clerk of the Acts of the Navy, reformed the system of having a Purser assigned to each ship to oversee the distribution of supplies, and obliged each one to lodge a cash surety, and to keep complete accounts of every item issued. By the time of the Anglo-Dutch Wars, however, the system was breaking down (the government complaining that sufficient provisions had not been delivered, and the contractor complaining that payment had not been made). As a result of this, a salaried Board of Commissioners was established in 1683, and this body retained oversight of victualling for the next 150 years.
Though nominally under the direction of the Navy Board (which had its headquarters nearby on Tower Hill), the Victualling Board was effectively independent. The Victualling Board took over certain functions, including medical services, from the Transport Board on its dissolution in 1817. The Victualling Board itself was abolished in the Admiralty reforms of 1832, victualling then became the responsibility of the Comptroller of Victualling and Transports, who was superintended by the Fourth Sea Lord. In 1862 transport duties passed to a separate Transport Department and in 1869 the office of Comptroller of Victualling was abolished. His former duties were divided between the newly formed Contract and Purchase Department, under the Parliamentary and Financial Secretary, which became responsible for purchasing, management of the victualling stores facilities were under the control of the Superintendent of Victualling and the Victualling Department under the control of the Director of Victualling.
Further activities
By 1739 the various Victualling Office facilities cost the state £16,241 to maintain, in addition to expenses for the purchase of victuals. In 1747, during the War of the Austrian Succession, this had risen to £30,393. In due course facilities were consolidated into Victualling Yards each with several processes and related storehouses accommodated on a single site. The Yards had deep-water wharves and were accessible (wind and weather permitting) from the major anchorages used by the Fleet. Under normal circumstances, ships due to set sail were expected to come to the nearest Yard to be loaded up with provisions. These would include preserved foodstuffs designed to last weeks or even months: ship's biscuit, salted beef, salted pork, pease, oatmeal, butter, cheese and beer. Most of these items were transported and stored in casks, which were themselves manufactured by the Board in large numbers at its on-site cooperages. In addition, the Victualling Yards provided fresh meat, bread and other items to ships stationed in port.
There was ongoing awareness of the need to stamp out corruption and improve quality. (In 1658 the crew of HMS Maidstone had demolished the Victualling Office at Rochester in protest at the foul quality of the food. Their captain Thomas Penrose refused to name any of the culprits.) The reason so much of the manufacturing process took place in-house was to guarantee a level of quality. It was far easier to gauge the quality of raw materials than it would have been to evaluate finished product bought in from other providers (some of whom were not so scrupulous). Therefore, the Commissioners oversaw not only supply, but manufacture: of beer from hops, of flour from grain, of meat from livestock.
Though by no means perfect the system generally improved; if the food was of poor quality, at least there was plenty of it. Modern research has shown that the sailor's diet during the mid-eighteenth century contained nearly twice as many calories per day than was available to men on shore or in the British Army. The single largest contributor of calories was beer, of which the Victualling Board purchased sufficient quantity that each sailor could consume a ration of one gallon per day. Food - principally bread, pork, beef, peas and oatmeal - was provided by the Board as stores for up to six months at a time. By the late 1750s this diet was supplemented with portable soup. The quality of food was also slowly improved; by the period of the Napoleonic Wars only about 1% of supplies were actually condemned as unfit to eat.
The Victualling Yards
Before 1815
By the early eighteenth century, Victualling Yards of various sizes had been established alongside several Royal Naval Dockyards in Britain, including Portsmouth, Plymouth, Deptford and Harwich (though the latter was closed, along with Harwich Dockyard, in 1713). There was also a Victualling Yard at Dover (which had no Dockyard, but was used to service ships in the nearby anchorage the Downs); the Maison Dieu served as Dover's victualling store from 1544 until 1831, when the Yard closed.
HM Victualling Yard, Deptford was the largest and busiest of the Victualling Yards (being advantageously close to the food wharves and markets of London). The other Naval Dockyards in the Thames area (Chatham, Sheerness and Woolwich) were all dependent on Deptford for victualling. (The Commissioners did maintain a small Yard at Chatham but little or no manufacturing took place here, it was more a storage depot). Deptford also directly supplied a
Victualling Yard at Gibraltar (established in the eighteenth century).
In the first decade of the nineteenth century, the Commissioners established new minor Yards at Sheerness and at Deal (which, like Dover, provided for ships anchored in the Downs). In the following decade, a complex of naval and victualling storehouses was built on Haulbowline Island in Cork Harbour, Ireland (successor to an earlier depot at Kinsale). It was known as the Royal Alexandra Victualling Yard before being handed over to the Irish government in 1923.
Overseas victualling was, where possible, arranged through contracts with local suppliers. In some places these were overseen by a resident Agent appointed by the Victualling Commissioners (though in more out-of-the-way locations ships' captains were expected to make their own arrangements). In the 17th century there were Agent Victuallers in Leghorn and Tangiers, as well as at a range of ports at home; by 1810 they were in such diverse locations as Malta, Rio de Janeiro, the Cape and Heligoland. For maximum flexibility, any necessary buildings were for the most part rented, rather than purpose-built; (although, in the 18th century, Yards were established on Jamaica and Antigua, these did not prove durable). On Gibraltar, however, a Victualling Yard was built in 1799 (following the loss of a rented property), and remained in operation until the 1980s.
1815-1900
The Victualling Yards in Britain had for the most part developed haphazardly over time. In 1822, however, the Victualling Board decided to rationalise its Plymouth operation in a new, centralised site at Stonehouse which was named the Royal William Victualling Yard. It consisted of a central Grand Storehouse, flanked by two sizeable manufactories alongside the waterfront: a mill/bakery on one side, a brewery on the other (providing biscuits and beer respectively). The other buildings on site include cooperages (for manufacturing barrels), officers' residences and an elegant Slaughterhouse (for provision of salted beef), all in matching limestone and arranged on a symmetrical grid layout.
A similar approach was taken with regard to Portsmouth: there, the new Royal Clarence Victualling Yard was begun in 1827 (on a site in Gosport known as the Weevil yard, where the Commissioners already owned a brewery and cooperage established in the early eighteenth century). Here the layout was less regimented, as the old cooperage was incorporated into the new complex; but it still presented an impressive frontage to the dockside (the symmetry of which has recently been restored through the rebuilding of a wing to the Granary, which had been demolished after the war). Royal Clarence was one of the first large industrial food processing plants in the country. Here, as at Royal William, many key buildings have survived in situ (though for the most part their function changed over decades of use): in addition to the 18th-century cooperage yard with its pump house, there is the monumental granary and bakery complex, a detached slaughterhouse, remains of the brewery storehouse (which also dates from the 18th century), a self-contained workshop complex, and officers' houses flanking the gateway arch. There is also an unusual building designed for storing and maintaining up to 3,000 cast iron ships' water tanks; a nearby reservoir (which also powered hydraulic machinery in the yard) was used to replenish HM Ships with fresh water.
Both the 'William' and the 'Clarence' yards were named after the future King William IV, who had taken an active interest in developments. Each was designed to maximize efficient storage, manufacture and seafront delivery of provisions, whilst also presenting a strikingly monumental symmetrical frontage to the sea. The Royal William Yard, in particular, has been described as "a unique concept in English industrial history: as a planned state manufacturing complex, on such a lavish scale, it is without comparison".
Deptford's Yard was not comprehensively rebuilt in this way, but it did continue to grow, even after the adjacent Dockyard had closed. (At its greatest extent, the site covered 35 acres.) During the 19th century, Deptford in particular began to stock or manufacture more specialised foodstuffs, in addition to the more traditional fare: there were cocoa, pepper and mustard mills on the site, along with storehouses for tea, sugar, rice, raisins and wine, as well as tobacco. In 1858, Deptford was renamed the Royal Victoria Victualling Yard.
Overseas, Yards and Storehouses continued to be established at different times when or where circumstances required; for example, at Georgetown on the remote settlement of Ascension Island a victualling storehouse was in place by 1827, later to be joined by a bakery (a rare instance of manufacturing in an overseas Yard) and a set of tanks for collecting and storing fresh water. In 1845, a Victualling Yard was built at Malta Dockyard; the Malta Maritime Museum is housed in one of its former buildings (the mill/bakery - of a monumental character similar to that of the Royal William Yard in Plymouth). At around the same time, work was beginning on the dockyard complex in Bermuda. Here, a spacious victualling yard was laid out between the dockyard proper and the fortified ordnance yard; still standing today, it consists of two long storehouses facing each other across an open quadrangle, the other two sides being formed by a cooperage and a row of officers' houses. The yard was eventually completed in around 1860.
1900-present
New Victualling Yards were still being established in the early 20th century, both at home (e.g. the Royal Elizabeth Yard, Dalmeny: a minor yard built to serve the new Dockyard at Rosyth) and abroad (e.g. the Royal Edward Yard, Darling Island, Sydney Harbour, Australia: built by the Government of New South Wales). Indeed, provisioning methods remained substantially unchanged until more widespread use of tinned foods, and then refrigeration, were adopted later in the century. At Gosport, the cooperage remained operational until 1970, when its work ceased along with the rum ration.
Deptford's Royal Victoria yard remained open until 1961, after which a housing estate was built on the site (though some buildings/features were retained and converted for community use). The South Coast yards - the Royal Clarence and the Royal William - both closed in 1992; since then, both sites have been sold to the private sector and their buildings (most of which are listed) have been converted to residential, office and leisure uses.
Administration and structure of the Board
On the Board, each Commissioner had responsibility for a key area of victualling activity: the Brewhouse department,, the Cutting House department, the Dry Goods department, Cooperage, Hoytaking and Stores. There were seven Commissioners; the aforementioned six, plus the Chairman (who had direct oversight of the Cash department). The Victualling Board proceeded to build breweries, slaughterhouses, mills and bakeries near to the Royal Navy Dockyards to provide beer, salted meat, ship's biscuits and other supplies under its own quality control. In 1725, the Victualling Commissioners, the Navy Board, the Sick and Hurt Commissioners and the Navy Pay Office all of which were components of the Navy Office moved into new accommodation in Somerset House.
Principal Officers and Commissioners of the Victualling Board
Included:
Comptroller of Victualling and Chairman of the Victualling Board
1803-1808 Captain. John Marsh
1808-1821 Captain, Thomas Welsh
1821-1822 Captain, John Clarke Searle
1822-1832 Hon. Granville Anson Chetwynd Stapylton
Deputy Chairman of the Victualling Board
1803-1822, Captain, George Philips Towry
1822-1823, Captain, Hon. Courtenay Boyle
1823-1832, John Wolley
Additional Comptrollers of the Victualling Board
Comptroller of the Brew House
Comptroller of the Cutting House
Comptroller of Dry Goods
Comptroller of Copperage
Comptroller of Hoytaking
Comptroller of Victualling Stores
Victualling Commissioners
Included:
1683-1690. Nicholas Fenn
1683—1690. Sir Richard Haddock
1683-1690. John Parsons
1683-1690. Anthony Sturt
1690-1693. James How
1690-1699. John Agar
1690-1699 Humphrey Ayles
1690-1702. Thomas Papillon
1690-1702 Simon Mayne
1693-1695. Israel Fielding
1695-1702 John Burrington
1699-1711 Thomas Colby
1699-1711. Henry Vincent
1702 Sir JJohn Houblon Kt.
1702 William Carpenter
1702-1703 William Wright
1702-1704 John James
1702-1706 Abraham Tilghman
1703-1705 Thomas Jennings
1704-1706 Samuel Hunter
1704-1706 Henry Lee
1704-1714 Kenrick Edisbury
1705-1711 Thomas Harlow
1706-1711 Denzil Onslow
1706-1711 Thomas Reynolds
1706-1725 Thomas Bere
1711-1714 Henry Lee
1711-1714 Sir Francis Marsham 3rd Bart
1711-1718 Henry Vincent
1711-1721 Samuel Hunter
1712-1714 William Stephens
1714-1717 Waller Bacon
1714-1719 Robert Arris
1714-1721 Denzil Onslow
1714-1721 Thomas Reynolds
1714-1723 Peter Jeyes
1717-1720 Owen Buckingham
1718-1720 Edward Eliot
1719-1728 William Passenger
1720-1721 Joshua Churchill
1720-1727 Henry Cartwright
1721-1722 Hugh Cholmley
1721-1727 Sir George Saunders Kt.
1721-1734 William Fisher
1722-1727 Stephen Bisse
1725-1729 George Huxley
1725-1733 Edward Trelawny
1727-1728 Sprig Manesty
1727-1739 Henry Parsons
1728-1734 John Berkeley
1728-1747 Thomas Revell
1729-1744 William Thompson
1729-1747 Thomas Brereton
1733-1738 George Crowle
1734-1742 Francis Eyles (later Eyles Stiles)
1734-1746 Stephen Bisse
1738-1748 William Hay
1741-1744 Thomas Trefusis
1742 -1752 Richard Hall
1742-1755 Thomas Cooper
1744-1748 William Davies
1745-1746 Arthur Stert
1746-1747 John Russell
1746-1778 James Wallace
1747-1760 William Jenkins
1747-1761 Francis Vernon
1747-1762 Sir Francis Haskins Eyles-Stiles, 3rd Bart
1747-1765 Hon. Horatio Townshend
1748-1752 Tyrwhitt Cayley
1752 Thomas Winterbottom
1752-1780 Sir Roger Burgoyne (Bart)
1755-1776 Robert Pett
1760-1763 Robert Rule
1761-1768 Tyringham Stephens
1762-1784 Jonas Hanway
1763-1772 George Marsh
1765-1767 James Fortrey
1767-1794 Alexander Chorley
1768-1780 Thomas Colby
1772-1776 William Gordon
1776-1778 Henry Pelham
1776-1785 Joah Bates
1778-1787 James Kirke
1778-1789 John Slade
1781-1786 Montagu Burgoyne
1781-1790 William Lance
1784-1803 George Phillips Towry
1785-1799 George Cherry
1785-1811 William Boscawen
1787-1793 Samuel Marshall
1789-1790 William Bellingham
1790-1798 Joseph Hunt
1790-1805 Francis Stephens
1793-1796 Francis John Hartwell
1794-1809 Sadleir Mood
1796-1803 John Rodney
1798-1803 John Marsh
1799-1807 John Harrison
1803-1806 Rear-Admiral, Charles Cunningham
1805-1808 William Budge
1807-1822 Thomas Welsh
1808-1822 John Aubin
1808-1831 Nicholas Brown
1809-1813 Hon. Edward Richard Stewart
1811-1832 Frederick Edgcumbe
1813-1825 Robert William Hay
1817-1831 John Weir
1821-1827 Richard Creyke
1821-1832 Henry Garrett
1822-1832 Sir William Burnett Kt. (ktd. 25 May 1831)
1825-1829 Hon. William Lennox Bathurst
1827-1832 Captain, Sir James Alexander Gordon Kt.
1827-1832 Captain, John Hill
1831-1832 John Thomas Briggs
1839-1832 James Meek.
Timeline
Note: Below is a timeline of responsibility for victualling for the Royal Navy.
Navy Board, Surveyor of Marine Victuals, 1550-1679
Navy Board, Victualling Board (Board of Victualling Commissioners), 1683-1832
Board of Admiralty, Comptroller of Victualling and Transport Services, 1832-1862
Board of Admiralty, Comptroller of Victualling, 1862-1870
Board of Admiralty, Contract and Purchase Department, 1869-1964
Board of Admiralty, Superintendent of Victualling, 1870-1878
Board of Admiralty, Director of Victualling, 1878-1964
See also
Sir William Bellingham, 1st Baronet
Notes
References
Attribution
Archives. National. (1660-1975). Records of Victualling Departments. ADM Division 9. http://discovery.nationalarchives.gov.uk/details/r/C708/Records of Victualling Departments
Further reading
External links
Video footage of the last coopers working at Royal Clarence Yard in 1970
Royal Navy
Royal Navy appointments
History of the Royal Navy
1832 disestablishments
|
Sir John Rice Crowe (November 20, 1795 – January 10, 1877) was an English businessman and diplomat who spent much of his life in Norway. He was the British consul-general in Norway, residing in Christiania, from 1843.
Together with Henry Dick Woodfall, John Rice Crowe started the company Alten Copper Works in Alta around 1826. This company was later renamed the Kåfjord Copper Works.
Diplomat
After serving for six years as a British diplomat in Russia, Crowe became the deputy vice-consul in Hammerfest in 1824. Thirteen years later, in 1837, he was appointed British consul in Finnmark, with the requirement to live in Hammerfest. In 1843 he became the general consul for Norway; as such he was the highest British representative in Norway.
Family
Crowe's uncle was an admiral in the English navy. Crowe was married to a Norwegian, Malene Marie Waad (1802–1843).
His daughter Anna Cecilie Crowe (1829–1914) was married to major Norwegian industrialist Halvor Schou. His son Henry Woodfall Crowe was British consul in Helsingfors. His son Septimus Crowe (1842–1903) was British Vice Consul and acting Consul-General in Christiania, but emigrated to Mexico in the 1880s.
Honours
He became a Companion of the British Order of the Bath in 1859 for outstanding service as a diplomat for his homeland. In Norway he became a Commander of the Order of St. Olav. Crowe was knighted by Queen Victoria on 7 July 1874.
References
1795 births
1877 deaths
19th-century English businesspeople
Gáivuotna–Kåfjord
British emigrants to Norway
Knights Bachelor
Companions of the Order of the Bath
Order of Saint Olav
People from Hammerfest
|
```java
/**
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.thingsboard.server.common.msg;
import lombok.Data;
import org.thingsboard.server.common.data.id.RuleChainId;
import org.thingsboard.server.common.data.id.RuleNodeId;
import org.thingsboard.server.common.msg.gen.MsgProtos;
import java.io.Serializable;
import java.util.UUID;
@Data
public class TbMsgProcessingStackItem implements Serializable {
private final RuleChainId ruleChainId;
private final RuleNodeId ruleNodeId;
MsgProtos.TbMsgProcessingStackItemProto toProto() {
return MsgProtos.TbMsgProcessingStackItemProto.newBuilder()
.setRuleChainIdMSB(ruleChainId.getId().getMostSignificantBits())
.setRuleChainIdLSB(ruleChainId.getId().getLeastSignificantBits())
.setRuleNodeIdMSB(ruleNodeId.getId().getMostSignificantBits())
.setRuleNodeIdLSB(ruleNodeId.getId().getLeastSignificantBits())
.build();
}
static TbMsgProcessingStackItem fromProto(MsgProtos.TbMsgProcessingStackItemProto item){
return new TbMsgProcessingStackItem(
new RuleChainId(new UUID(item.getRuleChainIdMSB(), item.getRuleChainIdLSB())),
new RuleNodeId(new UUID(item.getRuleNodeIdMSB(), item.getRuleNodeIdLSB()))
);
}
}
```
|
was a Japanese samurai of the late Edo period who was a retainer of the Matsudaira clan of Aizu. He served in the Aizu administration as a karō. He fought in the Boshin War, and led the defense of Wakamatsu against the Imperial Japanese Army, together with Tanaka Tosa. When the Aizu forces were overwhelmed, Jinbo and Tanaka retreated to a nearby residence and committed seppuku.
References
Tsunabuchi Kenjo (1984). Matsudaira Katamori no subete.
Nakamura Akihiko (2006). Byakkotai.
Hoshi Ryōichi (2005). Onnatachi no Aizusensō.
Samurai
1816 births
1868 deaths
People from Aizu
Seppuku from Meiji period to present
People of the Boshin War
Karō
Aizu-Matsudaira retainers
Suicides by sharp instrument in Japan
1860s suicides
|
```java
package com.tamsiree.rxui.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.tamsiree.rxkit.RxImageTool;
import com.tamsiree.rxui.R;
import java.io.ByteArrayOutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author tamsiree
* @date 16/7/22
*/
public class RxSeatAirplane extends View {
private Paint mPaint;
private Paint mPaintOther;
private Paint mPaintMap;
private RectF rectFCabin;
RectF rectFWall;
RectF rectFWC;
private HashMap<String, RectF> mSeats
= new HashMap<>();
private HashMap<String, SeatState> mSeatSelecting
= new HashMap<>();
private HashMap<String, SeatState> mSeatSelected
= new HashMap<>();
private HashMap<String, RectF> mSeatSelectingRectF = new HashMap<>();
private Path pathFuselage;
private Path pathArrow;
private Path pathTail;
private Bitmap mBitmapCabin = null;
private Bitmap mBitmapFuselage = null;
private Bitmap mBitmapArrow = null;
private Bitmap mBitmapTail = null;
private Bitmap mBitmapSeatNormal = null;
private Bitmap mBitmapSeatSelected = null;
private Bitmap mBitmapSeatSelecting = null;
private float scaleValue = 2.0f;
private float scaleMaxValue = 3f;
private float scaleMap = 10f;
private int maxSelectStates = 10;
private float moveY = 0;
private String getSeatKeyName(int row, int column) {
return row + "#" + column;
}
public void setSeatSelected(int row, int column) {
mSeatSelected.put(getSeatKeyName(row, column), SeatState.Selected);
}
public void goCabinPosition(CabinPosition mCabinPosition) {
if (mAnimatedValue > 0) {
if (mCabinPosition == CabinPosition.Top) {
moveY = 0;
} else if (mCabinPosition == CabinPosition.Last) {
moveY = rectFCabin.height() - rectFCabin.width() * 2.5f;
} else if (mCabinPosition == CabinPosition.Middle) {
moveY = (rectFCabin.height() - rectFCabin.width() * 2.5f) / 2;
}
invalidate();
}
}
public void setEmptySelecting() {
mSeatSelecting.clear();
mSeatSelectingRectF.clear();
invalidate();
}
public void setMaxSelectStates(int count) {
maxSelectStates = count;
}
public RxSeatAirplane(Context context) {
this(context, null);
}
public RxSeatAirplane(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RxSeatAirplane(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initPaint();
}
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
Canvas c = (Canvas) msg.obj;
Bundle bundle = msg.getData();
if (bundle != null && c != null) {
float left = bundle.getFloat("left");
float top = bundle.getFloat("top");
byte[] bis = bundle.getByteArray("bitmap");
Bitmap bitmap = BitmapFactory.decodeByteArray(bis, 0, bis.length);
if (bitmap != null) {
c.drawBitmap(bitmap, left, top, mPaint);
}
}
}
};
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
if (widthSpecMode == MeasureSpec.AT_MOST
&& heightSpecMode == MeasureSpec.AT_MOST) {
setMeasuredDimension(RxImageTool.dp2px(getContext(), 150), RxImageTool.dp2px(getContext(), 200));
} else if (widthSpecMode == MeasureSpec.AT_MOST) {
setMeasuredDimension((int) (heightSpecSize * 0.75f), heightSpecSize);
} else if (heightSpecMode == MeasureSpec.AT_MOST) {
setMeasuredDimension(widthSpecSize, (int) (widthSpecSize / 0.75f));
}
}
private void initPaint() {
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.WHITE);
mPaint.setStyle(Paint.Style.FILL);
mPaintOther = new Paint();
mPaintOther.setAntiAlias(true);
mPaintOther.setColor(Color.rgb(138, 138, 138));
mPaintOther.setStyle(Paint.Style.FILL);
mPaintMap = new Paint();
mPaintMap.setAntiAlias(true);
mPaintMap.setColor(Color.rgb(138, 138, 138));
mPaintMap.setStyle(Paint.Style.FILL);
rectFCabin = new RectF();
rectFWall = new RectF();
rectFWC = new RectF();
pathFuselage = new Path();
pathFuselage.reset();
pathArrow = new Path();
pathArrow.reset();
pathTail = new Path();
pathTail.reset();
if (isInEditMode()) {
return;
}
setOnTouchListener(new MoveListerner((Activity) getContext()) {
@Override
public void moveDirection(View v, int direction, float distanceX, float distanceY) {
}
@Override
public void moveUpAndDownDistance(MotionEvent event, int distance, int distanceY) {
// System.out.println("-----moveUpAndDownDistance:" + distance + "----:" + distanceY);
if (mAnimatedValue > 0) {
if (moveY >= 0 && moveY <= rectFCabin.height() - rectFCabin.width() * 2.5f) {
moveY = moveY + distanceY;
invalidate();
}
if (moveY < 0) {
moveY = 0;
}
if (moveY > rectFCabin.height() - rectFCabin.width() * 2.5f) {
moveY = rectFCabin.height() - rectFCabin.width() * 2.5f;
}
}
}
@Override
public void moveOver() {
// System.out.println("-----moveOver:");
}
@Override
public void Touch(float x, float y) {
if (mAnimatedValue == 0) {
startAnim(false);
} else {
RectF selecting = new RectF();
for (Map.Entry<String, RectF> stringRectFEntry : mSeats.entrySet()) {
String key = (String) ((Map.Entry) stringRectFEntry).getKey();
RectF val = (RectF) ((Map.Entry) stringRectFEntry).getValue();
// x=x-moveY;
if (val.contains(x, y)) {
// System.out.println("----key" + key);
if (mSeatSelecting.containsKey(key)) {
if (mSeatSelecting.get(key) != SeatState.Selected) {
mSeatSelecting.remove(key);
mSeatSelectingRectF.remove(key);
invalidate();
}
} else {
if (mSeatSelecting.size()
>= maxSelectStates) {
Toast.makeText(getContext(),
"Choose a maximum of " + maxSelectStates,
Toast.LENGTH_SHORT).show();
return;
} else {
if (!mSeatSelected.containsKey(key)) {
mSeatSelecting.put(key,
SeatState.Selecting);
selecting.top = val.top / scaleMap
+ rectFCabin.top + rectFCabin.width() * 0.8f
+ moveY / scaleMap;
selecting.bottom = val.bottom / scaleMap
+ rectFCabin.top + rectFCabin.width() * 0.8f
+ moveY / scaleMap;
selecting.left = val.centerX() / scaleMap - val.width() / scaleMap / 2f
- val.width() / scaleMap / 2f
+ rectFCabin.left;
selecting.right = val.centerX() / scaleMap + val.width() / scaleMap / 2f
- val.width() / scaleMap / 2f
+ rectFCabin.left;
mSeatSelectingRectF.put(key, selecting);
invalidate();
}
// else
// {
// Toast.makeText(getContext(),
// "The selected",
// Toast.LENGTH_SHORT).show();
// }
}
}
}
}
}
}
});
}
public enum CabinPosition {
Top, Middle, Last
}
enum SeatType {
Left, Middle, Right
}
enum SeatState {
Normal, Selected, Selecting
}
enum CabinType {
Frist, Second, Tourist, Last
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.save();
scaleValue = scaleMaxValue * mAnimatedValue;
@SuppressLint("DrawAllocation")
Matrix matrix = new Matrix();
matrix.postScale(1 + scaleValue * 2f, 1 + scaleValue * 2f);
matrix.postTranslate(getMeasuredWidth() * -1 * scaleValue,
scaleValue * 2f * (getMeasuredHeight() / 3f / 3f + getMeasuredWidth() / 8f) * -1 - moveY);
float rectFCabinWidth = getMeasuredWidth() / 8f;
rectFCabin.top = getMeasuredHeight() / 3f / 3f;
rectFCabin.left = getMeasuredWidth() / 2f - rectFCabinWidth / 2f;
rectFCabin.right = getMeasuredWidth() / 2f + rectFCabinWidth / 2f;
rectFCabin.bottom = getMeasuredHeight() / 3f / 3f + getMeasuredHeight() / 3f * 2f;
canvas.drawBitmap(getBitmapFuselage(rectFCabinWidth), matrix, mPaint);
canvas.drawBitmap(getBitmapArrow(), matrix, mPaint);
canvas.drawBitmap(getBitmapTail(), matrix, mPaint);
canvas.drawBitmap(getBitmapCabin(), matrix, mPaint);
rectFCabinWidth = getMeasuredWidth() / 8f * (1 + scaleValue * 2f);
rectFCabin.top = getMeasuredHeight() / 3f / 3f;
rectFCabin.left = getMeasuredWidth() / 2f - rectFCabinWidth / 2f;
rectFCabin.right = getMeasuredWidth() / 2f + rectFCabinWidth / 2f;
rectFCabin.bottom = getMeasuredHeight() / 3f / 3f + getMeasuredHeight() / 3f * 2f * (1 + scaleValue * 2f);
canvas.translate(0,
scaleValue * (1 - 0.1f * (scaleMaxValue - 2))
* (getMeasuredHeight() / 3f / 3f + getMeasuredWidth() / 8f) * -1 - moveY);
drawSeatFirst(canvas);
drawSeatTourist(canvas);
drawSeatLast(canvas);
drawSeatMap(canvas);
canvas.restore();
}
private void setSeat(int i, int j, Canvas canvas, float seatWH, SeatType type, CabinType cabinType) {
float top = 0f;
float left = 0f;
if (cabinType == CabinType.Frist) {
if (type == SeatType.Left) {
top = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + i * (seatWH) + seatWH / 2;
left = rectFCabin.left + j * (seatWH) + seatWH / 3;
} else if (type == SeatType.Middle) {
top = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + i * (seatWH) + seatWH / 2 + seatWH / 2;
left = rectFCabin.left + j * (seatWH) + seatWH * 1f;
} else if (type == SeatType.Right) {
top = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + i * (seatWH) + seatWH / 2;
left = rectFCabin.left + j * (seatWH) + seatWH * 2f
- seatWH / 3f;
}
} else if (cabinType == CabinType.Second) {
if (type == SeatType.Left) {
left = rectFCabin.left + j * (seatWH) + seatWH / 3;
top = rectFCabin.top + seatWH * 14f
+ rectFCabin.width() / 2 +
seatWH + i * (seatWH) + seatWH / 2;
} else if (type == SeatType.Middle) {
left = rectFCabin.left + j * (seatWH) + seatWH / 1f;
top = rectFCabin.top + rectFCabin.width() / 2
+ seatWH * 14f +
seatWH + i * (seatWH) + seatWH / 2 + seatWH / 2;
} else if (type == SeatType.Right) {
left = rectFCabin.left + j * (seatWH) + seatWH * 2f
- seatWH / 3f;
top = rectFCabin.top
+ seatWH * 14f
+ rectFCabin.width() / 2 +
seatWH + i * (seatWH) + seatWH / 2;
}
} else if (cabinType == CabinType.Tourist) {
if (type == SeatType.Left) {
left = rectFCabin.left + j * (seatWH)
+ seatWH / 3;
top = rectFWall.bottom
+ seatWH * 1.5f
+
i * (seatWH);
} else if (type == SeatType.Middle) {
left = rectFCabin.left + j * (seatWH)
+ seatWH * 1f
;
top = rectFWall.bottom
+ seatWH * 1.5f
+
i * (seatWH);
} else if (type == SeatType.Right) {
left = rectFCabin.left + j * (seatWH)
+ seatWH * 2.0f -
seatWH / 3f
;
top = rectFWall.bottom
+ seatWH * 1.5f
+
i * (seatWH);
}
} else if (cabinType == CabinType.Last) {
if (type == SeatType.Left) {
left = rectFCabin.left + j * (seatWH)
+ seatWH / 3
;
top = rectFWC.bottom
+ seatWH * 1.5f
+
i * (seatWH);
} else if (type == SeatType.Middle) {
left = rectFCabin.left + j * (seatWH)
+ seatWH * 1f
;
top = rectFWC.bottom
+ seatWH * 1.5f
+
i * (seatWH);
} else if (type == SeatType.Right) {
left = rectFCabin.left + j * (seatWH)
+ seatWH * 2.0f -
seatWH / 3f
;
top = rectFWC.bottom
+ seatWH * 1.5f
+
i * (seatWH);
}
}
RectF sRectF = new RectF(left, top,
left + seatWH, top + seatWH);
PointSeat point = null;
if (cabinType == CabinType.Frist) {
point = new PointSeat(i, j);
} else if (cabinType == CabinType.Second) {
point = new PointSeat(i + 7, j);
} else if (cabinType == CabinType.Tourist) {
point = new PointSeat(i + 10, j);
} else if (cabinType == CabinType.Last) {
point = new PointSeat(i + 35, j);
}
if (mAnimatedValue == 1) {
if (cabinType == CabinType.Frist) {
if (type == SeatType.Left || type == SeatType.Right) {
sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.51f) - moveY;
sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.51f) - moveY;
}
if (type == SeatType.Middle) {
sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.8f) - seatWH / 2f - moveY;
sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.8f) - seatWH / 2f - moveY;
}
} else if (cabinType == CabinType.Second) {
if (type == SeatType.Left || type == SeatType.Right) {
sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.25f) - moveY;
sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.25f) - moveY;
}
if (type == SeatType.Middle) {
sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.75f) - seatWH / 2f - moveY;
sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2
- seatWH * (scaleMaxValue - 1.75f) - seatWH / 2f - moveY;
}
// sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2 - seatWH * (scaleMaxValue - 1) - moveY;
// sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2 - seatWH * (scaleMaxValue - 1) - moveY;
} else if (cabinType == CabinType.Tourist) {
sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2 - seatWH * (scaleMaxValue - 1) - moveY;
sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2 - seatWH * (scaleMaxValue - 1) - moveY;
} else if (cabinType == CabinType.Last) {
sRectF.top = sRectF.top - rectFCabin.top - rectFCabin.width() / 2 - seatWH * (scaleMaxValue - 1) - moveY;
sRectF.bottom = sRectF.bottom - rectFCabin.top - rectFCabin.width() / 2 - seatWH * (scaleMaxValue - 1) - moveY;
}
if (sRectF.top > 0 && sRectF.bottom < getMeasuredHeight()) {
mSeats.put(getSeatKeyName(Objects.requireNonNull(point).row, point.column), sRectF);
}
}
if (mSeatSelected.containsKey(getSeatKeyName(Objects.requireNonNull(point).row, point.column))) {
canvas.drawBitmap(Objects.requireNonNull(getSeat(seatWH, mSeatSelected.get(getSeatKeyName(point.row, point.column))))
, left
,
top
,
mPaint
);
} else if (mSeatSelecting.containsKey(getSeatKeyName(point.row, point.column))) {
// System.out.println("-----" + point.row + "--" + point.column);
canvas.drawBitmap(Objects.requireNonNull(getSeat(seatWH, mSeatSelecting.get(getSeatKeyName(point.row, point.column))))
, left
,
top
,
mPaint
);
if (mAnimatedValue == 1) {
if (mSeatSelecting.get(getSeatKeyName(point.row, point.column)) == SeatState.Selecting) {
String text = (point.row + 1) + "," + (point.column + 1);
mPaintOther.setColor(Color.WHITE);
mPaintOther.setTextSize(seatWH / 4f);
canvas.drawText(
text, left + seatWH / 2f - getFontlength(mPaintOther, text) / 2,
top + seatWH / 2f + getFontHeight(mPaintOther, text) / 3,
mPaintOther
);
mPaintOther.setColor(Color.rgb(138, 138, 138));
}
}
} else {
if (isInEditMode()) {
return;
}
canvas.drawBitmap(Objects.requireNonNull(getSeat(seatWH, SeatState.Normal)), left, top, mPaint);
}
}
private void drawSeatMap(Canvas canvas) {
if (mAnimatedValue == 1) {
float mapW = rectFCabin.width() / scaleMap;
float mapH = (rectFCabin.height() - rectFCabin.width() * 2.5f) / scaleMap
+ getMeasuredHeight() / scaleMap;
RectF rectFMap = new RectF(rectFCabin.left, rectFCabin.top + rectFCabin.width() * 0.8f + moveY
, rectFCabin.left + mapW, rectFCabin.top + rectFCabin.width() * 0.8f + mapH + moveY);
mPaintMap.setColor(Color.rgb(138, 138, 138));
mPaintMap.setAlpha(80);
mPaintMap.setStyle(Paint.Style.FILL);
canvas.drawRect(rectFMap, mPaintMap);
mapH = getHeight() / scaleMap;
RectF rectFMapSee = new RectF(rectFCabin.left,
rectFCabin.top + rectFCabin.width() * 0.8f + moveY + moveY / scaleMap
, rectFCabin.left + mapW,
rectFCabin.top + rectFCabin.width() * 0.8f + mapH + moveY + moveY / scaleMap);
mPaintMap.setStyle(Paint.Style.STROKE);
mPaintMap.setStrokeWidth(RxImageTool.dp2px(getContext(), 0.75f));
mPaintMap.setColor(Color.RED);
canvas.drawRect(rectFMapSee, mPaintMap);
mPaintMap.setStrokeWidth(0);
if (mSeatSelectingRectF.size() > 0) {
mPaintMap.setStyle(Paint.Style.FILL);
mPaintMap.setColor(Color.RED);
mPaintMap.setAlpha(80);
RectF r = new RectF();
for (Map.Entry<String, RectF> stringRectFEntry : mSeatSelectingRectF.entrySet()) {
// String key = (String) ((Map.Entry) stringRectFEntry).getKey();
RectF val = (RectF) ((Map.Entry) stringRectFEntry).getValue();
r.top = val.top + moveY;
r.bottom = val.bottom + moveY;
r.left = val.left - RxImageTool.dp2px(getContext(), 0.5f);
r.right = val.right - RxImageTool.dp2px(getContext(), 0.5f);
canvas.drawRect(r, mPaintMap);
}
}
}
}
private void drawSeatFirst(Canvas canvas) {
int row = 7;
int column = 7;
mSeats.clear();
float seatWH = rectFCabin.width() / 9.0f;
for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
if (j < 2) {
setSeat(i, j, canvas, seatWH, SeatType.Left, CabinType.Frist);
// setBitmap
} else if (j < 5 && i < row - 1) {
setSeat(i, j, canvas, seatWH, SeatType.Middle, CabinType.Frist);
} else if (j >= 5) {
setSeat(i, j, canvas, seatWH, SeatType.Right, CabinType.Frist);
}
}
}
// RectF rectFWC = new RectF();
rectFWC.top = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + (row + 2.5f) * (seatWH) + seatWH / 2;
rectFWC.bottom = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + (row + 4.5f) * (seatWH) + seatWH / 2;
rectFWC.left = rectFCabin.left + seatWH / 3;
rectFWC.right = rectFCabin.left + seatWH / 3 + seatWH * 2
;
mPaintOther.setStyle(Paint.Style.STROKE);
canvas.drawRect(rectFWC, mPaintOther);
drawWcText(rectFWC, canvas);
RectF rectFWifi = new RectF();
rectFWifi.top = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + (row + 1f) * (seatWH) + seatWH / 2;
rectFWifi.bottom = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + (row + 4.5f) * (seatWH) + seatWH / 2;
rectFWifi.left = rectFWC.right + seatWH / 2f;
rectFWifi.right = rectFCabin.left + column * (seatWH) + seatWH * 2f
- seatWH / 3f - seatWH * 2 - seatWH / 2f;
canvas.drawRect(rectFWifi, mPaintOther);
drawWifiLogo(rectFWifi, canvas);
rectFWC.top = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + (row + 2.5f) * (seatWH) + seatWH / 2;
rectFWC.bottom = rectFCabin.top + rectFCabin.width() / 2 +
seatWH + (row + 4.5f) * (seatWH) + seatWH / 2;
rectFWC.right = rectFCabin.left + column * (seatWH) + seatWH * 2f
- seatWH / 3f;
rectFWC.left = rectFCabin.left + column * (seatWH) + seatWH * 2f
- seatWH / 3f - seatWH * 2
;
mPaintOther.setStyle(Paint.Style.STROKE);
canvas.drawRect(rectFWC, mPaintOther);
drawWcText(rectFWC, canvas);
drawSeatSecond(canvas, seatWH);
}
private void drawSeatSecond(Canvas canvas, float seatWH) {
int row = 3;
int column = 8;
float seatWH2 = rectFCabin.width() / 10.0f;
for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
if (j < 2) {
setSeat(i, j, canvas, seatWH2, SeatType.Left, CabinType.Second);
} else if (j < 6) {
setSeat(i, j, canvas, seatWH2, SeatType.Middle, CabinType.Second);
} else {
setSeat(i, j, canvas, seatWH2, SeatType.Right, CabinType.Second);
}
}
}
mPaintOther.setStyle(Paint.Style.FILL);
rectFWall.top = rectFCabin.top
+ seatWH * 13
+ rectFCabin.width() / 2 +
seatWH + (row + 1) * (seatWH2) + seatWH2 / 2;
rectFWall.left = rectFCabin.left + seatWH2 / 3;
rectFWall.right = rectFCabin.left + seatWH2 / 3
+ 2.5f * seatWH2;
rectFWall.bottom = rectFCabin.top
+ seatWH * 13
+ rectFCabin.width() / 2 +
seatWH + (row + 1) * (seatWH2) + seatWH2 / 2
+ (RxImageTool.dp2px(getContext(), 2) * mAnimatedValue < 1 ? 1 : (int) (RxImageTool.dp2px(getContext(), 2) * mAnimatedValue));
canvas.drawRoundRect(rectFWall, RxImageTool.dp2px(getContext(), 1), RxImageTool.dp2px(getContext(), 1), mPaintOther);
rectFWall.top = rectFCabin.top
+ seatWH * 13
+ rectFCabin.width() / 2 +
seatWH + (row + 1) * (seatWH2) + seatWH2 / 2;
rectFWall.left = rectFCabin.left + column * (seatWH2) + seatWH2 * 2f
- seatWH / 3f - 2.5f * seatWH2;
rectFWall.right = rectFCabin.left + column * (seatWH2) + seatWH2 * 2f
- seatWH / 3f;
rectFWall.bottom = rectFCabin.top
+ seatWH * 13
+ rectFCabin.width() / 2 +
seatWH + (row + 1) * (seatWH2) + seatWH2 / 2
+ (RxImageTool.dp2px(getContext(), 2) * mAnimatedValue < 1 ? 1 : (int) (RxImageTool.dp2px(getContext(), 2) * mAnimatedValue));
canvas.drawRoundRect(rectFWall, RxImageTool.dp2px(getContext(), 1), RxImageTool.dp2px(getContext(), 1), mPaintOther);
}
private void drawSeatTourist(Canvas canvas) {
int row = 25;
int column = 10;
int seatWH = (int) (rectFCabin.width() / 12);
for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
if (j < 3) {
setSeat(i, j, canvas, seatWH, SeatType.Left, CabinType.Tourist);
} else if (j < 7) {
setSeat(i, j, canvas, seatWH, SeatType.Middle, CabinType.Tourist);
} else {
setSeat(i, j, canvas, seatWH, SeatType.Right, CabinType.Tourist);
}
}
}
rectFWC.top = rectFWall.bottom
+ seatWH * 1.5f
+
26 * (seatWH);
rectFWC.bottom = rectFWC.top + seatWH * 3;
rectFWC.left = rectFCabin.left + seatWH / 3f;
rectFWC.right = rectFCabin.left + seatWH / 3f + seatWH * 3;
mPaintOther.setStyle(Paint.Style.STROKE);
canvas.drawRect(rectFWC, mPaintOther);
drawWcText(rectFWC, canvas);
RectF rectFWifi = new RectF();
rectFWifi.top = rectFWall.bottom
+ seatWH * 1.5f
+
26 * (seatWH);
rectFWifi.bottom = rectFWifi.top + seatWH * 3;
rectFWifi.left = rectFWC.right + seatWH / 2f;
rectFWifi.right = rectFCabin.left + column * (seatWH) + seatWH * 2f
- seatWH / 3f - seatWH * 3 - seatWH / 2f
;
canvas.drawRect(rectFWifi, mPaintOther);
drawWifiLogo(rectFWifi, canvas);
rectFWC.top = rectFWall.bottom
+ seatWH * 1.5f
+
26 * (seatWH);
rectFWC.bottom = rectFWC.top + seatWH * 3;
rectFWC.left = rectFCabin.left + column * (seatWH) + seatWH * 2f
- seatWH / 3f - seatWH * 3;
rectFWC.right = rectFCabin.left + column * (seatWH) + seatWH * 2f
- seatWH / 3f;
mPaintOther.setStyle(Paint.Style.STROKE);
canvas.drawRect(rectFWC, mPaintOther);
drawWcText(rectFWC, canvas);
}
private void drawSeatLast(Canvas canvas) {
int row = 19;
int column = 10;
int seatWH = (int) (rectFCabin.width() / 12);
for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
if (j < 3) {
setSeat(i, j, canvas, seatWH, SeatType.Left, CabinType.Last);
} else if (j < 7) {
setSeat(i, j, canvas, seatWH, SeatType.Middle, CabinType.Last);
} else {
setSeat(i, j, canvas, seatWH, SeatType.Right, CabinType.Last);
}
}
}
}
private Bitmap getSeat(float width, SeatState type) {
if (type == SeatState.Normal) {
if (mBitmapSeatNormal == null) {
mBitmapSeatNormal = setBitmapSize(R.drawable.seat_gray, width);
} else if (Math.abs(mBitmapSeatNormal.getWidth() - width) > 1) {
mBitmapSeatNormal = setBitmapSize(R.drawable.seat_gray, width);
}
return mBitmapSeatNormal;
}
if (type == SeatState.Selected) {
if (mBitmapSeatSelected == null) {
mBitmapSeatSelected = setBitmapSize(R.drawable.seat_sold, width);
} else if (Math.abs(mBitmapSeatSelected.getWidth() - width) > 1) {
mBitmapSeatSelected = setBitmapSize(R.drawable.seat_sold, width);
}
return mBitmapSeatSelected;
}
if (type == SeatState.Selecting) {
if (mBitmapSeatSelecting == null) {
mBitmapSeatSelecting = setBitmapSize(R.drawable.seat_green, width);
} else if (Math.abs(mBitmapSeatSelecting.getWidth() - width) > 1) {
mBitmapSeatSelecting = setBitmapSize(R.drawable.seat_green, width);
}
return mBitmapSeatSelecting;
}
return null;
}
private Bitmap setBitmapSize(int iconId, float w) {
Bitmap bitmap = BitmapFactory.decodeResource(getContext().getResources(), iconId);
if (bitmap == null) {
return null;
}
float s = w * 1.0f / bitmap.getWidth();
bitmap = Bitmap.createScaledBitmap(bitmap, (int) (bitmap.getWidth() * s),
(int) (bitmap.getHeight() * s), true);
return bitmap;
}
public Bitmap getBitmapFuselage(float rectFCabinWidth) {
Canvas canvas;
int w = getMeasuredWidth();
int h = getMeasuredHeight();
if (mBitmapFuselage == null) {
mBitmapFuselage = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
canvas = new Canvas(mBitmapFuselage);
pathFuselage.moveTo(w / 2f - rectFCabinWidth / 2f - RxImageTool.dp2px(getContext(), 2),
rectFCabin.top + rectFCabinWidth / 2f);
pathFuselage.cubicTo(
w / 2f - rectFCabinWidth / 4f,
rectFCabin.top - rectFCabinWidth * 1.2f,
w / 2f + rectFCabinWidth / 4f,
rectFCabin.top - rectFCabinWidth * 1.2f,
w / 2f + rectFCabinWidth / 2f + RxImageTool.dp2px(getContext(), 2),
rectFCabin.top + rectFCabinWidth / 2f
);
rectFCabin.top = rectFCabin.top + RxImageTool.dp2px(getContext(), 10);//
pathFuselage.lineTo(w / 2f + rectFCabinWidth / 2f + RxImageTool.dp2px(getContext(), 2)
, rectFCabin.top + rectFCabin.height() / 3f);
pathFuselage.lineTo(w
, rectFCabin.top + rectFCabin.height() * 0.55f);
pathFuselage.lineTo(w
, rectFCabin.top + rectFCabin.height() * 0.55f + rectFCabin.width() * 0.8f);
pathFuselage.lineTo(rectFCabin.right + rectFCabin.width() / 2 * 1.5f
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathFuselage.lineTo(w / 2f + rectFCabinWidth / 2f + RxImageTool.dp2px(getContext(), 2)
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
//
pathFuselage.lineTo(w / 2f + rectFCabinWidth / 2f + RxImageTool.dp2px(getContext(), 2)
, rectFCabin.bottom - rectFCabinWidth / 2f);
pathFuselage.cubicTo(
w / 2f + rectFCabinWidth / 4f,
rectFCabin.bottom + rectFCabinWidth * 2.5f,
w / 2f - rectFCabinWidth / 4f,
rectFCabin.bottom + rectFCabinWidth * 2.5f,
w / 2f - rectFCabinWidth / 2f - RxImageTool.dp2px(getContext(), 2)
, rectFCabin.bottom - rectFCabinWidth / 2f
);
pathFuselage.lineTo(w / 2f - rectFCabinWidth / 2f - RxImageTool.dp2px(getContext(), 2)
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathFuselage.lineTo(rectFCabin.left - rectFCabin.width() / 2 * 1.5f
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathFuselage.lineTo(0
, rectFCabin.top + rectFCabin.height() * 0.55f + rectFCabin.width() * 0.8f);
pathFuselage.lineTo(0
, rectFCabin.top + rectFCabin.height() * 0.55f);
pathFuselage.lineTo(w / 2f - rectFCabinWidth / 2f - RxImageTool.dp2px(getContext(), 2)
, rectFCabin.top + rectFCabin.height() / 3f);
pathFuselage.close();
mPaint.setColor(Color.WHITE);
mPaint.setAlpha(150);
canvas.drawPath(pathFuselage, mPaint);
}
return mBitmapFuselage;
}
private Bitmap getBitmapCabin() {
Canvas canvas;
if (mBitmapCabin == null) {
mBitmapCabin = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(), Bitmap.Config.ARGB_8888);
canvas = new Canvas(mBitmapCabin);
mPaint.setColor(Color.WHITE);
rectFCabin.top = rectFCabin.top - RxImageTool.dp2px(getContext(), 10);
rectFCabin.bottom = rectFCabin.bottom + RxImageTool.dp2px(getContext(), 5);
canvas.drawRoundRect(rectFCabin, getMeasuredWidth() / 8f / 2f, getMeasuredWidth() / 8f / 2f, mPaint);
}
return mBitmapCabin;
}
public Bitmap getBitmapArrow() {
Canvas canvas;
if (mBitmapArrow == null) {
mBitmapArrow = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(), Bitmap.Config.ARGB_8888);
canvas = new Canvas(mBitmapArrow);
pathArrow.reset();
pathArrow.moveTo(rectFCabin.right + rectFCabin.width() / 2 * 1.2f
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathArrow.quadTo(
rectFCabin.right + rectFCabin.width() / 2 * 1.3f,
rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 5f,
rectFCabin.right + rectFCabin.width() / 2 * 1.4f
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathArrow.close();
canvas.drawPath(pathArrow, mPaint);
pathArrow.reset();
pathArrow.moveTo(rectFCabin.left - rectFCabin.width() / 2 * 1.2f
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathArrow.quadTo(
rectFCabin.left - rectFCabin.width() / 2 * 1.3f,
rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 5f,
rectFCabin.left - rectFCabin.width() / 2 * 1.4f
, rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f);
pathArrow.close();
canvas.drawPath(pathArrow, mPaint);
pathArrow.reset();
float right1x = getMeasuredWidth();
float right1y = rectFCabin.top + rectFCabin.height() * 0.55f + rectFCabin.width() * 0.8f;
float right2x = rectFCabin.right + rectFCabin.width() / 2 * 1.5f;
float right2y = rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f;
pathArrow.moveTo(
(right1x + right2x) / 2f,
(right1y + right2y) / 2f);
pathArrow.quadTo(
(right1x + right2x) / 2f + rectFCabin.width() / 2 * 0.1f,
(right1y + right2y) / 2f + rectFCabin.height() / 60f * 7f,
(right1x + right2x) / 2f + rectFCabin.width() / 2 * 0.2f,
(right1y + right2y) / 2f
);
canvas.drawPath(pathArrow, mPaint);
pathArrow.reset();
float left1x = 0;
float left1y = rectFCabin.top + rectFCabin.height() * 0.55f + rectFCabin.width() * 0.8f;
float left2x = rectFCabin.left - rectFCabin.width() / 2 * 1.5f;
float left2y = rectFCabin.top + rectFCabin.height() / 2f + rectFCabin.height() / 6f / 2f;
pathArrow.moveTo(
(left1x + left2x) / 2f,
(left1y + left2y) / 2f);
pathArrow.quadTo(
(left1x + left2x) / 2f - rectFCabin.width() / 2 * 0.1f,
(left1y + left2y) / 2f + rectFCabin.height() / 60f * 7f,
(left1x + left2x) / 2f - rectFCabin.width() / 2 * 0.2f,
(left1y + left2y) / 2f
);
mPaint.setColor(Color.WHITE);
mPaint.setAlpha(150);
canvas.drawPath(pathArrow, mPaint);
}
return mBitmapArrow;
}
public void startAnim(boolean zoomOut) {// false zoom in,true zoom out
stopAnim();
startViewAnim(0f, 1f, 280, zoomOut);
}
private ValueAnimator valueAnimator;
private float mAnimatedValue = 0f;
public void stopAnim() {
if (valueAnimator != null) {
clearAnimation();
valueAnimator.setRepeatCount(0);
valueAnimator.cancel();
valueAnimator.end();
mAnimatedValue = 0f;
postInvalidate();
}
}
private ValueAnimator startViewAnim(float startF, final float endF, long time, final boolean zoomOut) {
if (zoomOut && moveY > 0) {
moveY = 0;
invalidate();
}
valueAnimator = ValueAnimator.ofFloat(startF, endF);
valueAnimator.setDuration(time);
valueAnimator.setInterpolator(new LinearInterpolator());
valueAnimator.setRepeatCount(0);//
valueAnimator.setRepeatMode(ValueAnimator.RESTART);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mAnimatedValue = (float) valueAnimator.getAnimatedValue();
if (zoomOut) {
mAnimatedValue = 1 - mAnimatedValue;
}
invalidate();
}
});
valueAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
}
@Override
public void onAnimationRepeat(Animator animation) {
super.onAnimationRepeat(animation);
}
});
if (!valueAnimator.isRunning()) {
valueAnimator.start();
}
return valueAnimator;
}
public float getFontlength(Paint paint, String str) {
Rect rect = new Rect();
paint.getTextBounds(str, 0, str.length(), rect);
return rect.width();
}
public float getFontHeight(Paint paint, String str) {
Rect rect = new Rect();
paint.getTextBounds(str, 0, str.length(), rect);
return rect.height();
}
private Bitmap getBitmapTail() {
Canvas canvas;
if (mBitmapTail == null) {
mBitmapTail = Bitmap.createBitmap(getMeasuredWidth(), getMeasuredHeight(), Bitmap.Config.ARGB_8888);
canvas = new Canvas(mBitmapTail);
pathTail.reset();
rectFCabin.bottom = rectFCabin.bottom - RxImageTool.dp2px(getContext(), 5);
pathTail.moveTo(rectFCabin.centerX(),
rectFCabin.bottom + rectFCabin.width() / 2);
pathTail.lineTo(rectFCabin.centerX() + rectFCabin.width() * 1.5f,
rectFCabin.bottom + rectFCabin.width() * 1.5f);
pathTail.lineTo(rectFCabin.centerX() + rectFCabin.width() * 1.5f,
rectFCabin.bottom + rectFCabin.width() * 2f);
pathTail.lineTo(rectFCabin.centerX(),
rectFCabin.bottom + rectFCabin.width() * 1.5f);
pathTail.lineTo(rectFCabin.centerX() - rectFCabin.width() * 1.5f,
rectFCabin.bottom + rectFCabin.width() * 2f);
pathTail.lineTo(rectFCabin.centerX() - rectFCabin.width() * 1.5f,
rectFCabin.bottom + rectFCabin.width() * 1.5f);
pathTail.close();
canvas.drawPath(pathTail, mPaint);
pathTail.reset();
pathTail.moveTo(rectFCabin.centerX() - rectFCabin.width() / 2 * 0.1f,
rectFCabin.bottom + rectFCabin.width() * 1.5f);
pathTail.quadTo(
rectFCabin.centerX(),
rectFCabin.bottom + rectFCabin.width() * 3f,
rectFCabin.centerX() + rectFCabin.width() / 2 * 0.1f,
rectFCabin.bottom + rectFCabin.width() * 1.5f);
pathTail.close();
mPaint.setColor(Color.WHITE);
mPaint.setAlpha(150);
canvas.drawPath(pathTail, mPaint);
}
return mBitmapTail;
}
private void drawWcText(RectF rectFWC, Canvas canvas) {
mPaintOther.setTextSize(rectFWC.width() / 4);
mPaintOther.setAlpha(150);
canvas.drawText("WC",
rectFWC.centerX()
- getFontlength(mPaintOther, "WC") / 2f
,
rectFWC.centerY() + getFontHeight(mPaintOther, "WC") / 3f,
mPaintOther
);
mPaintOther.setAlpha(255);
}
private void drawWifiLogo(RectF rectFWifi, Canvas canvas) {
float signalRadius = rectFWifi.height() / 2 / 4;
RectF rect;
mPaintOther.setStrokeWidth(signalRadius / 4);
mPaintOther.setAlpha(150);
float marginTop = signalRadius * (3 + 0.5f) / 2f;
for (int i = 0; i < 4; i++) {
float radius = signalRadius * (i + 0.5f);
if (i == 0) {
radius = signalRadius / 2f;
}
rect = new RectF(
rectFWifi.centerX() - radius,
rectFWifi.centerY() - radius + marginTop,
rectFWifi.centerX() + radius,
rectFWifi.centerY() + radius + marginTop);
if (i != 0) {
mPaintOther.setStyle(Paint.Style.STROKE);
canvas.drawArc(rect, -135, 90
, false, mPaintOther);
} else {
mPaintOther.setStyle(Paint.Style.FILL);
canvas.drawArc(rect, -135, 90
, true, mPaintOther);
}
}
mPaintOther.setStrokeWidth(0);
mPaintOther.setAlpha(255);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
stopAnim();
}
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(3);
private void setBitmap(final Canvas canvas, final float seatWH, final SeatState type, final float left, final float top) {
fixedThreadPool.execute(new Runnable() {
@Override
public void run() {
// canvas.drawBitmap(getSeat(seatWH, mSeatSelected.get(getSeatKeyName(point.row, point.column)))
// , left
// ,
// top
// ,
// mPaint
// );
Bitmap b = getSeat(seatWH, type);
if (b != null) {
// canvas.drawBitmap(b,left,top,mPaint);
Message msg = mHandler.obtainMessage();
Bundle bundle = new Bundle();
bundle.putFloat("left", left);
bundle.putFloat("top", top);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
b.compress(Bitmap.CompressFormat.PNG, 100, baos);
byte[] bitmapByte = baos.toByteArray();
bundle.putByteArray("bitmap", bitmapByte);
msg.setData(bundle);
msg.obj = canvas;
mHandler.sendMessage(msg);
}
// b.recycle();
}
});
}
public static class PointSeat {
public int row;
public int column;
PointSeat(int row, int column) {
this.row = row;
this.column = column;
}
}
public abstract class MoveListerner implements OnTouchListener,
GestureDetector.OnGestureListener {
public static final int MOVE_TO_LEFT = 0;
public static final int MOVE_TO_RIGHT = MOVE_TO_LEFT + 1;
public static final int MOVE_TO_UP = MOVE_TO_RIGHT + 1;
public static final int MOVE_TO_DOWN = MOVE_TO_UP + 1;
private static final int FLING_MIN_DISTANCE = 150;
private static final int FLING_MIN_VELOCITY = 50;
private boolean isScorllStart = false;
private boolean isUpAndDown = false;
GestureDetector mGestureDetector;
float x1 = 0;
float x2 = 0;
float y1 = 0;
float y2 = 0;
public MoveListerner(Activity context) {
super();
mGestureDetector = new GestureDetector(context, this);
}
float startX = 0;
float startY = 0;
@Override
public boolean onTouch(View v, MotionEvent event) {
if (mGestureDetector.onTouchEvent(event)) {
if (MotionEvent.ACTION_DOWN == event.getAction()) {
// Touch(event.getX(), event.getY());
startX = event.getX();
startY = event.getY();
return true;
} else if (MotionEvent.ACTION_UP == event.getAction()) {
if (Math.abs(event.getX() - startX) < 5 &&
Math.abs(event.getY() - startY) < 5) {
Touch(event.getX(), event.getY());
return true;
}
}
}
//
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_UP:
endGesture();
break;
default:
break;
}
return false;
}
private void endGesture() {
isScorllStart = false;
isUpAndDown = false;
// RxLogTool.e("a", "AA:over");
moveOver();
}
public abstract void moveDirection(View v, int direction, float distanceX, float distanceY);
public abstract void moveUpAndDownDistance(MotionEvent event, int distance, int distanceY);
public abstract void moveOver();
public abstract void Touch(float x, float y);
@Override
public boolean onDown(MotionEvent e) {
// TODO Auto-generated method stub
return true;
}
@Override
public void onShowPress(MotionEvent e) {
// TODO Auto-generated method stub
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
// TODO Auto-generated method stub
return true;
}
@Override
public void onLongPress(MotionEvent e) {
// TODO Auto-generated method stub
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
float mOldY = e1.getY();
int y = (int) e2.getRawY();
if (!isScorllStart) {
if (Math.abs(distanceX) / Math.abs(distanceY) > 2) {
//
isUpAndDown = false;
isScorllStart = true;
} else if (Math.abs(distanceY) / Math.abs(distanceX) > 3) {
//
isUpAndDown = true;
isScorllStart = true;
} else {
isScorllStart = false;
}
} else {
//
if (isUpAndDown) {
//
if (mOldY + 5 < y) {
moveUpAndDownDistance(e2, -3, (int) distanceY);
} else if (mOldY + 5 > y) {
moveUpAndDownDistance(e2, 3, (int) distanceY);
}
}
}
return true;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
// RxLogTool.e("a", "AA:A" + velocityX + ":" + velocityY);
if (isUpAndDown)
return false;
if (e1.getX() - e2.getX() > FLING_MIN_DISTANCE
&& Math.abs(velocityX) > FLING_MIN_VELOCITY) {
// Fling left
moveDirection(null, MOVE_TO_LEFT, e1.getX() - e2.getX(), e1.getY() - e2.getY());
} else if (e2.getX() - e1.getX() > FLING_MIN_DISTANCE
&& Math.abs(velocityX) > FLING_MIN_VELOCITY) {
// Fling right
moveDirection(null, MOVE_TO_RIGHT, e2.getX() - e1.getX(), e2.getY() - e1.getY());
} else if (e1.getY() - e2.getY() > FLING_MIN_DISTANCE
&& Math.abs(velocityY) > FLING_MIN_VELOCITY) {
// Fling up
moveDirection(null, MOVE_TO_UP, 0, e1.getY() - e2.getY());
} else {
// Fling down
moveDirection(null, MOVE_TO_DOWN, 0, e2.getY() - e1.getY());
}
return false;
}
}
}
```
|
This is a list of sports city derbies or other rivalries in Ukraine among professional teams. Those include games where rival teams met with each other more than one season.
Association football
Premier League
Klasychne derby or National rivalry Dynamo Kyiv vs. Shakhtar Donetsk
Main Donbas rivalry Shakhtar Donetsk vs. Zorya Luhansk
Galicia – Volhynia (West Ukrainian) rivalry Karpaty Lviv vs. Volyn Lviv
Main Kyiv derby (Capital derby) Dynamo vs. Arsenal (CSKA)
Kyiv derby Dynamo vs. Obolon
Kyiv derby Arsenal vs. Obolon
Donetsk derby Shakhtar vs. Metalurh
Zaporizhzhia derby Metalurh vs. Torpedo
Lviv derby Karpaty vs. Lviv
Kharkiv derby Metalist vs. Kharkiv
Odesa derby Chornomorets vs. Odesa
Donetsk (Donbas) rivalry Shakhtar vs. Olimpik, conducted outside of Donetsk due to Russian aggression
Regional derbies
Volhynian rivalry Volyn Lutsk vs. Veres Rivne
Podillian rivalry Nyva Vn. vs. Podillia Khmelnytskyi
Carpathian rivalry Hoverla (Zakarpattia) vs. Prykarpattia Ivano-Frankivsk
Carpathian (West Ukrainian) rivalry Hoverla (Zakarpattia) vs. Karpaty Lviv
[Great] Galician derby Karpaty Lviv vs. Prykarpattia Ivano-Frankivsk
West Ukrainian derby Rukh Vynnyky vs. Prykarpattia Ivano-Frankivsk
West Ukrainian derby Volyn Lutsk vs. Prykarpattia Ivano-Frankivsk
Dnipro–Kharkiv rivalry FC Dnipro vs. Metalist Kharkiv (SC Dnipro-1 vs. Metalist 1925)
AR Crimea
Main Crimean rivalry Tavriya Simferopol vs. FC Sevastopol (Top level)
Crimean rivalry FC Sevastopol vs. Krymteplytsia Molodizhne (by Football Federation of Ukraine and Professional Football League)
Donetsk Oblast
Donetsk Oblast (Donbas) rivalry Shakhtar Donetsk vs. [Illichivets] Mariupol (Top level) (by Segodnya)
Donetsk Oblast (Donbas) rivalry Metalurh Donetsk vs. [Illichivets] Mariupol (Top level) (by Football Federation of Ukraine)
Donetsk Oblast rivalry Illichivets Mariupol vs. Shakhtar-2 Donetsk
Donetsk Oblast rivalry Olimpik Donetsk vs. Avanhard Kramatorsk
Dnipropetrovsk Oblast
Main Dnipropetrovsk Oblast rivalry FC Dnipro vs. Kryvbas Kryvyi Rih (Top level)
Dnipropetrovsk Oblast rivalry Dnipro vs. Stal Dniprodzerzhynsk (Top level)
Dnipropetrovsk Oblast rivalry Metalurh Nikopol vs. Shakhtar Pavlohrad
Luhansk Oblast
Main Luhansk Oblast rivalry Zorya Luhansk vs. Stal Alchevsk (Top level)
Luhansk Oblast rivalry Stal Alchevsk vs. Khimik Severodonetsk
Luhansk Oblast rivalry Zorya Luhansk vs. Khimik Severodonetsk
Sumy Oblast
Main Sumy Oblast rivalry Naftovyk Okhtyrka vs. [Yavir]–Sumy
Sumy Oblast rivalry Naftovyk Okhtyrka vs. SBTS Sumy
Sumy Oblast rivalry Naftovyk Okhtyrka vs. FC Sumy
Poltava Oblast
Main Poltava Oblast rivalry Vorskla Poltava vs. Neftekhimik Kremenchuk
Poltava Oblast rivalry FC Poltava vs. Hirnyk-Sport
Ivano-Frankivsk Oblast
Main Ivano-Frankivsk Oblast rivalry Prykarpattia Ivano-Frankivsk vs. Enerhetyk Burshtyn
Ivano-Frankivsk Oblast rivalry Spartak Ivano-Frankivsk vs. Enerhetyk Burshtyn
Kirovohrad Oblast
Kirovohrad Oblast rivalry Zirka Kropyvnytskyi vs. [Polihraftekhnika] Oleksandriya (Top level)
Zakarpattia Oblast
Zakarpattia Oblast rivalry Zakarpattia Uzhhorod vs. Pryladyst Mukacheve
Mykolaiv Oblast
Mykolaiv Oblast rivalry Evis Mykolaiv vs. Artania Ochakiv
Khmelnytskyi Oblast
Khmelnytskyi Oblast rivalry Podillya Khmelnytskyi vs. Temp [Ratusha]
Lviv Oblast
Lviv Oblast rivalry Karpary Lviv vs. Hazovyk-Skala
City derbies (professional league games)
Kharkiv
Kharkiv derby: Spartak – Silmash (1937–1939) - Soviet Top League (Group A) (1:4, 0:2, 1:5)
Kharkiv derby: Spartak – Dynamo (1936, 1937, 1939) (1:1, 2:1, 1:5)
Kharkiv derby: Dynamo – Silmash (1937, 1939, 1940) (1:2, 0:5, 3:1, 5:2)
Kharkiv derby: Dynamo – Traktor (1937) (3:0)
Kharkiv derby: Spartak – Traktor (1937) (3:0)
Kharkiv derby: Silmash – Traktor (1937) (1:3)
Kharkiv derby: Lokomotyv – Dzerzhynets (1947, 1948) (1:0, 5:3, 2:0, 8:1)
Kharkiv derby: Torpedo – Dzerzhynets (1949) (0:1, 1:4)
Kharkiv derby: Arsenal – Metalist-2 (1999/0–2001/2) (0:2, 0:0, 2:0, 4:1, 1:0, 0:6)
Kharkiv derby: Arsenal – Metalist (2003/4) (1:2, 1:1)
Kharkiv derby: Helios – Metalist-2 (2003/4, 2004/5) (1:1, 0:1, 4:1, 2:2)
Main Kharkiv derby: Kharkiv – Metalist (2005/6–2008/9) (1:0, 0:1, 2:0, 0:0, 0:2, 0:2, 1:1, 1:2)
Kharkiv derby: Arsenal – Kharkiv-2 (2005/6) (4:0, 2:1)
Kharkiv derby: Helios – Kharkiv (2009/10) (5:0, 0:1)
Kyiv
Kyiv derby: Dynamo – Lokomotyv (1938) – Soviet Top League (Group A) (1:1)
Kyiv derby: DO – Spartak (1949) (2:2, 2:0)
Kyiv derby: Arsenal – Temp/Oktiabrsky Raion (1960–1962) (0:0, 2:0, 2:1, 3:1, 2:0, 2:3)
Kyiv derby: Arsenal – SKA (1963) (1:0, 0:2)
Kyiv derby: Dynamo-2 – SKA/CSKA[-2] (1992, 1996/7–2007/8) (1:0, 2:0, 3:0, 1:1, 3:1, 2:0, 1:0, 1:1, 2:0, 0:1, 3:0, 1:3, 2:2, 0:2, 2:0, 2:2, 4:1, 4:1, 0:1, 0:2, 4:0, 0:0, 1:1, 0:0, 5:1, 3:2)
Kyiv derby: Dynamo-2 – CSKA-Borysfen (1994/5) (4:0, 1:3)
Main Kyiv derby: Dynamo – CSKA/Arsenal (1995/6–2013/14, 2018/19) (2:1, 0:0, 1:0, 2:2, 1:0, 4:0, 4:0, 2:0, 3:0, 3:1, 5:1, 1:0, 1:0, 2:0, 1:0, 3:1, 6:1, 3:0, 0:0, 1:1, 2:0, 3:1, 1:0, 5:2, 1:0, 2:2, 3:0, 2:0, 3:1, 1:0, 3:2, 3:0, 1:0, 2:0, 4:0, 1:0, 2:0, 4:0, 1:0)
Kyiv derby: Obolon – CSKA[-2] (1995/6, 1999/0, 2001/2, 2005/6–2007/8) (0:0, 0:1, 2:1, 0:1, 3:1, 1:2, 2:1, 3:0, 3:2, 1:1, 1:1, 4:3)
Kyiv derby: Dynamo-2 – Obolon (1999/0, 2001/2, 2005/6–2008/9, 2012/13, 2015/16) (4:1, 0:0, 1:2, 0:1, 1:3, 0:2, 2:0, 0:1, 1:0, 0:4, 1:0, 0:0, 2:1, +/-, 1:3, 0:2)
Kyiv derby: Dynamo-3 – Obolon-2 (2001/2, 2003/4–2007/8) (3:2, 5:0, 1:2, 0:0, 3:1, 2:2, 1:1, 1:1, 3:0, 1:1, 2:1, 0:1)
Kyiv derby: Dynamo – Obolon (2002/3–2004/5, 2009/10–2011/12) (1:1, 5:3, 4:0, 2:0, 7:0, 3:1, 4:0, 2:1, 2:2, 0:2, 4:0, 1:0)
Kyiv derby: Arsenal – Obolon (2002/3–2004/5, 2009/10–2011/12, 2016/17, 2017/18) (2:0, 2:0, 2:1, 1:3, 1:0, 1:2, 4:1, 0:0, 1:0, 1:1, 4:1, 1:0, 2:1, 1:0, 1:1 , 5:1)
Kyiv derby: Obolon-2 – CSKA (2008/9) (0:2, -/+)
Lviv
Lviv derby: DO – Spartak (1949) (1:3, 1:2)
Lviv derby: SKA – Karpaty (1965–1969) (2:0, 3:0, 1:0, 0:1, 0:0, 1:2, 1:5, 1:4, 1:1, 1:2)
Lviv derby: Dynamo – Karpaty-3[2] (1999/0–2001/2) (1:3, 0:1, 1:0, 3:0, 1:0, 0:1)
Lviv derby: Dynamo – SKA-Orbita (2001/2) (4:0, 0:0)
Lviv derby: Karpaty-3 – SKA-Orbita (2001/2) (1:1, 0:0)
Main Lviv derby: Karpaty – Lviv (2008/9, 2018/19, 2019/20) (2:1, 4:2, 0:1, 1:1, 0:0, 0:0, 1:1, 1:1)
Lviv derby: Karpaty-2 – Lviv-2 (2009/10) (2:0, 1:3)
(* Lviv derby: Karpaty – Shakhtar Donetsk (2014/15, 2015/16) (0:2, 2:2, 1:2, 0:3))
Luhansk
Luhansk derby: Trudovi Rezervy – Dynamo (1949) (4:1, 2:1)
Luhansk derby: Zoria – Shakhtar (2002/3) (2:1, 0:0)
Odesa
Main Odesa derby: SKVO/SKA – Chornomorets (1959, 1961, 1962, 1964–1966) – Soviet Top League (Class A, Group 1) (1:0, 0:1, 0:0, 1:2, 0:2, 0:1, 2:1, 1:1, 0:2, 0:1, 1:0, 0:2)
Odesa derby: Odesa – SKA-Lotto (1997/8) (2:0, 0:2)
Odesa derby: Dynamo – SKA-Lotto (1997/8) (1:2, 0:1)
Odesa derby: Odesa – Dynamo[-SKA] (1997/8, 1998/9) (3:0, 1:0, 8:0, +/-)
Odesa derby: Palmira – Chornomorets-2 (2003/4) (1:2, 2:1)
Odesa derby: Palmira – Real (2004/5) (1:1, 2:1)
Odesa derby: Real Pharma – Zhemchuzhyna (2016/17) (1:1, 0:2)
Odesa derby: Real Pharma – Chornomorets-2 (2019/20) (0:0, 0:3)
Poltava
Poltava derby: Kolhospnyk – Lokomotyv (1960, 1961) (5:3, 1:3, 2:1, 2:0, 5:2)
Rivne
Rivne derby: Kolhospnyk – Spartak (1960–1962) (1:0, 3:1, 2:1, 1:1, 6:0, 3:0)
Chernivtsi
Chernivtsi derby: Avanhard – Spartak (1960) (3:0, 5:0)
Chernivtsi derby: Avanhard – Mashynobudivnyk (1961) (1:0, 4:0)
Chernihiv
Chernihiv derby: Desna – Zirka (1961) (6:0, 5:0)
Mykolaiv
Mykolaiv derby: Sudnobudivnyk – Torpedo (1961) (1:1, 2:0)
Mykolaiv derby: Sudnobudivnyk – Vympel (1962) (6:1, 2:0)
Mykolaiv derby: Sudnobudivnyk – Mykolaiv-2 (2017/18) (2:2, 1:4, 1:3)
Ternopil
Ternopil derby: Avanhard – Motor (1960) (1:1, 5:1)
Main Ternopil derby: Nyva – Ternopil (2012/13, 2014/15, 2015/16) (1:0, 2:0, 1:0, 1:1, 2:2, 2:2, 0:1, -/+)
Vinnytsia
Vinnytsia derby: Lokomotyv – Burevisnyk (1962) (4:0, 0:0)
Sumy
Sumy derby: Avanhard – SVADKU (1962) (2:0, 3:1)
Sumy derby: Sumy – Frunzenets-Liha (2001/2) (2:1, 2:1)
Zaporizhzhia
Main Zaporizhzhia derby: Torpedo – Metalurh (1992-1997/8) (3:0, 1:0, 1:1, 1:3, 3:1, 0:4, 1:0, 0:2, 0:2, 0:4, 1:0, 1:1)
Zaporizhzhia derby: Viktor – Metalurh-2 (1999/0) (1:1, 0:0)
Zaporizhzhia derby: Torpedo – Metalurh-2 (2002/3) (1:1, 0:2)
Zaporizhzhia derby: Metalurh – Zoria Luhansk (2014/15, 2015/16) (0:1, 0:3, 0:6, 1:4)
Donetsk
Donetsk derby: Shakhtar-2 – Metalurh (1995/6) (2:0, 0:3)
Main Donetsk derby: Shakhtar – Metalurh (1997/8–2013/14) (2:0, 2:1, 4:0, 4:2, 2:0, 3:2, 3:1, 3:0, 1:0, 3:1, 3:1, 2:0, 3:1, 2:0, 3:1, 3:0, 3:1, 2:0, 2:1, 0:0, 4:1, 1:0, 2:1, 1:1, 4:1, 1:0, 2:0, 2:0, 2:0, 2:0, 4:0, 4:0, 2:1, 2:2)
Donetsk derby: Shakhtar-2 – Metalurh-2 (1997/8) (1:0, 1:2)
Donetsk derby: Shakhtar-3 – Metalurh-2 (2001/2–2003/4) (3:1, 1:2, 1:0, 2:1, 4:2, 1:0)
Donetsk derby: Shakhtar-3 – Olimpik (2004/5–2010/11) (2:0, 0:2, 0:2, 1:5, 3:1, 1:1, 1:2, 2:3, 1:1, 2:6, 0:0, 1:4, 1:3, 1:3)
Donetsk derby: Titan – Olimpik (2007/8, 2008/9) (1:1, 0:3, 1:1, 0:2)
Donetsk derby: Shakhtar-3 – Titan (2007/8, 2008/9) (2:2, 2:1, 3:2, 5:1)
Kremenchuk
Kremenchuk derby: Kremin – Adoms (1999/0) (0:2, 0:4) (Second League Cup) (2:1, 1:0)
Ivano-Frankivsk
Ivano-Frankivsk derby: Fakel – Chornohora (2004/5, 2005/6) (3:2, 1:1, 2:1, 1:0)
Zhytomyr
Zhytomyr derby: Zhytychi – Zhytomyr (2005/6) (0:0, +/-)
Kryvyi Rih
Kryvyi Rih derby: Hirnyk – Kryvbas-2 (2005/6) (2:0, 1:1)
Bila Tserkva
Bila Tserkva derby: Arsenal – Ros (2008/9) (2:2, 1:1)
Crimea
Crimea derby: Tavriya – Sevastopol (2010/11) (2:1, 1:0)
Oleksandria
Oleksandria derby: Oleksandria – UkrAhroKom (2013/14) (2:1, 2:2)
Dnipro
Dnipro derby: Dnipro – Dnipro-1 (2017/18) (2:0, 0:0, 1:2)
References
External links
Regional derbi: history and the present. Sport.if.ua. 13 August 2010
SteveGOLD. New regional derby (Нове обласне дербі). UA-Football. 19 July 2015
Ukraine
Ukraine
|
```c
/*
*
*/
#define DT_DRV_COMPAT neorv32_uart
#include <zephyr/device.h>
#include <zephyr/drivers/syscon.h>
#include <zephyr/drivers/uart.h>
#include <zephyr/pm/device.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/logging/log.h>
#include <zephyr/irq.h>
#include <soc.h>
LOG_MODULE_REGISTER(uart_neorv32, CONFIG_UART_LOG_LEVEL);
/* NEORV32 UART registers offsets */
#define NEORV32_UART_CTRL_OFFSET 0x00
#define NEORV32_UART_DATA_OFFSET 0x04
/* UART_CTRL register bits */
#define NEORV32_UART_CTRL_EN BIT(0)
#define NEORV32_UART_CTRL_SIM_MODE BIT(1)
#define NEORV32_UART_CTRL_HWFC_EN BIT(2)
#define NEORV32_UART_CTRL_PRSC_POS 3U
#define NEORV32_UART_CTRL_PRSC_MASK BIT_MASK(3)
#define NEORV32_UART_CTRL_BAUD_POS 6U
#define NEORV32_UART_CTRL_BAUD_MASK BIT_MASK(10)
#define NEORV32_UART_CTRL_RX_NEMPTY BIT(16)
#define NEORV32_UART_CTRL_RX_HALF BIT(17)
#define NEORV32_UART_CTRL_RX_FULL BIT(18)
#define NEORV32_UART_CTRL_TX_NEMPTY BIT(19)
#define NEORV32_UART_CTRL_TX_HALF BIT(20)
#define NEORV32_UART_CTRL_TX_FULL BIT(21)
#define NEORV32_UART_CTRL_IRQ_RX_NEMPTY BIT(22)
#define NEORV32_UART_CTRL_IRQ_RX_HALF BIT(23)
#define NEORV32_UART_CTRL_IRQ_RX_FULL BIT(24)
#define NEORV32_UART_CTRL_IRQ_TX_EMPTY BIT(25)
#define NEORV32_UART_CTRL_IRQ_TX_NHALF BIT(26)
#define NEORV32_UART_CTRL_RX_OVER BIT(30)
#define NEORV32_UART_CTRL_TX_BUSY BIT(31)
struct neorv32_uart_config {
const struct device *syscon;
uint32_t feature_mask;
mm_reg_t base;
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
void (*irq_config_func)(const struct device *dev);
unsigned int tx_irq;
unsigned int rx_irq;
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
};
struct neorv32_uart_data {
struct uart_config uart_cfg;
uint32_t last_data;
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
struct k_timer timer;
uart_irq_callback_user_data_t callback;
void *callback_data;
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
};
static inline uint32_t neorv32_uart_read_ctrl(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
return sys_read32(config->base + NEORV32_UART_CTRL_OFFSET);
}
static inline void neorv32_uart_write_ctrl(const struct device *dev, uint32_t ctrl)
{
const struct neorv32_uart_config *config = dev->config;
sys_write32(ctrl, config->base + NEORV32_UART_CTRL_OFFSET);
}
static inline uint32_t neorv32_uart_read_data(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
struct neorv32_uart_data *data = dev->data;
uint32_t reg;
/* Cache status bits as they are cleared upon read */
reg = sys_read32(config->base + NEORV32_UART_DATA_OFFSET);
data->last_data = reg;
return reg;
}
static inline void neorv32_uart_write_data(const struct device *dev, uint32_t data)
{
const struct neorv32_uart_config *config = dev->config;
sys_write32(data, config->base + NEORV32_UART_DATA_OFFSET);
}
static int neorv32_uart_poll_in(const struct device *dev, unsigned char *c)
{
uint32_t data;
data = neorv32_uart_read_data(dev);
if ((data & NEORV32_UART_CTRL_RX_NEMPTY) != 0) {
*c = data & BIT_MASK(8);
return 0;
}
return -1;
}
static void neorv32_uart_poll_out(const struct device *dev, unsigned char c)
{
while ((neorv32_uart_read_ctrl(dev) & NEORV32_UART_CTRL_TX_BUSY) != 0) {
}
neorv32_uart_write_data(dev, c);
}
static int neorv32_uart_configure(const struct device *dev, const struct uart_config *cfg)
{
const struct neorv32_uart_config *config = dev->config;
struct neorv32_uart_data *data = dev->data;
uint32_t ctrl = NEORV32_UART_CTRL_EN;
uint16_t baudxx = 0;
uint8_t prscx = 0;
uint32_t clk;
int err;
__ASSERT_NO_MSG(cfg != NULL);
if (cfg->stop_bits != UART_CFG_STOP_BITS_1) {
LOG_ERR("hardware only supports one stop bit");
return -ENOTSUP;
}
if (cfg->data_bits != UART_CFG_DATA_BITS_8) {
LOG_ERR("hardware only supports 8 data bits");
return -ENOTSUP;
}
switch (cfg->parity) {
case UART_CFG_PARITY_NONE:
break;
default:
LOG_ERR("unsupported parity mode %d", cfg->parity);
return -ENOTSUP;
}
switch (cfg->flow_ctrl) {
case UART_CFG_FLOW_CTRL_NONE:
ctrl |= 0;
break;
case UART_CFG_FLOW_CTRL_RTS_CTS:
ctrl |= NEORV32_UART_CTRL_HWFC_EN;
break;
default:
LOG_ERR("unsupported flow control mode %d", cfg->flow_ctrl);
return -ENOTSUP;
}
err = syscon_read_reg(config->syscon, NEORV32_SYSINFO_CLK, &clk);
if (err < 0) {
LOG_ERR("failed to determine clock rate (err %d)", err);
return -EIO;
}
if (cfg->baudrate == 0) {
LOG_ERR("invalid baud rate 0");
return -EINVAL;
}
/*
* Calculate clock prescaler and baud prescaler. Initial prscx = 0 is
* clock / 2.
*/
baudxx = clk / (2 * cfg->baudrate);
while (baudxx >= NEORV32_UART_CTRL_BAUD_MASK) {
if ((prscx == 2) || (prscx == 4)) {
baudxx >>= 3;
} else {
baudxx >>= 1;
}
prscx++;
}
if (prscx > NEORV32_UART_CTRL_PRSC_MASK) {
LOG_ERR("unsupported baud rate %d", cfg->baudrate);
return -ENOTSUP;
}
ctrl |= (baudxx - 1) << NEORV32_UART_CTRL_BAUD_POS;
ctrl |= prscx << NEORV32_UART_CTRL_PRSC_POS;
data->uart_cfg = *cfg;
neorv32_uart_write_ctrl(dev, ctrl);
return 0;
}
static int neorv32_uart_config_get(const struct device *dev, struct uart_config *cfg)
{
struct neorv32_uart_data *data = dev->data;
__ASSERT_NO_MSG(cfg != NULL);
*cfg = data->uart_cfg;
return 0;
}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static int neorv32_uart_fifo_fill(const struct device *dev, const uint8_t *tx_data, int len)
{
uint32_t ctrl;
if (len <= 0) {
return 0;
}
__ASSERT_NO_MSG(tx_data != NULL);
ctrl = neorv32_uart_read_ctrl(dev);
if ((ctrl & NEORV32_UART_CTRL_TX_BUSY) == 0) {
neorv32_uart_write_data(dev, *tx_data);
return 1;
}
return 0;
}
static int neorv32_uart_fifo_read(const struct device *dev, uint8_t *rx_data, const int size)
{
struct neorv32_uart_data *data = dev->data;
int count = 0;
if (size <= 0) {
return 0;
}
__ASSERT_NO_MSG(rx_data != NULL);
while ((data->last_data & NEORV32_UART_CTRL_RX_NEMPTY) != 0) {
rx_data[count++] = data->last_data & BIT_MASK(8);
data->last_data &= ~(NEORV32_UART_CTRL_RX_NEMPTY);
if (count >= size) {
break;
}
(void)neorv32_uart_read_data(dev);
}
return count;
}
static void neorv32_uart_tx_soft_isr(struct k_timer *timer)
{
const struct device *dev = k_timer_user_data_get(timer);
struct neorv32_uart_data *data = dev->data;
uart_irq_callback_user_data_t callback = data->callback;
if (callback) {
callback(dev, data->callback_data);
}
}
static void neorv32_uart_irq_tx_enable(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
struct neorv32_uart_data *data = dev->data;
uint32_t ctrl;
irq_enable(config->tx_irq);
ctrl = neorv32_uart_read_ctrl(dev);
if ((ctrl & NEORV32_UART_CTRL_TX_BUSY) == 0) {
/*
* TX done event already generated an edge interrupt. Generate a
* soft interrupt and have it call the callback function in
* timer isr context.
*/
k_timer_start(&data->timer, K_NO_WAIT, K_NO_WAIT);
}
}
static void neorv32_uart_irq_tx_disable(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
irq_disable(config->tx_irq);
}
static int neorv32_uart_irq_tx_ready(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
uint32_t ctrl;
if (!irq_is_enabled(config->tx_irq)) {
return 0;
}
ctrl = neorv32_uart_read_ctrl(dev);
return (ctrl & NEORV32_UART_CTRL_TX_BUSY) == 0;
}
static void neorv32_uart_irq_rx_enable(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
irq_enable(config->rx_irq);
}
static void neorv32_uart_irq_rx_disable(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
irq_disable(config->rx_irq);
}
static int neorv32_uart_irq_tx_complete(const struct device *dev)
{
uint32_t ctrl;
ctrl = neorv32_uart_read_ctrl(dev);
return (ctrl & NEORV32_UART_CTRL_TX_BUSY) == 0;
}
static int neorv32_uart_irq_rx_ready(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
struct neorv32_uart_data *data = dev->data;
if (!irq_is_enabled(config->rx_irq)) {
return 0;
}
return (data->last_data & NEORV32_UART_CTRL_RX_NEMPTY) != 0;
}
static int neorv32_uart_irq_is_pending(const struct device *dev)
{
return (neorv32_uart_irq_tx_ready(dev) ||
neorv32_uart_irq_rx_ready(dev));
}
static int neorv32_uart_irq_update(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
if (irq_is_enabled(config->rx_irq)) {
/* Cache data for use by rx_ready() and fifo_read() */
(void)neorv32_uart_read_data(dev);
}
return 1;
}
static void neorv32_uart_irq_callback_set(const struct device *dev,
uart_irq_callback_user_data_t cb, void *user_data)
{
struct neorv32_uart_data *data = dev->data;
data->callback = cb;
data->callback_data = user_data;
}
static void neorv32_uart_isr(const struct device *dev)
{
struct neorv32_uart_data *data = dev->data;
uart_irq_callback_user_data_t callback = data->callback;
if (callback) {
callback(dev, data->callback_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
static int neorv32_uart_init(const struct device *dev)
{
const struct neorv32_uart_config *config = dev->config;
struct neorv32_uart_data *data = dev->data;
uint32_t features;
int err;
if (!device_is_ready(config->syscon)) {
LOG_ERR("syscon device not ready");
return -EINVAL;
}
err = syscon_read_reg(config->syscon, NEORV32_SYSINFO_FEATURES, &features);
if (err < 0) {
LOG_ERR("failed to determine implemented features (err %d)", err);
return -EIO;
}
if ((features & config->feature_mask) == 0) {
LOG_ERR("neorv32 uart instance not supported");
return -ENODEV;
}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
k_timer_init(&data->timer, &neorv32_uart_tx_soft_isr, NULL);
k_timer_user_data_set(&data->timer, (void *)dev);
config->irq_config_func(dev);
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
return neorv32_uart_configure(dev, &data->uart_cfg);
}
#ifdef CONFIG_PM_DEVICE
static int neorv32_uart_pm_action(const struct device *dev,
enum pm_device_action action)
{
uint32_t ctrl = neorv32_uart_read_ctrl(dev);
switch (action) {
case PM_DEVICE_ACTION_SUSPEND:
ctrl &= ~(NEORV32_UART_CTRL_EN);
break;
case PM_DEVICE_ACTION_RESUME:
ctrl |= NEORV32_UART_CTRL_EN;
break;
default:
return -ENOTSUP;
}
neorv32_uart_write_ctrl(dev, ctrl);
return 0;
}
#endif /* CONFIG_PM_DEVICE */
static const struct uart_driver_api neorv32_uart_driver_api = {
.poll_in = neorv32_uart_poll_in,
.poll_out = neorv32_uart_poll_out,
#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE
.configure = neorv32_uart_configure,
.config_get = neorv32_uart_config_get,
#endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
.fifo_fill = neorv32_uart_fifo_fill,
.fifo_read = neorv32_uart_fifo_read,
.irq_tx_enable = neorv32_uart_irq_tx_enable,
.irq_tx_disable = neorv32_uart_irq_tx_disable,
.irq_tx_ready = neorv32_uart_irq_tx_ready,
.irq_rx_enable = neorv32_uart_irq_rx_enable,
.irq_rx_disable = neorv32_uart_irq_rx_disable,
.irq_tx_complete = neorv32_uart_irq_tx_complete,
.irq_rx_ready = neorv32_uart_irq_rx_ready,
.irq_is_pending = neorv32_uart_irq_is_pending,
.irq_update = neorv32_uart_irq_update,
.irq_callback_set = neorv32_uart_irq_callback_set,
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
};
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
#define NEORV32_UART_CONFIG_FUNC(node_id, n) \
static void neorv32_uart_config_func_##n(const struct device *dev) \
{ \
IRQ_CONNECT(DT_IRQ_BY_NAME(node_id, tx, irq), \
DT_IRQ_BY_NAME(node_id, tx, priority), \
neorv32_uart_isr, \
DEVICE_DT_GET(node_id), 0); \
\
IRQ_CONNECT(DT_IRQ_BY_NAME(node_id, rx, irq), \
DT_IRQ_BY_NAME(node_id, rx, priority), \
neorv32_uart_isr, \
DEVICE_DT_GET(node_id), 0); \
}
#define NEORV32_UART_CONFIG_INIT(node_id, n) \
.irq_config_func = neorv32_uart_config_func_##n, \
.tx_irq = DT_IRQ_BY_NAME(node_id, tx, irq), \
.rx_irq = DT_IRQ_BY_NAME(node_id, rx, irq),
#else
#define NEORV32_UART_CONFIG_FUNC(node_id, n)
#define NEORV32_UART_CONFIG_INIT(node_id, n)
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
#define NEORV32_UART_INIT(node_id, n) \
NEORV32_UART_CONFIG_FUNC(node_id, n) \
\
static struct neorv32_uart_data neorv32_uart_##n##_data = { \
.uart_cfg = { \
.baudrate = DT_PROP(node_id, current_speed), \
.parity = DT_ENUM_IDX_OR(node_id, parity, \
UART_CFG_PARITY_NONE), \
.stop_bits = UART_CFG_STOP_BITS_1, \
.data_bits = UART_CFG_DATA_BITS_8, \
.flow_ctrl = DT_PROP(node_id, hw_flow_control) ? \
UART_CFG_FLOW_CTRL_RTS_CTS : \
UART_CFG_FLOW_CTRL_NONE, \
}, \
}; \
\
static const struct neorv32_uart_config neorv32_uart_##n##_config = { \
.syscon = DEVICE_DT_GET(DT_PHANDLE(node_id, syscon)), \
.feature_mask = NEORV32_SYSINFO_FEATURES_IO_UART##n, \
.base = DT_REG_ADDR(node_id), \
NEORV32_UART_CONFIG_INIT(node_id, n) \
}; \
\
PM_DEVICE_DT_DEFINE(node_id, neorv32_uart_pm_action); \
\
DEVICE_DT_DEFINE(node_id, &neorv32_uart_init, \
PM_DEVICE_DT_GET(node_id), \
&neorv32_uart_##n##_data, \
&neorv32_uart_##n##_config, \
PRE_KERNEL_1, \
CONFIG_SERIAL_INIT_PRIORITY, \
&neorv32_uart_driver_api)
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(uart0), DT_DRV_COMPAT, okay)
NEORV32_UART_INIT(DT_NODELABEL(uart0), 0);
#endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(uart1), DT_DRV_COMPAT, okay)
NEORV32_UART_INIT(DT_NODELABEL(uart1), 1);
#endif
```
|
```smalltalk
/*
* PROJECT: Atomix Development
* LICENSE: BSD 3-Clause (LICENSE.md)
* PURPOSE: Int Value MSIL
* PROGRAMMERS: Aman Priyadarshi (aman.eureka@gmail.com)
*/
using System.Reflection;
namespace Atomixilc.IL.CodeType
{
internal class OpInt : OpCodeType
{
internal readonly int Value;
internal OpInt(ILCode aCode, int aPosition, int aNextPosition, int aValue, ExceptionHandlingClause aEhc)
:base(aCode, aPosition, aNextPosition, aEhc)
{
Value = aValue;
}
public override string ToString()
{
return string.Format("{0} [0x{1}-0x{2}] {3}", GetType().Name, Position.ToString("X4"), NextPosition.ToString("X4"), Value);
}
}
}
```
|
Liberty Hall is a heritage-listed detached house at 84 Limestone Street, Ipswich, City of Ipswich, Queensland, Australia. It was built . It is also known as Mary Tregear Hostel. It was added to the Queensland Heritage Register on 21 October 1992.
History
Liberty Hall is a two-storey rendered brick house with a cellar, built between 1857 and 1860 for Chief Constable Edward Quinn. The property was sold to James Sloane in 1877, then passed to his widow in 1887.
The house then appears to have been rented by blacksmith Hugh Campbell. Hugh's father, Donald Campbell, had been the first free settler in Ipswich after George Thorn (senior), arriving with his family in 1842 and carrying on his trade as a blacksmith. The firm reputedly shod the horses for Ludwig Leichhardt when he passed through Ipswich on an exploring expedition.
Hugh Campbell also worked as a blacksmith and took over the business after his father died in 1857. The family home and business was at that time on the corner of East and Limestone streets, Ipswich. When the Ipswich & West Moreton Building Society building was built on the site in 1887, the Campbells re-established further up Limestone street. Hugh Campbell was well known in the Ipswich community, acting as Clerk of the Course on every raceday. It has been said that the building was called Liberty Hall because of his generous hospitality, but this may have been a local saying rather than a formal name, as the term was in general use at that time.
The house was bought by Hugh's three sons under nomination of trustees in 1910. The smithy closed down in 1916 and Hugh died in 1917 but the house remained in the family until 1942. The Queensland Country Women's Association bought the property in 1942. The house was used as a girls' hostel and a fibro-and-timber army building was moved to the site as a meeting hall. They named the property the Mary Tregear Hostel after the first president of the Ipswich branch of the Country Women's Association.
In 1964, the land was subdivided and a coal research laboratory was built on portion of it. The army hut was replaced by a brick hall on the eastern side of the block, and a rear kitchen wing was built, its materials and construction suggesting a date .
Description
Liberty Hall is a two-storey brick house with a half-gabled corrugated galvanised iron roof and basement cellar. It is constructed with the front wall against the road alignment. At the rear is an attached single-storey timber frame kitchen wing with a floor level approximately below the floor level of the original front wing. The site has been further developed with a flat-roofed brick and blockwork meeting hall which runs the full length of the eastern alignment.
The original two-storeyed wing has a painted ruled render exterior finish, with solid rendered architraves around the windows. The front elevation is of symmetrical design with a central front doorway flanked with two pairs of colonial sash windows. The upper level has three colonial sash windows. The original ground floor contains a central hallway leading to a small timber staircase and four rooms, one of which has a fireplace with simple painted cedar surround. Ground floor walls are generally of painted plaster, the joinery is of very simple design such as square section balusters under the cedar handrail to the stair. Ceilings are of fibro with timber cornice and doors are of the four-panel type.
The original wing's upper floor has a narrow transverse hallway entered from the stairway top landing. This level has five small bedrooms and a toilet. All of the upper level partition walls are of wide vertical beaded tongue-and-groove timber boards, single-lined, and all doors are of the simple ledged type, sheeted with vertical tongue and groove. Ceilings of the upper level are of tongue and groove.
A basement cellar extends underneath the whole of the ground floor of the original wing up to the retaining wall against the footpath. The rear kitchen wing supported on concrete stumps contains a kitchen, store-room, dining room, two bathrooms and a toilet. External walls are of asbestos cement "shadowline" sheeting and casement windows. Rear stairs give access internally to a lower level enclosed landing.
Heritage listing
Liberty Hall was listed on the Queensland Heritage Register on 21 October 1992 having satisfied the following criteria.
The place is important in demonstrating the evolution or pattern of Queensland's history.
The place demonstrates rare, uncommon or endangered aspects of Queensland's cultural heritage.
Built between 1857 and 1860, Mary Tregear Hostel is one of the oldest buildings in Ipswich and is a rare example of a simple town dwelling in colonial Georgian style.
The place is important because of its aesthetic significance.
Although its roofline has been altered, it retains much of its original symmetrical form and is valued by the community for its aesthetic contribution to the streetscape of central Ipswich.
The place has a special association with the life or work of a particular person, group or organisation of importance in Queensland's history.
It is closely associated with the work of the QCWA and in particular, its role in providing supervised accommodation for country girls working in the city. It is closely associated with the Campbell family, the first free settlers to arrive in Ipswich after 1842, and with an early senior police official Edward Quinn.
References
Attribution
External links
Queensland Heritage Register
Ipswich, Queensland
Houses in Queensland
Articles incorporating text from the Queensland Heritage Register
Country Women's Association buildings in Australia
|
```forth
SUBROUTINE SSPRF ( UPLO, N, ALPHA, X, INCX, AP )
* .. Scalar Arguments ..
REAL ALPHA
INTEGER INCX, N
CHARACTER*1 UPLO
* .. Array Arguments ..
REAL AP( * ), X( * )
* ..
*
* Purpose
* =======
*
* SSPR performs the symmetric rank 1 operation
*
* A := alpha*x*x' + A,
*
* where alpha is a real scalar, x is an n element vector and A is an
* n by n symmetric matrix, supplied in packed form.
*
* Parameters
* ==========
*
* UPLO - CHARACTER*1.
* On entry, UPLO specifies whether the upper or lower
* triangular part of the matrix A is supplied in the packed
* array AP as follows:
*
* UPLO = 'U' or 'u' The upper triangular part of A is
* supplied in AP.
*
* UPLO = 'L' or 'l' The lower triangular part of A is
* supplied in AP.
*
* Unchanged on exit.
*
* N - INTEGER.
* On entry, N specifies the order of the matrix A.
* N must be at least zero.
* Unchanged on exit.
*
* ALPHA - REAL .
* On entry, ALPHA specifies the scalar alpha.
* Unchanged on exit.
*
* X - REAL array of dimension at least
* ( 1 + ( n - 1 )*abs( INCX ) ).
* Before entry, the incremented array X must contain the n
* element vector x.
* Unchanged on exit.
*
* INCX - INTEGER.
* On entry, INCX specifies the increment for the elements of
* X. INCX must not be zero.
* Unchanged on exit.
*
* AP - REAL array of DIMENSION at least
* ( ( n*( n + 1 ) )/2 ).
* Before entry with UPLO = 'U' or 'u', the array AP must
* contain the upper triangular part of the symmetric matrix
* packed sequentially, column by column, so that AP( 1 )
* contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 1, 2 )
* and a( 2, 2 ) respectively, and so on. On exit, the array
* AP is overwritten by the upper triangular part of the
* updated matrix.
* Before entry with UPLO = 'L' or 'l', the array AP must
* contain the lower triangular part of the symmetric matrix
* packed sequentially, column by column, so that AP( 1 )
* contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 2, 1 )
* and a( 3, 1 ) respectively, and so on. On exit, the array
* AP is overwritten by the lower triangular part of the
* updated matrix.
*
*
* Level 2 Blas routine.
*
* -- Written on 22-October-1986.
* Jack Dongarra, Argonne National Lab.
* Jeremy Du Croz, Nag Central Office.
* Sven Hammarling, Nag Central Office.
* Richard Hanson, Sandia National Labs.
*
*
* .. Parameters ..
REAL ZERO
PARAMETER ( ZERO = 0.0E+0 )
* .. Local Scalars ..
REAL TEMP
INTEGER I, INFO, IX, J, JX, K, KK, KX
* .. External Functions ..
LOGICAL LSAME
EXTERNAL LSAME
* .. External Subroutines ..
EXTERNAL XERBLA
* ..
* .. Executable Statements ..
*
* Test the input parameters.
*
INFO = 0
IF ( .NOT.LSAME( UPLO, 'U' ).AND.
$ .NOT.LSAME( UPLO, 'L' ) )THEN
INFO = 1
ELSE IF( N.LT.0 )THEN
INFO = 2
ELSE IF( INCX.EQ.0 )THEN
INFO = 5
END IF
IF( INFO.NE.0 )THEN
CALL XERBLA( 'SSPR ', INFO )
RETURN
END IF
*
* Quick return if possible.
*
IF( ( N.EQ.0 ).OR.( ALPHA.EQ.ZERO ) )
$ RETURN
*
* Set the start point in X if the increment is not unity.
*
IF( INCX.LE.0 )THEN
KX = 1 - ( N - 1 )*INCX
ELSE IF( INCX.NE.1 )THEN
KX = 1
END IF
*
* Start the operations. In this version the elements of the array AP
* are accessed sequentially with one pass through AP.
*
KK = 1
IF( LSAME( UPLO, 'U' ) )THEN
*
* Form A when upper triangle is stored in AP.
*
IF( INCX.EQ.1 )THEN
DO 20, J = 1, N
IF( X( J ).NE.ZERO )THEN
TEMP = ALPHA*X( J )
K = KK
DO 10, I = 1, J
AP( K ) = AP( K ) + X( I )*TEMP
K = K + 1
10 CONTINUE
END IF
KK = KK + J
20 CONTINUE
ELSE
JX = KX
DO 40, J = 1, N
IF( X( JX ).NE.ZERO )THEN
TEMP = ALPHA*X( JX )
IX = KX
DO 30, K = KK, KK + J - 1
AP( K ) = AP( K ) + X( IX )*TEMP
IX = IX + INCX
30 CONTINUE
END IF
JX = JX + INCX
KK = KK + J
40 CONTINUE
END IF
ELSE
*
* Form A when lower triangle is stored in AP.
*
IF( INCX.EQ.1 )THEN
DO 60, J = 1, N
IF( X( J ).NE.ZERO )THEN
TEMP = ALPHA*X( J )
K = KK
DO 50, I = J, N
AP( K ) = AP( K ) + X( I )*TEMP
K = K + 1
50 CONTINUE
END IF
KK = KK + N - J + 1
60 CONTINUE
ELSE
JX = KX
DO 80, J = 1, N
IF( X( JX ).NE.ZERO )THEN
TEMP = ALPHA*X( JX )
IX = JX
DO 70, K = KK, KK + N - J
AP( K ) = AP( K ) + X( IX )*TEMP
IX = IX + INCX
70 CONTINUE
END IF
JX = JX + INCX
KK = KK + N - J + 1
80 CONTINUE
END IF
END IF
*
RETURN
*
* End of SSPR .
*
END
```
|
Dörverden () is a railway station located in Dörverden, Germany. The station is located on the Bremen–Hanover railway. The train services are operated by Deutsche Bahn.
Train services
The following services currently call at the station:
Regional services Norddeich - Emden - Oldenburg - Bremen - Nienburg - Hanover
Regional services Bremerhaven-Lehe - Bremen - Nienburg - Hanover
References
Railway stations in Lower Saxony
|
```ruby
require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "Module#freeze" do
it "needs to be reviewed for spec completeness"
end
```
|
Little Dragon Maiden, also known as The Brave Archer 5, is a 1983 Hong Kong film adapted from Louis Cha's novel The Return of the Condor Heroes. Little Dragon Maiden is seen as an unofficial sequel to the The Brave Archer, The Brave Archer 2, The Brave Archer 3, and The Brave Archer and His Mate.
Cast
Leslie Cheung as Yo Ko / Yo Kang
Mary Jean Reimer as Siauw-liong-lie
Chen Kuan-tai as Kwee Ceng
Leanne Liu as Oey Yong
as Li Mochou
Lung Tien-hsiang as Jinlun Fawang
Ku Kuan-chung as Huodu
Ku Feng as Ang Cit-kong
Lo Lieh as Auw-yang Hong
Sun Chien as Qiu Qianren
Hung San-nam as Yin Zhiping
Wong Lik as Zhao Zhijing
Lai Yin-san as Cheng Ying
Chan Lau as Oey Yok-su
Eddy Ko Hung as Da'erba
Steve Mak as Lu Qingdu
Lam Chi-tai as Zhiguang
Eric Chan as Wu Dunru
Siao Yuk as Wu Xiuwen
Yiu Man-kei as Ni Moxing
Choi Kwok-keung as Yin Kexi
Stephen Chan as Xiaoxiangzi
Wang Han-chen
Wan Seung-lam
Lau Fong-sai
Ngai Tim-choi
Kong Long
Lau Cheun
Kam Tin-chiu
Tang Yuk-wing
Lam Tit-ching
Cheung Wing-cheung
Fung Ming
External links
1983 films
Films based on works by Jin Yong
Hong Kong martial arts films
Films based on The Return of the Condor Heroes
Wuxia films
1980s Hong Kong films
|
Kathryn Jean Whitmire (née Niederhofer; born August 15, 1946) is an American politician, businesswoman, and accountant best known as the first woman to serve as Mayor of Houston, serving for five consecutive two-year terms from 1982 to 1991. From 1977 to 1981, she was the city controller, a position which made her the first female elected to any office in the city. Whitmire drew national attention when she defeated former Harris County Sheriff Jack Heard in her election as mayor. The election drew national focus because it symbolized a major political realignment in the fourth-largest city in the United States.
In office, she implemented many reforms to city finances, enabling new programs without raising taxes. Her appointment of the city's first African American police chief and the first Hispanic woman as presiding judge of the Municipal Court, her support of a failed job rights bill for homosexuals, among other acts, cemented her support among many minority groups.
When former mayor Louie Welch attempted a comeback in the 1985 election, he was unable to mount a convincing argument that he could more ably lead the city out of a recession than Whitmire could. Instead, the opposition to Whitmire focused on public fears about the AIDS epidemic. A so-called "Straight Slate" opposed gay rights and supported Welch, who, however, did not accept its endorsement. The issue failed to affect Whitmire's support. She won the election, getting 59.8 percent of the votes. The Straight Slate did force two city council members, Anthony Hall and Judson Robinson, into runoffs which they then won. Whitmire's string of victories ended with the 1991 mayoral election when she was defeated by long-time political power broker Bob Lanier and State Representative Sylvester Turner. Lanier defeated Turner in the December runoff. Whitmire has never run for political office again.
Early life
Kathy Niederhofer received her basic education in the Houston Independent School District, ultimately graduating from San Jacinto High School. She then enrolled at the University of Houston, and graduated magna cum laude with a Bachelor of Business Administration degree in accounting in 1968. She continued her studies at the university to earn a Master of Accountancy degree in 1970. In that same year, she married a fellow student, James M. (Jim) Whitmire, who died in 1976. In 1970, she began working in the Houston office of the well-known accounting firm Coopers and Lybrand. She also began working to qualify as a Certified Public Accountant (CPA), and opened an accounting firm with her husband. She also found time and energy to serve on the faculty of the Department of Business Management at the University of .
Political career
Kathy Whitmire's exposure to and interest in city politics began in her parents' home. Her father had been active in precinct-level politics, and the family frequently talked about local political issues. Her husband's brother, John Whitmire, already a rising star in the Texas Democratic Party, was a willing political mentor.
Houston City Controller
Whitmire was appointed as City Controller to serve out the unexpired term of Leonel Castillo, who had been appointed as Commissioner of Immigration for the United States Citizenship and Immigration Services, making him the first Hispanic to hold that role. Castillo accepted the Federal position on April 7, 1977. As City Controller, Whitmire became extremely knowledgeable about all aspects of the city's finances. She won a full two-year term in a landslide defeating Steve Jones in the Runoff Elections with 110,762 votes (58.57%) to Jones' 78,365 votes (41.44%). Upon being inaugurated for a full two-year term on January 2, 1978, Whitmire criticized the late then-Mayor Jim McConn for his inefficiency and lax administration. Becoming familiar with "sweetheart contracts", that had often been awarded to friends and supporters of influential office holders, she stopped the practice by rigorously enforcing observance of the Open Bidding laws. She also diligently looked for inefficiencies or outright wasteful practices in each of the city offices. Although this angered many "insiders", she won election in 1979 to a second term, becoming the first female elected to a top job in the Houston City government.
Mayoralty
Whitmire decided to run for mayor in the 1981 election. The incumbent, Jim McConn, had already served two terms in the office and was supported by the business community, who had largely controlled city politics for decades. However, McConn lost in the general election to Jack Heard, formerly Sheriff of Harris County and the City Controller, Whitmire, sending the race to a runoff between the latter two. There was a sharp contrast between Whitmire and Heard in the runoff election. Heard was 63 years old, with 25 years of experience in political office. Whitmire was only 35 and had little political experience. She said in her speeches that her opponent's experience was too narrowly focused on law enforcement. According to one report, Heard spent $1.5 million on the race, while his opponent spent $650,000. While Heard had credibility with those who were more concerned about law and order or maintaining the status quo, Whitmire campaigned on her fiscal conservatism and moderate-to-liberal views on social issues. Whitmire was supported by a coalition of women, minorities, and other groups who were looking for a more progressive city government. These voters had been strengthened by the wave of newcomers who had moved into Houston during the boom years. She won the race with 170,695 votes (62.49%) to Heard's 102,446 votes (37.51%) . As noted by the New York Times, The developers and bankers and oil millionaires who used to handpick candidates can no longer be said to dominate the political scene. Houston is home today to too many different kinds of people, with too many different sets of values and interests, for any one group to control elections so easily.
Whitmire was the first mayor to appoint an African American, Lee P. Brown, as Houston's police chief. Brown had previously served as Commissioner of Public Safety, in Atlanta, Georgia. In Houston, he introduced the concept of Community Policing, creating improved relationships between the police department and the various diverse communities of the city. He left Houston in 1990 to serve as Police Commissioner of New York City. Brown was succeeded by the city's first female police chief, Elizabeth Watson, after he resigned to accept the top police job in New York City. Whitmire also appointed the first Hispanic, Sylvia R. Garcia, as presiding judge of the Houston Municipal Court.
In 1985, she ran for mayor against five-term mayor Louie Welch. She won that election, getting about 60 percent of the vote. She was re-elected in 1987, winning 74 percent of the vote. Her closest rival in a field of six was Bill Anderson, who only received 12 percent of the vote. She then won the 1989 mayoral election, receiving 63 percent of the vote (176,342 votes), while former mayor Fred Hofheinz received 88,971 votes (32 percent of the total).
Bob Lanier was a wealthy attorney who was considered a political kingmaker in Houston. During the 1980s, he had sold off much of his investment portfolio, just in time to avoid the economic collapse that engulfed many other investors. Appointed as chairman of the Texas Highway Commission, he became a critic of Mayor Whitmire's plan for Houston Metro to build a monorail system. Supporters of the Metro agency decided that it was prudent to compromise with Lanier, so they agreed to fund more street improvements, rather than concentrate solely on a rail system. Lanier soon became chairman of the Metro system board. The mayor fired Lanier from his Metro position in December 1989. It proved to be fatal to Whitmire's political future. Unable to find another satisfactory candidate for her office, Lanier decided to challenge her himself. The hot-button issues for the 1991 election became fear of street crime and skepticism about the functionality of an expensive monorail system proposed by Whitmire. Lanier promised to cancel the latter and put more police on the streets. Lanier made inroads into Whitmire's white supporters, while a black candidate, Sylvester Turner, cut into her black support. She placed third with 20% of the vote and thus failed to make the run-off election. Lanier would go on to defeat Turner for the mayoralty.
After the mayorship
After the 1991 election, Whitmire turned her talents to teaching at Rice University, and the University of Maryland. At Rice, she served as Director of the Rice Institute for Policy Analysis and held the Tsanoff Lectureship in Public Affairs. In the latter position she taught courses in public policy, management, and political science. In 1994, she was appointed President and CEO of Junior Achievement. In 1995 and 1996, Whitmire served as lecturer on Public Policy at the John F. Kennedy School of Government at Harvard University and was a Fellow at Harvard's Institute of Politics. In 1997, she accepted a position at the newly formed Academy of Leadership at the University of Maryland College Park campus. She is credited with attracting former U.S. Senator Bill Bradley to join the Academy as a scholar and chairman of the board.
Unlike most of Houston's former mayors who are still living, Whitmire has moved away from the city. She has said that she has no plans to return, although she visits the city regularly to see family and friends. In 2001, Whitmire moved to Hawaii, where she became an active investor in real estate. She married Alan J. Whelms in 2002. Whitmire commutes by air to work at the University of Maryland, where she is a professor at the James MacGregor Burns Academy of Leadership. She has also taught at Harvard University and Rice University. On July 1, 2005, Whitmire became the volunteer president of The Outdoor Circle, an organization dedicated to preserving Hawaii's beauty by eliminating outdoor blight.
When Annise Parker, Kathy's long-time friend and supporter, ran for Mayor in 2009, Whitmire flew to Houston to show her support by hosting a fund raiser. Parker ultimately won the election and became the city's first gay mayor.
Awards and honors
Whitmire has received numerous awards for her efforts and accomplishments, including:
Public Service Award from the American Society of Women CPAs (1984)
International Business Award from the Houston World Trade Association (1985)
Michael A. DiNunzio Award for Partnerships for Youth from the U.S. Conference of Mayors (1985)
Distinguished Professional Woman by the Committee on the Status of Women at the University of Texas Health Science Center at Houston(1987)
Institute of Human Relations Award from the International New Thought Alliance (1986)
Distinguished Sales Award by the Sales and Marketing Executives Society of Houston for her economic development efforts for Houston. (1987)
In 1985, Whitmire received the Michael A. DiNunzio Award for Partnerships for Youth from the U.S. Conference of Mayors
In 1987, she co-chaired the National League of Cities' (NLC) International Economic Development Task Force and
was the 1987 chair of the NLC's Finance, Administration and Intergovernmental Relations Steering Committee
Served as second vice-president on the board of directors of the Texas Municipal League and was a member of the board of trustees of the UH Foundation and the executive committee of the Houston Economic Development Council
Inducted into the Houston Hall of Fame on August 26, 2010
Political legacy
Soon after Whitmire left office, Bob Stein, a political scientist at Rice University, said that her legacy was to make the city operate more efficiently, citing improvements in fundamental operations like garbage collection and public transportation. He added, "She brought (Houston) into the 21st Century (sic) in city administration." His concluding opinion was, "I think she really was one of the great administrative mayors of this city's history, maybe the finest."
The "good old boy network" that once controlled city politics has lost much of its political clout. It can no longer count on support by the local news media. Many of the reforms that occurred during that period are still in effect. Elected city offices are still more open to minority candidates. There have been two African-Americans (Lee P. Brown and Sylvester Turner) and one woman (Annise Parker) elected to the mayor's office. A number of minority members have been elected as council members and as city controller.
See also
Politics of Houston
Notes
References
External links
Whitmire, Mayor Kathy and Jim Barlow. Mayor Kathy Whitmire Oral History, Houston Oral History Project, July 14, 2008.
1946 births
Living people
American accountants
American women accountants
American members of the Churches of Christ
Women mayors of places in Texas
Mayors of Houston
Politicians from Houston
People from Hawaii
San Jacinto High School alumni
University of Houston alumni
Women in finance
Texas Democrats
University of Maryland, College Park faculty
Presidents of the United States Conference of Mayors
21st-century American women
|
```shell
Workflow: long running branches
Tracking shorthands
Fetching a remote branch
Setting the upstream branch
Merging branches
```
|
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="@bool/out_fits_system_windows"
tools:context="loopeer.com.appbarlayout_spring_extension.SpringAppBarLayoutActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
app:layout_behavior="@string/appbar_spring_behavior"
android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax"
android:src="@mipmap/img_test"/>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end"
app:srcCompat="@android:drawable/ic_dialog_email"/>
<include layout="@layout/content_fling_fix_app_bar_layout"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
```
|
Peter Burge may refer to:
Peter Burge (rugby) (1884–1956), Australian rugby footballer
Peter Burge (cricketer) (1932–2001), Australian cricketer
Peter Burge (athlete) (born 1974), Australian long and triple jumper
|
John Blyth Hayes (21 April 1868 – 12 July 1956) was an Australian politician who served as a Senator for Tasmania from 1923 to 1947. He was President of the Senate from 1938 to 1941. Before entering federal politics, he had been a member of the Parliament of Tasmania from 1913 to 1923 and served as Premier of Tasmania for almost exactly one year, from 1922 to 1923.
Early life
Hayes was born on 21 April 1868 in Bridgewater, Tasmania. He was the son of Elizabeth (née Blyth) and Joshua John Hayes, his father being a farmer. His grandfather John Hayes was a Tasmanian member of parliament in the 1860s. Hayes was educated by his mother, but little else is known of his early life. He participated in the Western Australian gold rushes, and eventually became the manager of an ore-reduction facility and cyanide works at Wiluna. In about 1906 he returned to Tasmania and took up a property at Scottsdale. He married his cousin Laura Linda Blyth on 22 January 1907. Her brother Ernest Blyth was also a member of parliament.
State politics
Hayes was elected president of the North-Eastern Agricultural and Pastoral Association in 1911 and secretary of the Scottsdale Board of Agriculture in 1912. He was elected to the Tasmanian House of Assembly at the 1913 state election, running as a Liberal in Bass with the support of the farming community. In September 1915, Hayes was elected deputy leader of the opposition under Walter Lee. The Liberals formed a government after the 1916 state election, and subsequently adopted the name of the federal Nationalist Party formed after the Australian Labor Party split of 1916.
With Lee as premier, Hayes served as Minister for Lands and Works (1916–1919), Minister for Works (1919–1923), and Minister for Agriculture (1916–1923). He was also in charge of the Hydro-Electric Department. He won praise for his handling of the agriculture portfolio and for his work in the area of soldier settlement. In 1921, he was appointed Companion of the Order of St Michael and St George (CMG).
The Nationalists were reduced to a minority government at the 1922 state election, due to the success of the newly formed Country Party led by Hayes' brother-in-law Ernest Blyth. Lee did not enjoy the support of the Country Party and resigned as premier in August 1922. With the support of Blyth, Hayes replaced him as state premier on 14 August and formed a coalition, the first in the state's history. He inherited a government heavily in debt, but was unable to resolve the situation and was criticised for inaction. He resigned as premier on 16 August 1923, after just after a year in office.
Federal politics
After losing the premiership, Hayes nominated to fill the casual vacancy caused by the death of Senator Thomas Bakhap. He was elected only narrowly, beginning his term on 12 September 1923. He won election in his own right at the 1925 federal election, and then was elected to full six-year terms in 1928, 1934, and 1940. He joined the United Australia Party (UAP) with the rest of the Nationalists upon its formation in 1931.
In the Senate, Hayes concentrated on rural issues and Tasmanian matters. He served on the Joint Committee of Public Accounts from 1926 to 1932, including for a period as chairman. He was elected President of the Senate on 1 July 1938, becoming the first Tasmanian to hold the position. His election meant that the positions of President of the Senate, Speaker of the House of Representatives, and Prime Minister were all held by Tasmanians (George John Bell being the incumbent speaker and Joseph Lyons the incumbent prime minister).
Hayes faced several motions of dissent in the early days of his presidency, but his rulings later achieved widespread acceptance. He lost his position in unusual circumstances on 1 July 1941, when the Senate elected at the 1940 election convened for the first time. Although the government had a nominal majority in the Senate, Allan MacDonald had been taken ill and Keith Wilson was absent overseas on military duty. This allowed the ALP candidate James Cunningham to tie with Hayes. Cunningham's name was subsequently drawn at random in accordance with the standing rules of the Senate.
Final years
Hayes did not recontest his seat at the 1946 election and he was 79 years old at the expiration of his term on 30 June 1947. He retired to Launceston where he died on 12 July 1956. He was granted a state funeral and buried at Carr Villa Cemetery.
References
Premiers of Tasmania
1868 births
1956 deaths
Presidents of the Australian Senate
Members of the Australian Senate
Members of the Australian Senate for Tasmania
Nationalist Party of Australia members of the Parliament of Australia
United Australia Party members of the Parliament of Australia
Liberal Party of Australia members of the Parliament of Australia
Australian Companions of the Order of St Michael and St George
20th-century Australian politicians
Members of the Tasmanian House of Assembly
Nationalist Party of Australia members of the Parliament of Tasmania
Colony of Tasmania people
|
```java
/**
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.thingsboard.server.common.data.id;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import org.thingsboard.server.common.data.EntityType;
import java.util.UUID;
public class QueueId extends UUIDBased implements EntityId {
private static final long serialVersionUID = 1L;
@JsonCreator
public QueueId(@JsonProperty("id") UUID id) {
super(id);
}
public static QueueId fromString(String queueId) {
return new QueueId(UUID.fromString(queueId));
}
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "QUEUE", allowableValues = "QUEUE")
@Override
public EntityType getEntityType() {
return EntityType.QUEUE;
}
}
```
|
Gorjana Reidel (born January 19th, 1978) is an American jewelry designer and entrepreneur based in Laguna Beach, California. She co-founded the jewelry line gorjana in 2004, alongside her husband Jason Griffin Reidel.
Early years and education
Reidel immigrated to the US from Serbia when she was a child. Both she and her husband are former models who each earned a degree in marketing from Arizona State University.
Gorjana (company)
Reidel and her husband launched the jewelry brand gorjana in 2004.
In 2016, the Reidels opened their first jewelry brand store in Laguna Beach, followed by a second store in Venice Beach. The 2018 opening of another store in the West Village was their first in New York City. In August 2019 they opened a store in Malibu.
The couple and the company have since opened more then 40 stores on both coasts, with plans for an aggressive retail expansion. Today the multi-million-dollar company has over 100 employees and more than 1,000 retailers worldwide.
Style
Of the "more is more" mindset, Gorjana's pieces are made to mix, match and layer. Her versatile, adjustable pieces offer the wearer the chance for self-expression and endless layering possibilities. Her designs have attracted celebrities such as Josephine Skriver, Olivia Wilde and Jessica Alba.
A leader in contemporary jewelry, the gorjana line is found in over 1,000 department and specialty retail stores throughout the U.S.A.
Private life
Reidel and her husband were married in 2003 and have two children.
References
1978 births
Living people
American jewelry designers
American people of Serbian descent
Serbian expatriates in the United States
Serbian designers
American philanthropists
Women jewellers
Arizona State University alumni
|
Blastocatella is a genus of bacteria from the family of Blastocatellaceae with one known species (Blastocatella fastidiosa). Blastocatella fastidiosa has been isolated from savanna soil from Erichsfelde in Namibia.
References
Bacteria genera
Monotypic bacteria genera
Acidobacteriota
Taxa described in 2013
Bacteria described in 2013
|
```c
/*
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "webrtc/modules/audio_processing/aecm/aecm_core.h"
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include "webrtc/common_audio/ring_buffer.h"
#include "webrtc/common_audio/signal_processing/include/real_fft.h"
#include "webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h"
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
#include "webrtc/system_wrappers/interface/compile_assert_c.h"
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
#include "webrtc/typedefs.h"
// Square root of Hanning window in Q14.
#if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
// Table is defined in an ARM assembly file.
extern const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END;
#else
static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = {
0, 399, 798, 1196, 1594, 1990, 2386, 2780, 3172,
3562, 3951, 4337, 4720, 5101, 5478, 5853, 6224,
6591, 6954, 7313, 7668, 8019, 8364, 8705, 9040,
9370, 9695, 10013, 10326, 10633, 10933, 11227, 11514,
11795, 12068, 12335, 12594, 12845, 13089, 13325, 13553,
13773, 13985, 14189, 14384, 14571, 14749, 14918, 15079,
15231, 15373, 15506, 15631, 15746, 15851, 15947, 16034,
16111, 16179, 16237, 16286, 16325, 16354, 16373, 16384
};
#endif
#ifdef AECM_WITH_ABS_APPROX
//Q15 alpha = 0.99439986968132 const Factor for magnitude approximation
static const uint16_t kAlpha1 = 32584;
//Q15 beta = 0.12967166976970 const Factor for magnitude approximation
static const uint16_t kBeta1 = 4249;
//Q15 alpha = 0.94234827210087 const Factor for magnitude approximation
static const uint16_t kAlpha2 = 30879;
//Q15 beta = 0.33787806009150 const Factor for magnitude approximation
static const uint16_t kBeta2 = 11072;
//Q15 alpha = 0.82247698684306 const Factor for magnitude approximation
static const uint16_t kAlpha3 = 26951;
//Q15 beta = 0.57762063060713 const Factor for magnitude approximation
static const uint16_t kBeta3 = 18927;
#endif
static const int16_t kNoiseEstQDomain = 15;
static const int16_t kNoiseEstIncCount = 5;
static void ComfortNoise(AecmCore* aecm,
const uint16_t* dfa,
ComplexInt16* out,
const int16_t* lambda);
static void WindowAndFFT(AecmCore* aecm,
int16_t* fft,
const int16_t* time_signal,
ComplexInt16* freq_signal,
int time_signal_scaling) {
int i = 0;
// FFT of signal
for (i = 0; i < PART_LEN; i++) {
// Window time domain signal and insert into real part of
// transformation array |fft|
int16_t scaled_time_signal = time_signal[i] << time_signal_scaling;
fft[i] = (int16_t)((scaled_time_signal * WebRtcAecm_kSqrtHanning[i]) >> 14);
scaled_time_signal = time_signal[i + PART_LEN] << time_signal_scaling;
fft[PART_LEN + i] = (int16_t)((
scaled_time_signal * WebRtcAecm_kSqrtHanning[PART_LEN - i]) >> 14);
}
// Do forward FFT, then take only the first PART_LEN complex samples,
// and change signs of the imaginary parts.
WebRtcSpl_RealForwardFFT(aecm->real_fft, fft, (int16_t*)freq_signal);
for (i = 0; i < PART_LEN; i++) {
freq_signal[i].imag = -freq_signal[i].imag;
}
}
static void InverseFFTAndWindow(AecmCore* aecm,
int16_t* fft,
ComplexInt16* efw,
int16_t* output,
const int16_t* nearendClean) {
int i, j, outCFFT;
int32_t tmp32no1;
// Reuse |efw| for the inverse FFT output after transferring
// the contents to |fft|.
int16_t* ifft_out = (int16_t*)efw;
// Synthesis
for (i = 1, j = 2; i < PART_LEN; i += 1, j += 2) {
fft[j] = efw[i].real;
fft[j + 1] = -efw[i].imag;
}
fft[0] = efw[0].real;
fft[1] = -efw[0].imag;
fft[PART_LEN2] = efw[PART_LEN].real;
fft[PART_LEN2 + 1] = -efw[PART_LEN].imag;
// Inverse FFT. Keep outCFFT to scale the samples in the next block.
outCFFT = WebRtcSpl_RealInverseFFT(aecm->real_fft, fft, ifft_out);
for (i = 0; i < PART_LEN; i++) {
ifft_out[i] = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(
ifft_out[i], WebRtcAecm_kSqrtHanning[i], 14);
tmp32no1 = WEBRTC_SPL_SHIFT_W32((int32_t)ifft_out[i],
outCFFT - aecm->dfaCleanQDomain);
output[i] = (int16_t)WEBRTC_SPL_SAT(WEBRTC_SPL_WORD16_MAX,
tmp32no1 + aecm->outBuf[i],
WEBRTC_SPL_WORD16_MIN);
tmp32no1 = (ifft_out[PART_LEN + i] *
WebRtcAecm_kSqrtHanning[PART_LEN - i]) >> 14;
tmp32no1 = WEBRTC_SPL_SHIFT_W32(tmp32no1,
outCFFT - aecm->dfaCleanQDomain);
aecm->outBuf[i] = (int16_t)WEBRTC_SPL_SAT(WEBRTC_SPL_WORD16_MAX,
tmp32no1,
WEBRTC_SPL_WORD16_MIN);
}
// Copy the current block to the old position
// (aecm->outBuf is shifted elsewhere)
memcpy(aecm->xBuf, aecm->xBuf + PART_LEN, sizeof(int16_t) * PART_LEN);
memcpy(aecm->dBufNoisy,
aecm->dBufNoisy + PART_LEN,
sizeof(int16_t) * PART_LEN);
if (nearendClean != NULL)
{
memcpy(aecm->dBufClean,
aecm->dBufClean + PART_LEN,
sizeof(int16_t) * PART_LEN);
}
}
// Transforms a time domain signal into the frequency domain, outputting the
// complex valued signal, absolute value and sum of absolute values.
//
// time_signal [in] Pointer to time domain signal
// freq_signal_real [out] Pointer to real part of frequency domain array
// freq_signal_imag [out] Pointer to imaginary part of frequency domain
// array
// freq_signal_abs [out] Pointer to absolute value of frequency domain
// array
// freq_signal_sum_abs [out] Pointer to the sum of all absolute values in
// the frequency domain array
// return value The Q-domain of current frequency values
//
static int TimeToFrequencyDomain(AecmCore* aecm,
const int16_t* time_signal,
ComplexInt16* freq_signal,
uint16_t* freq_signal_abs,
uint32_t* freq_signal_sum_abs) {
int i = 0;
int time_signal_scaling = 0;
int32_t tmp32no1 = 0;
int32_t tmp32no2 = 0;
// In fft_buf, +16 for 32-byte alignment.
int16_t fft_buf[PART_LEN4 + 16];
int16_t *fft = (int16_t *) (((uintptr_t) fft_buf + 31) & ~31);
int16_t tmp16no1;
#ifndef WEBRTC_ARCH_ARM_V7
int16_t tmp16no2;
#endif
#ifdef AECM_WITH_ABS_APPROX
int16_t max_value = 0;
int16_t min_value = 0;
uint16_t alpha = 0;
uint16_t beta = 0;
#endif
#ifdef AECM_DYNAMIC_Q
tmp16no1 = WebRtcSpl_MaxAbsValueW16(time_signal, PART_LEN2);
time_signal_scaling = WebRtcSpl_NormW16(tmp16no1);
#endif
WindowAndFFT(aecm, fft, time_signal, freq_signal, time_signal_scaling);
// Extract imaginary and real part, calculate the magnitude for
// all frequency bins
freq_signal[0].imag = 0;
freq_signal[PART_LEN].imag = 0;
freq_signal_abs[0] = (uint16_t)WEBRTC_SPL_ABS_W16(freq_signal[0].real);
freq_signal_abs[PART_LEN] = (uint16_t)WEBRTC_SPL_ABS_W16(
freq_signal[PART_LEN].real);
(*freq_signal_sum_abs) = (uint32_t)(freq_signal_abs[0]) +
(uint32_t)(freq_signal_abs[PART_LEN]);
for (i = 1; i < PART_LEN; i++)
{
if (freq_signal[i].real == 0)
{
freq_signal_abs[i] = (uint16_t)WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
}
else if (freq_signal[i].imag == 0)
{
freq_signal_abs[i] = (uint16_t)WEBRTC_SPL_ABS_W16(freq_signal[i].real);
}
else
{
// Approximation for magnitude of complex fft output
// magn = sqrt(real^2 + imag^2)
// magn ~= alpha * max(|imag|,|real|) + beta * min(|imag|,|real|)
//
// The parameters alpha and beta are stored in Q15
#ifdef AECM_WITH_ABS_APPROX
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
if(tmp16no1 > tmp16no2)
{
max_value = tmp16no1;
min_value = tmp16no2;
} else
{
max_value = tmp16no2;
min_value = tmp16no1;
}
// Magnitude in Q(-6)
if ((max_value >> 2) > min_value)
{
alpha = kAlpha1;
beta = kBeta1;
} else if ((max_value >> 1) > min_value)
{
alpha = kAlpha2;
beta = kBeta2;
} else
{
alpha = kAlpha3;
beta = kBeta3;
}
tmp16no1 = (int16_t)((max_value * alpha) >> 15);
tmp16no2 = (int16_t)((min_value * beta) >> 15);
freq_signal_abs[i] = (uint16_t)tmp16no1 + (uint16_t)tmp16no2;
#else
#ifdef WEBRTC_ARCH_ARM_V7
__asm __volatile(
"smulbb %[tmp32no1], %[real], %[real]\n\t"
"smlabb %[tmp32no2], %[imag], %[imag], %[tmp32no1]\n\t"
:[tmp32no1]"+&r"(tmp32no1),
[tmp32no2]"=r"(tmp32no2)
:[real]"r"(freq_signal[i].real),
[imag]"r"(freq_signal[i].imag)
);
#else
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
tmp32no1 = tmp16no1 * tmp16no1;
tmp32no2 = tmp16no2 * tmp16no2;
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
#endif // WEBRTC_ARCH_ARM_V7
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);
freq_signal_abs[i] = (uint16_t)tmp32no1;
#endif // AECM_WITH_ABS_APPROX
}
(*freq_signal_sum_abs) += (uint32_t)freq_signal_abs[i];
}
return time_signal_scaling;
}
int WebRtcAecm_ProcessBlock(AecmCore* aecm,
const int16_t* farend,
const int16_t* nearendNoisy,
const int16_t* nearendClean,
int16_t* output) {
int i;
uint32_t xfaSum;
uint32_t dfaNoisySum;
uint32_t dfaCleanSum;
uint32_t echoEst32Gained;
uint32_t tmpU32;
int32_t tmp32no1;
uint16_t xfa[PART_LEN1];
uint16_t dfaNoisy[PART_LEN1];
uint16_t dfaClean[PART_LEN1];
uint16_t* ptrDfaClean = dfaClean;
const uint16_t* far_spectrum_ptr = NULL;
// 32 byte aligned buffers (with +8 or +16).
// TODO(kma): define fft with ComplexInt16.
int16_t fft_buf[PART_LEN4 + 2 + 16]; // +2 to make a loop safe.
int32_t echoEst32_buf[PART_LEN1 + 8];
int32_t dfw_buf[PART_LEN2 + 8];
int32_t efw_buf[PART_LEN2 + 8];
int16_t* fft = (int16_t*) (((uintptr_t) fft_buf + 31) & ~ 31);
int32_t* echoEst32 = (int32_t*) (((uintptr_t) echoEst32_buf + 31) & ~ 31);
ComplexInt16* dfw = (ComplexInt16*)(((uintptr_t)dfw_buf + 31) & ~31);
ComplexInt16* efw = (ComplexInt16*)(((uintptr_t)efw_buf + 31) & ~31);
int16_t hnl[PART_LEN1];
int16_t numPosCoef = 0;
int16_t nlpGain = ONE_Q14;
int delay;
int16_t tmp16no1;
int16_t tmp16no2;
int16_t mu;
int16_t supGain;
int16_t zeros32, zeros16;
int16_t zerosDBufNoisy, zerosDBufClean, zerosXBuf;
int far_q;
int16_t resolutionDiff, qDomainDiff, dfa_clean_q_domain_diff;
const int kMinPrefBand = 4;
const int kMaxPrefBand = 24;
int32_t avgHnl32 = 0;
// Determine startup state. There are three states:
// (0) the first CONV_LEN blocks
// (1) another CONV_LEN blocks
// (2) the rest
if (aecm->startupState < 2)
{
aecm->startupState = (aecm->totCount >= CONV_LEN) +
(aecm->totCount >= CONV_LEN2);
}
// END: Determine startup state
// Buffer near and far end signals
memcpy(aecm->xBuf + PART_LEN, farend, sizeof(int16_t) * PART_LEN);
memcpy(aecm->dBufNoisy + PART_LEN, nearendNoisy, sizeof(int16_t) * PART_LEN);
if (nearendClean != NULL)
{
memcpy(aecm->dBufClean + PART_LEN,
nearendClean,
sizeof(int16_t) * PART_LEN);
}
// Transform far end signal from time domain to frequency domain.
far_q = TimeToFrequencyDomain(aecm,
aecm->xBuf,
dfw,
xfa,
&xfaSum);
// Transform noisy near end signal from time domain to frequency domain.
zerosDBufNoisy = TimeToFrequencyDomain(aecm,
aecm->dBufNoisy,
dfw,
dfaNoisy,
&dfaNoisySum);
aecm->dfaNoisyQDomainOld = aecm->dfaNoisyQDomain;
aecm->dfaNoisyQDomain = (int16_t)zerosDBufNoisy;
if (nearendClean == NULL)
{
ptrDfaClean = dfaNoisy;
aecm->dfaCleanQDomainOld = aecm->dfaNoisyQDomainOld;
aecm->dfaCleanQDomain = aecm->dfaNoisyQDomain;
dfaCleanSum = dfaNoisySum;
} else
{
// Transform clean near end signal from time domain to frequency domain.
zerosDBufClean = TimeToFrequencyDomain(aecm,
aecm->dBufClean,
dfw,
dfaClean,
&dfaCleanSum);
aecm->dfaCleanQDomainOld = aecm->dfaCleanQDomain;
aecm->dfaCleanQDomain = (int16_t)zerosDBufClean;
}
// Get the delay
// Save far-end history and estimate delay
WebRtcAecm_UpdateFarHistory(aecm, xfa, far_q);
if (WebRtc_AddFarSpectrumFix(aecm->delay_estimator_farend,
xfa,
PART_LEN1,
far_q) == -1) {
return -1;
}
delay = WebRtc_DelayEstimatorProcessFix(aecm->delay_estimator,
dfaNoisy,
PART_LEN1,
zerosDBufNoisy);
if (delay == -1)
{
return -1;
}
else if (delay == -2)
{
// If the delay is unknown, we assume zero.
// NOTE: this will have to be adjusted if we ever add lookahead.
delay = 0;
}
if (aecm->fixedDelay >= 0)
{
// Use fixed delay
delay = aecm->fixedDelay;
}
// Get aligned far end spectrum
far_spectrum_ptr = WebRtcAecm_AlignedFarend(aecm, &far_q, delay);
zerosXBuf = (int16_t) far_q;
if (far_spectrum_ptr == NULL)
{
return -1;
}
// Calculate log(energy) and update energy threshold levels
WebRtcAecm_CalcEnergies(aecm,
far_spectrum_ptr,
zerosXBuf,
dfaNoisySum,
echoEst32);
// Calculate stepsize
mu = WebRtcAecm_CalcStepSize(aecm);
// Update counters
aecm->totCount++;
// This is the channel estimation algorithm.
// It is base on NLMS but has a variable step length,
// which was calculated above.
WebRtcAecm_UpdateChannel(aecm,
far_spectrum_ptr,
zerosXBuf,
dfaNoisy,
mu,
echoEst32);
supGain = WebRtcAecm_CalcSuppressionGain(aecm);
// Calculate Wiener filter hnl[]
for (i = 0; i < PART_LEN1; i++)
{
// Far end signal through channel estimate in Q8
// How much can we shift right to preserve resolution
tmp32no1 = echoEst32[i] - aecm->echoFilt[i];
aecm->echoFilt[i] += (tmp32no1 * 50) >> 8;
zeros32 = WebRtcSpl_NormW32(aecm->echoFilt[i]) + 1;
zeros16 = WebRtcSpl_NormW16(supGain) + 1;
if (zeros32 + zeros16 > 16)
{
// Multiplication is safe
// Result in
// Q(RESOLUTION_CHANNEL+RESOLUTION_SUPGAIN+
// aecm->xfaQDomainBuf[diff])
echoEst32Gained = WEBRTC_SPL_UMUL_32_16((uint32_t)aecm->echoFilt[i],
(uint16_t)supGain);
resolutionDiff = 14 - RESOLUTION_CHANNEL16 - RESOLUTION_SUPGAIN;
resolutionDiff += (aecm->dfaCleanQDomain - zerosXBuf);
} else
{
tmp16no1 = 17 - zeros32 - zeros16;
resolutionDiff = 14 + tmp16no1 - RESOLUTION_CHANNEL16 -
RESOLUTION_SUPGAIN;
resolutionDiff += (aecm->dfaCleanQDomain - zerosXBuf);
if (zeros32 > tmp16no1)
{
echoEst32Gained = WEBRTC_SPL_UMUL_32_16((uint32_t)aecm->echoFilt[i],
supGain >> tmp16no1);
} else
{
// Result in Q-(RESOLUTION_CHANNEL+RESOLUTION_SUPGAIN-16)
echoEst32Gained = (aecm->echoFilt[i] >> tmp16no1) * supGain;
}
}
zeros16 = WebRtcSpl_NormW16(aecm->nearFilt[i]);
assert(zeros16 >= 0); // |zeros16| is a norm, hence non-negative.
dfa_clean_q_domain_diff = aecm->dfaCleanQDomain - aecm->dfaCleanQDomainOld;
if (zeros16 < dfa_clean_q_domain_diff && aecm->nearFilt[i]) {
tmp16no1 = aecm->nearFilt[i] << zeros16;
qDomainDiff = zeros16 - dfa_clean_q_domain_diff;
tmp16no2 = ptrDfaClean[i] >> -qDomainDiff;
} else {
tmp16no1 = dfa_clean_q_domain_diff < 0
? aecm->nearFilt[i] >> -dfa_clean_q_domain_diff
: aecm->nearFilt[i] << dfa_clean_q_domain_diff;
qDomainDiff = 0;
tmp16no2 = ptrDfaClean[i];
}
tmp32no1 = (int32_t)(tmp16no2 - tmp16no1);
tmp16no2 = (int16_t)(tmp32no1 >> 4);
tmp16no2 += tmp16no1;
zeros16 = WebRtcSpl_NormW16(tmp16no2);
if ((tmp16no2) & (-qDomainDiff > zeros16)) {
aecm->nearFilt[i] = WEBRTC_SPL_WORD16_MAX;
} else {
aecm->nearFilt[i] = qDomainDiff < 0 ? tmp16no2 << -qDomainDiff
: tmp16no2 >> qDomainDiff;
}
// Wiener filter coefficients, resulting hnl in Q14
if (echoEst32Gained == 0)
{
hnl[i] = ONE_Q14;
} else if (aecm->nearFilt[i] == 0)
{
hnl[i] = 0;
} else
{
// Multiply the suppression gain
// Rounding
echoEst32Gained += (uint32_t)(aecm->nearFilt[i] >> 1);
tmpU32 = WebRtcSpl_DivU32U16(echoEst32Gained,
(uint16_t)aecm->nearFilt[i]);
// Current resolution is
// Q-(RESOLUTION_CHANNEL+RESOLUTION_SUPGAIN- max(0,17-zeros16- zeros32))
// Make sure we are in Q14
tmp32no1 = (int32_t)WEBRTC_SPL_SHIFT_W32(tmpU32, resolutionDiff);
if (tmp32no1 > ONE_Q14)
{
hnl[i] = 0;
} else if (tmp32no1 < 0)
{
hnl[i] = ONE_Q14;
} else
{
// 1-echoEst/dfa
hnl[i] = ONE_Q14 - (int16_t)tmp32no1;
if (hnl[i] < 0)
{
hnl[i] = 0;
}
}
}
if (hnl[i])
{
numPosCoef++;
}
}
// Only in wideband. Prevent the gain in upper band from being larger than
// in lower band.
if (aecm->mult == 2)
{
// TODO(bjornv): Investigate if the scaling of hnl[i] below can cause
// speech distortion in double-talk.
for (i = 0; i < PART_LEN1; i++)
{
hnl[i] = (int16_t)((hnl[i] * hnl[i]) >> 14);
}
for (i = kMinPrefBand; i <= kMaxPrefBand; i++)
{
avgHnl32 += (int32_t)hnl[i];
}
assert(kMaxPrefBand - kMinPrefBand + 1 > 0);
avgHnl32 /= (kMaxPrefBand - kMinPrefBand + 1);
for (i = kMaxPrefBand; i < PART_LEN1; i++)
{
if (hnl[i] > (int16_t)avgHnl32)
{
hnl[i] = (int16_t)avgHnl32;
}
}
}
// Calculate NLP gain, result is in Q14
if (aecm->nlpFlag)
{
for (i = 0; i < PART_LEN1; i++)
{
// Truncate values close to zero and one.
if (hnl[i] > NLP_COMP_HIGH)
{
hnl[i] = ONE_Q14;
} else if (hnl[i] < NLP_COMP_LOW)
{
hnl[i] = 0;
}
// Remove outliers
if (numPosCoef < 3)
{
nlpGain = 0;
} else
{
nlpGain = ONE_Q14;
}
// NLP
if ((hnl[i] == ONE_Q14) && (nlpGain == ONE_Q14))
{
hnl[i] = ONE_Q14;
} else
{
hnl[i] = (int16_t)((hnl[i] * nlpGain) >> 14);
}
// multiply with Wiener coefficients
efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
hnl[i], 14));
efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
hnl[i], 14));
}
}
else
{
// multiply with Wiener coefficients
for (i = 0; i < PART_LEN1; i++)
{
efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
hnl[i], 14));
efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
hnl[i], 14));
}
}
if (aecm->cngMode == AecmTrue)
{
ComfortNoise(aecm, ptrDfaClean, efw, hnl);
}
InverseFFTAndWindow(aecm, fft, efw, output, nearendClean);
return 0;
}
static void ComfortNoise(AecmCore* aecm,
const uint16_t* dfa,
ComplexInt16* out,
const int16_t* lambda) {
int16_t i;
int16_t tmp16;
int32_t tmp32;
int16_t randW16[PART_LEN];
int16_t uReal[PART_LEN1];
int16_t uImag[PART_LEN1];
int32_t outLShift32;
int16_t noiseRShift16[PART_LEN1];
int16_t shiftFromNearToNoise = kNoiseEstQDomain - aecm->dfaCleanQDomain;
int16_t minTrackShift;
assert(shiftFromNearToNoise >= 0);
assert(shiftFromNearToNoise < 16);
if (aecm->noiseEstCtr < 100)
{
// Track the minimum more quickly initially.
aecm->noiseEstCtr++;
minTrackShift = 6;
} else
{
minTrackShift = 9;
}
// Estimate noise power.
for (i = 0; i < PART_LEN1; i++)
{
// Shift to the noise domain.
tmp32 = (int32_t)dfa[i];
outLShift32 = tmp32 << shiftFromNearToNoise;
if (outLShift32 < aecm->noiseEst[i])
{
// Reset "too low" counter
aecm->noiseEstTooLowCtr[i] = 0;
// Track the minimum.
if (aecm->noiseEst[i] < (1 << minTrackShift))
{
// For small values, decrease noiseEst[i] every
// |kNoiseEstIncCount| block. The regular approach below can not
// go further down due to truncation.
aecm->noiseEstTooHighCtr[i]++;
if (aecm->noiseEstTooHighCtr[i] >= kNoiseEstIncCount)
{
aecm->noiseEst[i]--;
aecm->noiseEstTooHighCtr[i] = 0; // Reset the counter
}
}
else
{
aecm->noiseEst[i] -= ((aecm->noiseEst[i] - outLShift32)
>> minTrackShift);
}
} else
{
// Reset "too high" counter
aecm->noiseEstTooHighCtr[i] = 0;
// Ramp slowly upwards until we hit the minimum again.
if ((aecm->noiseEst[i] >> 19) > 0)
{
// Avoid overflow.
// Multiplication with 2049 will cause wrap around. Scale
// down first and then multiply
aecm->noiseEst[i] >>= 11;
aecm->noiseEst[i] *= 2049;
}
else if ((aecm->noiseEst[i] >> 11) > 0)
{
// Large enough for relative increase
aecm->noiseEst[i] *= 2049;
aecm->noiseEst[i] >>= 11;
}
else
{
// Make incremental increases based on size every
// |kNoiseEstIncCount| block
aecm->noiseEstTooLowCtr[i]++;
if (aecm->noiseEstTooLowCtr[i] >= kNoiseEstIncCount)
{
aecm->noiseEst[i] += (aecm->noiseEst[i] >> 9) + 1;
aecm->noiseEstTooLowCtr[i] = 0; // Reset counter
}
}
}
}
for (i = 0; i < PART_LEN1; i++)
{
tmp32 = aecm->noiseEst[i] >> shiftFromNearToNoise;
if (tmp32 > 32767)
{
tmp32 = 32767;
aecm->noiseEst[i] = tmp32 << shiftFromNearToNoise;
}
noiseRShift16[i] = (int16_t)tmp32;
tmp16 = ONE_Q14 - lambda[i];
noiseRShift16[i] = (int16_t)((tmp16 * noiseRShift16[i]) >> 14);
}
// Generate a uniform random array on [0 2^15-1].
WebRtcSpl_RandUArray(randW16, PART_LEN, &aecm->seed);
// Generate noise according to estimated energy.
uReal[0] = 0; // Reject LF noise.
uImag[0] = 0;
for (i = 1; i < PART_LEN1; i++)
{
// Get a random index for the cos and sin tables over [0 359].
tmp16 = (int16_t)((359 * randW16[i - 1]) >> 15);
// Tables are in Q13.
uReal[i] = (int16_t)((noiseRShift16[i] * WebRtcAecm_kCosTable[tmp16]) >>
13);
uImag[i] = (int16_t)((-noiseRShift16[i] * WebRtcAecm_kSinTable[tmp16]) >>
13);
}
uImag[PART_LEN] = 0;
for (i = 0; i < PART_LEN1; i++)
{
out[i].real = WebRtcSpl_AddSatW16(out[i].real, uReal[i]);
out[i].imag = WebRtcSpl_AddSatW16(out[i].imag, uImag[i]);
}
}
```
|
The Hagwilget Village First Nation is a First Nations band government, a subgroup of the (Gitxsan) people, located at Hagwilget, British Columbia, Canada, which is just east of Hazelton, British Columbia. The band is one of the 13 member governments of the |Hereditary Chiefs of the Gitxsan, which functions as a tribal council (but is a traditional government) in alliance with the 35 members of the Hereditary Chiefs of the Gitxsan.
Chief and Councillors
Demographics
INAC number 534, the Hagwilget Village First Nation had 694 members as of July 2009.
References
External links
Hagwilget website
Bulkley Valley
Skeena Country
|
Mari Jászai (born Mária Krippel; 24 February 1850, Ászár – 5 October 1926, Budapest) was a Hungarian actress.
Life
Mari Jászai 24 February 1850 in Ászár, Komárom county, as a daughter of a carpenter. She worked from age 10 as a maidservant, both in Budapest and Vienna, assisting soldiers as a sutling wench in the Battle of Königgrätz. In 1866, aged 16, she fled to the touring company of Gusztáv Hubay in Székesfehérvár, and began to work as an extra. By 1867 she already acted on stages of Buda, and from 1868, in the theatre of Cluj-Napoca. She met her first husband, comedian Vidor Kassai during her time in Buda, whom she divorced two years later, never marrying again. Jászai became a member of the National Theatre in 1872, where she remained until her death (except for the 1900 season, working in Vígszínház theatre).
Legacy
A permanent member of the National Theatre since 1901, Mari Jászai became one of the most influential actors in the Hungarian theatrical world. Playing over 300 roles, she also translated a number of works, including Henrik Ibsen's John Gabriel Borkman. The theatre of Tatabánya is named after her, as are numerous public places in Budapest, and one of the premier awards of national dramatic artists, the Jászai Mari Award.
Selected filmography
Bánk Bán (1914)
The Exile (1914)
Sources
István, Lehel. Jászai Mari emlékiratai. Budapest: Babits Kiadó, 2003.
Mónika, Balatoni. Tükör-játék. Budapest: Kairosz Kiadó, 2002.
External links
Official site of the Jászai Mari Theatre
Mari Jászai on Port.hu
1850 births
1926 deaths
Actresses from British India
Hungarian stage actresses
Burials at Kerepesi Cemetery
19th-century Hungarian actresses
Hungarian silent film actresses
20th-century Hungarian actresses
|
```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of satpy.
#
# satpy is free software: you can redistribute it and/or modify it under the
# version.
#
# satpy is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
#
# satpy. If not, see <path_to_url
"""FIDUCEO MVIRI FCDR Reader.
Introduction
------------
The FIDUCEO MVIRI FCDR is a Fundamental Climate Data Record (FCDR) of
re-calibrated Level 1.5 Infrared, Water Vapour, and Visible radiances from
the Meteosat Visible Infra-Red Imager (MVIRI) instrument onboard the
Meteosat First Generation satellites. There are two variants of the dataset:
The *full FCDR* and a simplified version called *easy FCDR*. Some datasets are
only available in one of the two variants, see the corresponding YAML
definition in ``satpy/etc/readers/``.
Dataset Names
-------------
The FIDUCEO MVIRI readers use names ``VIS``, ``WV`` and ``IR`` for the visible,
water vapor and infrared channels, respectively. These are different from
the original netCDF variable names for the following reasons:
- VIS channel is named differently in full FCDR (``counts_vis``) and easy FCDR
(``toa_bidirectional_reflectance_vis``)
- netCDF variable names contain the calibration level (e.g. ``counts_...``),
which might be confusing for satpy users if a different calibration level
is chosen.
Remaining datasets (such as quality flags and uncertainties) have the same
name in the reader as in the netCDF file.
Example:
--------
This is how to read FIDUCEO MVIRI FCDR data in satpy:
.. code-block:: python
from satpy import Scene
scn = Scene(filenames=['FIDUCEO_FCDR_L15_MVIRI_MET7-57.0...'],
reader='mviri_l1b_fiduceo_nc')
scn.load(['VIS', 'WV', 'IR'])
Global netCDF attributes are available in the ``raw_metadata`` attribute of
each loaded dataset.
Image Orientation
-----------------
The images are stored in MVIRI scanning direction, that means South is up and
East is right. This can be changed as follows:
.. code-block:: python
scn.load(['VIS'], upper_right_corner='NE')
Geolocation
-----------
In addition to the image data, FIDUCEO also provides so called *static FCDRs*
containing latitude and longitude coordinates. In order to simplify their
usage, the FIDUCEO MVIRI readers do not make use of these static files, but
instead provide an area definition that can be used to compute longitude and
latitude coordinates on demand.
.. code-block:: python
area = scn['VIS'].attrs['area']
lons, lats = area.get_lonlats()
Those were compared to the static FCDR and they agree very well, however there
are small differences. The mean difference is < 1E3 degrees for all channels
and projection longitudes.
Huge VIS Reflectances
---------------------
You might encounter huge VIS reflectances (10^8 percent and greater) in
situations where both radiance and solar zenith angle are small. The reader
certainly needs some improvement in this regard. Maybe the corresponding
uncertainties can be used to filter these cases before calculating reflectances.
VIS Channel Quality Flags
-------------------------
Quality flags are available for the VIS channel only. A simple approach for
masking bad quality pixels is to set the ``mask_bad_quality`` keyword argument
to ``True``:
.. code-block:: python
scn = Scene(filenames=['FIDUCEO_FCDR_L15_MVIRI_MET7-57.0...'],
reader='mviri_l1b_fiduceo_nc',
reader_kwargs={'mask_bad_quality': True})
See :class:`FiduceoMviriBase` for an argument description. In some situations
however the entire image can be flagged (look out for warnings). In that case
check out the ``quality_pixel_bitmask`` and ``data_quality_bitmask`` datasets
to find out why.
Angles
------
The FIDUCEO MVIRI FCDR provides satellite and solar angles on a coarse tiepoint
grid. By default these datasets will be interpolated to the higher VIS
resolution. This can be changed as follows:
.. code-block:: python
scn.load(['solar_zenith_angle'], resolution=4500)
If you need the angles in both resolutions, use data queries:
.. code-block:: python
from satpy import DataQuery
query_vis = DataQuery(
name='solar_zenith_angle',
resolution=2250
)
query_ir = DataQuery(
name='solar_zenith_angle',
resolution=4500
)
scn.load([query_vis, query_ir])
# Use the query objects to access the datasets as follows
sza_vis = scn[query_vis]
References:
-----------
- `[Handbook]`_ MFG User Handbook
- `[PUG]`_ FIDUCEO MVIRI FCDR Product User Guide
.. _[Handbook]: path_to_url
.. _[PUG]: path_to_url
"""
import abc
import functools
import warnings
import dask.array as da
import numpy as np
import xarray as xr
from satpy.readers._geos_area import get_area_definition, get_area_extent, sampling_to_lfac_cfac
from satpy.readers.file_handlers import BaseFileHandler
from satpy.utils import get_legacy_chunk_size
CHUNK_SIZE = get_legacy_chunk_size()
EQUATOR_RADIUS = 6378140.0
POLE_RADIUS = 6356755.0
ALTITUDE = 42164000.0 - EQUATOR_RADIUS
"""[Handbook] section 5.2.1."""
MVIRI_FIELD_OF_VIEW = 18.0
"""[Handbook] section 5.3.2.1."""
CHANNELS = ["VIS", "WV", "IR"]
ANGLES = [
"solar_zenith_angle",
"solar_azimuth_angle",
"satellite_zenith_angle",
"satellite_azimuth_angle"
]
OTHER_REFLECTANCES = [
"u_independent_toa_bidirectional_reflectance",
"u_structured_toa_bidirectional_reflectance"
]
HIGH_RESOL = 2250
class IRWVCalibrator:
"""Calibrate IR & WV channels."""
def __init__(self, coefs):
"""Initialize the calibrator.
Args:
coefs: Calibration coefficients.
"""
self.coefs = coefs
def calibrate(self, counts, calibration):
"""Calibrate IR/WV counts to the given calibration."""
if calibration == "counts":
return counts
elif calibration in ("radiance", "brightness_temperature"):
return self._calibrate_rad_bt(counts, calibration)
else:
raise KeyError(
"Invalid IR/WV calibration: {}".format(calibration.name)
)
def _calibrate_rad_bt(self, counts, calibration):
"""Calibrate counts to radiance or brightness temperature."""
rad = self._counts_to_radiance(counts)
if calibration == "radiance":
return rad
bt = self._radiance_to_brightness_temperature(rad)
return bt
def _counts_to_radiance(self, counts):
"""Convert IR/WV counts to radiance.
Reference: [PUG], equations (4.1) and (4.2).
"""
rad = self.coefs["a"] + self.coefs["b"] * counts
return rad.where(rad > 0, np.float32(np.nan))
def _radiance_to_brightness_temperature(self, rad):
"""Convert IR/WV radiance to brightness temperature.
Reference: [PUG], equations (5.1) and (5.2).
"""
bt = self.coefs["bt_b"] / (np.log(rad) - self.coefs["bt_a"])
return bt.where(bt > 0, np.float32(np.nan))
class VISCalibrator:
"""Calibrate VIS channel."""
def __init__(self, coefs, solar_zenith_angle=None):
"""Initialize the calibrator.
Args:
coefs:
Calibration coefficients.
solar_zenith_angle (optional):
Solar zenith angle. Only required for calibration to
reflectance.
"""
self.coefs = coefs
self.solar_zenith_angle = solar_zenith_angle
def calibrate(self, counts, calibration):
"""Calibrate VIS counts."""
if calibration == "counts":
return counts
elif calibration in ("radiance", "reflectance"):
return self._calibrate_rad_refl(counts, calibration)
else:
raise KeyError(
"Invalid VIS calibration: {}".format(calibration.name)
)
def _calibrate_rad_refl(self, counts, calibration):
"""Calibrate counts to radiance or reflectance."""
rad = self._counts_to_radiance(counts)
if calibration == "radiance":
return rad
refl = self._radiance_to_reflectance(rad)
refl = self.update_refl_attrs(refl)
return refl
def _counts_to_radiance(self, counts):
"""Convert VIS counts to radiance.
Reference: [PUG], equations (7) and (8).
"""
years_since_launch = self.coefs["years_since_launch"]
a_cf = (self.coefs["a0"] +
self.coefs["a1"] * years_since_launch +
self.coefs["a2"] * years_since_launch ** 2)
mean_count_space_vis = self.coefs["mean_count_space"]
rad = (counts - mean_count_space_vis) * a_cf
return rad.where(rad > 0, np.float32(np.nan))
def _radiance_to_reflectance(self, rad):
"""Convert VIS radiance to reflectance factor.
Note: Produces huge reflectances in situations where both radiance and
solar zenith angle are small. Maybe the corresponding uncertainties
can be used to filter these cases before calculating reflectances.
Reference: [PUG], equation (6).
"""
sza = self.solar_zenith_angle.where(
da.fabs(self.solar_zenith_angle) < 90,
np.float32(np.nan)
) # direct illumination only
cos_sza = np.cos(np.deg2rad(sza))
refl = (
(np.pi * self.coefs["distance_sun_earth"] ** 2) /
(self.coefs["solar_irradiance"] * cos_sza) *
rad
)
return self.refl_factor_to_percent(refl)
def update_refl_attrs(self, refl):
"""Update attributes of reflectance datasets."""
refl.attrs["sun_earth_distance_correction_applied"] = True
refl.attrs["sun_earth_distance_correction_factor"] = self.coefs[
"distance_sun_earth"].item()
return refl
@staticmethod
def refl_factor_to_percent(refl):
"""Convert reflectance factor to percent."""
return refl * 100
class Navigator:
"""Navigate MVIRI images."""
def get_area_def(self, im_size, projection_longitude):
"""Create MVIRI area definition."""
proj_params = self._get_proj_params(im_size, projection_longitude)
extent = get_area_extent(proj_params)
return get_area_definition(proj_params, extent)
def _get_proj_params(self, im_size, projection_longitude):
"""Get projection parameters for the given settings."""
area_name = "geos_mviri_{0}x{0}".format(im_size)
lfac, cfac, loff, coff = self._get_factors_offsets(im_size)
return {
"ssp_lon": projection_longitude,
"a": EQUATOR_RADIUS,
"b": POLE_RADIUS,
"h": ALTITUDE,
"units": "m",
"loff": loff - im_size,
"coff": coff,
"lfac": -lfac,
"cfac": -cfac,
"nlines": im_size,
"ncols": im_size,
"scandir": "S2N", # Reference: [PUG] section 2.
"p_id": area_name,
"a_name": area_name,
"a_desc": "MVIRI Geostationary Projection"
}
def _get_factors_offsets(self, im_size):
"""Determine line/column offsets and scaling factors."""
# For offsets see variables "asamp" and "aline" of subroutine
# "refgeo" in [Handbook] and in
# path_to_url
loff = coff = im_size / 2 + 0.5
lfac = cfac = sampling_to_lfac_cfac(
np.deg2rad(MVIRI_FIELD_OF_VIEW) / im_size
)
return lfac, cfac, loff, coff
class Interpolator:
"""Interpolate datasets to another resolution."""
@staticmethod
def interp_tiepoints(ds, target_x, target_y):
"""Interpolate dataset between tiepoints.
Uses linear interpolation.
FUTURE: [PUG] recommends cubic spline interpolation.
Args:
ds:
Dataset to be interpolated
target_x:
Target x coordinates
target_y:
Target y coordinates
"""
# No tiepoint coordinates specified in the files. Use dimensions
# to calculate tiepoint sampling and assign tiepoint coordinates
# accordingly.
sampling = target_x.size // ds.coords["x"].size
ds = ds.assign_coords(x=target_x.values[::sampling],
y=target_y.values[::sampling])
return ds.interp(x=target_x.values, y=target_y.values)
@staticmethod
def interp_acq_time(time2d, target_y):
"""Interpolate scanline acquisition time to the given coordinates.
The files provide timestamps per pixel for the low resolution
channels (IR/WV) only.
1) Average values in each line to obtain one timestamp per line.
2) For the VIS channel duplicate values in y-direction (as
advised by [PUG]).
Note that the timestamps do not increase monotonically with the
line number in some cases.
Returns:
Mean scanline acquisition timestamps
"""
# Compute mean timestamp per scanline
time = time2d.mean(dim="x")
# If required, repeat timestamps in y-direction to obtain higher
# resolution
y = time.coords["y"].values
if y.size < target_y.size:
reps = target_y.size // y.size
y_rep = np.repeat(y, reps)
time_hires = time.reindex(y=y_rep)
time_hires = time_hires.assign_coords(y=target_y)
return time_hires
return time
class VisQualityControl:
"""Simple quality control for VIS channel."""
def __init__(self, mask):
"""Initialize the quality control."""
self._mask = mask
def check(self):
"""Check VIS channel quality and issue a warning if it's bad."""
use_with_caution = da.bitwise_and(self._mask, 2)
if use_with_caution.all():
warnings.warn(
'All pixels of the VIS channel are flagged as "use with '
'caution". Use datasets "quality_pixel_bitmask" and '
'"data_quality_bitmask" to find out why.',
stacklevel=2
)
def mask(self, ds):
"""Mask VIS pixels with bad quality.
Pixels are considered bad quality if the "quality_pixel_bitmask" is
everything else than 0 (no flag set).
"""
return ds.where(self._mask == 0, np.float32(np.nan))
def is_high_resol(resolution):
"""Identify high resolution channel."""
return resolution == HIGH_RESOL
class DatasetWrapper:
"""Helper class for accessing the dataset."""
def __init__(self, nc):
"""Wrap the given dataset."""
self.nc = nc
@property
def attrs(self):
"""Exposes dataset attributes."""
return self.nc.attrs
def __getitem__(self, item):
"""Get a variable from the dataset."""
ds = self.nc[item]
if self._should_dims_be_renamed(ds):
ds = self._rename_dims(ds)
elif self._coordinates_not_assigned(ds):
ds = self._reassign_coords(ds)
self._cleanup_attrs(ds)
return ds
def _should_dims_be_renamed(self, ds):
"""Determine whether dataset dimensions need to be renamed."""
return "y_ir_wv" in ds.dims or "y_tie" in ds.dims
def _rename_dims(self, ds):
"""Rename dataset dimensions to match satpy's expectations."""
new_names = {
"y_ir_wv": "y",
"x_ir_wv": "x",
"y_tie": "y",
"x_tie": "x"
}
for old_name, new_name in new_names.items():
if old_name in ds.dims:
ds = ds.rename({old_name: new_name})
return ds
def _coordinates_not_assigned(self, ds):
return "y" in ds.dims and "y" not in ds.coords
def _reassign_coords(self, ds):
"""Re-assign coordinates.
For some reason xarray doesn't assign coordinates to all high
resolution data variables.
"""
return ds.assign_coords({"y": self.nc.coords["y"],
"x": self.nc.coords["x"]})
def _cleanup_attrs(self, ds):
"""Cleanup dataset attributes."""
# Remove ancillary_variables attribute to avoid downstream
# satpy warnings.
ds.attrs.pop("ancillary_variables", None)
def get_time(self):
"""Get time coordinate.
Variable is sometimes named "time" and sometimes "time_ir_wv".
"""
try:
return self["time_ir_wv"]
except KeyError:
return self["time"]
def get_xy_coords(self, resolution):
"""Get x and y coordinates for the given resolution."""
if is_high_resol(resolution):
return self.nc.coords["x"], self.nc.coords["y"]
return self.nc.coords["x_ir_wv"], self.nc.coords["x_ir_wv"]
def get_image_size(self, resolution):
"""Get image size for the given resolution."""
if is_high_resol(resolution):
return self.nc.coords["y"].size
return self.nc.coords["y_ir_wv"].size
class FiduceoMviriBase(BaseFileHandler):
"""Baseclass for FIDUCEO MVIRI file handlers."""
nc_keys = {
"WV": "count_wv",
"IR": "count_ir"
}
def __init__(self, filename, filename_info, filetype_info, # noqa: D417
mask_bad_quality=False):
"""Initialize the file handler.
Args:
mask_bad_quality: Mask VIS pixels with bad quality, that means
any quality flag except "ok". If you need more control, use
the ``quality_pixel_bitmask`` and ``data_quality_bitmask``
datasets.
"""
super(FiduceoMviriBase, self).__init__(
filename, filename_info, filetype_info)
self.mask_bad_quality = mask_bad_quality
nc_raw = xr.open_dataset(
filename,
chunks={"x": CHUNK_SIZE,
"y": CHUNK_SIZE,
"x_ir_wv": CHUNK_SIZE,
"y_ir_wv": CHUNK_SIZE}
)
self.nc = DatasetWrapper(nc_raw)
# Projection longitude is not provided in the file, read it from the
# filename.
self.projection_longitude = float(filename_info["projection_longitude"])
self.calib_coefs = self._get_calib_coefs()
self._get_angles = functools.lru_cache(maxsize=8)(
self._get_angles_uncached
)
self._get_acq_time = functools.lru_cache(maxsize=3)(
self._get_acq_time_uncached
)
def get_dataset(self, dataset_id, dataset_info):
"""Get the dataset."""
name = dataset_id["name"]
resolution = dataset_id["resolution"]
if name in ANGLES:
ds = self._get_angles(name, resolution)
elif name in CHANNELS:
ds = self._get_channel(name, resolution, dataset_id["calibration"])
else:
ds = self._get_other_dataset(name)
ds = self._cleanup_coords(ds)
self._update_attrs(ds, dataset_info)
return ds
def get_area_def(self, dataset_id):
"""Get area definition of the given dataset."""
im_size = self.nc.get_image_size(dataset_id["resolution"])
nav = Navigator()
return nav.get_area_def(
im_size=im_size,
projection_longitude=self.projection_longitude
)
def _get_channel(self, name, resolution, calibration):
"""Get and calibrate channel data."""
ds = self.nc[self.nc_keys[name]]
ds = self._calibrate(
ds,
channel=name,
calibration=calibration
)
if name == "VIS":
qc = VisQualityControl(self.nc["quality_pixel_bitmask"])
if self.mask_bad_quality:
ds = qc.mask(ds)
else:
qc.check()
ds["acq_time"] = self._get_acq_time(resolution)
return ds
def _get_angles_uncached(self, name, resolution):
"""Get angle dataset.
Files provide angles (solar/satellite zenith & azimuth) at a coarser
resolution. Interpolate them to the desired resolution.
"""
angles = self.nc[name]
target_x, target_y = self.nc.get_xy_coords(resolution)
return Interpolator.interp_tiepoints(
angles,
target_x=target_x,
target_y=target_y
)
def _get_other_dataset(self, name):
"""Get other datasets such as uncertainties."""
ds = self.nc[name]
if name in OTHER_REFLECTANCES:
ds = VISCalibrator.refl_factor_to_percent(ds)
return ds
def _update_attrs(self, ds, info):
"""Update dataset attributes."""
ds.attrs.update(info)
ds.attrs.update({"platform": self.filename_info["platform"],
"sensor": self.filename_info["sensor"]})
ds.attrs["raw_metadata"] = self.nc.attrs
ds.attrs["orbital_parameters"] = self._get_orbital_parameters()
def _cleanup_coords(self, ds):
"""Cleanup dataset coordinates.
Y/x coordinates have been useful for interpolation so far, but they
only contain row/column numbers. Drop these coordinates so that Satpy
can assign projection coordinates upstream (based on the area
definition).
"""
return ds.drop_vars(["y", "x"])
def _calibrate(self, ds, channel, calibration):
"""Calibrate the given dataset."""
if channel == "VIS":
return self._calibrate_vis(ds, channel, calibration)
calib = IRWVCalibrator(self.calib_coefs[channel])
return calib.calibrate(ds, calibration)
@abc.abstractmethod
def _calibrate_vis(self, ds, channel, calibration): # pragma: no cover
"""Calibrate VIS channel. To be implemented by subclasses."""
raise NotImplementedError
def _get_calib_coefs(self):
"""Get calibration coefficients for all channels.
Note: Only coefficients present in both file types.
"""
coefs = {
"VIS": {
"distance_sun_earth": self.nc["distance_sun_earth"],
"solar_irradiance": self.nc["solar_irradiance_vis"]
},
"IR": {
"a": self.nc["a_ir"],
"b": self.nc["b_ir"],
"bt_a": self.nc["bt_a_ir"],
"bt_b": self.nc["bt_b_ir"]
},
"WV": {
"a": self.nc["a_wv"],
"b": self.nc["b_wv"],
"bt_a": self.nc["bt_a_wv"],
"bt_b": self.nc["bt_b_wv"]
},
}
# Convert coefficients to 32bit float to reduce memory footprint
# of calibrated data.
for ch in coefs:
for name in coefs[ch]:
coefs[ch][name] = np.float32(coefs[ch][name])
return coefs
def _get_acq_time_uncached(self, resolution):
"""Get scanline acquisition time for the given resolution.
Note that the acquisition time does not increase monotonically
with the scanline number due to the scan pattern and rectification.
"""
time2d = self.nc.get_time()
_, target_y = self.nc.get_xy_coords(resolution)
return Interpolator.interp_acq_time(time2d, target_y=target_y.values)
def _get_orbital_parameters(self):
"""Get the orbital parameters."""
orbital_parameters = {
"projection_longitude": self.projection_longitude,
"projection_latitude": 0.0,
"projection_altitude": ALTITUDE
}
ssp_lon, ssp_lat = self._get_ssp_lonlat()
if not np.isnan(ssp_lon) and not np.isnan(ssp_lat):
orbital_parameters.update({
"satellite_actual_longitude": ssp_lon,
"satellite_actual_latitude": ssp_lat,
# altitude not available
})
return orbital_parameters
def _get_ssp_lonlat(self):
"""Get longitude and latitude at the subsatellite point.
Easy FCDR files provide satellite position at the beginning and
end of the scan. This method computes the mean of those two values.
In the full FCDR the information seems to be missing.
Returns:
Subsatellite longitude and latitude
"""
ssp_lon = self._get_ssp("longitude")
ssp_lat = self._get_ssp("latitude")
return ssp_lon, ssp_lat
def _get_ssp(self, coord):
key_start = "sub_satellite_{}_start".format(coord)
key_end = "sub_satellite_{}_end".format(coord)
try:
sub_lonlat = np.nanmean(
[self.nc[key_start].values,
self.nc[key_end].values]
)
except KeyError:
# Variables seem to be missing in full FCDR
sub_lonlat = np.nan
return sub_lonlat
class FiduceoMviriEasyFcdrFileHandler(FiduceoMviriBase):
"""File handler for FIDUCEO MVIRI Easy FCDR."""
nc_keys = FiduceoMviriBase.nc_keys.copy()
nc_keys["VIS"] = "toa_bidirectional_reflectance_vis"
def _calibrate_vis(self, ds, channel, calibration):
"""Calibrate VIS channel.
Easy FCDR provides reflectance only, no counts or radiance.
"""
if calibration == "reflectance":
coefs = self.calib_coefs[channel]
cal = VISCalibrator(coefs)
refl = cal.refl_factor_to_percent(ds)
refl = cal.update_refl_attrs(refl)
return refl
elif calibration in ("counts", "radiance"):
raise ValueError("Cannot calibrate to {}. Easy FCDR provides "
"reflectance only.".format(calibration.name))
else:
raise KeyError("Invalid calibration: {}".format(calibration.name))
class FiduceoMviriFullFcdrFileHandler(FiduceoMviriBase):
"""File handler for FIDUCEO MVIRI Full FCDR."""
nc_keys = FiduceoMviriBase.nc_keys.copy()
nc_keys["VIS"] = "count_vis"
def _get_calib_coefs(self):
"""Add additional VIS coefficients only present in full FCDR."""
coefs = super()._get_calib_coefs()
coefs["VIS"].update({
"years_since_launch": np.float32(self.nc["years_since_launch"]),
"a0": np.float32(self.nc["a0_vis"]),
"a1": np.float32(self.nc["a1_vis"]),
"a2": np.float32(self.nc["a2_vis"]),
"mean_count_space": np.float32(
self.nc["mean_count_space_vis"]
)
})
return coefs
def _calibrate_vis(self, ds, channel, calibration):
"""Calibrate VIS channel."""
sza = None
if calibration == "reflectance":
sza = self._get_angles("solar_zenith_angle", HIGH_RESOL)
cal = VISCalibrator(self.calib_coefs[channel], sza)
return cal.calibrate(ds, calibration)
```
|
The Barakat Foundation ( lit. The Blessing Foundation) is a charitable trust in Iran (a Bonyad) focused on economic development projects in rural areas. It has also stakes in Iran’s pharmaceutical industry. It's affiliated to the Execution of Imam Khomeini's Order which is controlled by Seyyed Ali Khamenei.
In 2013, one of its senior officials stated that during the last five years, the foundation had invested more than $1.6 billion in development projects, as well as building 200 schools, 400 homes and health clinics; and “nearly 100 percent of the income of Setad and the Tadbir Group is placed at the disposal” of the foundation; however, these claims are impossible to verify because its accounts are not publicly available.
History
The Barakat Foundation was established on 11 December 2007, two months after Mohammad Mokhber was elected as the leader of Setad, in order to perform activities in fields of entrepreneurship and the social and economic development in the deprived areas. The foundation was formerly managed by Aref Norouzi. The current manager is Amir Hosein Madani.
Following the statement by Khamenei, the current Supreme Leader of Iran, i.e. “solve the problems of 1,000 villages. It would be good to develop 1,000 places or to build 1,000 schools. Prepare this organisation for this task”, Barakat was created as the affiliated department to Setad. The organization aimed to carry out construction projects in underdeveloped regions of the country as a “Leader’s gift to people living in these regions”, according to the IRNA.
Activity
Barakat Foundation aims to provide sustainable employment and facilitate process in villages.
As the head of the foundation's board of directors mentioned, Barakat Foundation is going to provided 10,000 jobs in rural and deprived regions of Iran till March 2019.
In Sistan and Baluchestan Province, Barakat Foundation is going to establish two factories for packaging and processing dates to support farmers.
During five years Barakat has been supported several economic development projects, such as building schools, roads, housing units and mosques, as well as providing water and electricity.
Construction of schools
According to the report of the International Quran News Agency, the Barkat Foundation has built 2,000 schools in cooperation with the Execution of Imam Khomeini's Order, and the 2,000th school was opened in March 2023. Among its other activities is the operation of 500 water supply projects to 500 deprived villages in the country. Likewise, According to the CEO of this foundation: "Building schools with Iranian Islamic identity is on the agenda of Barkat Foundation."
Health services
The Foundation has prepared health services for deprived populations and has supported over 60,000 cancer patients by building equipped cancer clinic type 3. The Foundation has carried out 482 economic and entrepreneurship projects for 198,000 people who need a job in 31 provinces of the country. Six pharmaceutical companies affiliated to setad, under the administration of the Barakat Foundation is spending their income in for charitable movement.
Telehealth
The Barakat Foundation and Execution of Imam Khomeini's Order (in cooperation with the Ministry of Health) have pursued/implemented the issue of Telehealth. According to the minister of Health, Saeed Namaki: "... This great scientific work helps us in order to utilize a tool called "telemedicine" in these (far) areas of the country. This new approach (telemedicine) allows us to increase productivity in Islamic Republic of Iran's specialized manpower and have health justice in the farthest areas of Iran. He also added, "it began in the farthest and most deprived parts of the country."
Services in Arba'een pilgrims
Among the activities of this foundation is related to its participation in infrastructure development and providing services to Arba'een pilgrims at the borders.
Projects
According to the CEO of Barkat Foundation: 57,000 construction projects have been initiated in Barkat Foundation and nearly 52,000 of them have come to fruition.
COVID-19 Vaccine
COVIran Barekat, the first COVID-19 vaccine produced by Iranian researchers has been produced by Shifa-Pharmed Company (a subsidiary of Barakat Pharmaceutical Group). The human-injection of the first phase of clinical studies of the Iranian corona vaccine on December 29, 2020; The first phase of human testing of the vaccine began with the injection for 56 volunteers. The second group of the volunteers was also injected with the vaccine. According to the head of the vaccine production team at the Setad, the results show that this vaccine also neutralizes the British mutated COVID-19 virus. The vaccine has passed the phase(s) 2 and 3 of clinical studies; and currently it has reached its final phase. The production line of 25 million doses per month of the vaccine was discharged on 26 April 2021.
With the signing of a memorandum (of understanding) of cooperation between the Barakat Foundation and the Deputy Minister of "Cultural Heritage, Handicrafts and Tourism", the process of creating 3,000 jobs began with the support of 1,000 handicraft production projects with priority given to the victims of COVID-19. According to the Deputy Coordinator of the Execution of Imam Khomeini's Order: On 27 July 2021, about 5 million doses of Iran Barakat vaccine have been produced in Shafa-farmad factory so far.
According to IRNA, quoting the spokesman of the National Corona Headquarters and the Deputy Minister of "Ministry of Health and Medical Education": "Barakat Iranian vaccine is (also) produced exclusively for Omicron."
Ehsan-Barakat Charity foundation
Ehsan-Barakat Charity foundation associated to Execution of Imam Khomeini's Order and Barekat Foundation was founded in order to request of current Supreme Leader of Iran, Ali Khamenei to provide more quickly help for individual cases (needy people). As Mokhber, the chief of Execution of Imam Khomeini's Order nominated, the activities which be performed by the Charity relies on people’s help.
According to Mohammad Vudud Madani, the manager of Ehsan-Barakat in May 2018, 3 trailer equipped with medical equipment and 2 service trailers, as well as 10 tents with a capacity of 140 hospital beds, were prepared and sent for deprived areas. The Charity organized that 8000 needy people who live in deprived areas including Helmand region, Hamoun and Nimroz in Sistan and Baluchestan province, cities from South Khorasan Province and Ahmadfedaleh Rural District, travel to Karbala in Arba'een as the special campaign called "the Visa of Paradise".
Barakat Tel
The Barakat Tel Company is one of the companies affiliated with the Execution of Imam Khomeini's Order, funded by Barakat Foundation as a designer and executor of the Electronic Health Program to develop services at the deprived areas of the country in the field of public health. The company provides 18 types of electronic services during the Electronic Health Program.
Barkat Pharmaceutical Group
The Barkat Pharmaceutical Group is a subsidiary of the Setad, which was established in 2010 under the name of "New Technologies of Tedbir Pharmaceutical Technologies".
The company provides services through cooperation with Knowledge enterprises and the world's medical scientists.
Barkat Ventures
Barkat Ventures is the part of Setad for New Technologies and the Development of Knowledge Economy. Its duties are introduced based on Iranian-Islamic pattern in establishing and expanding the ecosystem and infrastructure for the development of knowledge and activities of Knowledge enterprise.
See also
Execution of Imam Khomeini's Order
Bonyad
Economy of Iran
Barkat Ventures
15 Khordad Foundation
References
Charities based in Iran
Front organizations
Foundations based in Iran
Execution of Imam Khomeini's Order
Manufacturing companies of Iran
|
```yaml
id: Cortex XDR device control violations
version: -1
name: Cortex XDR device control violations
description: "Queries Cortex XDR for device control violations for the specified hosts, IP address, or XDR endpoint ID. It then communicates via email with the involved users to understand the nature of the incident and if the user connected the device. \nAll the collected data will be displayed in the XDR device control incident layout.\nThis playbook can also be associated with Cortex XDR device control violation job to periodically query and investigate XDR device control violations. In this configuration, the playbook will only communicate with the involved users."
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: 99d3bc4b-62a5-432d-821f-4dffa1c5b1e9
type: start
task:
id: 99d3bc4b-62a5-432d-821f-4dffa1c5b1e9
version: -1
name: ""
iscommand: false
brand: ""
description: ''
nexttasks:
'#none#':
- "10"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 50
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"1":
id: "1"
taskid: 3b9e0236-4004-482e-8c5b-5084d95a532d
type: regular
task:
id: 3b9e0236-4004-482e-8c5b-5084d95a532d
version: -1
name: Get endpoint device control violations
description: Gets a list of device control violations filtered by selected fields. You can retrieve up to 100 violations.
script: '|||xdr-get-endpoint-device-control-violations'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "2"
scriptarguments:
endpoint_ids:
complex:
root: inputs.EndpointID
hostname:
complex:
root: inputs.Hostname
ip_list:
complex:
root: inputs.IPAddress
product: {}
product_id: {}
serial: {}
timestamp_gte:
complex:
root: inputs.TimeStamp
timestamp_lte: {}
type: {}
username: {}
vendor: {}
vendor_id: {}
violation_id_list: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 370
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"2":
id: "2"
taskid: 5201332f-5be8-49ca-8a34-ba282ec5ff82
type: condition
task:
id: 5201332f-5be8-49ca-8a34-ba282ec5ff82
version: -1
name: Were device control violations found?
type: condition
iscommand: false
brand: ""
description: ''
nexttasks:
'#default#':
- "8"
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isNotEmpty
left:
value:
complex:
root: PaloAltoNetworksXDR
accessor: EndpointViolations
iscontext: true
view: |-
{
"position": {
"x": 50,
"y": 545
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"3":
id: "3"
taskid: a28d149b-91ca-4c81-8640-327f703edd79
type: collection
task:
id: a28d149b-91ca-4c81-8640-327f703edd79
version: -1
name: Communicate with the end-user
description: Sends an email using EWS.
type: collection
iscommand: false
brand: ""
nexttasks:
'#none#':
- "5"
scriptarguments:
additionalHeader: {}
attachCIDs: {}
attachIDs: {}
attachNames: {}
bcc: {}
body: {}
cc: {}
from: {}
htmlBody: {}
replyTo: {}
subject:
simple: Device Control Violation
templateParams: {}
to:
complex:
root: ActiveDirectory.Users
accessor: mail
transientFile: {}
transientFileCID: {}
transientFileContent: {}
separatecontext: false
view: |-
{
"position": {
"x": 447.5,
"y": 1265
}
}
note: false
timertriggers: []
ignoreworker: false
message:
to:
complex:
root: Account
accessor: Email
subject:
complex:
root: inputs.MessageSubject
body:
complex:
root: inputs.MessageBody
methods:
- email
format: ""
bcc:
cc:
timings:
retriescount: 2
retriesinterval: 360
completeafterreplies: 1
form:
questions:
- id: "0"
label: ""
labelarg:
simple: 'Did you connect the '
required: true
gridcolumns: []
defaultrows: []
type: singleSelect
options: []
optionsarg:
- simple: "Yes"
- simple: "No"
fieldassociated: ""
placeholder: ""
tooltip: ""
readonly: false
- id: "1"
label: ""
labelarg:
simple: Please add any additional information that can assist the investigation
required: false
gridcolumns: []
defaultrows: []
type: shortText
options: []
optionsarg: []
fieldassociated: ""
placeholder: ""
tooltip: ""
readonly: false
title: Device Control Violation
description: Did you perform the external device connection?
sender: Your SOC team
expired: false
totalanswers: 0
skipunavailable: false
quietmode: 0
"4":
id: "4"
taskid: 256b3ed5-14c2-4e5f-8ae2-bc937b86b8ce
type: regular
task:
id: 256b3ed5-14c2-4e5f-8ae2-bc937b86b8ce
version: -1
name: Get user email address
description: Retrieves detailed information about a user account. The user can be specified by name, email address, or as an Active Directory Distinguished Name (DN). If no filter is specified, all users are returned.
script: '|||ad-get-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "12"
scriptarguments:
attributes: {}
custom-field-data: {}
custom-field-type: {}
dn: {}
email: {}
limit: {}
name: {}
user-account-control-out: {}
username:
complex:
root: PaloAltoNetworksXDR.EndpointViolations
accessor: username
transformers:
- operator: uniq
- operator: Cut
args:
delimiter:
value:
simple: \
fields:
value:
simple: "0"
separatecontext: false
view: |-
{
"position": {
"x": 447.5,
"y": 890
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"5":
id: "5"
taskid: 935f3d5b-a6b6-452a-81ca-0a3c31495999
type: condition
task:
id: 935f3d5b-a6b6-452a-81ca-0a3c31495999
version: -1
name: Did the involved user connect the device?
type: condition
iscommand: false
brand: ""
description: ''
nexttasks:
'#default#':
- "8"
"yes":
- "6"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualString
left:
value:
complex:
root: Device Control Violation.Answers
accessor: "0"
iscontext: true
right:
value:
simple: "Yes"
view: |-
{
"position": {
"x": 447.5,
"y": 1430
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"6":
id: "6"
taskid: 2a3eb3b4-ac48-4526-8b8d-dcde62ec67d2
type: regular
task:
id: 2a3eb3b4-ac48-4526-8b8d-dcde62ec67d2
version: -1
name: Check if the device is approved for use
type: regular
iscommand: false
brand: ""
description: ''
nexttasks:
'#none#':
- "8"
separatecontext: false
view: |-
{
"position": {
"x": 700,
"y": 1600
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"8":
id: "8"
taskid: 1a96d761-18b5-456a-8f26-b282377c131c
type: title
task:
id: 1a96d761-18b5-456a-8f26-b282377c131c
version: -1
name: Done
type: title
iscommand: false
brand: ""
description: ''
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1770
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"9":
id: "9"
taskid: 199041f9-c401-46e9-81f6-268a5b132768
type: regular
task:
id: 199041f9-c401-46e9-81f6-268a5b132768
version: -1
name: Set device control grid
description: Creates a grid table from items or key-value pairs.
scriptName: SetGridField
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "4"
scriptarguments:
columns:
simple: Hostname,Username,IP,XDR endpoint ID,Violation type,Date,Product,Vendor
context_path:
simple: PaloAltoNetworksXDR.EndpointViolations
grid_id:
simple: xdrdevicecontrolviolations
keys:
simple: hostname,username,ip,endpoint_id,type,date,product,vendor
overwrite: {}
sort_by: {}
unpack_nested_elements: {}
separatecontext: false
view: |-
{
"position": {
"x": 447.5,
"y": 720
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"10":
id: "10"
taskid: e12bce4a-c80e-4907-8767-86102a491bd8
type: condition
task:
id: e12bce4a-c80e-4907-8767-86102a491bd8
version: -1
name: Were current violations found?
type: condition
iscommand: false
brand: ""
description: ''
nexttasks:
'#default#':
- "1"
"yes":
- "11"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isNotEmpty
left:
value:
complex:
root: incident
accessor: xdrdevicecontrolviolations
iscontext: true
view: |-
{
"position": {
"x": 265,
"y": 195
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
"11":
id: "11"
taskid: 637b111d-8ab6-4f2b-8498-26e01b330c6b
type: regular
task:
id: 637b111d-8ab6-4f2b-8498-26e01b330c6b
version: -1
name: Set Violations fields
description: Set a value in context under the key you entered.
scriptName: Set
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "9"
scriptarguments:
append:
simple: "true"
key:
simple: PaloAltoNetworksXDR.EndpointViolations
stringify: {}
value:
complex:
root: incident
accessor: xdrdevicecontrolviolations
separatecontext: false
view: |-
{
"position": {
"x": 447.5,
"y": 370
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
"12":
id: "12"
taskid: 1a497783-b55d-4aec-8764-2722b3d3216d
type: condition
task:
id: 1a497783-b55d-4aec-8764-2722b3d3216d
version: -1
name: Is the user's email retrieved?
type: condition
iscommand: false
brand: ""
description: ""
nexttasks:
'#default#':
- "8"
"yes":
- "3"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
complex:
root: Account
accessor: Email
iscontext: true
continueonerrortype: ""
view: |-
{
"position": {
"x": 447.5,
"y": 1060
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
view: |-
{
"linkLabelsPosition": {
"10_11_yes": 0.47,
"2_8_#default#": 0.1,
"5_6_yes": 0.57,
"5_8_#default#": 0.22
},
"paper": {
"dimensions": {
"height": 1785,
"width": 1030,
"x": 50,
"y": 50
}
}
}
inputs:
- key: TimeStamp
value: {}
required: false
description: |-
Timestamp in relative date format for query device control events
from Cortex XDR.
For example "1 day", "3 weeks".
playbookInputQuery:
- key: EndpointID
value: {}
required: false
description: Comma-separated list of endpoint IDs to filter results for.
playbookInputQuery:
- key: Hostname
value: {}
required: false
description: Comma-separated list of hostnames to filter results for.
playbookInputQuery:
- key: IPAddress
value: {}
required: false
description: Comma-separated list of endpoints IP Addresses to filter results for.
playbookInputQuery:
- key: MessageSubject
value:
simple: Device control violation
required: false
description: The subject of the message for communication with the involved users.
playbookInputQuery:
- key: MessageBody
value:
simple: |-
Hello,
Your user was involved with a device control violation. Please open the following link to fill in the needed information to understand the incident further.
required: false
description: A body of the message for communication with the involved users.
playbookInputQuery:
outputs: []
tests:
- No tests (auto formatted)
fromversion: 5.5.0
marketplaces:
- xsoar
```
|
Hugh Francis Delahunty (born 28 June 1949) is an Australian politician. He was a National Party member of the Victorian Legislative Assembly from 1999 to 2014, representing the electorates of Wimmera (1999–2002) and Lowan (2002–2014). He served as Minister for Sport and Recreation and Minister for Veterans Affairs in the Baillieu and Napthine Coalition governments from 2010 to 2014. Delahunty is the brother of former state Labor minister Mary Delahunty.
Political career
Delahunty was elected to the Victorian Legislative Assembly in the 1999 election to represent the electorate of Wimmera with 58% of the two party preferred vote. He was returned to Parliament at the 2002 election after a redistribution as the Member for Lowan with 67% of the two party vote, and was re-elected at the 2006 election with a massive 72% of the two party vote.
Delahunty is a member of the All Party Parliamentary Drugs and Crime Prevention Committee, a board member of VicHealth and is a charter member of the Lions Club of State Parliament Victoria.
He retired from politics in 2014.
Personal life
Delahunty was born and educated in Murtoa, a wheat district town in country Victoria. His secondary education was at Monivae College, Hamilton and further studies at the William Angliss Food and Trade School, Melbourne. He farmed for four years on the family grain and sheep property before moving to Melbourne and later Donald before settling in Horsham. Delahunty worked as a Meat Industry Standards Officer until 1990 when he commenced employment as a Rural Affairs Adviser for the Office of Rural Affairs (Agriculture Victoria and later Department of Sustainability and Environment).
During the early 1970s he played Australian rules football in the Victorian Football League (VFL) with Essendon. Recruited from Murtoa, Delahunty made 46 senior appearances for Essendon and kicked 18 goals. A keen sportsman, Delahunty participated in and coached many sports in the Wimmera and is a life member of the Murtoa Football Club.
Delahunty has been actively involved in community activities for many years. He was a Councillor and Mayor for the former Horsham City Council, Chairman of Commissioners of the Mildura Rural City, and the first Mayor and a Councillor of the new Horsham Rural City Council.
Delahunty is married with three adult sons. He is the brother of former Labor Party Victorian Government minister Mary Delahunty. His younger brother, Mike Delahunty, played football for Collingwood.
References
External links
Official website
The Nationals – Victoria
|-
National Party of Australia members of the Parliament of Victoria
Members of the Victorian Legislative Assembly
Australian rules footballers from Victoria (state)
Essendon Football Club players
Murtoa Football Club players
Australian sportsperson-politicians
1949 births
Living people
Ministers for Veterans (Victoria)
Ministers for Sport (Victoria)
|
```smalltalk
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Ombi.Core.Models;
using Ombi.Helpers;
using Ombi.Store.Entities;
using Ombi.Store.Repository;
using RecentlyAddedType = Ombi.Store.Entities.RecentlyAddedType;
namespace Ombi.Core.Engine
{
public class RecentlyAddedEngine : IRecentlyAddedEngine
{
public RecentlyAddedEngine(IPlexContentRepository plex, IEmbyContentRepository emby, IJellyfinContentRepository jellyfin, IRepository<RecentlyAddedLog> recentlyAdded)
{
_plex = plex;
_emby = emby;
_jellyfin = jellyfin;
_recentlyAddedLog = recentlyAdded;
}
private readonly IPlexContentRepository _plex;
private readonly IEmbyContentRepository _emby;
private readonly IJellyfinContentRepository _jellyfin;
private readonly IRepository<RecentlyAddedLog> _recentlyAddedLog;
public IEnumerable<RecentlyAddedMovieModel> GetRecentlyAddedMovies(DateTime from, DateTime to)
{
var plexMovies = _plex.GetAll().Where(x => x.Type == MediaType.Movie && x.AddedAt > from && x.AddedAt < to);
var embyMovies = _emby.GetAll().Where(x => x.Type == MediaType.Movie && x.AddedAt > from && x.AddedAt < to);
var jellyfinMovies = _jellyfin.GetAll().Where(x => x.Type == MediaType.Movie && x.AddedAt > from && x.AddedAt < to);
return GetRecentlyAddedMovies(plexMovies, embyMovies, jellyfinMovies).Take(30);
}
public IEnumerable<RecentlyAddedMovieModel> GetRecentlyAddedMovies()
{
var plexMovies = _plex.GetAll().Where(x => x.Type == MediaType.Movie);
var embyMovies = _emby.GetAll().Where(x => x.Type == MediaType.Movie);
var jellyfinMovies = _jellyfin.GetAll().Where(x => x.Type == MediaType.Movie);
return GetRecentlyAddedMovies(plexMovies, embyMovies, jellyfinMovies);
}
public IEnumerable<RecentlyAddedTvModel> GetRecentlyAddedTv(DateTime from, DateTime to, bool groupBySeason)
{
var plexTv = _plex.GetAll().Include(x => x.Seasons).Include(x => x.Episodes).Where(x => x.Type == MediaType.Series && x.AddedAt > from && x.AddedAt < to);
var embyTv = _emby.GetAll().Include(x => x.Episodes).Where(x => x.Type == MediaType.Series && x.AddedAt > from && x.AddedAt < to);
var jellyfinTv = _jellyfin.GetAll().Include(x => x.Episodes).Where(x => x.Type == MediaType.Series && x.AddedAt > from && x.AddedAt < to);
return GetRecentlyAddedTv(plexTv, embyTv, jellyfinTv, groupBySeason).Take(30);
}
public IEnumerable<RecentlyAddedTvModel> GetRecentlyAddedTv(bool groupBySeason)
{
var plexTv = _plex.GetAll().Include(x => x.Seasons).Include(x => x.Episodes).Where(x => x.Type == MediaType.Series);
var embyTv = _emby.GetAll().Include(x => x.Episodes).Where(x => x.Type == MediaType.Series);
var jellyfinTv = _jellyfin.GetAll().Include(x => x.Episodes).Where(x => x.Type == MediaType.Series);
return GetRecentlyAddedTv(plexTv, embyTv, jellyfinTv, groupBySeason);
}
public async Task<bool> UpdateRecentlyAddedDatabase()
{
var plexContent = _plex.GetAll().Include(x => x.Episodes);
var embyContent = _emby.GetAll().Include(x => x.Episodes);
var jellyfinContent = _jellyfin.GetAll().Include(x => x.Episodes);
var recentlyAddedLog = new HashSet<RecentlyAddedLog>();
foreach (var p in plexContent)
{
if (!p.HasTheMovieDb)
{
continue;
}
if (p.Type == MediaType.Movie)
{
recentlyAddedLog.Add(new RecentlyAddedLog
{
AddedAt = DateTime.Now,
Type = RecentlyAddedType.Plex,
ContentId = int.Parse(p.TheMovieDbId),
ContentType = ContentType.Parent
});
}
else
{
// Add the episodes
foreach (var ep in p.Episodes)
{
if (!ep.Series.HasTvDb)
{
continue;
}
recentlyAddedLog.Add(new RecentlyAddedLog
{
AddedAt = DateTime.Now,
Type = RecentlyAddedType.Plex,
ContentId = int.Parse(ep.Series.TvDbId),
ContentType = ContentType.Episode,
EpisodeNumber = ep.EpisodeNumber,
SeasonNumber = ep.SeasonNumber
});
}
}
}
foreach (var e in embyContent)
{
if (e.TheMovieDbId.IsNullOrEmpty())
{
continue;
}
if (e.Type == MediaType.Movie)
{
recentlyAddedLog.Add(new RecentlyAddedLog
{
AddedAt = DateTime.Now,
Type = RecentlyAddedType.Emby,
ContentId = int.Parse(e.TheMovieDbId),
ContentType = ContentType.Parent
});
}
else
{
// Add the episodes
foreach (var ep in e.Episodes)
{
if (ep.Series.TvDbId.IsNullOrEmpty())
{
continue;
}
recentlyAddedLog.Add(new RecentlyAddedLog
{
AddedAt = DateTime.Now,
Type = RecentlyAddedType.Emby,
ContentId = int.Parse(ep.Series.TvDbId),
ContentType = ContentType.Episode,
EpisodeNumber = ep.EpisodeNumber,
SeasonNumber = ep.SeasonNumber
});
}
}
}
foreach (var e in jellyfinContent)
{
if (e.TheMovieDbId.IsNullOrEmpty())
{
continue;
}
if (e.Type == MediaType.Movie)
{
recentlyAddedLog.Add(new RecentlyAddedLog
{
AddedAt = DateTime.Now,
Type = RecentlyAddedType.Jellyfin,
ContentId = int.Parse(e.TheMovieDbId),
ContentType = ContentType.Parent
});
}
else
{
// Add the episodes
foreach (var ep in e.Episodes)
{
if (ep.Series.TvDbId.IsNullOrEmpty())
{
continue;
}
recentlyAddedLog.Add(new RecentlyAddedLog
{
AddedAt = DateTime.Now,
Type = RecentlyAddedType.Jellyfin,
ContentId = int.Parse(ep.Series.TvDbId),
ContentType = ContentType.Episode,
EpisodeNumber = ep.EpisodeNumber,
SeasonNumber = ep.SeasonNumber
});
}
}
}
await _recentlyAddedLog.AddRange(recentlyAddedLog);
return true;
}
private IEnumerable<RecentlyAddedTvModel> GetRecentlyAddedTv(IQueryable<PlexServerContent> plexTv, IQueryable<EmbyContent> embyTv, IQueryable<JellyfinContent> jellyfinTv,
bool groupBySeason)
{
var model = new HashSet<RecentlyAddedTvModel>();
TransformPlexShows(plexTv, model);
TransformEmbyShows(embyTv, model);
TransformJellyfinShows(jellyfinTv, model);
if (groupBySeason)
{
return model.DistinctBy(x => x.SeasonNumber);
}
return model;
}
private IEnumerable<RecentlyAddedMovieModel> GetRecentlyAddedMovies(IQueryable<PlexServerContent> plexMovies, IQueryable<EmbyContent> embyMovies, IQueryable<JellyfinContent> jellyfinMovies)
{
var model = new HashSet<RecentlyAddedMovieModel>();
TransformPlexMovies(plexMovies, model);
TransformEmbyMovies(embyMovies, model);
TransformJellyfinMovies(jellyfinMovies, model);
return model;
}
private static void TransformEmbyMovies(IQueryable<EmbyContent> embyMovies, HashSet<RecentlyAddedMovieModel> model)
{
foreach (var emby in embyMovies)
{
model.Add(new RecentlyAddedMovieModel
{
Id = emby.Id,
ImdbId = emby.ImdbId,
TheMovieDbId = emby.TheMovieDbId,
TvDbId = emby.TvDbId,
AddedAt = emby.AddedAt,
Title = emby.Title,
});
}
}
private static void TransformJellyfinMovies(IQueryable<JellyfinContent> jellyfinMovies, HashSet<RecentlyAddedMovieModel> model)
{
foreach (var jellyfin in jellyfinMovies)
{
model.Add(new RecentlyAddedMovieModel
{
Id = jellyfin.Id,
ImdbId = jellyfin.ImdbId,
TheMovieDbId = jellyfin.TheMovieDbId,
TvDbId = jellyfin.TvDbId,
AddedAt = jellyfin.AddedAt,
Title = jellyfin.Title,
});
}
}
private static void TransformPlexMovies(IQueryable<PlexServerContent> plexMovies, HashSet<RecentlyAddedMovieModel> model)
{
foreach (var plex in plexMovies)
{
model.Add(new RecentlyAddedMovieModel
{
Id = plex.Id,
ImdbId = plex.ImdbId,
TheMovieDbId = plex.TheMovieDbId,
AddedAt = plex.AddedAt,
Title = plex.Title,
Quality = plex.Quality,
ReleaseYear = plex.ReleaseYear
});
}
}
private static void TransformPlexShows(IQueryable<PlexServerContent> plexShows, HashSet<RecentlyAddedTvModel> model)
{
foreach (var plex in plexShows)
{
foreach (var season in plex.Seasons)
{
foreach (var episode in plex.Episodes)
{
model.Add(new RecentlyAddedTvModel
{
Id = plex.Id,
ImdbId = plex.ImdbId,
TheMovieDbId = plex.TheMovieDbId,
AddedAt = plex.AddedAt,
Title = plex.Title,
Quality = plex.Quality,
ReleaseYear = plex.ReleaseYear,
TvDbId = plex.TvDbId,
EpisodeNumber = episode.EpisodeNumber,
SeasonNumber = season.SeasonNumber
});
}
}
}
}
private static void TransformEmbyShows(IQueryable<EmbyContent> embyShows, HashSet<RecentlyAddedTvModel> model)
{
foreach (var emby in embyShows)
{
foreach (var episode in emby.Episodes)
{
model.Add(new RecentlyAddedTvModel
{
Id = emby.Id,
ImdbId = emby.ImdbId,
TvDbId = emby.TvDbId,
TheMovieDbId = emby.TheMovieDbId,
AddedAt = emby.AddedAt,
Title = emby.Title,
EpisodeNumber = episode.EpisodeNumber,
SeasonNumber = episode.SeasonNumber
});
}
}
}
private static void TransformJellyfinShows(IQueryable<JellyfinContent> jellyfinShows, HashSet<RecentlyAddedTvModel> model)
{
foreach (var jellyfin in jellyfinShows)
{
foreach (var episode in jellyfin.Episodes)
{
model.Add(new RecentlyAddedTvModel
{
Id = jellyfin.Id,
ImdbId = jellyfin.ImdbId,
TvDbId = jellyfin.TvDbId,
TheMovieDbId = jellyfin.TheMovieDbId,
AddedAt = jellyfin.AddedAt,
Title = jellyfin.Title,
EpisodeNumber = episode.EpisodeNumber,
SeasonNumber = episode.SeasonNumber
});
}
}
}
}
}
```
|
```php
<?php
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*/
namespace Google\Service\GoogleAnalyticsAdmin;
class GoogleAnalyticsAdminV1betaFirebaseLink extends \Google\Model
{
/**
* @var string
*/
public $createTime;
/**
* @var string
*/
public $name;
/**
* @var string
*/
public $project;
/**
* @param string
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
/**
* @return string
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* @param string
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string
*/
public function setProject($project)
{
$this->project = $project;
}
/**
* @return string
*/
public function getProject()
{
return $this->project;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleAnalyticsAdminV1betaFirebaseLink::class, your_sha256_hashrebaseLink');
```
|
```go
package migrations
import "embed"
//go:embed *
var FS embed.FS
```
|
```shell
Quick `cd` tips
Aliasing ssh connections
Useful aliasing in bash
Random password generator
Get to know your commands with `type`
```
|
The University of Pittsburgh at Greensburg (Pitt-Greensburg or UPG) is a state-related liberal arts college in Greensburg, Pennsylvania. It is a baccalaureate degree-granting regional campus of the University of Pittsburgh. Opened in 1963, Pitt-Greensburg was granted four-year degree-granting status in 1988. As of 2020, Pitt-Greensburg had 1,439 undergraduates and 96 faculty.
History
Pitt-Greensburg opened in September 1963, following a request of area school superintendents for a branch campus of the University of Pittsburgh. Pitt-Greensburg began as a two-year institution with instruction in nine areas of study, 15 faculty, 56 full-time, and 156 part-time students. The school was originally located in the Vogle Building, a former private elementary school and Greensburg School System administrative building located at 122 North Maple Avenue in downtown Greensburg across from St. Clair Park. Fine arts classes were originally taught at the Westmoreland Museum of American Art, physical education was held at the Greensburg YMCA, and laboratory classes were held in what is now Greensburg Salem Middle School. In 1964, the university purchased the Charles McKenna Lynch estate in Hempfield. At first, faculty offices and classrooms were split between Greensburg and Lynch Hall, a former residence on the Lynch estate campus. In 1976, the entire Pitt-Greensburg campus moved to the Hempfield location on the former Lynch estate. Until 1988, when it received 4-year degree-granting status, Pitt-Greensburg served as a two-year feeder school to the main campus as the University of Pittsburgh in the Oakland section of Pittsburgh. By 1989, Pitt-Greensburg had its first graduating class. In 1999, a distinctive feature of Pitt-Greensburg opened when the first of three Academic Villages (Behavioral Sciences, Natural Sciences, and Humanities), where high-achieving students live in residences based on their majors and participate in after-class events geared to those disciplines. As (2018), the campus boasts 29 majors, 24 minors, and four certificate programs.
Five presidents have led the campus since its founding: Al Smith (1963–1980), George Chambers (1980–1996), Frank Cassell (1997–2007), Sharon P. Smith (2007-2019), and Robert Gregerson who became Pitt-Greensburg's fifth president on July 1, 2019.
Location and campus
Pitt-Greensburg is located two miles (3 km) south of the center of Greensburg, Pennsylvania, a city located in Westmoreland County, and approximately to the southeast of Pittsburgh. Since 1976, the university has been centralized at its current location on the former estate of Charles McKenna Lynch in suburban Hempfield. The entire campus consists of 22 buildings on .
Many student residences consist of "Houses" in the Academic Village section (Apollo, Athena, Benjamin Franklin, Margaret Mead, Selene, and Thurgood Marshall), with Village Hall as the Villages' social hub. The various academic villages integrate curricular and extracurricular student experiences and each have their own student council. Each village must be applied to in order to live there, and they are organized around four themes including Behavioral Sciences, Humanities, International, and Natural Science and New Technologies. Other residence Halls are also located in College Hall and Robertshaw Hall, Westmoreland Hall and the University Court.
Other campus facilities include three classroom buildings (Powers, Smith, and McKenna—which also serves as the computer center), Millstein Library, Chambers Hall, the administration building (Lynch Hall), the admissions office (Rossetti House) and the Ridilla Athletic Fields. A new classroom and office building named after former campus president Frank Cassell has recently opened and has been awarded LEED gold certification, being the first building on campus to achieve such designation. The campus also features a nature trail and a small creek (Slate Run) that runs through the center of campus.
Academics
Pitt-Greensburg offers 29 bachelor's degree programs, 24 minors, and numerous pre-professional and certificate programs.
The University of Pittsburgh, including Pitt-Greensburg and its other regional campuses, is accredited through the Middle States Association of Colleges and Schools’ Commission on Higher Education.
A school-wide honor society, the Ben Franklin Society, was organized in 2008 for sophomores, juniors, and seniors with a cumulative grade point average of 3.75 or higher. The society functions to help students identify, prepare and apply for prestigious fellowships and scholarships. Another honor society, the Da Vinci Society, also exists for juniors and seniors selected for their academic excellence, leadership, service, and international experience. Other honor societies also exist on campus for specific programs of study. In addition, Academic Villages, for which grades and participation are evaluated for admittance, act as living and learning communities for students with similar academic interests.
Athletics
Pitt-Greensburg competes athletically as a member of NCAA Division III and is a charter member of the Allegheny Mountain Collegiate Conference. Men's athletic programs include basketball, soccer, baseball, tennis, golf, and cross country. Women's programs consist of basketball, soccer, softball, volleyball, golf, cross country. Pitt-Greensburg also has an intramural program with flag football, racquetball, and billiards. On January 31, 2003, the men's and women's basketball teams of the Pitt-Greensburg and the University of Pittsburgh at Bradford held a doubleheader at the Petersen Events Center on the University of Pittsburgh's main campus in the Oakland section of Pittsburgh in celebration of both school's 40th anniversaries.
Gallery
References
External links
Official website
Official athletics website
Educational institutions established in 1963
Universities and colleges in Westmoreland County, Pennsylvania
1963 establishments in Pennsylvania
|
```c
/*
===========================================================================
This file is part of Quake III Arena source code.
Quake III Arena source code is free software; you can redistribute it
or (at your option) any later version.
Quake III Arena source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with Quake III Arena source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "../client/snd_local.h"
#include "win_local.h"
extern cvar_t *s_khz;
static qboolean dsound_init;
static qboolean SNDDMA_InitDS( void );
// Visual Studio 2012+ or MINGW
#if ( _MSC_VER >= 1700 ) || defined(MINGW)
#ifndef USE_WASAPI
#define USE_WASAPI 1
#endif
#endif
#if USE_WASAPI
static qboolean wasapi_init;
#include <mmreg.h>
#include <mmdeviceapi.h>
#include <audioclient.h>
// Ugly hack to detect Win10 without manifest
// path_to_url#xx5080848xx
typedef LONG( WINAPI *RtlGetVersionPtr )( RTL_OSVERSIONINFOEXW* );
static qboolean IsWindows7OrGreater( void ) {
RtlGetVersionPtr rtl_get_version_f = NULL;
HMODULE ntdll = GetModuleHandle( T( "ntdll" ) );
RTL_OSVERSIONINFOEXW osver;
if ( !ntdll )
return qfalse; // will never happen
rtl_get_version_f = (RtlGetVersionPtr)GetProcAddress( ntdll, "RtlGetVersion" );
if ( !rtl_get_version_f )
return qfalse; // will never happen
osver.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOEXW );
if ( rtl_get_version_f( &osver ) == 0 ) {
if ( osver.dwMajorVersion >= 7 )
return qtrue;
}
return qfalse;
}
UINT32 bufferFrameCount;
UINT32 bufferPosition; // in fullsamples
UINT32 bufferSampleSize;
static int inPlay;
static HANDLE hEvent;
static HANDLE hThread;
static CRITICAL_SECTION cs; // to lock mixer thread during buffer painting
#ifndef AUDCLNT_STREAMFLAGS_RATEADJUST
#define AUDCLNT_STREAMFLAGS_RATEADJUST 0x00100000
#endif
const GUID IID_IUnknown = { 0x00000000, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };
const GUID IID_IAudioClient = { 0x1CB9AD4C, 0xDBFA, 0x4c32, { 0xB1, 0x78, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2 } };
const GUID IID_IAudioRenderClient = { 0xF294ACFC, 0x3146, 0x4483, { 0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2 } };
const GUID CLSID_MMDeviceEnumerator = { 0xBCDE0395, 0xE52F, 0x467C, { 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E } };
const GUID IID_IMMNotificationClient = { 0x7991EEC9, 0x7E89, 0x4D85, { 0x83, 0x90, 0x6C, 0x70, 0x3C, 0xEC, 0x60, 0xC0 } };
const GUID IID_IMMDeviceEnumerator = { 0xA95664D2, 0x9614, 0x4F35, { 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6 } };
const GUID PcmSubformatGuid = { 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } };
const GUID FloatSubformatGuid = { 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } };
static LPWSTR DeviceID = NULL;
static qboolean doSndRestart = qfalse;
static IAudioRenderClient *iAudioRenderClient = NULL;
static IAudioClient *iAudioClient = NULL;
static IMMDeviceEnumerator *pEnumerator = NULL;
static IMMDevice *iMMDevice = NULL;
static void initFormat( WAVEFORMATEXTENSIBLE *wave, int nChannels, int nSamples, int nBits )
{
Com_Memset( wave, 0, sizeof( *wave ) );
// wave->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wave->Format.wFormatTag = WAVE_FORMAT_PCM;
wave->Format.nChannels = nChannels;
wave->Format.nSamplesPerSec = nSamples;
wave->Format.nBlockAlign = (nChannels * nBits) / 8;
wave->Format.nAvgBytesPerSec = nSamples * ( nChannels * nBits ) / 8;
wave->Format.wBitsPerSample = nBits;
if ( wave->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE )
{
wave->Format.cbSize = sizeof( WAVEFORMATEXTENSIBLE ) - sizeof( WAVEFORMATEX );
wave->Samples.wValidBitsPerSample = nBits;
if ( nBits == 32 )
memcpy( &wave->SubFormat, &FloatSubformatGuid, sizeof( GUID ) );
else
memcpy( &wave->SubFormat, &PcmSubformatGuid, sizeof( GUID ) );
}
}
// Sound mixer thread
static DWORD WINAPI ThreadProc( HANDLE hInited )
{
HANDLE( WINAPI *pAvSetMmThreadCharacteristicsW )( _In_ LPCWSTR TaskName, _Inout_ LPDWORD TaskIndex );
BOOL( WINAPI *pAvRevertMmThreadCharacteristics )( _In_ HANDLE AvrtHandle );
BYTE *pData;
DWORD taskIndex;
HANDLE th;
DWORD dwOffset;
DWORD dwRes;
UINT32 samples, n;
HRESULT hr;
UINT32 numFramesAvailable;
HMODULE hAVRT;
// execution starts in main thread context
// Ask MMCSS to temporarily boost our thread priority to reduce glitches while the low-latency stream plays
th = NULL;
taskIndex = 0;
pAvSetMmThreadCharacteristicsW = NULL;
pAvRevertMmThreadCharacteristics = NULL;
hAVRT = LoadLibraryW( L"avrt" );
if ( hAVRT )
{
pAvSetMmThreadCharacteristicsW = (void*)GetProcAddress( hAVRT, "AvSetMmThreadCharacteristicsW" );
pAvRevertMmThreadCharacteristics = (void*)GetProcAddress( hAVRT, "AvRevertMmThreadCharacteristics" );
if ( pAvRevertMmThreadCharacteristics && pAvSetMmThreadCharacteristicsW )
{
th = pAvSetMmThreadCharacteristicsW( L"Pro Audio", &taskIndex );
if ( th == NULL )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: thread priority setup failed\n" );
goto err_exit;
}
}
else
{
Com_Printf( S_COLOR_RED "WASAPI: failed to load avrt.dll\n" );
}
}
if ( com_developer->integer )
{
REFERENCE_TIME streamLatency;
if ( iAudioClient->lpVtbl->GetStreamLatency( iAudioClient, &streamLatency ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: GetStreamLatency() failed\n" );
goto err_exit;
}
Com_Printf( S_COLOR_CYAN "WASAPI stream latency: %ims\n", (int)( streamLatency / 10000 ) );
}
inPlay = 1;
bufferPosition = 0;
numFramesAvailable = bufferFrameCount;
if ( iAudioRenderClient->lpVtbl->GetBuffer( iAudioRenderClient, numFramesAvailable, &pData ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI GetBuffer failed\n" );
goto err_exit;
}
if ( iAudioRenderClient->lpVtbl->ReleaseBuffer( iAudioRenderClient, numFramesAvailable, AUDCLNT_BUFFERFLAGS_SILENT ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI ReleaseBuffer failed\n" );
goto err_exit;
}
// Start audio playback
if ( iAudioClient->lpVtbl->Start( iAudioClient ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI playback start failed\n" );
goto err_exit;
}
// return control to the main thread
SetEvent( hInited ); hInited = NULL;
// execution continues in async mixer thread, we can't use Com_Printf anymore
for ( ;; )
{
dwRes = WaitForSingleObject( hEvent, INFINITE );
if ( !inPlay || dwRes != WAIT_OBJECT_0 )
break;
if ( iAudioClient->lpVtbl->GetCurrentPadding( iAudioClient, &numFramesAvailable ) != S_OK )
continue;
numFramesAvailable = bufferFrameCount - numFramesAvailable;
if ( numFramesAvailable == 0 )
continue;
hr = iAudioRenderClient->lpVtbl->GetBuffer( iAudioRenderClient, numFramesAvailable, &pData );
if ( hr == S_OK )
{
dwOffset = 0;
samples = numFramesAvailable;
EnterCriticalSection( &cs );
// fill pData with numFramesAvailable
do
{
if ( bufferPosition + samples > dma.fullsamples )
n = dma.fullsamples - bufferPosition;
else
n = samples;
Com_Memcpy( pData + dwOffset, dma.buffer + bufferPosition * bufferSampleSize, n * bufferSampleSize );
dwOffset += n * bufferSampleSize;
bufferPosition = ( bufferPosition + n ) & ( dma.fullsamples - 1 );
samples -= n;
}
while ( samples );
LeaveCriticalSection( &cs );
iAudioRenderClient->lpVtbl->ReleaseBuffer( iAudioRenderClient, numFramesAvailable, 0 );
}
}
iAudioClient->lpVtbl->Stop( iAudioClient );
err_exit:
if ( hAVRT )
{
if ( pAvRevertMmThreadCharacteristics && th != NULL )
pAvRevertMmThreadCharacteristics( th );
FreeLibrary( hAVRT );
}
inPlay = 0;
bufferPosition = 0;
if ( hInited )
SetEvent( hInited );
return 0;
}
static BOOL ValidFormat( const WAVEFORMATEXTENSIBLE *format, const WORD wFormatTag, const GUID *SubFormat ) {
if ( format->Format.wFormatTag == wFormatTag )
{
return TRUE;
}
if ( format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE )
{
if ( memcmp( &format->SubFormat, SubFormat, sizeof( GUID ) ) == 0 )
{
return TRUE;
}
}
return FALSE;
}
typedef struct NotificationClient_s
{
const IMMNotificationClientVtbl *lpVtbl;
LONG refcount;
}
NotificationClient_t;
static HRESULT STDMETHODCALLTYPE QueryInterface( IMMNotificationClient *this, REFIID riid, VOID **ppvInterface )
{
if ( !memcmp( riid, &IID_IUnknown, sizeof( GUID ) ) || !memcmp( riid, &IID_IMMNotificationClient, sizeof( GUID ) ) )
{
*ppvInterface = (void**)this;
this->lpVtbl->AddRef( this );
return S_OK;
}
else
{
*ppvInterface = NULL;
return E_NOINTERFACE;
}
}
static ULONG STDMETHODCALLTYPE AddRef( IMMNotificationClient *this )
{
NotificationClient_t *cl = (NotificationClient_t *) this;
return InterlockedIncrement( &cl->refcount );
}
static ULONG STDMETHODCALLTYPE Release( IMMNotificationClient *this )
{
NotificationClient_t *cl = (NotificationClient_t *) this;
return InterlockedDecrement( &cl->refcount );
}
static HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged( IMMNotificationClient *this, EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId )
{
if ( flow == eRender && role == eMultimedia )
{
doSndRestart = qtrue;
}
return S_OK;
}
static HRESULT STDMETHODCALLTYPE OnDeviceAdded( IMMNotificationClient *this, LPCWSTR pwstrDeviceId )
{
return S_OK;
}
static HRESULT STDMETHODCALLTYPE OnDeviceRemoved( IMMNotificationClient *this, LPCWSTR pwstrDeviceId )
{
return S_OK;
}
static HRESULT STDMETHODCALLTYPE OnDeviceStateChanged( IMMNotificationClient *this, LPCWSTR pwstrDeviceId, DWORD dwNewState )
{
if ( DeviceID && wcscmp( DeviceID, pwstrDeviceId ) == 0 )
{
if ( dwNewState == DEVICE_STATE_ACTIVE )
{
doSndRestart = qtrue;
}
else // DEVICE_STATE_DISABLED, DEVICE_STATE_NOTPRESENT, DEVICE_STATE_UNPLUGGED
{
inPlay = 0; // do not waste CPU cycles, terminate mixer thread
}
}
return S_OK;
}
static HRESULT STDMETHODCALLTYPE OnPropertyValueChanged( IMMNotificationClient *this, LPCWSTR pwstrDeviceId, const PROPERTYKEY key )
{
//MessageBox( 0, "PropertyValueChanged", "", MB_ICONWARNING );
return S_OK;
}
static const IMMNotificationClientVtbl notification_client_vtbl = {
QueryInterface,
AddRef,
Release,
OnDeviceStateChanged,
OnDeviceAdded,
OnDeviceRemoved,
OnDefaultDeviceChanged,
OnPropertyValueChanged
};
static NotificationClient_t notification_client = { ¬ification_client_vtbl, 1 };
static qboolean SNDDMA_InitWASAPI( void )
{
static byte buffer[ 64 * 1024 ];
DWORD dwStreamFlags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
WAVEFORMATEXTENSIBLE desiredFormat;
WAVEFORMATEXTENSIBLE *closest = NULL;
DWORD dwThreadID;
HANDLE hInited;
qboolean isfloat;
HRESULT hr;
InitializeCriticalSection( &cs );
hr = CoCreateInstance( &CLSID_MMDeviceEnumerator, 0, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (void **) &pEnumerator );
if ( hr != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: CoCreateInstance() failed\n" );
goto error1;
}
hr = pEnumerator->lpVtbl->RegisterEndpointNotificationCallback( pEnumerator, (IMMNotificationClient*) ¬ification_client );
if ( hr != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: RegisterEndpointNotificationCallback() failed\n" );
goto error2;
}
hr = pEnumerator->lpVtbl->GetDefaultAudioEndpoint( pEnumerator, eRender, eMultimedia, &iMMDevice );
if ( hr != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: GetDefaultAudioEndpoint() failed\n" );
goto error2;
}
if ( DeviceID ) // release old device id if exists
{
CoTaskMemFree( DeviceID );
DeviceID = NULL;
}
iMMDevice->lpVtbl->GetId( iMMDevice, &DeviceID );
hr = iMMDevice->lpVtbl->Activate( iMMDevice, &IID_IAudioClient, CLSCTX_ALL, 0, (void **)&iAudioClient );
if ( hr != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: audio client activation failed\n" );
goto error3;
}
dma.channels = 2;
dma.samplebits = 16;
switch ( s_khz->integer ) {
case 48: dma.speed = 48000; break;
case 44: dma.speed = 44100; break;
case 11: dma.speed = 11025; break;
case 8: dma.speed = 8000; break;
case 22:
default: dma.speed = 22050; break;
};
initFormat( &desiredFormat, dma.channels, dma.speed, dma.samplebits );
#if 0
iAudioClient->lpVtbl->GetMixFormat( iAudioClient, (WAVEFORMATEX**) &mixFormat );
if ( mixFormat )
{
Com_Printf( "MIX FORMAT\n" );
Com_Printf( "subformat: %x-%x-%x-%x\n", mixFormat->SubFormat.Data1, mixFormat->SubFormat.Data2, mixFormat->SubFormat.Data3, mixFormat->SubFormat.Data4 );
Com_Printf( "channels: %i\n", mixFormat->Format.nChannels );
Com_Printf( "samples per sec: %i\n", mixFormat->Format.nSamplesPerSec );
Com_Printf( "bits per sample: %i\n", mixFormat->Format.wBitsPerSample );
}
#endif
hr = iAudioClient->lpVtbl->IsFormatSupported( iAudioClient, AUDCLNT_SHAREMODE_SHARED, (const WAVEFORMATEX *) &desiredFormat, (WAVEFORMATEX **) &closest );
if ( hr != S_OK )
{
if ( closest )
{
Com_Memcpy( &desiredFormat, closest,
closest->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE ? sizeof( WAVEFORMATEXTENSIBLE ) : sizeof( WAVEFORMATEX ) );
CoTaskMemFree( closest );
}
else
{
Com_Printf( S_COLOR_YELLOW "WASAPI: desired format is not supported\n" );
goto error3;
}
}
// check if format is supported
if ( desiredFormat.Format.nChannels != 1 && desiredFormat.Format.nChannels != 2 )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: unsupported channel count %i\n", desiredFormat.Format.nChannels );
goto error3;
}
switch ( desiredFormat.Format.wBitsPerSample )
{
case 8:
case 16:
if ( !ValidFormat( &desiredFormat, WAVE_FORMAT_PCM, &PcmSubformatGuid ) )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: unsupported format for %i-bit samples\n", desiredFormat.Format.wBitsPerSample );
goto error3;
}
isfloat = qfalse;
break;
case 32:
if ( !ValidFormat( &desiredFormat, WAVE_FORMAT_IEEE_FLOAT, &FloatSubformatGuid ) )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: unsupported format for %i-bit samples\n", desiredFormat.Format.wBitsPerSample );
goto error3;
}
isfloat = qtrue;
break;
default:
Com_Printf( S_COLOR_YELLOW "WASAPI: unsupported sample count %i\n", desiredFormat.Format.wBitsPerSample );
goto error3;
}
if ( desiredFormat.Format.nSamplesPerSec != (DWORD) dma.speed )
{
if ( !IsWindows7OrGreater() )
{
// Windows7+ is required for AUDCLNT_STREAMFLAGS_RATEADJUST
// we don't bother about Vista support and fall back to DirectSound
goto error3;
}
// use wasapi resampler
Com_DPrintf( "WASAPI resample from %iHz to %iHz\n", dma.speed, (int)desiredFormat.Format.nSamplesPerSec );
desiredFormat.Format.nSamplesPerSec = dma.speed;
desiredFormat.Format.nAvgBytesPerSec = dma.speed * desiredFormat.Format.nBlockAlign;
dwStreamFlags |= AUDCLNT_STREAMFLAGS_RATEADJUST;
}
if ( com_developer->integer )
{
// this is only for information, we will not use returned value in any way
// because we will call Initialize() with hnsBufferDuration=0 to select minimal buffer size
REFERENCE_TIME defDuration;
iAudioClient->lpVtbl->GetDevicePeriod( iAudioClient, &defDuration, NULL );
Com_Printf( S_COLOR_CYAN "WASAPI buffer duration: %i.%i millisecons\n",
(int)(defDuration / 10000), (int)(( ( defDuration + 500 ) / 1000 ) % 10) );
}
// initialize sound device with desired format in shared mode
hr = iAudioClient->lpVtbl->Initialize( iAudioClient, AUDCLNT_SHAREMODE_SHARED, dwStreamFlags, 0, 0, (WAVEFORMATEX *) &desiredFormat, 0 );
if ( hr != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: Initialize() failed\n" );
goto error4;
}
hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
if ( hEvent == NULL )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: CreateEvent( hEvent ) failed\n" );
goto error4;
}
// get the actual size of the audio buffer
if ( iAudioClient->lpVtbl->GetBufferSize( iAudioClient, &bufferFrameCount ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: GetBufferSize() failed\n" );
goto error5;
}
Com_DPrintf( "WASAPI buffer frame count: %i\n", bufferFrameCount );
dma.submission_chunk = 1;
dma.buffer = buffer;
dma.isfloat = isfloat;
dma.channels = desiredFormat.Format.nChannels;
dma.speed = desiredFormat.Format.nSamplesPerSec;
dma.samplebits = desiredFormat.Format.wBitsPerSample;
dma.fullsamples = log2pad( bufferFrameCount * 8, 1 );
while ( dma.fullsamples * desiredFormat.Format.nBlockAlign > sizeof( buffer ) )
dma.fullsamples >>= 1;
if ( dma.fullsamples < bufferFrameCount )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: static sound buffer is too small\n" );
goto error5;
}
dma.samples = dma.fullsamples * dma.channels;
bufferPosition = 0; // in fullsamples
bufferSampleSize = desiredFormat.Format.nBlockAlign;
if ( iAudioClient->lpVtbl->SetEventHandle( iAudioClient, hEvent ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: SetEventHandle() failed\n" );
goto error5;
}
if ( iAudioClient->lpVtbl->GetService( iAudioClient, &IID_IAudioRenderClient, (void**)&iAudioRenderClient ) != S_OK )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: GetService() failed\n" );
iAudioRenderClient = NULL;
goto error5;
}
// additional event to synchronize thread creation
hInited = CreateEvent( NULL, FALSE, FALSE, NULL );
if ( hInited == NULL )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: CreateEvent( hInited ) failed\n" );
goto error6;
}
hThread = CreateThread( NULL, 4096, (LPTHREAD_START_ROUTINE)ThreadProc, hInited, 0, &dwThreadID );
if ( hThread == NULL )
{
Com_Printf( S_COLOR_YELLOW "WASAPI: CreateThread( hThread ) failed\n" );
goto error7;
}
WaitForSingleObject( hInited, INFINITE );
CloseHandle( hInited ); hInited = NULL;
if ( inPlay )
return qtrue;
Com_Printf( S_COLOR_YELLOW "WASAPI: mixer thread startup failed\n" );
error7:
if ( hInited )
CloseHandle( hInited );
hInited = NULL;
error6:
iAudioRenderClient->lpVtbl->Release( iAudioRenderClient ); iAudioRenderClient = NULL;
error5:
CloseHandle( hEvent ); hEvent = NULL;
error4:
iAudioClient->lpVtbl->Release( iAudioClient ); iAudioClient = NULL;
error3:
iMMDevice->lpVtbl->Release( iMMDevice ); iMMDevice = NULL;
error2:
if ( DeviceID )
CoTaskMemFree( DeviceID );
DeviceID = NULL;
if ( notification_client.lpVtbl->QueryInterface ) {
pEnumerator->lpVtbl->UnregisterEndpointNotificationCallback( pEnumerator, (IMMNotificationClient *)¬ification_client );
}
pEnumerator->lpVtbl->Release( pEnumerator ); pEnumerator = NULL;
error1:
DeleteCriticalSection( &cs );
Com_Memset( &dma, 0, sizeof( dma ) );
dma.channels = 1; // to avoid division-by-zero in S_GetSoundtime()
return qfalse;
}
static void Done_WASAPI( void )
{
inPlay = 0; // break mixer loop
if ( hEvent )
SetEvent( hEvent );
if ( hThread )
{
WaitForSingleObject( hThread, INFINITE ); CloseHandle( hThread ); hThread = NULL;
}
//error6:
iAudioRenderClient->lpVtbl->Release( iAudioRenderClient ); iAudioRenderClient = NULL;
//error5:
if ( hEvent )
CloseHandle( hEvent );
hEvent = NULL;
//error4:
iAudioClient->lpVtbl->Release( iAudioClient ); iAudioClient = NULL;
//error3:
iMMDevice->lpVtbl->Release( iMMDevice ); iMMDevice = NULL;
//error2:
if ( DeviceID )
CoTaskMemFree( DeviceID );
DeviceID = NULL;
pEnumerator->lpVtbl->UnregisterEndpointNotificationCallback( pEnumerator, (IMMNotificationClient *) ¬ification_client );
pEnumerator->lpVtbl->Release( pEnumerator ); pEnumerator = NULL;
// error1:
DeleteCriticalSection( &cs );
}
#endif // USE_WASAPI
HRESULT (WINAPI *pDirectSoundCreate)(GUID FAR *lpGUID, LPDIRECTSOUND FAR *lplpDS, IUnknown FAR *pUnkOuter);
#define iDirectSoundCreate(a,b,c) pDirectSoundCreate(a,b,c)
#define SECONDARY_BUFFER_SIZE 0x10000
static int sample16;
static DWORD gSndBufSize;
static DWORD locksize;
static LPDIRECTSOUND pDS;
static LPDIRECTSOUNDBUFFER pDSBuf, pDSPBuf;
static HINSTANCE hInstDS;
static const char *DSoundError( int error ) {
switch ( error ) {
case DSERR_BUFFERLOST:
return "DSERR_BUFFERLOST";
case DSERR_INVALIDCALL:
return "DSERR_INVALIDCALLS";
case DSERR_INVALIDPARAM:
return "DSERR_INVALIDPARAM";
case DSERR_PRIOLEVELNEEDED:
return "DSERR_PRIOLEVELNEEDED";
}
return "unknown";
}
/*
==================
SNDDMA_Shutdown
==================
*/
void SNDDMA_Shutdown( void ) {
Com_DPrintf( "Shutting down sound system\n" );
#if USE_WASAPI
if ( wasapi_init ) {
Done_WASAPI();
}
#endif
if ( pDS ) {
Com_DPrintf( "Destroying DS buffers\n" );
if ( pDS ) {
Com_DPrintf( "...setting NORMAL coop level\n" );
pDS->lpVtbl->SetCooperativeLevel( pDS, g_wv.hWnd, DSSCL_PRIORITY );
}
if ( pDSBuf ) {
Com_DPrintf( "...stopping and releasing sound buffer\n" );
pDSBuf->lpVtbl->Stop( pDSBuf );
pDSBuf->lpVtbl->Release( pDSBuf );
}
// only release primary buffer if it's not also the mixing buffer we just released
if ( pDSPBuf && ( pDSBuf != pDSPBuf ) ) {
Com_DPrintf( "...releasing primary buffer\n" );
pDSPBuf->lpVtbl->Release( pDSPBuf );
}
pDSBuf = NULL;
pDSPBuf = NULL;
Com_DPrintf( "...releasing DS object\n" );
pDS->lpVtbl->Release( pDS );
}
if ( hInstDS ) {
Com_DPrintf( "...freeing DSOUND.DLL\n" );
FreeLibrary( hInstDS );
hInstDS = NULL;
}
pDS = NULL;
pDSBuf = NULL;
pDSPBuf = NULL;
dsound_init = qfalse;
#if USE_WASAPI
wasapi_init = qfalse;
#endif
memset( &dma, 0, sizeof( dma ) );
CoUninitialize();
}
/*
==================
SNDDMA_Init
Initialize direct sound
Returns false if failed
==================
*/
qboolean SNDDMA_Init( void ) {
#if USE_WASAPI
const char *defdrv;
cvar_t *s_driver;
if ( IsWindows7OrGreater() )
defdrv = "wasapi";
else
defdrv = "dsound";
s_driver = Cvar_Get( "s_driver", defdrv, CVAR_LATCH | CVAR_ARCHIVE_ND );
Cvar_SetDescription( s_driver, "Specify sound subsystem in win32 environment:\n"
" dsound - DirectSound\n"
" wasapi - WASAPI\n" );
#endif
memset( &dma, 0, sizeof( dma ) );
dsound_init = qfalse;
#if USE_WASAPI
wasapi_init = qfalse;
#endif
if ( CoInitialize( NULL ) != S_OK ) {
return qfalse;
}
#if USE_WASAPI
if ( Q_stricmp( s_driver->string, "wasapi" ) == 0 && SNDDMA_InitWASAPI() ) {
dma.driver = "WASAPI";
wasapi_init = qtrue;
return qtrue;
}
#endif
if ( SNDDMA_InitDS() ) {
dma.driver = "DirectSound";
dsound_init = qtrue;
return qtrue;
} else {
dma.channels = 1; // to avoid division-by-zero in S_GetSoundTime()
}
Com_DPrintf( "Failed\n" );
return qfalse;
}
#undef DEFINE_GUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
const GUID name \
= { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000}
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}
DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66);
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
static qboolean SNDDMA_InitDS( void )
{
HRESULT hresult;
DSBUFFERDESC dsbuf;
DSBCAPS dsbcaps;
WAVEFORMATEX format;
int use8;
Com_Printf( "Initializing DirectSound\n" );
use8 = 1;
// Create IDirectSound using the primary sound device
if( FAILED( hresult = CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, (void **)&pDS))) {
use8 = 0;
if( FAILED( hresult = CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void **)&pDS))) {
Com_Printf ("failed\n");
SNDDMA_Shutdown();
return qfalse;
}
}
hresult = pDS->lpVtbl->Initialize( pDS, NULL);
Com_DPrintf( "ok\n" );
Com_DPrintf("...setting DSSCL_PRIORITY coop level: " );
if ( DS_OK != pDS->lpVtbl->SetCooperativeLevel( pDS, g_wv.hWnd, DSSCL_PRIORITY ) ) {
Com_Printf ("failed\n");
SNDDMA_Shutdown();
return qfalse;
}
Com_DPrintf("ok\n" );
// create the secondary buffer we'll actually work with
dma.channels = 2;
dma.samplebits = 16;
switch ( s_khz->integer ) {
case 48: dma.speed = 48000; break;
case 44: dma.speed = 44100; break;
case 11: dma.speed = 11025; break;
case 22:
default: dma.speed = 22050; break;
};
memset( &format, 0, sizeof( format ) );
format.wFormatTag = WAVE_FORMAT_PCM;
format.nChannels = dma.channels;
format.wBitsPerSample = dma.samplebits;
format.nSamplesPerSec = dma.speed;
format.nBlockAlign = format.nChannels * format.wBitsPerSample / 8;
format.cbSize = 0;
format.nAvgBytesPerSec = format.nSamplesPerSec*format.nBlockAlign;
memset( &dsbuf, 0, sizeof( dsbuf ) );
dsbuf.dwSize = sizeof(DSBUFFERDESC);
// Micah: take advantage of 2D hardware.if available.
dsbuf.dwFlags = DSBCAPS_LOCHARDWARE | DSBCAPS_GLOBALFOCUS;
if (use8) {
dsbuf.dwFlags |= DSBCAPS_GETCURRENTPOSITION2;
}
dsbuf.dwBufferBytes = SECONDARY_BUFFER_SIZE;
dsbuf.lpwfxFormat = &format;
memset(&dsbcaps, 0, sizeof(dsbcaps));
dsbcaps.dwSize = sizeof(dsbcaps);
Com_DPrintf( "...creating secondary buffer: " );
if (DS_OK == pDS->lpVtbl->CreateSoundBuffer(pDS, &dsbuf, &pDSBuf, NULL)) {
Com_Printf( "locked hardware. ok\n" );
}
else {
// Couldn't get hardware, fallback to software.
dsbuf.dwFlags = DSBCAPS_LOCSOFTWARE | DSBCAPS_GLOBALFOCUS;
if (use8) {
dsbuf.dwFlags |= DSBCAPS_GETCURRENTPOSITION2;
}
if (DS_OK != pDS->lpVtbl->CreateSoundBuffer(pDS, &dsbuf, &pDSBuf, NULL)) {
Com_Printf( "failed\n" );
SNDDMA_Shutdown();
return qfalse;
}
Com_DPrintf( "forced to software. ok\n" );
}
// Make sure mixer is active
if ( DS_OK != pDSBuf->lpVtbl->Play(pDSBuf, 0, 0, DSBPLAY_LOOPING) ) {
Com_Printf ("*** Looped sound play failed ***\n");
SNDDMA_Shutdown();
return qfalse;
}
// get the returned buffer size
if ( DS_OK != pDSBuf->lpVtbl->GetCaps (pDSBuf, &dsbcaps) ) {
Com_Printf ("*** GetCaps failed ***\n");
SNDDMA_Shutdown();
return qfalse;
}
gSndBufSize = dsbcaps.dwBufferBytes;
dma.isfloat = qfalse;
dma.channels = format.nChannels;
dma.samplebits = format.wBitsPerSample;
dma.speed = format.nSamplesPerSec;
dma.samples = gSndBufSize/(dma.samplebits/8);
dma.fullsamples = dma.samples / dma.channels;
dma.submission_chunk = 1;
dma.buffer = NULL; // must be locked first
sample16 = (dma.samplebits/8) - 1;
SNDDMA_BeginPainting();
if ( dma.buffer )
memset( dma.buffer, 0, dma.samples * dma.samplebits/8 );
SNDDMA_Submit();
return qtrue;
}
/*
==============
SNDDMA_GetDMAPos
return the current sample WRITE position (in mono samples)
inside the recirculating dma buffer, so the mixing code will know
how many sample are required to fill it up.
===============
*/
int SNDDMA_GetDMAPos( void ) {
#if USE_WASAPI
if ( wasapi_init ) {
// restart sound system if needed
if ( doSndRestart ) {
Done_WASAPI();
Com_DPrintf( "WASAPI: restart due to device configuration changes\n" );
wasapi_init = SNDDMA_InitWASAPI();
doSndRestart = qfalse;
}
return ( bufferPosition * dma.channels ) & ( dma.samples - 1 );
}
#endif
if ( dsound_init ) {
DWORD dwWriteCursor;
// write position is the only safe position to start update
pDSBuf->lpVtbl->GetCurrentPosition( pDSBuf, NULL, &dwWriteCursor );
return ( dwWriteCursor >> sample16 ) & ( dma.samples - 1 );
}
return 0;
}
/*
==============
SNDDMA_BeginPainting
Makes sure dma.buffer is valid
===============
*/
void SNDDMA_BeginPainting( void ) {
int reps;
DWORD dwSize2;
DWORD *pbuf, *pbuf2;
HRESULT hresult;
DWORD dwStatus;
#if USE_WASAPI
if ( wasapi_init ) {
EnterCriticalSection( &cs );
return;
}
#endif
if ( !pDSBuf ) {
return;
}
// if the buffer was lost or stopped, restore it and/or restart it
if ( pDSBuf->lpVtbl->GetStatus (pDSBuf, &dwStatus) != DS_OK ) {
Com_Printf ("Couldn't get sound buffer status\n");
}
if (dwStatus & DSBSTATUS_BUFFERLOST)
pDSBuf->lpVtbl->Restore (pDSBuf);
if (!(dwStatus & DSBSTATUS_PLAYING))
pDSBuf->lpVtbl->Play(pDSBuf, 0, 0, DSBPLAY_LOOPING);
// lock the dsound buffer
reps = 0;
dma.buffer = NULL;
while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, (LPVOID)&pbuf, &locksize,
(LPVOID)&pbuf2, &dwSize2, 0)) != DS_OK)
{
if (hresult != DSERR_BUFFERLOST)
{
Com_Printf( "SNDDMA_BeginPainting: Lock failed with error '%s'\n", DSoundError( hresult ) );
S_Shutdown();
return;
}
else
{
pDSBuf->lpVtbl->Restore( pDSBuf );
}
if (++reps > 2)
return;
}
dma.buffer = (byte *)pbuf;
}
/*
==============
SNDDMA_Submit
Send sound to device if buffer isn't really the dma buffer
Also unlocks the dsound buffer
===============
*/
void SNDDMA_Submit( void ) {
#if USE_WASAPI
if ( wasapi_init ) {
LeaveCriticalSection( &cs );
return;
}
#endif
// unlock the dsound buffer
if ( pDSBuf ) {
pDSBuf->lpVtbl->Unlock(pDSBuf, dma.buffer, locksize, NULL, 0);
}
}
/*
=================
SNDDMA_Activate
When we change windows we need to do this
=================
*/
void SNDDMA_Activate( void ) {
#if USE_WASAPI
if ( wasapi_init ) {
if ( inPlay == 0 ) {
doSndRestart = qtrue;
}
return;
}
#endif
if ( !pDS ) {
return;
}
if ( DS_OK != pDS->lpVtbl->SetCooperativeLevel( pDS, g_wv.hWnd, DSSCL_PRIORITY ) ) {
Com_Printf( "sound SetCooperativeLevel failed\n" );
SNDDMA_Shutdown();
}
}
```
|
David Blatherwick may refer to:
David Blatherwick (artist) (born 1960), Canadian artist
David Blatherwick (diplomat) (born 1941), retired British diplomat
|
Martin Reimann is a psychologist and marketing researcher. He is an associate professor of marketing at the Eller College of Management at the University of Arizona.
Research
Reimann's research focuses on consumer psychology, especially the role of positive and negative affect in consumption, and is aimed at identifying an overarching framework for how consumers utilize emotional information to arrive at decisions. Specifically, he is interested in reward and reinforcement, food consumption, and relationship management. Reimann's research also deals with accuracy of survey responses and the triangulation of different data forms.
Service
Reimann helped found (with Oliver Schilke) the Journal of Neuroscience, Psychology, and Economics, an official journal of the American Psychological Association.
Selected publications
Reimann, Martin, Judith Zaichkowsky, Carolin Neuhaus, Thomas Bender, and Bernd Weber. "Aesthetic package design: A behavioral, neural, and psychological investigation." Journal of consumer psychology 20, no. 4 (2010): 431–441.
Reimann, M., Schilke, O. and Thomas, J.S., 2010. Customer relationship management and firm performance: the mediating role of business strategy. Journal of the academy of marketing science, 38(3), pp. 326–346.
Homburg, C., Klarmann, M., Reimann, M. and Schilke, O., 2012. What drives key informant accuracy?. Journal of Marketing Research, 49(4), pp. 594–608.
Reimann, M., Castaño, R., Zaichkowsky, J. and Bechara, A., 2012. How we relate to brands: Psychological and neurophysiological insights into consumer–brand relationships. Journal of Consumer Psychology, 22(1), pp. 128–142.
Reimann, M., Lünemann, U.F. and Chase, R.B., 2008. Uncertainty avoidance as a moderator of the relationship between perceived service quality and customer satisfaction. Journal of Service Research, 11(1), pp. 63–73.
References
External links
Marketing Department at The University of Arizona
Journal of Neuroscience, Psychology, and Economics
21st-century American psychologists
Living people
Year of birth missing (living people)
Date of birth missing (living people)
University of Arizona staff
|
```xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN" sourcelanguage="en_US">
<context>
<name>ArrowToolOptionsBox</name>
<message>
<source>Pick:</source>
<translation>:</translation>
</message>
<message>
<source>Position</source>
<translation></translation>
</message>
<message>
<source>X:</source>
<translation>:</translation>
</message>
<message>
<source>Y:</source>
<translation>:</translation>
</message>
<message>
<source>Z:</source>
<translation>:</translation>
</message>
<message>
<source>SO:</source>
<translation>:</translation>
</message>
<message>
<source>Rotation</source>
<translation></translation>
</message>
<message>
<source>Scale</source>
<translation></translation>
</message>
<message>
<source>Global:</source>
<translation>:</translation>
</message>
<message>
<source>H:</source>
<translation>:</translation>
</message>
<message>
<source>V:</source>
<translation>:</translation>
</message>
<message>
<source>Maintain:</source>
<translation>:</translation>
</message>
<message>
<source>Shear</source>
<translation></translation>
</message>
<message>
<source>Center</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Lock</source>
<translation type="vanished"></translation>
</message>
<message>
<source>(</source>
<translation>(</translation>
</message>
<message>
<source>)</source>
<translation>)</translation>
</message>
<message>
<source>Center Position</source>
<translation></translation>
</message>
<message>
<source>Position:</source>
<translation>:</translation>
</message>
<message>
<source>Rotation:</source>
<translation>:</translation>
</message>
<message>
<source>Table</source>
<translation></translation>
</message>
<message>
<source>Flip Object Horizontally</source>
<translation></translation>
</message>
<message>
<source>Flip Object Vertically</source>
<translation></translation>
</message>
<message>
<source>Rotate Object Left</source>
<translation></translation>
</message>
<message>
<source>Rotate Object Right</source>
<translation></translation>
</message>
</context>
<context>
<name>BrushTool</name>
<message>
<source>Thickness</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Hardness:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Accuracy:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Selective</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Preset:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Break Sharp Angles</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Pencil Mode</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Pressure Sensitivity</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Cap</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Join</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Miter:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Size</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Break</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Pencil</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Pressure</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Smooth:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Range:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Snap</source>
<translation type="vanished"></translation>
</message>
<message>
<source><custom></source>
<translation type="vanished"><></translation>
</message>
<message>
<source>Off</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Linear</source>
<translation type="vanished"></translation>
</message>
<message>
<source>In</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Out</source>
<translation type="vanished"></translation>
</message>
<message>
<source>In&Out</source>
<translation type="vanished">&</translation>
</message>
<message>
<source>Low</source>
<translation type="vanished"></translation>
</message>
<message>
<source>High</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Butt cap</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Round cap</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Projecting cap</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Miter join</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Round join</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Bevel join</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Med</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Draw Order:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Over All</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Under All</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Palette Order</source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>BrushToolOptionsBox</name>
<message>
<source>Preset Name</source>
<translation></translation>
</message>
<message>
<source>OK</source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
</context>
<context>
<name>ControlPointEditorTool</name>
<message>
<source>Auto Select Drawing</source>
<translation></translation>
</message>
<message>
<source>Snap</source>
<translation></translation>
</message>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Low</source>
<translation></translation>
</message>
<message>
<source>Med</source>
<translation></translation>
</message>
<message>
<source>High</source>
<translation></translation>
</message>
</context>
<context>
<name>ControlPointSelection</name>
<message>
<source>Set Linear Control Point</source>
<translation></translation>
</message>
<message>
<source>Set Nonlinear Control Point</source>
<translation></translation>
</message>
</context>
<context>
<name>DVGui::StyleIndexLineEdit</name>
<message>
<source>current</source>
<translation></translation>
</message>
</context>
<context>
<name>EditTool</name>
<message>
<source>Scale Constraint:</source>
<translation>:</translation>
</message>
<message>
<source>Auto Select Column</source>
<translation></translation>
</message>
<message>
<source>Global Key</source>
<translation></translation>
</message>
<message>
<source>Lock Center X</source>
<translation>()</translation>
</message>
<message>
<source>Lock Center Y</source>
<translation>()</translation>
</message>
<message>
<source>Lock Position X</source>
<translation>()</translation>
</message>
<message>
<source>Lock Position Y</source>
<translation>()</translation>
</message>
<message>
<source>Lock Rotation</source>
<translation></translation>
</message>
<message>
<source>Lock Shear H</source>
<translation>()</translation>
</message>
<message>
<source>Lock Shear V</source>
<translation>()</translation>
</message>
<message>
<source>Lock Scale H</source>
<translation>()</translation>
</message>
<message>
<source>Lock Scale V</source>
<translation>()</translation>
</message>
<message>
<source>Lock Global Scale</source>
<translation>()</translation>
</message>
<message>
<source>X and Y Positions</source>
<translation></translation>
</message>
<message>
<source>Z Position</source>
<translation></translation>
</message>
<message>
<source>SO</source>
<translation></translation>
</message>
<message>
<source>Rotation</source>
<translation></translation>
</message>
<message>
<source>Global Scale</source>
<translation></translation>
</message>
<message>
<source>Horizontal and Vertical Scale</source>
<translation></translation>
</message>
<message>
<source>Shear</source>
<translation></translation>
</message>
<message>
<source>Center Position</source>
<translation></translation>
</message>
<message>
<source>Active Axis</source>
<translation></translation>
</message>
<message>
<source>None</source>
<translation></translation>
</message>
<message>
<source>A/R</source>
<translation></translation>
</message>
<message>
<source>Mass</source>
<translation></translation>
</message>
<message>
<source>Column</source>
<translation></translation>
</message>
<message>
<source>Pegbar</source>
<translation></translation>
</message>
<message>
<source>Position</source>
<translation></translation>
</message>
<message>
<source>Scale</source>
<translation></translation>
</message>
<message>
<source>Center</source>
<translation></translation>
</message>
<message>
<source>All</source>
<translation></translation>
</message>
</context>
<context>
<name>EraserTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Hardness:</source>
<translation>:</translation>
</message>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Selective</source>
<translation></translation>
</message>
<message>
<source>Invert</source>
<translation></translation>
</message>
<message>
<source>Frame Range</source>
<translation></translation>
</message>
<message>
<source>Pencil Mode</source>
<translation></translation>
</message>
<message>
<source>Normal</source>
<translation></translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
<message>
<source>Lines</source>
<translation></translation>
</message>
<message>
<source>Areas</source>
<translation></translation>
</message>
<message>
<source>Lines & Areas</source>
<translation></translation>
</message>
<message>
<source>Segment</source>
<translation></translation>
</message>
<message>
<source>Linear</source>
<translation></translation>
</message>
<message>
<source>Ease In</source>
<translation></translation>
</message>
<message>
<source>Ease Out</source>
<translation></translation>
</message>
<message>
<source>Ease In/Out</source>
<translation>/</translation>
</message>
</context>
<context>
<name>FillTool</name>
<message>
<source>Frame Range</source>
<translation></translation>
</message>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Selective</source>
<translation></translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Onion Skin</source>
<translation></translation>
</message>
<message>
<source>Fill Depth</source>
<translation></translation>
</message>
<message>
<source>Segment</source>
<translation></translation>
</message>
<message>
<source>Lines</source>
<translation></translation>
</message>
<message>
<source>Areas</source>
<translation></translation>
</message>
<message>
<source>Lines && Areas</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Normal</source>
<translation></translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
<message>
<source>Autopaint Lines</source>
<translation></translation>
</message>
<message>
<source>Lines & Areas</source>
<translation></translation>
</message>
<message>
<source>Maximum Gap</source>
<translation></translation>
</message>
<message>
<source>Pick+Freehand</source>
<translation>+</translation>
</message>
</context>
<context>
<name>FingerTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Invert</source>
<translation></translation>
</message>
</context>
<context>
<name>FullColorBrushTool</name>
<message>
<source>Thickness</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Pressure Sensitivity</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Opacity:</source>
<translation type="vanished">:</translation>
</message>
<message>
<source>Hardness:</source>
<translation>:</translation>
</message>
<message>
<source>Preset:</source>
<translation>:</translation>
</message>
<message>
<source>Size</source>
<translation></translation>
</message>
<message>
<source>Pressure</source>
<translation></translation>
</message>
<message>
<source>Opacity</source>
<translation></translation>
</message>
<message>
<source>Eraser</source>
<translation></translation>
</message>
<message>
<source>Lock Alpha</source>
<translation></translation>
</message>
<message>
<source><custom></source>
<translation><></translation>
</message>
</context>
<context>
<name>FullColorEraserTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Opacity:</source>
<translation>:</translation>
</message>
<message>
<source>Hardness:</source>
<translation>:</translation>
</message>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Invert</source>
<translation></translation>
</message>
<message>
<source>Frame Range</source>
<translation></translation>
</message>
<message>
<source>Normal</source>
<translation></translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
</context>
<context>
<name>FullColorFillTool</name>
<message>
<source>Fill Depth</source>
<translation></translation>
</message>
</context>
<context>
<name>HandToolOptionsBox</name>
<message>
<source>Reset Position</source>
<translation></translation>
</message>
</context>
<context>
<name>HookTool</name>
<message>
<source>Snap</source>
<translation></translation>
</message>
</context>
<context>
<name>MagnetTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>PaintBrushTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Selective</source>
<translation></translation>
</message>
<message>
<source>Lines</source>
<translation></translation>
</message>
<message>
<source>Areas</source>
<translation></translation>
</message>
<message>
<source>Lines & Areas</source>
<translation></translation>
</message>
<message>
<source>Lock Alpha</source>
<translation></translation>
</message>
</context>
<context>
<name>PinchTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Corner:</source>
<translation>:</translation>
</message>
<message>
<source>Manual</source>
<translation></translation>
</message>
</context>
<context>
<name>PlasticTool</name>
<message>
<source>Build Skeleton</source>
<translation></translation>
</message>
<message>
<source>Paint Rigid</source>
<translation></translation>
</message>
<message>
<source>Animate</source>
<translation></translation>
</message>
<message>
<source>Rigid</source>
<translation></translation>
</message>
<message>
<source>Flex</source>
<translation></translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Vertex Name:</source>
<translation>:</translation>
</message>
<message>
<source>Allow Stretching</source>
<translation></translation>
</message>
<message>
<source>Thickness</source>
<translation></translation>
</message>
<message>
<source>Keep Distance</source>
<translation></translation>
</message>
<message>
<source>Global Key</source>
<translation></translation>
</message>
<message>
<source>A group of skeletons already exists for current column. Replacing it will also substitute any existing vertex animation.
Do you want to continue?</source>
<translation>
</translation>
</message>
<message>
<source>Ok</source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Copy Skeleton</source>
<translation></translation>
</message>
<message>
<source>Paste Skeleton</source>
<translation></translation>
</message>
<message>
<source>Delete Vertex</source>
<translation></translation>
</message>
<message>
<source>Set Key</source>
<translation></translation>
</message>
<message>
<source>Set Rest Key</source>
<translation></translation>
</message>
<message>
<source>Set Global Key</source>
<translation></translation>
</message>
<message>
<source>Set Global Rest Key</source>
<translation></translation>
</message>
<message>
<source>Show Mesh</source>
<translation></translation>
</message>
<message>
<source>Show Rigidity</source>
<translation></translation>
</message>
<message>
<source>Show SO</source>
<translation></translation>
</message>
<message>
<source>Show Skeleton Onion Skin</source>
<translation></translation>
</message>
<message>
<source>The previous vertex name will be discarded, and all associated keys will be lost.
Do you want to proceed?</source>
<translation>
</translation>
</message>
<message>
<source>Edit Mesh</source>
<translation></translation>
</message>
<message>
<source>Snap To Mesh</source>
<translation></translation>
</message>
<message>
<source>Angle Bounds</source>
<translation></translation>
</message>
<message>
<source>Swap Edge</source>
<translation></translation>
</message>
<message>
<source>Collapse Edge</source>
<translation></translation>
</message>
<message>
<source>Split Edge</source>
<translation></translation>
</message>
<message>
<source>Cut Mesh</source>
<translation></translation>
</message>
</context>
<context>
<name>PlasticToolOptionsBox</name>
<message>
<source>Create Mesh</source>
<translation></translation>
</message>
<message>
<source>Skeleton:</source>
<translation>:</translation>
</message>
<message>
<source>SO</source>
<translation></translation>
</message>
<message>
<source>Angle</source>
<translation></translation>
</message>
<message>
<source>Distance</source>
<translation></translation>
</message>
</context>
<context>
<name>PrimitiveParam</name>
<message>
<source>Shape:</source>
<translation>:</translation>
</message>
<message>
<source>Thickness:</source>
<translation>:</translation>
</message>
<message>
<source>Opacity:</source>
<translation>:</translation>
</message>
<message>
<source>Hardness:</source>
<translation>:</translation>
</message>
<message>
<source>Polygon Sides:</source>
<translation>:</translation>
</message>
<message>
<source>Auto Group</source>
<translation></translation>
</message>
<message>
<source>Auto Fill</source>
<translation></translation>
</message>
<message>
<source>Selective</source>
<translation></translation>
</message>
<message>
<source>Pencil Mode</source>
<translation></translation>
</message>
<message>
<source>Cap</source>
<translation></translation>
</message>
<message>
<source>Join</source>
<translation></translation>
</message>
<message>
<source>Miter:</source>
<translation>:</translation>
</message>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Snap</source>
<translation></translation>
</message>
<message>
<source>Rectangle</source>
<translation></translation>
</message>
<message>
<source>Circle</source>
<translation></translation>
</message>
<message>
<source>Ellipse</source>
<translation></translation>
</message>
<message>
<source>Line</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
<message>
<source>Arc</source>
<translation></translation>
</message>
<message>
<source>Polygon</source>
<translation></translation>
</message>
<message>
<source>Butt cap</source>
<translation></translation>
</message>
<message>
<source>Round cap</source>
<translation></translation>
</message>
<message>
<source>Projecting cap</source>
<translation></translation>
</message>
<message>
<source>Miter join</source>
<translation></translation>
</message>
<message>
<source>Round join</source>
<translation></translation>
</message>
<message>
<source>Bevel join</source>
<translation></translation>
</message>
<message>
<source>Low</source>
<translation></translation>
</message>
<message>
<source>High</source>
<translation></translation>
</message>
<message>
<source>Med</source>
<translation></translation>
</message>
<message>
<source>MultiArc</source>
<translation></translation>
</message>
<message>
<source>Smooth</source>
<translation></translation>
</message>
<message>
<source>Rotate</source>
<translation></translation>
</message>
</context>
<context>
<name>PumpTool</name>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
<message>
<source>Accuracy:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Min:</source>
<translation>:</translation>
</message>
<message>
<source>Max:</source>
<translation>:</translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
<message>
<source>No</source>
<translation></translation>
</message>
<message>
<source>The copied selection cannot be pasted in the current drawing.</source>
<translation></translation>
</message>
<message>
<source>The current column is locked.</source>
<translation></translation>
</message>
<message>
<source>The current column is not visible in Camera Stand.</source>
<translation type="vanished"></translation>
</message>
<message>
<source>It is not possible to edit the audio column.</source>
<translation></translation>
</message>
<message>
<source>It is not possible to edit the Magpie column.</source>
<translation type="vanished"> MAGPIE </translation>
</message>
<message>
<source>The current tool cannot be used on a Level column.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used on a Mesh column.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used in Level Strip mode.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used to edit a motion path.</source>
<translation></translation>
</message>
<message>
<source>The current level is not editable.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used on a Vector Level.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used on a Toonz Level.</source>
<translation> Toonz </translation>
</message>
<message>
<source>The current tool cannot be used on a Raster Level.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used on a Mesh Level.</source>
<translation></translation>
</message>
<message>
<source>The current tool cannot be used on a mesh-deformed level</source>
<translation></translation>
</message>
<message>
<source>The current frame is locked: any editing is forbidden.</source>
<translation></translation>
</message>
<message>
<source>Ok</source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Paste</source>
<translation></translation>
</message>
<message>
<source>Move Center</source>
<translation></translation>
</message>
<message>
<source>RGB Picker (R%1, G%2, B%3)</source>
<translation>RGB (R%1, G%2, B%3)</translation>
</message>
<message>
<source>Group</source>
<translation></translation>
</message>
<message>
<source>Ungroup</source>
<translation></translation>
</message>
<message>
<source>Move Group</source>
<translation></translation>
</message>
<message>
<source>Modify Fx Gadget </source>
<translation> </translation>
</message>
<message>
<source>%1 Level : %2 Frame : %3</source>
<translation>%1 : %2 : %3</translation>
</message>
<message>
<source>Modify Stroke Tool</source>
<translation></translation>
</message>
<message>
<source>Modify Spline</source>
<translation></translation>
</message>
<message>
<source>Deform Raster</source>
<translation></translation>
</message>
<message>
<source>Transform Raster</source>
<translation></translation>
</message>
<message>
<source>Set Save Box : (X%1,Y%2,W%3,H%4)->(X%5,Y%6,W%7,H%8)</source>
<translation>(X%1,Y%2,W%3,H%4)->(X%5,Y%6,W%7,H%8)</translation>
</message>
<message>
<source>The current column is hidden.</source>
<translation></translation>
</message>
<message>
<source>Note columns can only be edited in the xsheet or timeline.</source>
<translation></translation>
</message>
<message>
<source> to Front</source>
<translation> </translation>
</message>
<message>
<source> to Forward</source>
<translation> </translation>
</message>
<message>
<source> to Back</source>
<translation> </translation>
</message>
<message>
<source> to Backward</source>
<translation> </translation>
</message>
<message>
<source>The selection cannot be updated. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>The selection cannot be deleted. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>The selection cannot be pasted. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>The selection cannot be grouped. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>The selection cannot be entered. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>The selection cannot be ungrouped. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>The selection cannot be moved. It is not editable.</source>
<translation></translation>
</message>
<message>
<source>Snap At Intersection</source>
<translation></translation>
</message>
</context>
<context>
<name>RGBPickerTool</name>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Passive Pick</source>
<translation></translation>
</message>
<message>
<source>Normal</source>
<translation></translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
</context>
<context>
<name>RGBPickerToolOptionsBox</name>
<message>
<source>Pick Screen</source>
<translation></translation>
</message>
</context>
<context>
<name>RasterSelectionTool</name>
<message>
<source>No Antialiasing</source>
<translation></translation>
</message>
<message>
<source>Modify Savebox</source>
<translation></translation>
</message>
</context>
<context>
<name>RasterTapeTool</name>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Distance:</source>
<translation>:</translation>
</message>
<message>
<source>Style Index:</source>
<translation>:</translation>
</message>
<message>
<source>Opacity:</source>
<translation>:</translation>
</message>
<message>
<source>Frame Range</source>
<translation></translation>
</message>
<message>
<source>Angle:</source>
<translation>:</translation>
</message>
<message>
<source>Normal</source>
<translation></translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
<message>
<source>current</source>
<translation></translation>
</message>
</context>
<context>
<name>RotateTool</name>
<message>
<source>Rotate On Camera Center</source>
<translation></translation>
</message>
</context>
<context>
<name>RotateToolOptionsBox</name>
<message>
<source>Reset Rotation</source>
<translation></translation>
</message>
</context>
<context>
<name>RulerToolOptionsBox</name>
<message>
<source>X:</source>
<comment>ruler tool option</comment>
<translation>:</translation>
</message>
<message>
<source>Y:</source>
<comment>ruler tool option</comment>
<translation>:</translation>
</message>
<message>
<source>W:</source>
<comment>ruler tool option</comment>
<translation>:</translation>
</message>
<message>
<source>H:</source>
<comment>ruler tool option</comment>
<translation>:</translation>
</message>
<message>
<source>A:</source>
<comment>ruler tool option</comment>
<translation>:</translation>
</message>
<message>
<source>L:</source>
<comment>ruler tool option</comment>
<translation>:</translation>
</message>
</context>
<context>
<name>SelectionTool</name>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
<message>
<source>Freehand</source>
<translation></translation>
</message>
<message>
<source>Polyline</source>
<translation></translation>
</message>
</context>
<context>
<name>SelectionToolOptionsBox</name>
<message>
<source>H:</source>
<translation>:</translation>
</message>
<message>
<source>V:</source>
<translation>:</translation>
</message>
<message>
<source>Rotation</source>
<translation></translation>
</message>
<message>
<source>X:</source>
<translation>:</translation>
</message>
<message>
<source>Y:</source>
<translation>:</translation>
</message>
<message>
<source>Thickness</source>
<translation></translation>
</message>
<message>
<source>Link</source>
<translation></translation>
</message>
<message>
<source>Scale</source>
<translation></translation>
</message>
<message>
<source>Position</source>
<translation></translation>
</message>
<message>
<source>Flip Selection Horizontally</source>
<translation></translation>
</message>
<message>
<source>Flip Selection Vertically</source>
<translation></translation>
</message>
<message>
<source>Rotate Selection Left</source>
<translation></translation>
</message>
<message>
<source>Rotate Selection Right</source>
<translation></translation>
</message>
</context>
<context>
<name>ShiftTraceToolOptionBox</name>
<message>
<source>Reset Previous</source>
<translation></translation>
</message>
<message>
<source>Reset Following</source>
<translation></translation>
</message>
<message>
<source>Previous Drawing</source>
<translation></translation>
</message>
<message>
<source>Following Drawing</source>
<translation></translation>
</message>
</context>
<context>
<name>SkeletonTool</name>
<message>
<source>Global Key</source>
<translation></translation>
</message>
<message>
<source>Show Only Active Skeleton</source>
<translation></translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Reset Pinned Center</source>
<translation></translation>
</message>
<message>
<source>Build Skeleton</source>
<translation></translation>
</message>
<message>
<source>Animate</source>
<translation></translation>
</message>
<message>
<source>Inverse Kinematics</source>
<translation></translation>
</message>
</context>
<context>
<name>StylePickerTool</name>
<message>
<source>No current level.</source>
<translation></translation>
</message>
<message>
<source>Current level has no available palette.</source>
<translation></translation>
</message>
<message>
<source>Palette must have more than one palette to be organized.</source>
<translation></translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Passive Pick</source>
<translation></translation>
</message>
<message>
<source>Organize Palette</source>
<translation></translation>
</message>
<message>
<source>Lines</source>
<translation></translation>
</message>
<message>
<source>Areas</source>
<translation></translation>
</message>
<message>
<source>Lines & Areas</source>
<translation></translation>
</message>
</context>
<context>
<name>StylePickerToolOptionsBox</name>
<message>
<source>With this option being activated, the picked style will be
moved to the end of the first page of the palette.</source>
<translation></translation>
</message>
</context>
<context>
<name>ToonzRasterBrushTool</name>
<message>
<source>Size</source>
<translation></translation>
</message>
<message>
<source>Hardness:</source>
<translation>:</translation>
</message>
<message>
<source>Smooth:</source>
<translation>:</translation>
</message>
<message>
<source>Draw Order:</source>
<translation>:</translation>
</message>
<message>
<source>Over All</source>
<translation></translation>
</message>
<message>
<source>Under All</source>
<translation></translation>
</message>
<message>
<source>Palette Order</source>
<translation></translation>
</message>
<message>
<source>Preset:</source>
<translation>:</translation>
</message>
<message>
<source><custom></source>
<translation><></translation>
</message>
<message>
<source>Pencil</source>
<translation></translation>
</message>
<message>
<source>Pressure</source>
<translation></translation>
</message>
<message>
<source>Lock Alpha</source>
<translation></translation>
</message>
</context>
<context>
<name>ToonzVectorBrushTool</name>
<message>
<source>Size</source>
<translation></translation>
</message>
<message>
<source>Accuracy:</source>
<translation>:</translation>
</message>
<message>
<source>Smooth:</source>
<translation>:</translation>
</message>
<message>
<source>Preset:</source>
<translation>:</translation>
</message>
<message>
<source><custom></source>
<translation><></translation>
</message>
<message>
<source>Break</source>
<translation></translation>
</message>
<message>
<source>Pressure</source>
<translation></translation>
</message>
<message>
<source>Cap</source>
<translation></translation>
</message>
<message>
<source>Join</source>
<translation></translation>
</message>
<message>
<source>Miter:</source>
<translation>:</translation>
</message>
<message>
<source>Range:</source>
<translation>:</translation>
</message>
<message>
<source>Snap</source>
<translation></translation>
</message>
<message>
<source>Off</source>
<translation></translation>
</message>
<message>
<source>Linear</source>
<translation></translation>
</message>
<message>
<source>In</source>
<translation></translation>
</message>
<message>
<source>Out</source>
<translation></translation>
</message>
<message>
<source>In&Out</source>
<translation>&</translation>
</message>
<message>
<source>Low</source>
<translation></translation>
</message>
<message>
<source>Med</source>
<translation></translation>
</message>
<message>
<source>High</source>
<translation></translation>
</message>
<message>
<source>Butt cap</source>
<translation></translation>
</message>
<message>
<source>Round cap</source>
<translation></translation>
</message>
<message>
<source>Projecting cap</source>
<translation></translation>
</message>
<message>
<source>Miter join</source>
<translation></translation>
</message>
<message>
<source>Round join</source>
<translation></translation>
</message>
<message>
<source>Bevel join</source>
<translation></translation>
</message>
</context>
<context>
<name>TrackerTool</name>
<message>
<source>Width:</source>
<translation>:</translation>
</message>
<message>
<source>Height:</source>
<translation>:</translation>
</message>
<message>
<source>X:</source>
<translation>:</translation>
</message>
<message>
<source>Y:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>TypeTool</name>
<message>
<source>Font:</source>
<translation>:</translation>
</message>
<message>
<source>Style:</source>
<translation>:</translation>
</message>
<message>
<source>Vertical Orientation</source>
<translation></translation>
</message>
<message>
<source>Size:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>VectorSelectionTool</name>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Preserve Thickness</source>
<translation></translation>
</message>
<message>
<source>Cap</source>
<translation></translation>
</message>
<message>
<source>Join</source>
<translation></translation>
</message>
<message>
<source>Miter:</source>
<translation>:</translation>
</message>
<message>
<source>Standard</source>
<translation></translation>
</message>
<message>
<source>Selected Frames</source>
<translation></translation>
</message>
<message>
<source>Whole Level</source>
<translation></translation>
</message>
<message>
<source>Same Style</source>
<translation></translation>
</message>
<message>
<source>Same Style on Selected Frames</source>
<translation></translation>
</message>
<message>
<source>Same Style on Whole Level</source>
<translation></translation>
</message>
<message>
<source>Boundary Strokes</source>
<translation></translation>
</message>
<message>
<source>Boundaries on Selected Frames</source>
<translation></translation>
</message>
<message>
<source>Boundaries on Whole Level</source>
<translation></translation>
</message>
<message>
<source>Butt cap</source>
<translation></translation>
</message>
<message>
<source>Round cap</source>
<translation></translation>
</message>
<message>
<source>Projecting cap</source>
<translation></translation>
</message>
<message>
<source>Miter join</source>
<translation></translation>
</message>
<message>
<source>Round join</source>
<translation></translation>
</message>
<message>
<source>Bevel join</source>
<translation></translation>
</message>
<message>
<source>Include Intersection</source>
<translation></translation>
</message>
</context>
<context>
<name>VectorTapeTool</name>
<message>
<source>Smooth</source>
<translation></translation>
</message>
<message>
<source>Join Vectors</source>
<translation></translation>
</message>
<message>
<source>Distance</source>
<translation></translation>
</message>
<message>
<source>Mode:</source>
<translation>:</translation>
</message>
<message>
<source>Type:</source>
<translation>:</translation>
</message>
<message>
<source>Endpoint to Endpoint</source>
<translation></translation>
</message>
<message>
<source>Endpoint to Line</source>
<translation></translation>
</message>
<message>
<source>Line to Line</source>
<translation></translation>
</message>
<message>
<source>Normal</source>
<translation></translation>
</message>
<message>
<source>Rectangular</source>
<translation></translation>
</message>
</context>
<context>
<name>ZoomToolOptionsBox</name>
<message>
<source>Reset Zoom</source>
<translation></translation>
</message>
</context>
</TS>
```
|
```java
package com.egzosn.pay.common.api;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSON;
import com.egzosn.pay.common.bean.PayMessage;
import com.egzosn.pay.common.bean.PayOutMessage;
import com.egzosn.pay.common.exception.PayErrorException;
/**
*
*
*
* @author egan
* <pre>
* email egzosn@gmail.com
* date 2018-10-29 17:31:05
* </pre>
*/
public class DefaultPayMessageHandler implements PayMessageHandler<PayMessage, PayService> {
protected final Logger LOG = LoggerFactory.getLogger(DefaultPayMessageHandler.class);
/**
* @param payMessage
* @param context handlerinterceptor
* @param payService
* @return xml, textnull
*/
@Override
public PayOutMessage handle(PayMessage payMessage, Map<String, Object> context, PayService payService) throws PayErrorException {
if (LOG.isInfoEnabled()) {
LOG.info("" + JSON.toJSONString(payMessage));
}
return payService.successPayOutMessage(payMessage);
}
}
```
|
Ryan Scott Prince (born May 16, 1977) is a former American football tight end who played for the Jacksonville Jaguars of the National Football League (NFL). He played college football at Weber State University.
References
1977 births
Living people
People from Farmington, Utah
Sportspeople from the Salt Lake City metropolitan area
Players of American football from Utah
American football tight ends
Weber State Wildcats football players
Jacksonville Jaguars players
|
Birgitta Kumlien-Nyheim (born 1942, citizen of Norway) is an established fine artist and abstract painter. Her paintings have been exhibited over the last decades in Europe and North America. Her work is strong and has a bold expressive quality combined with fine sensitivity. She currently lives and works in Italy and Norway
Education
Birgitta Kumlien-Nyheim was born in Sweden, but grew up in Rome (Italy). She received a Bachelor of Arts in modern languages at the University of Stockholm, a diploma at L’Accademia delle Belle Arti in Rome, and a degree at the University of Oslo in Art history. In her adult life she lived in Japan, Norway, Italy, Spain and Canada. This international exposure has brought forth the rich expressive quality of her paintings.
Selected solo exhibitions
Galleri Kampen (Oslo, Norway) in 2002, 2004, 2006, 2009;
Hurum Kunstlag (Holmsbu, Norway) in 2007;
Christianssands Kunstforening(Kristiansand, Norway) in 2006;
Fundacion Colegio del Rey, Casa de la Entrevista, Alkala’ de Henares (Madrid, Spain) in 2001;
Galeria Edurne(Madrid, Spain) in 1999;
Clockworthy Art Centre (Belfast, Northern Ireland) in 1997;
Ormond Gallery (Dublin, Ireland) in 1996;
Palazzo Ruspoli (Rome, Italy) 1993;
La Galerie Rodrigue Le May (Ottawa, Canada) in 1990; and
Oslo Kunstforening (Oslo, Norway) in 1987.
Quotes from the Artist
“In my paintings I try to express our so called “other world”, our deep instinctive nature, our longing for spirituality and our need to unite these two worlds, the invisible with the visible, our dreams and life's realities.”
“To succeed with a painting is when there is change and that happens when I have said a thorough and defenceless yes to myself.”
“To succeed with an exhibition is for me when the viewer finds response in my paintings for our common universal feelings which acknowledge us as human beings and which make that I am you and you are me, like in a mirror, mine or your own.”
1942 births
Living people
Norwegian artists
Swedish artists
|
The Abhidharma are ancient (third century BCE and later) Buddhist texts which contain detailed scholastic presentations of doctrinal material appearing in the Buddhist sutras. It also refers to the scholastic method itself as well as the field of knowledge that this method is said to study.
Bhikkhu Bodhi calls it "an abstract and highly technical systemization of the [Buddhist] doctrine," which is "simultaneously a philosophy, a psychology and an ethics, all integrated into the framework of a program for liberation." According to Peter Harvey, the Abhidharma method seeks "to avoid the inexactitudes of colloquial conventional language, as is sometimes found in the Suttas, and state everything in psycho-philosophically exact language." In this sense, it is an attempt to best express the Buddhist view of "ultimate reality" (paramartha-satya).
There are different types of Abhidharma literature. The early canonical Abhidharma works (like the Abhidhamma Pitaka) are not philosophical treatises, but mainly summaries and expositions of early doctrinal lists with their accompanying explanations. These texts developed out of early Buddhist lists or matrices (mātṛkās) of key teachings.
Later post-canonical Abhidharma works were written as either large treatises (śāstra), as commentaries (aṭṭhakathā) or as smaller introductory manuals. They are more developed philosophical works which include many innovations and doctrines not found in the canonical Abhidharma.
Abhidharma remains an important field of scholarship among both Theravāda and Mahayana Buddhists.
Definition
The Belgian Indologist Étienne Lamotte described the Abhidharma as "Doctrine pure and simple, without the intervention of literary development or the presentation of individuals" Compared to the colloquial sutras, Abhidharma texts are much more technical, analytic and systematic in content and style. The Theravādin and Sarvastivadin Abhidharmikas generally considered the Abhidharma to be the pure and literal (nippariyaya) description of ultimate truth (paramattha sacca) and an expression of perfect spiritual wisdom, while the sutras were considered 'conventional' (sammuti) and figurative (pariyaya) teachings, given by the Buddha to specific people, at specific times, depending on specific worldly circumstances. They held that Abhidharma was taught by the Buddha to his most eminent disciples, and that therefore this justified the inclusion of Abhidharma texts into their scriptural canon.
According to Collett Cox, Abhidhamma started as a systematic elaboration of the teachings of the suttas, but later developed independent doctrines. The prominent Western scholar of Abhidharma, Erich Frauwallner has said that these Buddhist systems are "among the major achievements of the classical period of Indian philosophy."
Two interpretations of the term "Abhi-dharma" are common. According to Analayo, the initial meaning of Abhidharma in the earliest texts (such as the Mahāgosiṅga-sutta and its parallels) was simply a discussion concerning the Dharma, or talking about the Dharma. In this sense, abhi has the meaning of "about" or "concerning," and can also been in the parallel term abhivinaya (which just means discussions about the vinaya). The other interpretation, where abhi is interpreted as meaning "higher" or "superior" and thus Abhidharma means "higher teaching", seems to have been a later development.
Some in the West have considered the Abhidhamma to be the core of what is referred to as "Buddhism and psychology". Other writers on the topic such as Nyanaponika Thera and Dan Lusthaus describe Abhidhamma as a Buddhist phenomenology while Noa Ronkin and Kenneth Inada equate it with Process philosophy. Bhikkhu Bodhi writes that the system of the Abhidhamma Piṭaka is "simultaneously a philosophy, a psychology and an ethics, all integrated into the framework of a program for liberation." According to L. S. Cousins, the suttas deal with sequences and processes, while the Abhidhamma describes occasions and events.
Origin and history
Modern scholarship
Modern scholars generally believe that the canonical Abhidharma texts emerged after the time of the Buddha, in around the 3rd century BCE. Therefore, the canonical Abhidharma works are generally claimed by scholars not to represent the words of the Buddha himself, but those of later Buddhists. Peter Skilling describes the Abhidharma literature as "the end-product of several centuries of intellectual endeavor."
The various Vinaya accounts of the compilation of the Buddhist canon after the death of the Buddha offer various sometimes conflicting narratives regarding the canonical status of Abhidharma. While the Mahāsāṅghika Vinaya does not speak of an Abhidharma apart from the Sutra Pitaka and the Vinaya Pitaka, the Mahīśāsaka, Theravāda, Dharmaguptaka and Sarvāstivāda Vinayas all provide different accounts which mention that there was some kind of Abhidharma to be learned aside from the Sutras and Vinaya. According to Analayo, "the Mūlasarvāstivāda Vinaya does not explicitly mention the Abhidharma, although it reports that on this occasion Mahākāśyapa recited the mātṛkā(s)." Analayo thinks that this reflects an early stage, when what later became Abhidharma was called the mātṛkās. The term appears in some sutras, such as the Mahāgopālaka-sutta (and its parallel) which says that a learned monk is one who knows the Dharma, Vinaya and the mātṛkās.
The ancient core (the mātṛkās)
Various scholars such as André Migot, Edward J. Thomas, Erich Frauwallner, Rupert Gethin, and Johannes Bronkhorst have argued that the Abhidharma was based on early and ancient lists of doctrinal terms which are called mātikās (Sanskrit: mātṛkā). Migot points to the mention of a "Mātṛkā Pitaka" in the Cullavagga as the precursor to the canonical Abhidharma. Migot argues that this Mātṛkā Pitaka, said to have been recited by Mahākāśyapa at the First Council according to the Ashokavadana, likely began as a condensed version of Buddhist doctrine that was expanded over time. Thomas and Frauwallner both argue that while the Abhidharma works of the different schools were compiled separately and have major differences, they are based on an "ancient core" of common material. Rupert Gethin also writes that the mātikās are from an earlier date than the Abhidhamma books themselves.
According to Frauwallner,
The extensive use of mātṛkā can be found in some early Buddhist texts, including the Saṅgīti Sutta and Dasuttara Sutta of the Dīgha Nikāya (as well as the Saṅgīti Sūtra and Daśottara Sūtra of the Dīrgha Āgama). Similar lists of numerically arranged doctrinal terms can be found in AN 10.27 and AN 10.28. Tse fu Kuan also argues that certain sutras of the Aṅguttara Nikāya (AN 3.25, AN 4.87–90, AN 9.42–51) depicts an Abhidhamma style method.
Another sutra which contains a similar list that acts as a doctrinal summary is the Madhyama-āgama “Discourse on Explaining the Spheres” (MĀ 86) which includes a list of thirty one topics to be taught to newly ordained monastics. The last sutra of the Madhyama-āgama, MĀ 222, is contains a similar doctrinal summary listing, which combines three lists into one: a list of eight activities, a list of ten mental qualities and practices, and the twelve links of dependent arising. These two do not have any parallels in Pali.
According to Bhikhu Analayo, another important doctrinal list which appears in the early texts is the "thirty seven qualities that are conducive to awakening" (bodhipākṣikā dharmāḥ). This mātṛkā appears in various sutras, like the Pāsādika-sutta, the Sāmagāma-sutta (and their parallels) and in the Mahāparinirvāṇa-sūtra, where it is said to have been taught by the Buddha just before passing way.
Analayo notes that these various lists served a useful purpose in early Buddhism since they served as aids for the memorization and teaching of the doctrine. The use of lists can similarly be seen in Jain literature. The fact that these lists were seen by the early Buddhists as a way to preserve and memorize the doctrine can be seen in the Saṅgīti Sūtra and its various parallels, which mention how the Jain community became divided over matters of doctrine after the death of their leader. The sutta depicts Śāriputra as reciting a list of doctrinal terms and stating that the community will remain "united, unanimous, and in unison we will not dispute" regarding the teaching and also states they will recite together the doctrine. The close connection between the Saṅgīti Sūtra and Abhidharma can be seen in the fact that it became the basis for one of the canonical Abhidharma texts of the Sarvāstivāda school, the Saṅgītiparyāya, which is effectively a commentary on the sutra.
Frauwallner notes that basic fundamental concepts such as the 12 āyatanāni, the 18 dhatāvah and the 5 skandhāh often occur as a group in the early Buddhist texts. He also points out another such list that occurs in various texts "comprises several groups of elements of import for entanglement in the cycle of existence" and was modeled on the Oghavagga of the Samyuttanikaya. These lists were intended as a basic way of explaining the Buddhist doctrine, and are likely to have been accompanied by oral explanations, which continued to develop and expand and were later written down.
Another related early method is called the "attribute mātṛkā" and refers to lists of terms divided by a dyad or triad of attributes. For example, terms could be grouped into those things that are rūpa (form, physical) or arūpa (formless), saṃskṛtam (constructed) or asaṃskṛtam, and the triad of kuśalam (wholesome), akuśalam (unwholesome) or avyākṛtam (indetermined). An early form of this method can be found in the Dasuttara Sutta.
Development
The explanations of the various elements in these lists also dealt with how these elements were connected (samprayogah) with each other. Over time, the need arose for an overarching way to classify all these terms and doctrinal elements, and the first such framework was to subsume or include (samgraha) all main terms into the schema of the 12 āyatanāni, the 18 dhatāvah and the 5 skandhāh.
Over time, the initial scholastic method of listing and categorizing terms was expanded in order to provide a complete and comprehensive systematization of the doctrine. According to Analayo, the beginning of Abhidharma proper was inspired by the desire "to be as comprehensive as possible, to supplement the directives given in the early discourses for progress on the path with a full picture of all aspects of the path in an attempt to provide a complete map of everything in some way related to the path."
As Frauwallner explains, due to this scholastic impulse, lists grew in size, different mātṛkās were combined with each other to produce new ones, and new concepts and schemas were introduced, such as the differentiation of cittas and caitasikās and new ways of connecting or relating the various elements with each other.
According to Analayo, these various lists were also not presented alone, but included some kind of commentary and explanation which was also part of the oral tradition. Sometimes this commentary included quotations from other sutras, and traces of this can be found in the canonical Abhidharma texts. As time passed, these commentaries and their accompanying lists became inseparable from each other, and the commentaries gained canonical status. Thus, according to Analayo: just as the combination of the prātimokṣa with its commentary was central for the development of the Vinaya, so too the combination of mātṛkās with a commentary was instrumental in the development of the Abhidharma. Thus the use of a mātṛkā together with its exegesis is a characteristic common to the Abhidharma and the Vinaya, whose expositions often take the form of a commentary on a summary list. Therefore, the different Buddhist Abhidharma texts were developed over time as Buddhists expanded their analytical methods in different ways. Since this happened in different communities located in different places, they developed in separate doctrinal directions. This divergence was perhaps enhanced by the various schisms in the Buddhist community and also by geographic distance. According to Frauwallner, the period of the development of the canonical Abhidharma works is between 250 and 50 BCE. By the time the different canons began to be written down, the Abhidharma texts of the different schools were substantially different, as can be seen in how different the Theravāda and the Sarvāstivādin canonical Abhidharma texts are. These differences are much more pronounced than among the other canonical collections (Sutras, Agamas and Vinaya). As such, the Abhidharma collections of the various schools are much more unique to each sect. The various Abhidhammic traditions grew to have very fundamental philosophical disagreements with each other (such as on the status of the person, or temporal eternalism). Thus, according to Frauwallner, the different Abhidharma canons contained collections of doctrines which were sometimes unrelated to each other and sometimes contradictory.
These various Abhidhammic theories were (together with differences in Vinaya) some of the various causes for the splits in the monastic Sangha, which resulted in the fragmented early Buddhist landscape of the Early Buddhist schools. However, these differences did not mean the existence of totally independent sects, as noted by Rupert Gethin, "at least some of the schools mentioned by later Buddhist tradition are likely to have been informal schools of thought in the manner of ‘Cartesians,’ ‘British Empiricists,’ or ‘Kantians’ for the history of modern philosophy." By the 7th-century, Chinese pilgrim Xuanzang could reportedly collect Abhidharma texts from seven different traditions.
These various Abhidharma works were not accepted by all Indian Buddhist schools as canonical, for example, the Mahasanghika school seems not to have accepted them as part of the canon. Another school included most of the Khuddaka Nikaya within the Abhidhamma Pitaka.
After the closing of the various Buddhist canons, Abhidharma texts continued to be composed, but now they were either commentaries on the canonical texts (like the Pali Aṭṭhakathās and the Mahāvibhāṣa), or independent treatises ('śāstra') in their own right. In these post-canonical texts, further doctrinal developments and innovations can be found. As Noa Ronkin writes, "post-canonical Abhidharma texts became complex philosophical treatises employing sophisticated methods of argumentation and independent investigations that resulted in doctrinal conclusions quite far removed from their canonical antecedents." As Frauwallner writes, these later works were attempts to build truly complete philosophical systems out of the various canonical Abhidharma texts.
Some of these texts surpassed the canonical Abhidharma in influence and popularity, becoming the orthodox summas of their particular schools' Abhidharma. Two exegetical texts, both from the 5th century, stand above the rest as the most influential. The work of Buddhaghosa (5th century CE), particularly the Visuddhimagga, remains the main reference work of the Theravāda school, while the Abhidharmakośa (4–5th century CE) of Vasubandhu remains the primary source for Abhidharma studies in both Indo-Tibetan Buddhism and East Asian Buddhism.
In the modern era, only the Abhidharmas of the Sarvāstivādins and the Theravādins have survived as complete collections, each consisting of seven books with accompanying commentarial literature. A small number of other Abhidharma texts are preserved in the Chinese canon and also in Sanskrit fragments, such as the Śāriputra Abhidharma Śāstra of the Dharmaguptaka school and various texts from the Pudgalavada tradition. These different traditions have some similarities, suggesting either interaction between groups or some common ground antedating the separation of the schools.
Traditional views
In the Theravāda tradition it was held that the Abhidhamma was not a later addition, but rather was taught in the fourth week of Gautama Buddha's enlightenment. The Theravada tradition is unique in regarding its Abhidharma as having been taught in its complete form by the Buddha as a single teaching, with the exception of the Kathavatthu, which contains material relating to later disputes and was held to only have been presented as an outline.
According to their tradition, devas built a beautiful jeweled residence for the Buddha to the north-east of the bodhi tree, where he meditated and delivered the Abhidharma teachings to gathered deities in the Trāyastriṃśa heaven, including his deceased mother Māyā. The tradition holds that the Buddha gave daily summaries of the teachings given in the heavenly realm to the bhikkhu Sariputta, who passed them on.
The Sarvāstivāda-Vaibhāṣika held that the Buddha and his disciples taught the Abhidharma, but that it was scattered throughout the canon. Only after his death was the Abhidharma compiled systematically by his elder disciples and was recited by Ananda at the first Buddhist council.
The Sautrāntika school ('those who rely on the sutras') rejected the status of the Abhidharma as being Buddhavacana (word of the Buddha), they held it was the work of different monks after his death, and that this was the reason different Abhidharma schools varied widely in their doctrines. However, this school still studied and debated on Abhidharma concepts and thus did not seek to question the method of the Abhidharma in its entirety. Indeed, there were numerous Abhidharma texts written from an Abhidharma perspective. According to K.L. Dhammajoti, the commentator Yaśomitra even states that "the Sautrantikas can be said to have an abhidharma collection, i.e., as texts that are declared to be varieties of sutra in which the characteristics of factors are described."
Doctrine
The Abhidharma texts' field of inquiry extends to the entire Buddhadharma, since their goal was to outline, systematize and analyze all of the teachings. Abhidharmic thought also extends beyond the sutras to cover new philosophical and psychological ground which is only implicit in sutras or not present at all. There are certain doctrines which were developed or even invented by the Abhidharmikas and these became grounds for the debates among the different early Buddhist schools.
Dhamma theory
The "base upon which the entire [Abhidhamma] system rests" is the 'dhamma theory' and this theory 'penetrated all the early schools'. For the Abhidharmikas, the ultimate components of existence, the elementary constituents of experience were called dhammas (Pali: dhammas). This concept has been variously translated as "factors" (Collett Cox), "psychic characteristics" (Bronkhorst), "phenomena" (Nyanaponika) and "psycho-physical events" (Ronkin).
The early Buddhist scriptures give various lists of the constituents of the person such as the five skandhas, the six or 18 dhatus, and the twelve sense bases. In Abhidhamma literature, these lists of dhammas systematically arranged and they were seen as the ultimate entities or momentary events which make up the fabric of people's experience of reality. The idea was to create an exhaustive list of all possible phenomena that make up the world.
The conventional reality of substantial objects and persons is merely a conceptual construct imputed by the mind on a flux of dhammas. However, dhammas are never seen as individually separate entities, but are always dependently conditioned by other dhammas in a stream of momentary constellations of dhammas, constantly coming into being and vanishing, always in flux. Perception and thinking is then seen as a combination of various dhammas. Cittas (awareness events) are never experienced on their own, but are always intentional and hence accompanied by various mental factors (cetasikas), in a constantly flowing stream of experience occurrences.
Human experience is thus explained by a series of dynamic processes and their patterns of relationships with each other. Buddhist Abhidhamma philosophers then sought to explain all experience by creating lists and matrices (matikas) of these dhammas, which varied by school. The four categories of dhammas in the Theravada Abhidhamma are:
Citta (Mind, Consciousness, awareness)
Cetasika (mental factors, mental events, associated mentality), there are 52 types
Rūpa — (physical occurrences, material form), 28 types
Nibbāna — (Extinction, cessation). This dhamma is unconditioned it neither arises nor ceases due to causal interaction.
The Sarvastivada Abhidharma also used these, along with a fifth category: "factors dissociated from thought" (cittaviprayuktasaṃskāra). The Sarvastivadas also included three dharmas in the fourth "unconditioned" category instead of just one, the dharma of space and two states of cessation.
The Abhidharma project was thus to provide a completely exhaustive account of every possible type of conscious experience in terms of its constituent factors and their relations. The Theravada tradition holds that there were 82 types of possible dhammas – 82 types of occurrences in the experiential world, while the general Sarvastivada tradition eventually enumerated 75 dharma types.
For the Abhidharmikas, truth was twofold and there are two ways of looking at reality. One way is the way of everyday experience and of normal worldly persons. This is the category of the nominal and the conceptual (paññatti), and is termed the conventional truth (saṃvṛti-satya). However, the way of the Abhidharma, and hence the way of enlightened persons like the Buddha, who have developed the true insight (vipassana), sees reality as the constant stream of collections of dharmas, and this way of seeing the world is ultimate truth (paramārtha-satya).
As the Indian Buddhist Vasubandhu writes: "Anything the idea of which does not occur upon division or upon mental analysis, such as an object like a pot, that is a 'conceptual fiction'. The ultimately real is otherwise." For Vasubandhu then, something is not the ultimately real if it 'disappears under analysis', but is merely conventional.
The ultimate goal of the Abhidharma is Nirvana and hence the Abhidharmikas systematized dhammas into those which are skillful (kusala), purify the mind and lead to liberation, and those which are unskillful and do not. The Abhidharma then has a soteriological purpose, first and foremost and its goal is to support Buddhist practice and meditation. By carefully watching the coming and going of dhammas, and being able to identify which ones are wholesome and to be cultivated, and which ones are unwholesome and to be abandoned, the Buddhist meditator makes use of the Abhidharma as a schema to liberate his mind and realize that all experiences are impermanent, not-self, unsatisfactory and therefore not to be clung to.
Svabhāva
The Abhidharmikas often used the term svabhāva (Pali: sabhāva) to explain the causal workings of dharmas. This term was used in different ways by the different Buddhist schools. This term does not appear in the sutras. The Abhidharmakośabhāṣya states: “dharma means ‘upholding,’ [namely], upholding intrinsic nature (svabhāva)” while the Theravādin commentaries holds that: “dhammas are so called because they bear their intrinsic natures, or because they are borne by causal conditions.” Dharmas were also said to be distinct from each other by their intrinsic/unique characteristics (svalaksana). The examination of these characteristics was held to be extremely important, the Sarvastivada Mahavibhasa states "Abhidharma is [precisely] the analysis of the svalaksana and samanya-laksana of dharmas".
According to Peter Harvey, the Theravadin view of dharmas was that "'They are dhammas because they uphold their own nature [sabhaava]. They are dhammas because they are upheld by conditions or they are upheld according to their own nature' (Asl.39). Here 'own-nature' would mean characteristic nature, which is not something inherent in a dhamma as a separate ultimate reality, but arise due to the supporting conditions both of other dhammas and previous occurrences of that dhamma."
The Visuddhimagga of Buddhaghosa, the most influential classical Theravada treatise, states that not-self does not become apparent because it is concealed by "compactness" when one does not give attention to the various elements which make up the person. The Paramatthamañjusa Visuddhimaggatika of Acariya Dhammapala, a later Theravada commentary on the Visuddhimagga, refers to the fact that we often assume unity and compactness in phenomena and functions which are instead made up of various elements, but when one sees that these are merely empty dhammas, one can understand the not-self characteristic:"when they are seen after resolving them by means of knowledge into these elements, they disintegrate like froth subjected to compression by the hand. They are mere states (dhamma) occurring due to conditions and void. In this way the characteristic of not-self becomes more evident."The Sarvastivadins saw dharmas as the ultimately 'real entities' (sad-dravya), though they also held that dharmas were dependently originated. For the Sarvastivadins, a synonym for svabhava is avayaya (a 'part'), the smallest possible unit which cannot be analyzed into smaller parts and hence it is ultimately real as opposed to only conventionally real (such as a chariot or a person). However, the Sarvastivadins did not hold that dharmas were completely independent of each other, as the Mahavibhasa states: "conditioned dharmas are weak in their intrinsic nature, they can accomplish their activities only through mutual dependence" and "they have no sovereignty (aisvarya). They are dependent on others."
Svabhava in the early Abhidhamma texts was then not a term which meant ontological independence, metaphysical essence or underlying substance, but simply referred to their characteristics, which are dependent on other conditions and qualities. According to Ronkin: "In the early Sarvāstivāda exegetical texts, then, svabhāva is used as an atemporal, invariable criterion determining what a dharma is, not necessarily that a dharma exists. The concern here is primarily with what makes categorial types of dharma unique, rather than with the ontological status of dharmas." However, in the later Sarvastivada texts, like the Mahavibhasa, the term svabhava began to be defined more ontologically as the really existing “intrinsic nature” specifying individual dharmas.
The Sautrantika school accepted the doctrine of svabhāva as referring to the distinctive or main characteristic of a dharma, but rejected the view that they exist in all three times . The Buddhist philosopher Dharmakirti uses the concept of svabhāva, though he interprets it as being based on causal powers. For Dharmakirti, the essential nature (or ‘nature-svabhāva’) is:“The arising of an effect that is inferred by way of a causal complex is characterized as a svabhāva of that causal complex, because [the capacity for] the effect’s production does not depend on anything else.” Other early Buddhist schools did not accept the svabhava concept, instead positing a kind of nominalism or conceptualism (prajñaptivada). This view was widespread among the Mahasamghika Nikaya. One school was even called "Prajñaptivada" because of their denial of the ultimate reality of all dharmas and their view that all dharmas are characterized by prajñapti (provisional designation or fictitious construction). Another school called the Vainasikas also held that all dharmas were without svabhava. According to Paramārtha (499–569), another school, the Ekavyavahārikas held "that both the mundane and the supramundane factors [dharmas] are merely nominal (prajñapti). They therefore claimed that all factors have no real essence, and that hence the same name applies to all [dharmas]." This helps to explain their name as “Ekavyavahārika” (those who propound the single meaning). Paramārtha also notes that the Lokottaravāda school held "that the mundane factors have arisen from perversion (viparyāsa) and are only nominal (prajñapti)." However, in contrast to the other schools, they also held that the supramundane dharmas (nirvana etc.) were not nominal but real.
This view that dharmas are empty or void is also found in the Lokānuvartana-sūtra (‘The Sutra of Conformity with the World’, Taisho No.807) which survives in Chinese and Tibetan translation, and may have been a scripture of the Purvasailas, which was a sub-school of the Mahasamghika.
Causality and dependent origination
Another important project for the Abhidharmikas was to outline a theory of causality, especially of how momentary dharmas relate to each other through causes and conditions.
The Sarvastivadin analysis focused on six causes (hetu), four conditions (pratyaya) and five effects (phala). According to K.L. Dhammajoti, for the Sarvastivada school, 'causal efficacy is the central criterion for the reality/existence (astitva) of a dharma' and hence they were also sometimes called the 'Hetuvada' school. A dharma is real because it is a cause and it has effects, if it had no causal efficacy, it would not exist. The six causes outlined by the Sarvastivada are:
Efficient cause (karana-hetu) – dharma A, causes dharma B
Homogeneous cause (sabhäga-hetu) – dharma A(1) causes another dharma A(2)
Universal cause (sarvatraga-hetu) – a Homogeneus cause, pertaining only to defiled dharmas
Retribution cause (vipäka-hetu) – leads to karmic retribution
Co-existent cause (sahabhu-hetu) – a cause which arises from the mutuality of all dharmas, a 'simultaneous causality.'
Conjoined cause (samprayuktaka-hetu)
In the Mahavibhasa treatment of dependent origination, four different types are outlined:
Momentary (ksanika) causation, as when all twelve moments of the chain are realized in a single moment of action
Serial (sambandhika) causation, in which dependent origination is viewed in reference to the relationship between cause and effect
Static (avasthika) causation, in which dependent origination involves twelve distinct periods of the five aggregates
Prolonged (prakarsika) causation, in which that sequence of causation occurs over three lifetimes
The Sarvastivada Vibhasa-sastrins accepted only static dependent origination
The last book of the Pali Abhidhamma, the Patthana, sets out the main Theravada theory on conditioned relations and causality. The Patthana is an exhaustive examination of the conditioned nature (Paticcasamupada) of all dhammas. The introduction begins with a detailed list of 24 specific types of conditioned relationships (paccaya) that may pertain between different factors. The majority of these conditions have counterparts in the Sarvāstivāda Abhidharma. The Pali Abhidhammatthasangaha reduces them all to four main types.
The Sautrāntika school used a theory of 'seeds' (bīja) in the mental continuum to explain causal interaction between past and present dharmas, this theory was later developed by the Yogacara school in their theory of “storehouse consciousness” (ālayavijñāna).
Temporality
A prominent argument between the Abhidharmikas was on the Philosophy of time. The Sarvāstivādin tradition held the view (expressed in the Vijñanakaya) that dharmas exist in all three times – past, present, future; hence the name of their school means "theory of all exists". The Sautrāntika, Vibhajyavāda and Theravada schools argued against this eternalist view in favor of presentism (only the present moment exists). This argument was so central, that north Indian Buddhist schools were often named according to their philosophical position. According to Vasubandhu:
"Those who hold 'all exists' — the past, the present and the future — belong to the Sarvāstivāda. Those, on the other hand, who hold that some exist, viz., the present and the past karma that has not given fruit but not those that have given fruit or the future, are followers of the Vibhajyaväda."
Vasubandhu initially wrote in favor of Sarvāstivāda, and later critiqued this position. The Sarvāstivāda-Vaibhāṣika also held an atomistic conception of time which divided time into discrete indivisible moments (kṣaṇa) and saw all events as lasting only for a minute instant (and yet also existing in all three times).
Theravadins also held a theory of momentariness (Khāṇavāda), but it was less ontological than Sarvāstivāda and more focused on the psychological aspects of time. The Theravada divided every dhamma into three different instants of origination (uppādakkhaṇa), endurance (ṭhitikkhaṇa) and cessation (bhaṅgakkhaṇa). They also held that only mental events were momentary, material events could endure for longer.
Rebirth and personal identity
A key problem which the Abhidharmikas wished to tackle was the question of how rebirth and karma works if there is no self to be reborn apart from the five aggregates. The Patthana includes the earliest Pali canonical reference to an important answer to this question: bhavanga, or 'life-continuum'. Bhavanga, literally, "the limb on which existence occurs" is 'that substratum which maintains the continuity of the individual throughout that life.' The Sarvastivadins had a similar term, nikayasabhagata. This concept is similar to the Yogacara doctrine of the storehouse consciousness (alayavijnana), which was later associated with the Buddha nature doctrine.
This problem was also taken up by a group of Buddhist schools termed the Pudgalavadins or "Personalists" which included the Vātsīputrīya, the Dharmottarīya, the Bhadrayānīya, the Sammitiya and the Shannagarika. These schools posited the existence of a 'person' (pudgala) or self, which had a real existence that was not reducible to streams and collections of dharmas. They also often used other terms to refer to this real 'self', such as 'Atman' and 'Jiva' which are words for the immortal soul in Hinduism and Jainism respectively. They seemed to have held that the 'self' was part of a fifth category of existence, the “inexpressible”. This was a radically different view than the not-self view held by the mainstream Buddhist schools and this theory was a major point of controversy and was thoroughly attacked by other Buddhist schools such as the Theravadins, Sarvastivadins and later Mahayanists.
The Sarvastivadin Abhidharmikas also developed the novel idea of an intermediate state between death and the next rebirth. The Purvasaila, Sammitiya, Vatsiputriya, and later Mahisasaka schools accepted this view, while the Theravadins, Vibhajyavada, Mahasanghika, and the Sariputrabhidharmasastra of the Dharmaguptakas rejected it.
Atomism
Some Abhidharmikas such as the Sarvastivadins also defended an atomic theory. However unlike the Hindu Vaisheshika school, Abhidharmic atoms (paramannu) are not permanent, but momentary. The Vaibhasika held that an atom is the smallest analyzable unit of matter (rupa), hence it is a 'conceptual atom' (prajnapti-paramanu), though this also corresponds to a real existing thing. The Mahabhivasa states:
"An atom (paramänu) is the smallest rüpa. It cannot be cut, broken, penetrated; it cannot be taken up, abandoned, ridden on, stepped on, struck or dragged. It is neither long nor short, square nor round, regular nor irregular, convex nor concave. It has no smaller parts; it cannot be decomposed, cannot be seen, heard, smelled, touched. It is thus that the paramänu is said to be the finest (sarva-süksma) of all rüpas."
Theravāda Abhidhamma
The Abhidhamma Piṭaka is the third pitaka, or basket, of the Tipitaka (Sanskrit: ), the canon of the Theravāda school. It consists of seven sections or books. There are also three Abhidhamma type texts which are found in the Khuddaka Nikāya (‘Minor Collection’): Paṭisambhidāmagga, Nettipakaraṇa and the Peṭakopadesa.
The Abhidhamma Piṭaka, like the rest of the Theravāda Tipiṭaka, was orally transmitted until the 1st century BCE. Due to famines and constant wars, the monks responsible for recording the oral tradition felt that there was a risk of portions of the canon being lost so the Abhidhamma was written down for the first time along with the rest of the Pāli Canon in the first century BCE. The books of the Abhidhamma Piṭaka were translated into English in the 20th century and published by the Pāli Text Society.
In addition to the canonical Abhidharma, Pali literature includes a variety of Abhidhamma commentaries and introductory manuals written after the compilation of the Abhidhamma Piṭaka. These post-canonical texts attempted to expand and further clarify the analysis presented in the Abhidhamma.
The most influential of these commentaries are those of Buddhaghosa (c. 5th century) a South Indian exegete and philosopher who moved to Sri Lanka and wrote various commentaries and treatises in Pali. His Visuddhimagga ("Path of Purification") is a comprehensive manual of Buddhist practice that also contains an overview of the Abhidhamma. This text remains one of the most popular Abhidhamma influenced texts in Theravada.
Sri Lankan Theravādins also composed shorter introductory manuals to the Abhidhamma. The most popular and widely used of these remains the Abhidhammatthasangaha (Compendium of the Topics of the Abhidharma) by Anuruddha (circa 8th to 12th century). A further period of medieval Sri Lankan scholarship also produced a series of texts called the sub-commentaries (which are commentaries to the commentaries).
Abhidhamma remains a living tradition in Theravāda nations today and modern Abhidhamma works continue to be written in modern languages such as Burmese and Sinhala. Abhidhamma studies are particularly stressed in Myanmar, where it has been the primary subject of study since around the 17th century. One of the most important figures in modern Myanmar Buddhism, Ledi Sayadaw (1846–1923), was well known for his writings on Abhidhamma (especially his commentary on the Abhidhammatthasangaha, called the Paramatthadipanitika).
Sarvāstivāda Abhidharma
The most influential Indian Abhidharma tradition was that of the Sarvāstivāda Vaibhāṣika school, which was dominant in North India, especially Kashmir and also in Bactria and Gandhara. This is the Abhidharma tradition that is studied in East Asian Buddhism and also in Tibetan Buddhism.
Like the Theravada Abhidharma, the Sarvāstivāda Abhidharma Pitaka also consists of seven texts, but they are quite different works, unlike the Sarvāstivāda Agamas, which are very close, often identical, to the suttas of the Theravada Sutta Pitaka. According to Frauwallner however, the two Abhidharma collections share an "ancient core", which is basically an early doctrinal list of dharmas. The core canonical work of this school, the Jñānaprasthāna ('Foundation of Knowledge'), also known as Aṣṭaskandha or Aṣṭagrantha, was said to be composed by master Kātyāyanīputra. This became the basis for the Abhidharma Mahāvibhāṣa Śāstra ("Great Commentary"), an encyclopedic work which became the central text of the Vaibhāṣika tradition who became the Kasmiri Sarvāstivāda Orthodoxy under the patronage of the Kushan empire.
Despite numerous variations and doctrinal disagreements within the tradition, most Sarvāstivāda-Vaibhāṣikas were united in their acceptance of the doctrine of "sarvāstitva" (all exists), which says that all phenomena in the three times (past, present and future) can be said to exist. Another defining Vaibhāṣika doctrine was that of simultaneous causation (sahabhū-hetu).
In addition to the core Vaibhāṣika Abhidharma literature, a variety of expository texts or treatises were written to serve as overviews and introductions to the Abhidharma. The oldest one of these was the Abhidharma-hṛdaya-sastra (The Heart of Abhidharma), by the Tocharian Dharmasresthin, (c. 1st. century B.C.). This text became the model for most of the later treatises.
The most influential of these treatises however, is certainly the Abhidharmakośabhāsya (Treasury of Higher Knowledge, 5th century), a series of verses and accompanying commentary by Vasubandhu. It often critiques Vaibhāṣika views from a Sautrantika perspective. The Sautrantikas were a dissent group within the Sarvāstivāda tradition that rejected many of the core Vaibhāṣika views. This text remains the main source for Abhidharma in Indo-Tibetan and East Asian Buddhism.
The most mature and refined form of Vaibhāṣika philosophy can be seen in the work of master Saṃghabhadra (ca fifth century CE), "undoubtedly one of the most brilliant Abhidharma masters in India". His two main works, the *Nyāyānusāra (Shun zhengli lun 順正理論) and the *Abhidharmasamayapradīpikā (Apidamo xian zong lun 阿毘達磨顯宗論), are key sources of late Vaibhāṣika Abhidharma.
Other Abhidharma traditions
The Śāriputra Abhidharma Śāstra (舍利弗阿毘曇論 Shèlìfú Āpítán Lùn) (T. 1548) is a complete abhidharma text that is thought to come from the Dharmaguptaka sect. The only complete edition of this text is that in Chinese. Sanskrit fragments from this text have been found in Bamiyan, Afghanistan, and are now part of the Schøyen Collection (MS 2375/08). The manuscripts at this find are thought to have been part of a monastery library of the Mahāsāṃghika Lokottaravāda sect.
Several Pudgalavada Abhidharma type texts also survive in Chinese, such as the Traidharmakasastra (Taisho no. 1506 pp. 15c-30a) and the Sammatiyanikayasastra. These texts contain traditional Abhidharma type lists and doctrines, but they also attempt to expound and defend the unique Pudgalavada doctrine of the "person" (pudgala).
Many Abhidharma texts have been lost- likely more than have survived. This includes texts brought from India by Xuanzang belonging to a variety of Indian schools that were never translated into Chinese. Many Abhidharma sastras discovered among the Gandharan Buddhist texts have no parallel in existing Indic languages or Chinese or Tibetan translation, suggesting the former breadth of Abhidharma literature.
According to some sources, abhidharma was not accepted as canonical by the Mahāsāṃghika school. The Theravādin Dīpavaṃsa, for example, records that the Mahāsāṃghikas had no abhidharma. However, other sources indicate that there were such collections of abhidharma. During the early 5th century, the Chinese pilgrim Faxian is said to have found a Mahāsāṃghika Abhidharma at a monastery in Pāṭaliputra. When Xuanzang visited Dhānyakaṭaka, he wrote that the monks of this region were Mahāsāṃghikas, and mentions the Pūrvaśailas specifically. Near Dhānyakaṭaka, he met two Mahāsāṃghika bhikṣus and studied Mahāsāṃghika abhidharma with them for several months, during which time they also studied various Mahāyāna śāstras together under Xuanzang's direction. On the basis of textual evidence as well as inscriptions at Nāgārjunakoṇḍā, Joseph Walser concludes that at least some Mahāsāṃghika sects probably had an abhidharma collection, and that it likely contained five or six books.
Tattvasiddhi Śāstra
The Tattvasiddhi Śāstra ("the treatise that accomplishes reality"; Chinese: 成實論, Chéngshílun), is an extant Abhidharma text which was popular in Chinese Buddhism. This Abhidharma is now contained in the Chinese Buddhist canon, in sixteen fascicles (Taishō Tripiṭaka 1646). Its authorship is attributed to Harivarman, a third-century monk from central India. This work may belong to the Mahāsāṃghika Bahuśrutīya school or to the Sautrāntika school.
Paramārtha cites this Bahuśrutīya abhidharma as containing a combination of Hīnayāna and Mahāyāna doctrines, and Joseph Walser agrees that this assessment is correct. Ian Charles Harris also characterizes the text as a synthesis of Hīnayāna and Mahāyāna, and notes that its doctrines are very close to those in Mādhyamaka and Yogācāra works. The Satyasiddhi Śāstra maintained great popularity in Chinese Buddhism, and even lead to the formation of its own school of Buddhism in China, the Chéngshí school (成實宗), which was founded in 412 CE. As summarized by Nan Huai-Chin:
The Chéngshí School taught a progression of twenty-seven stations for cultivating realization, based upon the teachings of this text. They took Harivarman as its founder in India, and Kumārajīva as the school's founder in China. The Chéngshí School is counted among the ten schools of Tang dynasty Buddhism. From China, the Chéngshí School was transmitted to Japan in 625 CE, where it was known as Jōjitsu-shu (成實宗). This school is known as one of the six great schools of Japanese Buddhism in the Nara period (710–794 CE).
Mahāyāna Abhidharma
Another complete system of Abhidharma thought is elaborated in certain works of the Mahāyāna Yogācāra tradition (which mainly evolved out of the Sarvāstivāda Abhidharma). This Yogācāra Abhidharma can be found in the works of figures like Asanga, Vasubandhu, Sthiramati, Dharmapāla, Śīlabhadra, Xuanzang (Hsüan-tsang), and Vinītadeva.
Yogācāra Abhidharmikas discussed many concepts not widely found in non-Mahāyāna Abhidharma, such as the theory of the eight consciousnesses (aṣṭa vijñānakāyāḥ) which includes the novel ālayavijñāna, the three natures (trisvabhāva), mere cognizance (vijñapti-mātra), the fundamental revolution of the basis (āśraya-parāvṛtti), the Mahāyāna buddhology of the three bodies of the Buddha, the ten pāramitā and the ten bhūmi.
Main Yogācāra Abhidharma works include:
Yogācārabhūmi-Śāstra (Treatise on the Foundation for Yoga Practitioners). A compendium of doctrine and Buddhist meditation, with a strong influence from the Sarvāstivāda Abhidharma.
Abhidharma-samuccaya ("Compendium of Abhidharma") by Asanga. It mainly discusses traditional Abhidharma concepts, with a few Mahāyāna elements added. According to Frauwallner, this text is based on the Abhidharma of the Mahīśāsaka tradition.
Abhidharma-samuccaya-bhasyam, a commentary on the work above, possibly by Sthiramati.
Abhidharmamahāyānasūtra
Mahāyānasaṃgraha. This is a true compendium of Mahāyāna (Yogācāra) Abhidharma by Asanga. Its main sources are the Abhidharmamahāyānasūtra, and the Yogācārabhūmi.
Mahāyānasaṃgraha-bhāṣya, by Vasubandhu, a commentary on the work above.
Vijñapti-mātratā-siddhi, Ch. Cheng Weishi Lun ("Discourse on the Perfection of Consciousness-only") by Xuanzang – a commentary on Vasubandhu's Triṃśikā-vijñaptimātratā ("Thirty Verses")
Cheng weishi lun shuji, a commentary on the above, by Xuanzang's student Kuiji.
While this Yogācārin Abhidharma is based on the Sarvāstivādin system, it also incorporates aspects of other Abhidharma systems and present a complete Abhidharma in accordance with a Mahāyāna Yogācāra view that thought (vijñapti) alone is ultimately "real." The Yogācāra Abhidharma texts served as the foundations of the East Asian "Consciousness Only school" (Wéishí-zōng).
Yogācārins developed an Abhidharma literature set within a Mahāyāna framework. John Keenan, who has translated the Saṃdhinirmocana Sūtra into English, writes:
Prajñāpāramitā texts
The Prajñāpāramitā sutras and associated literature are influenced by Abhidharma. These texts make use of Abhidharma categories (like the dharma theory), and adopt them or critique them in different ways. Thus, according to Johannes Bronkhorst, the Aṣṭasāhasrikā Prajñāpāramitā, "only makes sense against the historical background of the Abhidharma."
According to Edward Conze, the Prajñāpāramitā sutras were meant to be a criticism of the view held by some of the Abhidharmikas which saw dharmas as real. Conze also notes that the later Prajñāpāramitā sutras have been expanded by the insertion of various doctrinal Abhidharma lists.
There is also plenty of Abhidharma material (mainly Sarvāstivāda) in the Dà zhìdù lùn (The Treatise on the Great Prajñāpāramitā; Chinese: 大智度論, Mahāprajñāpāramitāupadeśa* Taishō Tripiṭaka no. 1509). The Dà zhìdù lùn was translated into Chinese by Kumārajīva (344–413 CE) and his student Sengrui. The work claims it is written by Nāgārjuna (c. 2nd century), but various scholars such as Étienne Lamotte and Paul Demiéville, have questioned this, holding that the author was instead a Sarvāstivāda monk learned in Abhidharma who became a Mahāyānist and wrote this text. It is a very influential text in East Asian Buddhism.
The Abhisamayālaṅkāra ("Ornament of/for Realization[s]") also includes numerous Abhidharma type listings, and according to Karl Brunnholzl, "may be considered as a kind of highly formalized mahāyāna abhidharma presentation of the path and realization (similar to chapters five to eight of the Abhidharmakosa, which are frequently quoted in the AA commentaries)."
See also
Buddhist texts
Tipitaka
Abhidhamma Pitaka
Sutta Pitaka
Vinaya Pitaka
Buddhist concepts
Pratitya-samutpada
Skandha
Index of Buddhism-related articles
References
Sources
Cox, Collett (2003). "Abidharma", in: Buswell, Robert E. ed. Encyclopedia of Buddhism, New York: Macmillan Reference Lib. ; pp. 1–7.
Dutt, Nalinaksha (1978). Buddhist Sects in India, Delhi: Motilal Banarsidass
Goleman, Daniel (2004). Destructive Emotions: A Scientific Dialogue with the Dalai Lama. NY: Bantam Dell. .
Horner, I.B. (1963). The book of discipline Vol. V (Cullavagga), London Luzac.
Red Pine (2004). The Heart Sutra: The Womb of the Buddhas, Shoemaker 7 Hoard.
Rhys Davids, Caroline A. F. ([1900], 2003). Buddhist Manual of Psychological Ethics, of the Fourth Century B.C., Being a Translation, now made for the First Time, from the Original Pāli, of the First Book of the , entitled (Compendium of States or Phenomena). Kessinger Publishing. . Internet Archive
Rhys Davids, Caroline A. F. (1914). Buddhist Psychology: An Inquiry into the Analysis and Theory of Mind in Pali Literature, London: G. Bell and Sons.
Takakusu, J. (1905). "On the Abhidhamma books of the Sarvastivadins", Journal of the Pali Text Society, pp. 67–146
Trungpa, Chogyam (1975, 2001). Glimpses of Abhidharma: From a Seminar on Buddhist Psychology. Boston, MA: Shambhala Publications. .
Further reading
Anālayo, Bhikkhu, The Dawn of Abhidharma, Hamburg Buddhist Studies 2, Hamburg: Hamburg University Press, 2014
External links
Readable online HTML book of the Dhammasangani (first book of the Abhidhamma).
www.abhidhamma.org – Numerous books and articles on Abhidhamma by Sujin Boriharnwanaket and others
www.abhidhamma.com – Abhidhamma the Buddhist Philosophy and Psychology
BuddhaNet – description of the Abhidhamma
BuddhaNet – Abhidhamma articles
Access to Insight – description of the Abhidhamma
Online excerpt of a well-known book about the Abhidhamma
Books results for Abdhidhamma search on Internet Archive
Unravelling the Mysteries of Mind and Body through Abhidhamma
A Comprehensive Manual of Abhidhamma (Amazon book link)
Buddhist literature
|
```go
package main
import (
"errors"
"fmt"
"github.com/3xxx/engineercms/commands/daemon"
"github.com/3xxx/engineercms/conf"
"github.com/3xxx/engineercms/controllers"
"github.com/3xxx/engineercms/models"
_ "github.com/3xxx/engineercms/routers" //
"github.com/beego/beego/v2/adapter/toolbox"
"github.com/beego/beego/v2/client/orm"
"github.com/beego/beego/v2/core/logs"
"github.com/beego/beego/v2/server/web"
"github.com/beego/i18n"
"github.com/kardianos/service"
_ "github.com/mattn/go-sqlite3"
"io"
// "log"
"net/http"
"os"
"os/exec"
"path"
"strings"
"time"
)
// gracefulrouter2
// vendorgoinitmain
// golandvendor
// 2021-8-30
// 1.beegocontrollersinit()modelsinit()gormmodelsinit()
// 2.controllerseforcecasbin_rulemodelsinit()
// 3.controllersuseruser
// 4.eforceadminreturn-
func main() {
// beego.AddFuncMap("dict", dict)
//web.AutoRender = false
//beego.TemplateLeft = "<<<"
//beego.TemplateRight = ">>>"
//web.TemplateLeft = "<<<"
//web.TemplateRight = ">>>"
//
orm.RunSyncdb("default", false, true)
// orm.RunSyncdb("default", true, true)
models.InsertUser()
// models.InsertGroup()
models.InsertRole()
// err := orm.RunSyncdb("default", false, true) // mindoc
// if err == nil {
// initialization()
// } else {
// panic(err.Error())
// }
web.AddFuncMap("loadtimes", loadtimes)
web.AddFuncMap("subsuffix", subsuffix)
//ormbeegoorm
ormDebug, err := web.AppConfig.String("ormDebug")
if err != nil {
logs.Error("ormDebug ->", err.Error())
}
if ormDebug == "true" {
orm.Debug = true
} else {
orm.Debug = false
}
//ModePerm FileMode = 0777 // Unix&
os.Mkdir("attachment", os.ModePerm)
//
os.Mkdir("attachment/carousel", os.ModePerm)
// time1 := "0/" + time + " * * * * *"
// time1 := "* 30 8 * * 1-5"
time1, err := web.AppConfig.String("tasktime")
if err != nil {
logs.Error("tasktime ->", err.Error())
}
if time1 != "" {
tk1 := toolbox.NewTask("tk1", time1, func() error { controllers.SendMessage(); return nil }) //func() error { fmt.Println("tk1"); return nil }
toolbox.AddTask("tk1", tk1)
toolbox.StartTask()
defer toolbox.StopTask()
}
//
time2, err := web.AppConfig.String("backupdatatime")
if err != nil {
logs.Error("tasktime ->", err.Error())
}
// logs.Info(time2)
if time2 != "" {
tk2 := toolbox.NewTask("tk2", time2, func() error { controllers.Postdata(); return nil }) //func() error { fmt.Println("tk1"); return nil }
toolbox.AddTask("tk2", tk2)
toolbox.StartTask()
defer toolbox.StopTask()
}
// ********mindoc*********
// if len(os.Args) >= 3 && os.Args[1] == "service" {
// if os.Args[2] == "install" {
// daemon.Install()
// } else if os.Args[2] == "remove" {
// daemon.Uninstall()
// } else if os.Args[2] == "restart" {
// daemon.Restart()
// }
// }
initialization()
// commands.RegisterCache()
// commands.RegisterLogger(conf.LogFile)
// commands.RegisterCommand()
d := daemon.NewDaemon()
s, err := service.New(d, d.Config())
if err != nil {
fmt.Println("Create service error => ", err)
os.Exit(1)
}
if err := s.Run(); err != nil {
// log.Fatal(" ->", err)
logs.Error(" ->", err)
}
// ********mindoc*********
// web.SetStaticPath("/down1", "download1")
web.Run()
// pprof,
// go func() {
// log.Println(http.ListenAndServe("127.0.0.1:6060", nil))
// }()
}
//
func loadtimes(t time.Time) int {
return int(time.Now().Sub(t).Nanoseconds() / 1e6)
}
//
func subsuffix(in string) string {
fileSuffix := path.Ext(in)
return strings.TrimSuffix(in, fileSuffix)
}
// GoLang
//
// func main() {
// server()
// }
func server() {
http.HandleFunc("/version", version)
http.ListenAndServe(":8080", nil)
}
func version(w http.ResponseWriter, r *http.Request) {
out, err := exec.Command("go", "version").Output()
if err != nil {
// log.Fatal(err)
logs.Error(err)
}
io.WriteString(w, fmt.Sprintf("%s", out))
}
//commands install.go
func initialization() {
err := models.NewOption().Init()
if err != nil {
panic(err.Error())
}
// command.go
lang, _ := web.AppConfig.String("default_lang")
// err = i18n.SetMessage(lang, "conf/lang/"+lang+".ini")
// if err != nil {
// panic(fmt.Errorf("initialize locale error: %s", err))
// }
member, err := models.NewMember().FindByFieldFirst("account", "admin")
if errors.Is(err, orm.ErrNoRows) {
// create admin user
logs.Info("creating admin user")
member.Account = "admin"
member.Avatar = conf.URLForWithCdnImage("/static/mindoc/images/headimgurl.jpg")
member.Password = "123456"
member.AuthMethod = "local"
member.Role = conf.MemberSuperRole
member.Email = "admin@iminho.me"
if err := member.Add(); err != nil {
panic("Member.Add => " + err.Error())
}
// create demo book
logs.Info("creating demo book")
book := models.NewBook()
book.MemberId = member.MemberId
book.BookName = i18n.Tr(lang, "init.default_proj_name") //"MinDoc"
book.Status = 0
book.ItemId = 1
book.Description = i18n.Tr(lang, "init.default_proj_desc") //"MinDoc"
book.CommentCount = 0
book.PrivatelyOwned = 0
book.CommentStatus = "open" //"closed"
book.Identify = "mindoc"
book.DocCount = 0
book.CommentCount = 0
book.Version = time.Now().Unix()
book.Cover = conf.GetDefaultCover()
book.Editor = "markdown"
book.Theme = "default"
if err := book.Insert(lang); err != nil {
panic(" -> " + err.Error())
}
} else if err != nil {
panic(fmt.Errorf("occur errors when initialize: %s", err))
}
if !models.NewItemsets().Exist(1) {
item := models.NewItemsets()
item.ItemName = i18n.Tr(lang, "init.default_proj_space") //""
item.MemberId = 1
if err := item.Save(); err != nil {
panic(" -> " + err.Error())
}
}
}
// *******Golang *********
// bool //false
// string //
// int int8 int16 int32 int64 //0
// uint uint8 uint16 uint32 uint64 uintptr //0
// byte // uint8
// rune // int32
// float32 float64 //0
// complex64 complex128 //0
// Go"0"false"0"0
// "0"""////"0"nil
// (Field)"0""nil"
// func Create(name string) (file *File, err error)
// func OpenFile(name string, flag int, perm FileMode) (file *File, err error)
//flag intO_CREAT
// const (
// O_RDONLY int = syscall.O_RDONLY //
// O_WRONLY int = syscall.O_WRONLY //
// O_RDWR int = syscall.O_RDWR //
// O_APPEND int = syscall.O_APPEND //
// O_CREATE int = syscall.O_CREAT //
// O_EXCL int = syscall.O_EXCL // O_CREATE
// O_SYNC int = syscall.O_SYNC // I/O
// O_TRUNC int = syscall.O_TRUNC //
// )
// ,
// f, f_err := os.OpenFile(file_save, os.O_WRONLY|os.O_CREATE, 0666)
// if f_err != nil {
// fmt.Fprintf(w, "file open fail:%s", f_err)
// } // copy
// _, copy_err := io.Copy(f, file)
// if copy_err != nil {
// fmt.Fprintf(w, "file copy fail:%s", copy_err)
// } //
// defer f.Close()
// defer file.Close()
//
// func main() {
// filename := "/root/Desktop/2.jpg"
// //
// startTime1 := time.Now()
// for i := 0; i < 1000000; i++ {
// _ = filepath.Base(filename)
// }
// endTime1 := time.Now()
// 4KBbufio.NewReader(f), 4KBbufio.NewReaderSize(f,)
// Reader, ioutil.ReadAll()
// ioutil.ReadFile()
// func Ioutil(name string) {
// if contents,err := ioutil.ReadFile(name);err == nil {
// //contents[]bytestring,strings.Replace
// result := strings.Replace(string(contents),"\n","",1)
// fmt.Println("Use ioutil.ReadFile to read a file:",result)
// }
// }
// func main() {
// b, err := ioutil.ReadFile("test.log")
// if err != nil {
// fmt.Print(err)
// }
// fmt.Println(b)
// str := string(b)
// fmt.Println(str)
// }
// ioutil.ReadFile[]byte
// func Read0() (string){
// f, err := ioutil.ReadFile("file/test")
// if err != nil {
// fmt.Println("read fail", err)
// }
// return string(f)
// }
// func read3(path string)string{
// fi,err := os.Open(path)
// if err != nil{panic(err)}
// defer fi.Close()
// fd,err := ioutil.ReadAll(fi)
// // fmt.Println(string(fd))
// return string(fd)
// }
//
// func writeMsgToLog(msg string, client Client) {
// //
// file, e := os.OpenFile(
// "D:/BJBlockChain1801/demos/W4/day1/01ChatRoomII/logs/"+client.name+".log",
// os.O_CREATE|os.O_WRONLY|os.O_APPEND,
// 0644)
// SHandleError(e, "os.OpenFile")
// defer file.Close()
// //
// logMsg := fmt.Sprintln(time.Now().Format("2006-01-02 15:04:05"), msg)
// file.Write([]byte(logMsg))
// }
//map for Http Content-Type Http content-Type
// var HttpContentType = map[string]string{
// ".avi": "video/avi",
// ".mp3": " audio/mp3",
// ".mp4": "video/mp4",
// ".wmv": " video/x-ms-wmv",
// ".asf": "video/x-ms-asf",
// ".rm": "application/vnd.rn-realmedia",
// ".rmvb": "application/vnd.rn-realmedia-vbr",
// ".mov": "video/quicktime",
// ".m4v": "video/mp4",
// ".flv": "video/x-flv",
// ".jpg": "image/jpeg",
// ".png": "image/png",
// }
// // url
// func PubResFileStreamGetService(c *gin.Context) {
// filePath := c.Query("url")
// //
// fileNameWithSuffix := path.Base(filePath)
// //
// fileType := path.Ext(fileNameWithSuffix)
// //http ContentType
// fileContentType := HttpContentType[fileType]
// if common.IsEmpty(fileContentType) {
// c.String(http.StatusNotFound, "file http contentType not found")
// return
// }
// c.Header("Content-Type", fileContentType)
// c.File(filePath)
// }
// beego
// step1:beego:
// copyrequestbody = true
//
// req:=this.Ctx.Input.RequestBody
// data:=string(req)
```
|
Melvin Herbert King (October 20, 1928 – March 28, 2023) was an American politician, community organizer, and educator. In 1973, King was elected as a member of the Massachusetts House of Representatives' 9th Suffolk district, a post he held until early 1983. King was the runner-up in the 1983 Boston mayoral election, against Raymond Flynn.
King, a lifelong resident of South End neighborhood of Boston, was active in creating community programs and institutions for low-income people in the city, and was the founder of the South End Technology Center. At the time of his death, he held the position of Senior Lecturer Emeritus at the Massachusetts Institute of Technology in their Department of Urban Studies and Planning.
Early years
King's mother, Ursula, was born in Guyana, and his father, Watts King, in Barbados. His parents met and married in Nova Scotia and immigrated to Boston in the early 1920s. Born in the South End neighborhood, King was one of eleven children, only nine of whom survived past infancy. He graduated from Boston Technical High School in 1946 and then from Claflin College in Orangeburg, South Carolina in 1950 with a Bachelor of Science degree in mathematics. In 1951, he received a Master of Arts degree in education from Boston State College, and then taught math, first at Boston Trade High School and at his alma mater, Boston Technical High School.
In 1953, King left the classroom to work with at-risk students, becoming Director of Boy's Work at Lincoln House, a settlement house in the South End. He continued doing community work, focusing on street-corner gangs as Youth Director at the United South End Settlements (USES). King also worked as a community activist, as well as an urban renewal and anti-poverty organizer. He was fired by USES when he promoted neighborhood control over government control, but was later rehired after community protests over his firing and was given the job of community organizer. King then founded the Community Assembly for a United South End (C.A.U.S.E.) to give tenants and community residents a voice.
Political activities
Activism
In 1967, King became the director of the New Urban League of Greater Boston. He brought job training for the unemployed and organized the community around public school, employment, and human services delivery issues. In 2003, King created The New Majority – an organization and program uniting Boston's communities of color– Blacks, Hispanics, Asians, and Native Americans – uniting them around candidates for elective office.
Boston Redevelopment Authority protests and Tent City
In 1968, King helped organize a sit-in at the Boston Redevelopment Authority (BRA) office on April 25 in protest of a planned parking garage that was going to be built at the corner of Dartmouth and Columbus Streets in the South End, a site where housing had been leveled. The next morning, King organized an occupation of the lot.
For the next three days, while facing police retaliation, from 100 to 400 people occupied the lot. They built tents and wooden shanties and put up a large sign welcoming the media and visitors to "Tent City." Celtics legend Bill Russell, who owned a South End restaurant, provided food for the protestors. The story received extensive coverage in the local media. In honor of the demonstration, when a housing complex at that site was dedicated on April 30, 1988, it was named "Tent City." King told reporters that the key to the project was convincing ordinary Bostonians that they had to play a role in the development of their neighborhood.
Boston School Committee campaigns
King ran three times for a seat on the Boston School Committee in 1961, 1963, and 1965 – being unsuccessful each time.
State representative
In 1973, King was elected to the Massachusetts House of Representatives for the 4th Suffolk district; he served until 1982. He was redistricted to the 9th Suffolk district in 1978.
1979 mayoral election
In 1979, King ran for Mayor for the first time. He finished third in the preliminary election and was eliminated.
1983 mayoral campaign
In 1983, when the incumbent Mayor of Boston, Kevin White, withdrew from contention after 16 years in office, Mel King ran for mayor, the first African-American to run in a final election bid for mayor of Boston, and ultimately against Raymond Flynn. Though King secured the African American vote by wide margins and significant support among other ethnic groups, King ultimately lost to Flynn, an Irish-Catholic with roots in South Boston.
Both King and Flynn had originally been viewed as underdogs in the primary election. King's campaign relied heavily on volunteers, as did the campaign of Flynn. King's campaign came in a year where Black candidates in other cities had enjoyed success. This included the election of Harold Washington in Chicago.
King and Flynn had known each other since childhood, meeting through both playing basketball, and had both served as state representatives at the same time and worked together there on legislation. They would ultimately have a lifelong friendship, despite having run against each other for mayor.
Rainbow Coalition/Green-Rainbow Party
King founded the Rainbow Coalition Party in Massachusetts in 1997. The term "rainbow coalition" had been used to describe coalitions which brought together a variety of demographic groups (including multiple ethnicities) into a political coalition. King had used it to describe his coalition of support during his 1983 mayoral campaign, preceding the Jesse Jackson presidential campaign the next year. In 2002, the Rainbow Coalition Party merged with the Massachusetts Green Party to become the Green-Rainbow Party, the Massachusetts affiliate of the Green Party of the United States.
In 2002, King supported Green-Rainbow Party nominee Jill Stein for governor of Massachusetts, saying "Jill Stein is the only candidate who will speak truth to power...She's the only one that makes issues of racism and social justice integral parts of her campaign.
King remained active as a member of the Green-Rainbow Party. In 2014, he was the campaign manager for the Green-Rainbow Party candidate for State Auditor, M. K. Merelice. He also supported the candidacies of other Green-Rainbow Party candidates; Danny Factor for Secretary of the Commonwealth and Ian Jackson for Treasurer.
Endorsements of candidacies
During the 2000 presidential election, King endorsed the presidential campaign of Ralph Nader.
King endorsed Boston City Council at-large member Sam Yoon for mayor on August 10, 2009. King praised Yoon's vision, his collaborative approach and his focus on improving the educational system in Boston.
King endorsed Rep. Marty Walsh for mayor in his 2013 race against Boston City Councilor John Connolly.
King gave a last-minute endorsement to acting mayor Kim Janey before the primary of the 2021 Boston mayoral election.
The Mel King Institute
The Mel King Institute for Community Building was formed in 2009 by the Massachusetts Association of Community Development Corporations (MACDC) and Local Initiatives Support Corporation (LISC) Boston, a nonprofit that supports affordable housing and community development. It is a training center and information clearinghouse for community development practitioners.
Academic work
In 1970, King created the Community Fellows Program (CFP) in the Department of Urban Studies and Planning at MIT. He served as an Adjunct Professor of Urban Studies and Planning and director of the Community Fellows Program for twenty-five years until 1996. CFP, a nine-month-long program brought community organizers and leaders from across America to reflect, research, and study urban community politics, economics, social life, education, housing, and media.
In 1981, King's book, Chain of Change: Struggles for Black Community Development was published by South End Press. It focused on development in housing, education, employment and politics in Boston from the 1950s through the 1970s. Inspired by young activists, King reprinted Chain of Change in 2018.
In addition to writing Chain of Change and journal articles, King also used poetry to share his messages.
Later years and death
Upon his retirement from MIT, King established the South End Technology Center to provide computer training for low-income people.
In 2021, an intersection in Boston's South End was named the "Melvin H. 'Mel' King Square" in his honor.
King died at his home in Boston's South End on March 28, 2023, at the age of 94. He was survived by his wife, the former Joyce Kenion, whom he married in 1951.
See also
1973–1974 Massachusetts legislature
1975–1976 Massachusetts legislature
References
External links
MassMoments: "Activists Erect Tent City in Boston"
Boston Phoenix: "Still going strong at 75, former Boston mayoral candidate Mel King reflects on a life of political activism"
Interview with Mel King about living in a diverse city for the WGBH series, Ten O'Clock News
"WGBH: Gail Harris interviews Mel King"
Time Magazine: "Boston wins by a landslide .. a black takes the primary in a racially scarred city"
Dorchester Reporter: "The Campaign that changed Boston: 1983"
MIT News Office: "Conference to Honor Mel King"
South End Technology Center@Tent City
The New Majority: Uniting Boston's Communities of Color
Historymakers Profile: Hon. Melvin King
1928 births
2023 deaths
American people of Guyanese descent
American people of Barbadian descent
American urban planners
Activists for African-American civil rights
African-American state legislators in Massachusetts
Boston State College alumni
Claflin University alumni
University of Massachusetts Boston alumni
Members of the Massachusetts House of Representatives
Massachusetts Greens
People from South End, Boston
MIT School of Architecture and Planning faculty
Writers from Boston
Politicians from Boston
21st-century African-American politicians
21st-century American politicians
|
```javascript
import ElProgress from './src/progress';
/* istanbul ignore next */
ElProgress.install = function(Vue) {
Vue.component(ElProgress.name, ElProgress);
};
export default ElProgress;
```
|
California's 66th State Assembly district is one of 80 California State Assembly districts. It is currently represented by Democrat Al Muratsuchi of Rolling Hills Estates.
District profile
The district encompasses the heart of the South Bay region, including the Beach Cities and the Palos Verdes Peninsula. Located southwest of Downtown Los Angeles, the district is relatively suburban and primarily affluent.
Los Angeles County – 4.8%
Alondra Park
Gardena – 74.2%
Hermosa Beach
Lomita
Los Angeles – 1.0%
Harbor City – partial
Harbor Gateway – partial
Manhattan Beach
Palos Verdes Estates
Rancho Palos Verdes
Redondo Beach
Rolling Hills
Rolling Hills Estates
Torrance
West Carson
Election results from statewide races
List of Assembly Members
Due to redistricting, the 66th district has been moved around different parts of the state. The current iteration resulted from the 2011 redistricting by the California Citizens Redistricting Commission.
Election results 1992 - present
2020
2018
2016
2014
2012
2010
2008
2006
2004
2002
2000
1998
1996
1994
1992
See also
California State Assembly
California State Assembly districts
Districts in California
References
External links
District map from the California Citizens Redistricting Commission
66
Government of Los Angeles County, California
Hermosa Beach, California
Palos Verdes Peninsula
Lomita, California
Manhattan Beach, California
Redondo Beach, California
South Bay, Los Angeles
Torrance, California
|
```python
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from hypothesis import given
import hypothesis.strategies as st
from multiprocessing import Process
import numpy as np
import tempfile
import shutil
import caffe2.python.hypothesis_test_util as hu
op_engine = 'GLOO'
class TemporaryDirectory:
def __enter__(self):
self.tmpdir = tempfile.mkdtemp()
return self.tmpdir
def __exit__(self, type, value, traceback):
shutil.rmtree(self.tmpdir)
def allcompare_process(filestore_dir, process_id, data, num_procs):
from caffe2.python import core, data_parallel_model, workspace, dyndep
from caffe2.python.model_helper import ModelHelper
from caffe2.proto import caffe2_pb2
dyndep.InitOpsLibrary("@/caffe2/caffe2/distributed:file_store_handler_ops")
workspace.RunOperatorOnce(
core.CreateOperator(
"FileStoreHandlerCreate", [], ["store_handler"], path=filestore_dir
)
)
rendezvous = dict(
kv_handler="store_handler",
shard_id=process_id,
num_shards=num_procs,
engine=op_engine,
exit_nets=None
)
model = ModelHelper()
model._rendezvous = rendezvous
workspace.FeedBlob("test_data", data)
data_parallel_model._RunComparison(
model, "test_data", core.DeviceOption(caffe2_pb2.CPU, 0)
)
class TestAllCompare(hu.HypothesisTestCase):
@given(
d=st.integers(1, 5), n=st.integers(2, 11), num_procs=st.integers(1, 8)
)
def test_allcompare(self, d, n, num_procs):
dims = []
for _ in range(d):
dims.append(np.random.randint(1, high=n))
test_data = np.random.ranf(size=tuple(dims)).astype(np.float32)
with TemporaryDirectory() as tempdir:
processes = []
for idx in range(num_procs):
process = Process(
target=allcompare_process,
args=(tempdir, idx, test_data, num_procs)
)
processes.append(process)
process.start()
while len(processes) > 0:
process = processes.pop()
process.join()
if __name__ == "__main__":
import unittest
unittest.main()
```
|
```groff
.TH BESSIDE-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
besside-ng - crack a WEP or WPA key without user intervention and collaborate with WPA cracking statistics
.SH SYNOPSIS
.B besside-ng
[options] <interface>
.SH DESCRIPTION
.BI besside-ng
is a tool wich will crack all the WEP networks in range and log all the WPA handshakes.
WPA handshakes can be uploaded to the online cracking service at wpa.darkircop.org.
.BR
Wpa.darkircop.com also provides useful statistics based on user-submitted capture
files about the feaseability of WPA cracking.
.PP
.TP
.I -b <target mac>
Specifies the target's BSSID
.TP
.I -s <WPA server>
Where to upload capture file for cracking. A good choice is wpa.darkircop.org
.TP
.I -c <chan>
Channel lock
.TP
.I -p <pps>
Packages per second to send (flood rate).
.TP
.I -W
Crack only WPA networks
.TP
.I -v
Verbos mode. Use -vv for more verbose, -vv for even more and so on.
.TP
.I -h
Help screen
.SH AUTHOR
This manual page was written by David Francos Cuartero.
.SH SEE ALSO
.br
.B airbase-ng(8)
.br
.B aireplay-ng(8)
.br
.B airmon-ng(8)
.br
.B airodump-ng(8)
.br
.B airodump-ng-oui-update(8)
.br
.B airserv-ng(8)
.br
.B airtun-ng(8)
.br
.B easside-ng(8)
.br
.B tkiptun-ng(8)
.br
.B wesside-ng(8)
.br
.B aircrack-ng(1)
.br
.B airdecap-ng(1)
.br
.B airdecloak-ng(1)
.br
.B airolib-ng(1)
.br
.B besside-ng-crawler(1)
.br
.B buddy-ng(1)
.br
.B ivstools(1)
.br
.B kstats(1)
.br
.B makeivs-ng(1)
.br
.B packetforge-ng(1)
.br
.B wpaclean(1)
```
|
```javascript
/**
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
define(["style/interface.scss", "data/Scores", "Tone/core/Transport", "interface/Loader"],
function (interfaceStyle, Scores, Transport, Loader) {
var PlayButton = function(container){
//the play button
this._playButton = document.createElement("div");
this._playButton.id = "PlayPause";
this._playButton.classList.add("Button");
container.appendChild(this._playButton);
this._playButton.addEventListener("click", this._play.bind(this));
//the midi file title
this._midiButton = document.createElement("div");
this._midiButton.id = "Midi";
this._midiButton.classList.add("TextButton");
var xSpan = document.createElement("span");
var textSpan = document.createElement("span");
xSpan.innerHTML = "";
textSpan.classList.add("Text");
textSpan.innerHTML = "testfile.mid";
this._midiButton.appendChild(xSpan);
this._midiButton.appendChild(textSpan);
container.appendChild(this._midiButton);
this._midiButton.addEventListener("click", this._clearMidiFile.bind(this));
//the prev button
this._prevButton = document.createElement("div");
this._prevButton.id = "Previous";
this._prevButton.classList.add("Button");
this._prevButton.classList.add("ScoreButton");
this._prevButton.classList.add("icon-svg_left_arrow");
container.appendChild(this._prevButton);
this._prevButton.addEventListener("click", this._selectScore.bind(this, -1));
//the next button
this._nextButton = document.createElement("div");
this._nextButton.id = "Next";
this._nextButton.classList.add("Button");
this._nextButton.classList.add("ScoreButton");
this._nextButton.classList.add("icon-svg_right_arrow");
container.appendChild(this._nextButton);
this._nextButton.addEventListener("click", this._selectScore.bind(this, 1));
this._scoreIndex = 0;
this._setScoreControls();
//the callbacks
this.onPlay = function(){};
this.onScore = function(){};
this._setPlayIcon();
//load the first score
// this._loadScore();
};
PlayButton.prototype._clearMidiFile = function() {
document.getElementById('PlayPause').classList.remove('Shifted');
document.querySelectorAll('#Previous, #Next').forEach(function(n) { n.classList.remove('Hidden') });
document.getElementById('Midi').classList.remove('Active');
this._loadScore();
this.onPlay(false);
this.stop();
};
PlayButton.prototype._selectScore = function(move){
this._setPlayIcon();
this._scoreIndex += move;
this._setScoreControls();
this._loadScore(Scores[this._scoreIndex]);
};
PlayButton.prototype.stop = function(move){
this._setPlayIcon();
};
PlayButton.prototype._play = function(){
if (Transport.state === "started"){
Transport.stop();
this._setPlayIcon();
this.onPlay(false);
} else {
this._setPauseIcon();
Transport.start();
this.onPlay(true);
}
};
PlayButton.prototype._setPlayIcon = function(){
this._playButton.classList.remove("icon-svg_pause");
this._playButton.classList.add("icon-svg_play");
this._playButton.classList.remove("Active");
};
PlayButton.prototype._setPauseIcon = function(){
this._playButton.classList.add("icon-svg_pause");
this._playButton.classList.remove("icon-svg_play");
this._playButton.classList.add("Active");
};
PlayButton.prototype._loadScore = function(){
//pause before the score
Transport.stop();
this.onPlay(false);
var name = Scores[this._scoreIndex];
var loader = new Loader("score");
var xhr = new XMLHttpRequest();
xhr.open("GET", "./midi/" + name + ".json");
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var json = JSON.parse(xhr.responseText);
loader.resolve();
this.onScore(json);
} else {
console.log('Error: ' + xhr.status); // An error occurred during the request.
}
}
}.bind(this);
xhr.send(null);
};
PlayButton.prototype._setScoreControls = function(){
if (this._scoreIndex === 0){
this._prevButton.classList.add("Disabled");
} else {
this._prevButton.classList.remove("Disabled");
}
if (this._scoreIndex === Scores.length - 1){
this._nextButton.classList.add("Disabled");
} else {
this._nextButton.classList.remove("Disabled");
}
};
return PlayButton;
});
```
|
```java
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing,
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// specific language governing permissions and limitations
package org.apache.impala;
import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredJavaObject;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
import org.apache.hadoop.io.Text;
public class GenericImportsNearbyClassesUdf extends GenericUDF {
public GenericImportsNearbyClassesUdf() {
// Ensure that new classes can be loaded in constructor.
UtilForUdfConstructor.getHello();
}
@Override
public ObjectInspector initialize(ObjectInspector[] arguments)
throws UDFArgumentException {
if (arguments.length != 1) {
throw new UDFArgumentException("GenericImports takes one argument.");
}
if (!(arguments[0] instanceof PrimitiveObjectInspector)) {
throw new UDFArgumentException("Found an input that is not a primitive.");
}
PrimitiveObjectInspector poi = (PrimitiveObjectInspector) arguments[0];
if (poi.getPrimitiveCategory() != PrimitiveCategory.STRING) {
throw new UDFArgumentException("GenericImports needs one STRING arg.");
}
// Ensure that new classes can be loaded in initialize().
UtilForUdfInitialize.getHello();
return PrimitiveObjectInspectorFactory.writableStringObjectInspector;
}
@Override
public Object evaluate(DeferredObject[] arguments)
throws HiveException {
// Ensure that new classes can be loaded in evaluate().
return new Text(UtilForUdf.getHello());
}
@Override
public String getDisplayString(String[] children) {
return "GenericImports";
}
}
```
|
```batchfile
@echo off
set ssleay=%1%
set tmp1=pem.out
set cmp=fc.exe
cecopy %ssleay% CE:\OpenSSL
copy ..\test\testcrl.pem >nul
call tpemce.bat crl testcrl.pem
if errorlevel 1 goto err
copy ..\test\testp7.pem >nul
call tpemce.bat pkcs7 testp7.pem
if errorlevel 1 goto err
copy ..\test\testreq2.pem >nul
call tpemce.bat req testreq2.pem
if errorlevel 1 goto err
copy ..\test\testrsa.pem >nul
call tpemce.bat rsa testrsa.pem
if errorlevel 1 goto err
copy ..\test\testx509.pem >nul
call tpemce.bat x509 testx509.pem
if errorlevel 1 goto err
copy ..\test\v3-cert1.pem >nul
call tpemce.bat x509 v3-cert1.pem
if errorlevel 1 goto err
copy ..\test\v3-cert1.pem >nul
call tpemce.bat x509 v3-cert1.pem
if errorlevel 1 goto err
copy ..\test\testsid.pem >nul
call tpemce.bat sess_id testsid.pem
if errorlevel 1 goto err
echo OK
del %tmp1% >nul 2>&1
:err
```
|
Eugene Smith (April 22, 1921 – May 9, 2009) was an American gospel singer and composer.
Early years
Eugene Smith was born on April 22, 1921. In 1933, Smith met Roberta Martin at Ebenezer Missionary Baptist Church when he joined the junior chorus led by Martin. That same year, Smith became one of the original Roberta Martin Singers.
Life
Smith was born to devout parents from Mobile, Alabama, and attended Wendell Phillips High School in Chicago, IL. During the start of World War II, Smith briefly served in the Army, but was discharged for his height, which barely registered five feet. Smith married and had a son, Eugene Smith, Jr., but the marriage ended in divorce, and Smith became estranged from Eugene Jr.
Musical career
Smith sang with the Roberta Martin Singers from the group's inception until it disbanded after Martin's death in 1969. As Smith termed his relationship with Martin in a 1981 interview for the Smithsonian, he and Martin "went together like bacon and eggs." Smith was known for his distinct baritone/tenor register, his unique delivery of songs which influenced the styles of other gospel singers such as Professor Alex Bradford and Rev. James Cleveland, and his trademark narration and sermonettes which would often stir worshippers in a frenzied ecstasy. Smith was often beckoned by music producers to release a solo album or to start his own group, but he refused and remained committed to The Roberta Martin Singers. In the early 1940s, Smith composed the gospel blues song "I Know the Lord Will Make a Way, Oh Yes He Will", which is still popular among congregations today, and in 1949, became the business manager and booking agent for the Roberta Martin Singers. After the group disbanded, Smith still sang in and around the Chicago area, and participated in various programs honoring The Roberta Martin Singers and other singers and musicians from the "Golden Era" of gospel until his death.
Death
Eugene Smith died in his sleep at his apartment in Chicago, Illinois, on May 9, 2009. He was 88 years old.
Songs
Smith was featured as a lead vocalist on the following songs recorded by The Roberta Martin Singers.
Fidelity Records Label Recordings
"He's All I Need" (1947)
"Don't Wonder About Him" (1947)
Religious Recording Label Recordings
"Pass Me Not O Gentle Savior" (1947)
Apollo Label Recordings
"I'll Follow in His Footsteps" (1949)
"Do You Know Him" (1950)
"Satisfied" (1950)
"I am Sealed (Sealed)" (1951)
"I Wanna See Jesus" (1951)
"Oh! Lord, Stand By Me" (1952)
"Come in The Room" (1952)
"After It's All Over" (lead shared with Roberta Martin) (1952)
"I'm Too Close" (1952)
"Let God Abide" (lead shared with Norsalus McKissick) (1952)
"I'm Determined" (lead shared with Norsalus McKissick) (1952)
"Shine on Me" (1952)
"Keep on Trusting" (1953)
"Is There Anybody Here" (1953)
"Marching to Zion" (1953)
"Shine Heavenly Light" (1954)
"He's Using Me" (lead shared with Norsalus McKissick) (1955)
"I'm Saved" (1955)
"There Is a Man" (1955)
"He's Always Right There" (1956?)
Savoy Label Recordings
"Walk in Jerusalem" (1957)
"Every Now and Then" (lead shared with Norsalus McKissick) (1957)
"(Crucifixion) One Day" (1957)
"Dark Hours" (lead shared with "Little Lucy" Smith Collier) (1957)
"I Can Make It" (1958)
"That Great Judgment Day" (lead shared with Roberta Martin) (1959)
"He Laid His Hands on Me" (1959)
"He Never Said a Word" (1960)
"It's Gonna Rain" (1960)
"He's Leading Me" (1960)
"I Couldn't Hear Nobody Pray" (1961)
"All Things Are Possible" (1961)
"It Was the Blood" (1962)
"Come Lord Jesus" (1963)
"Didn't It Rain" (1964)
"The Failure's Not in God, It's in Me" (lead shared with Norsalus McKissick, Gloria Griffin, and "Little" Lucy Smith Collier) (1964)
"Standing on the Promises" (1965)
"The God I Serve" (1965)
"He's The One" (1966)
"Saved" (1968)
References
Horace Clarence Boyer, How Sweet the Sound: The Golden Age of Gospel Elliot & Clark Publishing (1995),
Bil Carpenter, Uncloudy Days: The Gospel Music Encyclopedia Backbeat Books (2005),
Cedric J. Hayes, Robert Laughton The Gospel Discography: 1943–1970 Eyeball Productions, Inc (2007)
Bernice Johnson Reagon, We'll Understand It Better By and By Smithsonian Institution Press (1992)
Legendary Gospel Singer Eugene Smith Dead at 88, The Black Gospel Blog, Bob Marovich, May 9, 2009.
Eugene Smith, a Sparkplug of Gospel Music, Dies at 88, The New York Times, Bruce Weber, May 12, 2009.
Eugene Smith, 1921–2009: Gospel music pioneer and performer, The Chicago Tribune, May 13, 2009.
American gospel singers
Singers from Chicago
Gospel blues musicians
Songwriters from Illinois
1921 births
2009 deaths
African-American male songwriters
20th-century African-American women singers
|
Nightmare Ending is the seventh studio album from Portland, Oregon ambient musician Matthew Robert Cooper, under the name Eluvium. It is a double-album and was released on May 14, 2013. The album’s final track, “Happiness”, features vocals by Ira Kaplan of the band Yo La Tengo. A special digital edition, featuring a print by artist Jeannie Paske, was released on May 1, 2013, limited to 300 copies.
Track listing
Disc 1
"Don't Get Any Closer" – 9:06
"Warm" – 7:10
"By the Rails" – 2:15
"Unknown Variation" – 8:42
"Caroling" – 3:54
"Sleeper" – 6:17
"Envenom Mettle" – 5:23
Disc 2
"Chime" – 3:26
"Rain Gently" – 8:49
"Impromptu (For the Procession)" – 4:01
"Covered in Writing" – 9:18
"Entendre" – 4:20
"Strange Arrivals" – 2:50
"Happiness" (ft. Ira Kaplan) – 8:16
References
2013 albums
Eluvium (musician) albums
Temporary Residence Limited albums
|
Verbmobil was a long-term interdisciplinary Language Technology (esp. Machine Translation) research project with the aim of developing a system that could recognize, translate and produce natural utterances and thus "translate spontaneous speech robustly and bidirectionally for German/English and German/Japanese".
Verbmobil research was carried out between 1993 and 2000 and received a total of 116 million German marks (roughly 60 million euros) in funding from Germany's Federal Ministry of Research and Technology, the Bundesministerium für Forschung und Technologie; industry partners (such as DaimlerChrysler, Siemens and Philips) contributed an additional 52 million DM (26 million euros).
In the Verbmobil II project, the University of Tübingen created semi-automatically annotated treebanks for German, Japanese and English spontaneous speech.
TüBa-D/S contains approximately 38,000 sentences or 360,000 words.
TüBa-E/S contains approximately 30,000 sentences or 310,000 words.
TüBa-J/S contains approximately 18,000 sentences or 160,000 words.
Notes
External links
DFKI Verbmobil Overview German Artificial Intelligence Research Institute - Verbmobil overview (in English)
DFKI Verbmobil Portal German Artificial Intelligence Research Institute - Verbmobil portal page (in German)
Computational linguistics
Machine translation
|
The Archdiocesan Shrine of St. Vincent Ferrer (commonly known as Leganes Church) is a neoclassical church dedicated to Saint Vincent Ferrer in Leganes, Iloilo, Philippines under the Archdiocese of Jaro. Its current structure is a result of the numerous restoration efforts which was necessity because of both man-made and natural disasters.
History
The current San Vicente Ferrer Church was a product of repairs and reconstructions. The first was completed in 1889 under the patronage of Father Eladio Zamora using the materials of tabigue, bamboo and brickwork. It replaced the old chapel which was constructed out of local indigenous materials. The adjoining convent was made out of local wood while the adjacent cemetery was bordered by a bamboo fence.
Strong winds and rain damaged the church and rendered the convent useless during the typhoon that happened on May 10, 1896. Repairs were initiated by Father Fulgencio Rodriguez on the church. Two years after the tragic event, Augustinians handed the church over to the secular priests who have given assistance to the natives since the evangelization started.
On January 25, 1948, the church was severely damaged when the Lady Caycay earthquake with a magnitude of 8.2 struck the whole of Panay Island. The shocks lasted for 70 seconds which devastated almost all the heritage churches within the island. Also recovering from World War II, the church reconstruction only went underway during the 1950s with an addition of a separate bell tower and other supplementary buildings.
Architecture
The facade is neoclassical expressed through the columns and the pediments at the center with fenestration of arched doorways and windows. The whole of interior is filled with colorful stained glass windows. One of which is an oculus located at the sanctuary wall that lights up the sculpture of St. Vincent Ferrer. Life of the saint is depicted through these stained windows which include his birth, his baptism, the apparition of the Virgin Mary to him, and his death.
It has a central nave and two aisles with lower ceilings flanking it. In front of the right aisle is a simple altar of Jesus and Mary while the baptistery ends the left aisle.
References
External links
Leganes
Churches in the Roman Catholic Archdiocese of Jaro
|
Lucy Skidmore Scribner (July 4, 1853 – May 2, 1931) was the founder of Skidmore College.
Biography
She was born on July 4, 1853, to Joseph Russell Skidmore (1821–1882), a coal merchant, and Lucy Ann Hawley (1821–1853). Lucy's grandparents were Jeremiah and Judith Ludlam Skidmore and Irad and Sarah Holmes Hawley. In 1875 she married John Blair Scribner. The couple resided at 21 East 48th Street in New York for their marriage. In 1879, after just 4 years of marriage, Lucy was widowed when her husband died of pneumonia.
In 1903, she created "The Young Women's Industrial Club" in Saratoga Springs, New York, and in 1911, the club was renamed the "Skidmore School of Arts" and chartered as a college to vocationally and professionally train young women. In 1922, the school became a four-year, degree-granting institution for women and was renamed "Skidmore College." In 1971, Skidmore College became co-educational. Lucy Skidmore Scribner died on May 2, 1931. and is buried in Woodlawn Cemetery in the Bronx near her husband.
References
External links
Lucy Skidmore Scribner at FindAGrave.com
1853 births
1931 deaths
University and college founders
Burials at Woodlawn Cemetery (Bronx, New York)
American women philanthropists
Philanthropists from New York (state)
Skidmore College
|
```ruby
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
#
# path_to_url
#
# Unless required by applicable law or agreed to in writing,
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# specific language governing permissions and limitations
class TestTime32Scalar < Test::Unit::TestCase
def setup
@data_type = Arrow::Time32DataType.new(:second)
@value = 60 * 10 # 00:10:00
@scalar = Arrow::Time32Scalar.new(@data_type, @value)
end
def test_data_type
assert_equal(@data_type,
@scalar.data_type)
end
def test_valid?
assert do
@scalar.valid?
end
end
def test_equal
assert_equal(Arrow::Time32Scalar.new(@data_type, @value),
@scalar)
end
def test_to_s
assert_equal("00:10:00", @scalar.to_s)
end
def test_value
assert_equal(@value, @scalar.value)
end
end
```
|
```shell
#!/bin/bash
# Curl Testing Script for Nginx Ultimate Bad Bot Blocker
# Created by: Mitchell Krog (mitchellkrog@gmail.com)
# Repo Url: path_to_url
##############################################################################
# _ __ _ #
# / |/ /__ _(_)__ __ __ #
# / / _ `/ / _ \\ \ / #
# /_/|_/\_, /_/_//_/_\_\ #
# __/___/ __ ___ __ ___ __ __ #
# / _ )___ ____/ / / _ )___ / /_ / _ )/ /__ ____/ /_____ ____ #
# / _ / _ `/ _ / / _ / _ \/ __/ / _ / / _ \/ __/ '_/ -_) __/ #
# /____/\_,_/\_,_/ /____/\___/\__/ /____/_/\___/\__/_/\_\\__/_/ #
# #
##############################################################################
# your_sha256_hash--------------
# your_sha256_hash--------------
# path_to_url
# your_sha256_hash--------------
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# your_sha256_hash--------------
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# your_sha256_hash--------------
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# your_sha256_hash--------------
export TERM=xterm
# -------------------------------------------
# For Testing REGEX and False Positives Cases
# -------------------------------------------
# ------------------------
# Set Terminal Font Colors
# ------------------------
bold=$(tput bold)
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
blue=$(tput setaf 4)
magenta=$(tput setaf 5)
cyan=$(tput setaf 6)
white=$(tput setaf 7)
defaultcolor=$(tput setaf default)
# -----------------------------
# USER-AGENT ARRAY - MUST MATCH
# -----------------------------
UAmustmatch[0]="Titan"
UAmustmatch[1]="Nutch"
UAmustmatch[2]="Ebingbong"
# ---------------------------------
# USER-AGENT ARRAY - MUST NOT MATCH
# ---------------------------------
UAmustnotmatch[0]="Titanium"
UAmustnotmatch[1]="Nutchers"
UAmustnotmatch[2]="SNutch"
UAmustnotmatch[3]="Bing"
UAmustnotmatch[4]="bing"
# ---------------------------
# REFERRER ARRAY - MUST MATCH
# ---------------------------
REFmustmatch[0]="zx6.ru"
REFmustmatch[1]="100dollars-seo.com"
REFmustmatch[2]="googglet.com"
REFmustmatch[3]="www.zx6.ru"
REFmustmatch[4]="www7.100dollars-seo.com"
REFmustmatch[5]="ftp.googglet.com"
# ---------------------------------
# USER-AGENT ARRAY - MUST NOT MATCH
# ---------------------------------
REFmustnotmatch[0]="zx6.russia"
REFmustnotmatch[1]="100dollars-seo.community"
REFmustnotmatch[2]="googglet.co"
REFmustnotmatch[3]="google.com"
# ---------
# FUNCTIONS
# ---------
reloadNginX () {
printf "\n"
echo "${bold}${green}---------------"
echo "${bold}${green}Reloading Nginx"
echo "${bold}${green}---------------"
sudo nginx -t && sudo nginx -s reload
}
waitforReload () {
echo "${bold}${yellow}your_sha256_hash-------"
echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis"
echo "${bold}${yellow}your_sha256_hash-------"
printf "\n"
sleep 10s
}
# -----------------------
# UA FALSE POSITIVE TESTS
# -----------------------
UAtest_mustmatch () {
for mustmatch in "${UAmustmatch[@]}"
do
if
curl -A "${mustmatch}" path_to_url 2>&1 | grep -i '(52)'; then
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
else
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
exit 1
fi
done
}
UAtest_mustnotmatch () {
for mustnotmatch in "${UAmustnotmatch[@]}"
do
if
curl -A "${mustnotmatch}" path_to_url 2>&1 | grep -i '(52)'; then
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
exit 1
else
echo "${bold}${green}PASSED (No False Positive) - ${bold}${red}${mustnotmatch}"
fi
done
}
# -----------------------------
# REFERRER FALSE POSITIVE TESTS
# -----------------------------
REFtest_mustmatch () {
for mustmatch in "${REFmustmatch[@]}"
do
if
curl -I path_to_url -e "${mustmatch}" 2>&1 | grep -i '(52)'; then
echo "${bold}${green}PASSED - ${red}${mustmatch} was ${bold}${red}BLOCKED"
else
echo "${bold}${red}FAILED - ${red}${mustmatch} was ${bold}${red}NOT BLOCKED"
exit 1
fi
done
}
REFtest_mustnotmatch () {
for mustnotmatch in "${REFmustnotmatch[@]}"
do
if
curl -I path_to_url -e "${mustnotmatch}" 2>&1 | grep -i '(52)'; then
echo "${bold}${red}FAILED (FALSE POSITIVE DETECTED) - ${bold}${red}${mustnotmatch}"
exit 1
else
echo "${bold}${green}PASSED (No False Positive) - ${bold}${red}${mustnotmatch}"
fi
done
}
# -------------------------
# Trigger Functions / Tests
# -------------------------
UAtest_mustmatch
UAtest_mustnotmatch
REFtest_mustmatch
REFtest_mustnotmatch
echo "${bold}${cyan}False Positive Testing Completed"
echo "${bold}${green}All Tests Passed"
# ----------------------
# Exit With Error Number
# ----------------------
exit ${?}
# your_sha256_hash--------------
# your_sha256_hash--------------
# path_to_url
# your_sha256_hash--------------
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# your_sha256_hash--------------
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# your_sha256_hash--------------
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# your_sha256_hash--------------
```
|
```objective-c
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t LED_BUILTIN = 19;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
static const uint8_t SDA = 21;
static const uint8_t SCL = 22;
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
static const uint8_t A0 = 36;
static const uint8_t A3 = 39;
static const uint8_t A4 = 32;
static const uint8_t A5 = 33;
static const uint8_t A6 = 34;
static const uint8_t A7 = 35;
static const uint8_t A10 = 4;
static const uint8_t A11 = 0;
static const uint8_t A12 = 2;
static const uint8_t A13 = 15;
static const uint8_t A14 = 13;
static const uint8_t A15 = 12;
static const uint8_t A16 = 14;
static const uint8_t A17 = 27;
static const uint8_t A18 = 25;
static const uint8_t A19 = 26;
static const uint8_t T0 = 4;
static const uint8_t T1 = 0;
static const uint8_t T2 = 2;
static const uint8_t T3 = 15;
static const uint8_t T4 = 13;
static const uint8_t T5 = 12;
static const uint8_t T6 = 14;
static const uint8_t T7 = 27;
static const uint8_t T8 = 33;
static const uint8_t T9 = 32;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
#endif /* Pins_Arduino_h */
```
|
```c
/*
*
*/
#define DT_DRV_COMPAT microchip_xec_pinctrl
#include <zephyr/drivers/pinctrl.h>
#include <soc.h>
/*
* Microchip XEC: each GPIO pin has two 32-bit control register.
* The first 32-bit register contains all pin features except
* slew rate and driver strength in the second control register.
* We compute the register index from the beginning of the GPIO
* control address space which is the same range of the PINCTRL
* parent node. A zero value in the PINCTRL pinmux field means
* do not touch.
*/
static void config_drive_slew(struct gpio_regs * const regs, uint32_t idx, uint32_t conf)
{
uint32_t slew = (conf >> MCHP_XEC_SLEW_RATE_POS) & MCHP_XEC_SLEW_RATE_MSK0;
uint32_t drvstr = (conf >> MCHP_XEC_DRV_STR_POS) & MCHP_XEC_DRV_STR_MSK0;
uint32_t msk = 0, val = 0;
if (slew) {
msk |= MCHP_GPIO_CTRL2_SLEW_MASK;
/* slow slew value is 0 */
if (slew == MCHP_XEC_SLEW_RATE_FAST0) {
val |= MCHP_GPIO_CTRL2_SLEW_FAST;
}
}
if (drvstr) {
msk |= MCHP_GPIO_CTRL2_DRV_STR_MASK;
/* drive strength values are 0 based */
val |= ((drvstr - 1u) << MCHP_GPIO_CTRL2_DRV_STR_POS);
}
if (!msk) {
return;
}
regs->CTRL2[idx] = (regs->CTRL2[idx] & ~msk) | (val & msk);
}
/*
* Internal pulls feature:
* None, weak pull-up, weak pull-down, or repeater mode (both pulls enabled).
* We do not touch this field unless one or more of the DT booleans are set.
* If the no-bias boolean is set then disable internal pulls.
* If pull up and/or down is set enable the respective pull or both for what
* MCHP calls repeater(keeper) mode.
*/
static uint32_t prog_pud(uint32_t pcr1, uint32_t conf)
{
if (conf & BIT(MCHP_XEC_NO_PUD_POS)) {
pcr1 &= ~(MCHP_GPIO_CTRL_PUD_MASK);
pcr1 |= MCHP_GPIO_CTRL_PUD_NONE;
return pcr1;
}
if (conf & (BIT(MCHP_XEC_PU_POS) | BIT(MCHP_XEC_PD_POS))) {
pcr1 &= ~(MCHP_GPIO_CTRL_PUD_MASK);
if (conf & BIT(MCHP_XEC_PU_POS)) {
pcr1 |= MCHP_GPIO_CTRL_PUD_PU;
}
if (conf & BIT(MCHP_XEC_PD_POS)) {
pcr1 |= MCHP_GPIO_CTRL_PUD_PD;
}
}
return pcr1;
}
/*
* DT enable booleans take precedence over disable booleans.
* We initially clear alternate output disable allowing us to set output state
* in the control register. Hardware sets output state bit in both control and
* parallel output register bits. Alternate output disable only controls which
* register bit is writable by the EC. We also clear the input pad disable
* bit because we need the input pin state and we don't know if the requested
* alternate function is input or bi-directional.
* Note 1: hardware allows input and output to be simultaneously enabled.
* Note 2: hardware interrupt detection is only on the input path.
*/
static int xec_config_pin(uint32_t portpin, uint32_t conf, uint32_t altf)
{
struct gpio_regs * const regs = (struct gpio_regs * const)DT_INST_REG_ADDR(0);
uint32_t port = MCHP_XEC_PINMUX_PORT(portpin);
uint32_t pin = (uint32_t)MCHP_XEC_PINMUX_PIN(portpin);
uint32_t idx = 0u, pcr1 = 0u;
if (port >= NUM_MCHP_GPIO_PORTS) {
return -EINVAL;
}
/* MCHP XEC family is 32 pins per port */
idx = (port * 32U) + pin;
config_drive_slew(regs, idx, conf);
/* Clear alternate output disable and input pad disable */
regs->CTRL[idx] &= ~(BIT(MCHP_GPIO_CTRL_AOD_POS) | BIT(MCHP_GPIO_CTRL_INPAD_DIS_POS));
pcr1 = regs->CTRL[idx]; /* current configuration including pin input state */
pcr1 = regs->CTRL[idx]; /* read multiple times to allow propagation from pad */
pcr1 = regs->CTRL[idx]; /* Is this necessary? */
pcr1 = prog_pud(pcr1, conf);
/* Touch output enable. We always enable input */
if (conf & BIT(MCHP_XEC_OUT_DIS_POS)) {
pcr1 &= ~(MCHP_GPIO_CTRL_DIR_OUTPUT);
}
if (conf & BIT(MCHP_XEC_OUT_EN_POS)) {
pcr1 |= MCHP_GPIO_CTRL_DIR_OUTPUT;
}
/* Touch output state? Bit can be set even if the direction is input only */
if (conf & BIT(MCHP_XEC_OUT_LO_POS)) {
pcr1 &= ~BIT(MCHP_GPIO_CTRL_OUTVAL_POS);
}
if (conf & BIT(MCHP_XEC_OUT_HI_POS)) {
pcr1 |= BIT(MCHP_GPIO_CTRL_OUTVAL_POS);
}
/* Touch output buffer type? */
if (conf & BIT(MCHP_XEC_PUSH_PULL_POS)) {
pcr1 &= ~(MCHP_GPIO_CTRL_BUFT_OPENDRAIN);
}
if (conf & BIT(MCHP_XEC_OPEN_DRAIN_POS)) {
pcr1 |= MCHP_GPIO_CTRL_BUFT_OPENDRAIN;
}
/* Always touch power gate */
pcr1 &= ~MCHP_GPIO_CTRL_PWRG_MASK;
if (conf & BIT(MCHP_XEC_PIN_LOW_POWER_POS)) {
pcr1 |= MCHP_GPIO_CTRL_PWRG_OFF;
} else {
pcr1 |= MCHP_GPIO_CTRL_PWRG_VTR_IO;
}
/* Always touch MUX (alternate function) */
pcr1 &= ~MCHP_GPIO_CTRL_MUX_MASK;
pcr1 |= (uint32_t)((altf & MCHP_GPIO_CTRL_MUX_MASK0) << MCHP_GPIO_CTRL_MUX_POS);
/* Always touch invert of alternate function. Need another bit to avoid touching */
if (conf & BIT(MCHP_XEC_FUNC_INV_POS)) {
pcr1 |= BIT(MCHP_GPIO_CTRL_POL_POS);
} else {
pcr1 &= ~BIT(MCHP_GPIO_CTRL_POL_POS);
}
/* output state set in control & parallel regs */
regs->CTRL[idx] = pcr1;
/* make output state in control read-only in control and read-write in parallel reg */
regs->CTRL[idx] = pcr1 | BIT(MCHP_GPIO_CTRL_AOD_POS);
return 0;
}
int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
uintptr_t reg)
{
uint32_t portpin, pinmux, func;
int ret;
ARG_UNUSED(reg);
for (uint8_t i = 0U; i < pin_cnt; i++) {
pinmux = pins[i];
func = MCHP_XEC_PINMUX_FUNC(pinmux);
if (func >= MCHP_AFMAX) {
return -EINVAL;
}
portpin = MEC_XEC_PINMUX_PORT_PIN(pinmux);
ret = xec_config_pin(portpin, pinmux, func);
if (ret < 0) {
return ret;
}
}
return 0;
}
```
|
```smalltalk
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// ==========================================================================
using System.Diagnostics.Contracts;
using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Core.Schemas;
public sealed class FieldCollection<T> where T : IField
{
public static readonly FieldCollection<T> Empty = new FieldCollection<T>();
private static readonly Dictionary<long, T> EmptyById = [];
private static readonly Dictionary<string, T> EmptyByString = [];
private readonly T[] fieldsOrdered;
private Dictionary<long, T>? fieldsById;
private Dictionary<string, T>? fieldsByName;
public IReadOnlyList<T> Ordered
{
get => fieldsOrdered;
}
public IReadOnlyDictionary<long, T> ById
{
get
{
if (fieldsById == null)
{
if (fieldsOrdered.Length == 0)
{
fieldsById = EmptyById;
}
else
{
fieldsById = fieldsOrdered.ToDictionary(x => x.Id);
}
}
return fieldsById;
}
}
public IReadOnlyDictionary<string, T> ByName
{
get
{
if (fieldsByName == null)
{
if (fieldsOrdered.Length == 0)
{
fieldsByName = EmptyByString;
}
else
{
fieldsByName = fieldsOrdered.ToDictionary(x => x.Name);
}
}
return fieldsByName;
}
}
private FieldCollection()
{
fieldsOrdered = [];
}
public FieldCollection(T[] fields)
{
Guard.NotNull(fields);
fieldsOrdered = fields;
}
public static FieldCollection<T> Create(params T[]? fields)
{
return fields is not { Length: > 0 } ? Empty : new FieldCollection<T>(fields);
}
[Pure]
public FieldCollection<T> Remove(long fieldId)
{
if (!ById.TryGetValue(fieldId, out _))
{
return this;
}
return new FieldCollection<T>(fieldsOrdered.Where(x => x.Id != fieldId).ToArray());
}
[Pure]
public FieldCollection<T> Reorder(List<long> ids)
{
Guard.NotNull(ids);
if (ids.Count != fieldsOrdered.Length || ids.Exists(x => !ById.ContainsKey(x)))
{
ThrowHelper.ArgumentException("Ids must cover all fields.", nameof(ids));
}
if (ids.SequenceEqual(fieldsOrdered.Select(x => x.Id)))
{
return this;
}
return new FieldCollection<T>(fieldsOrdered.OrderBy(f => ids.IndexOf(f.Id)).ToArray());
}
[Pure]
public FieldCollection<T> Add(T field)
{
Guard.NotNull(field);
if (ByName.ContainsKey(field.Name))
{
ThrowHelper.ArgumentException($"A field with name '{field.Name}' already exists.", nameof(field));
}
if (ById.ContainsKey(field.Id))
{
ThrowHelper.ArgumentException($"A field with ID {field.Id} already exists.", nameof(field));
}
return new FieldCollection<T>(fieldsOrdered.Union(Enumerable.Repeat(field, 1)).ToArray());
}
[Pure]
public FieldCollection<T> Update(long fieldId, Func<T, T> updater)
{
Guard.NotNull(updater);
if (!ById.TryGetValue(fieldId, out var field))
{
return this;
}
var newField = updater(field);
if (ReferenceEquals(newField, field))
{
return this;
}
if (newField is null)
{
ThrowHelper.InvalidOperationException($"Field must be of type {typeof(T)}");
return default!;
}
return new FieldCollection<T>(fieldsOrdered.Select(x => ReferenceEquals(x, field) ? newField : x).ToArray());
}
}
```
|
```javascript
/*!your_sha256_hash-------------
* monaco-languages version: 0.30.1(5a7ba61be909ae9e4889768a3453ebb0dec392e2)
* Released under the MIT license
* path_to_url
*your_sha256_hash-------------*/
define("vs/basic-languages/php/php",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:"(",close:")",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],folding:{markers:{start:new RegExp("^\\s*(#|//)region\\b"),end:new RegExp("^\\s*(#|//)endregion\\b")}}},t.language={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@comment"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/[^<]+/]],doctype:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],phpInSimpleState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3"}],{include:"phpRoot"}],phpInEmbeddedState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"phpRoot"}],phpRoot:[[/[a-zA-Z_]\w*/,{cases:{"@phpKeywords":{token:"keyword.php"},"@phpCompileTimeConstants":{token:"constant.php"},"@default":"identifier.php"}}],[/[$a-zA-Z_]\w*/,{cases:{"@phpPreDefinedVariables":{token:"variable.predefined.php"},"@default":"variable.php"}}],[/[{}]/,"delimiter.bracket.php"],[/[\[\]]/,"delimiter.array.php"],[/[()]/,"delimiter.parenthesis.php"],[/[ \t\r\n]+/],[/(#|\/\/)$/,"comment.php"],[/(#|\/\/)/,"comment.php","@phpLineComment"],[/\/\*/,"comment.php","@phpComment"],[/"/,"string.php","@phpDoubleQuoteString"],[/'/,"string.php","@phpSingleQuoteString"],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/,"delimiter.php"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.php"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.php"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.php"],[/0[0-7']*[0-7]/,"number.octal.php"],[/0[bB][0-1']*[0-1]/,"number.binary.php"],[/\d[\d']*/,"number.php"],[/\d/,"number.php"]],phpComment:[[/\*\//,"comment.php","@pop"],[/[^*]+/,"comment.php"],[/./,"comment.php"]],phpLineComment:[[/\?>/,{token:"@rematch",next:"@pop"}],[/.$/,"comment.php","@pop"],[/[^?]+$/,"comment.php","@pop"],[/[^?]+/,"comment.php"],[/./,"comment.php"]],phpDoubleQuoteString:[[/[^\\"]+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/"/,"string.php","@pop"]],phpSingleQuoteString:[[/[^\\']+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/'/,"string.php","@pop"]]},phpKeywords:["abstract","and","array","as","break","callable","case","catch","cfunction","class","clone","const","continue","declare","default","do","else","elseif","enddeclare","endfor","endforeach","endif","endswitch","endwhile","extends","false","final","for","foreach","function","global","goto","if","implements","interface","instanceof","insteadof","namespace","new","null","object","old_function","or","private","protected","public","resource","static","switch","throw","trait","try","true","use","var","while","xor","die","echo","empty","exit","eval","include","include_once","isset","list","require","require_once","return","print","unset","yield","__construct"],phpCompileTimeConstants:["__CLASS__","__DIR__","__FILE__","__LINE__","__NAMESPACE__","__METHOD__","__FUNCTION__","__TRAIT__"],phpPreDefinedVariables:["$GLOBALS","$_SERVER","$_GET","$_POST","$_FILES","$_REQUEST","$_SESSION","$_ENV","$_COOKIE","$php_errormsg","$HTTP_RAW_POST_DATA","$http_response_header","$argc","$argv"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/}}));
```
|
Alain Bauer (born 8 May 1962) is a French criminologist who has been a professor of criminology at the Conservatoire national des arts et métiers (CNAM Paris) since 2009. He is also a senior research fellow at the John Jay College of Criminal Justice (New York) and the China University of Political Science and Law (Beijing). There were many protests in the scientific community in France against the appointment because he had not received a PhD.
Career
As an elected student on the "U.N.E.F. I.D." list, a socialist organisation, he was the youngest vice president of the Sorbonne in charge of Finances and Administration, an office he held from 1982 to 1989. Afterwards, he became an advisor on national security to Prime Minister Michel Rocard from 1988 to 1990.
Bauer was elected Professor of Criminology at the National Conservatory for Arts and Crafts under CNAM in Paris in 2010. He is a member of the International Association of Chiefs of Police. In 2006 and 2007, he has been appointed at the French Commission on police data control and of the French Working Group on Policing. He also worked as an advisor to the New York City Police Department (NYPD), the Los Angeles County Sheriff's Department (LASD) and the Sûreté du Québec (Canada).
He was appointed in August 2007 by President Nicolas Sarkozy to reorganise the French system on studies and research on security and strategy, focusing on the creation of a national security council. Bauer was also an advisor for the French industrial company Lafarge between 2007 and 2014.
Awards
Grand Master of the Grand Orient de France, 2000–2003
Chancellor of the International Masonic Institute since 2003
Knight of the Legion of Honour
Captain of the National Order of Merit, of the National Order of Academic Palms, of the National Order of Arts and Letters
Grand Cross of the Lafayette Order
Works
Violence et Insécurité urbaines (Que Sais Je 1998, 11ème éd., PUF 2007)
l'Amérique, la violence, le crime (2000, 2 e éd., PUF 2001)
la Guerre ne fait que commencer (JC. LATTES 2002, rééd. GALLIMARD 2003)
les Polices en France (Que Sais Je 2 e éd., PUF 2002)
le Crime aux Etats-Unis (PUF), les Polices aux Etats-Unis (PUF)
Imaginer la sécurité globale (Pensée et les Hommes Bruxelles 2003)
Etat d'urgence (Fayard 2004), Deux siècles de débats républicains (Edimaf) et Dico rebelle (Michalon 2004)
l'Enigme Al Qaïda (JC. LATTES 2005)
Mercenaires et polices privées (en coll., UNIVERSALIS 2006)
Géographie de la France criminelle (ODILE JACOB 2006)
les Polices au Québec (dir., Que sais-je, PUF 2006)
Mieux contrôler les fichiers de police (DOCUMENTATION FRANCAISE 2006)
World Chaos, Early Detection and Proactive Security (DRMCC 2007)
Les mystères de Channel Row (JC. LATTES 2007)
Radicalization in the West (NYPD 2007)
L’année stratégique 2008 (Dalloz 2007)
Le nouveau chaos mondial (Les Riaux 2007 plus éditions italien, arabe, chinois)
L’esprit des lumières est il perdu (Le MONDE-PUR 2007)
République, Républiques (GODF 2007)
Pour une stratégie globale de sécurité nationale (Dalloz 2008)
Vidéosurveillance et vidéoprotection (Que Sais Je PUF 2008)
Le 11 Septembre (Memorial de Caen – Ouest France 2008)
100 Mots pour comprendre l’actualité (PUF 2008)
References
1962 births
Living people
French criminologists
Academic staff of the University of Paris
John Jay College of Criminal Justice faculty
French Freemasons
20th-century French Jews
French people of German-Jewish descent
Lawyers from Paris
Commanders of the Legion of Honour
|
```xml
import fs from 'fs';
import path from 'path';
import { Argv } from 'yargs';
import { prepareWithJora } from '@statoscope/webpack-model';
import { RawStatsFileDescriptor } from '@statoscope/webpack-model/types';
import { parseChunked, stringifyStream } from '@discoveryjs/json-ext';
import { waitFinished } from '@statoscope/report-writer/dist/utils';
export default function (yargs: Argv): Argv {
return yargs.command(
'query',
`Execute jora-query on stats file`,
(yargs) => {
return yargs
.option('input', {
describe: 'path to a stats.json',
alias: 'i',
type: 'string',
})
.option('query', {
describe: 'jora query (could be passed as stdin)',
alias: 'q',
type: 'string',
})
.array('input')
.demandOption('input');
},
async (argv) => {
const query = argv.query || fs.readFileSync(0, 'utf-8');
const files: RawStatsFileDescriptor[] = [];
for (const input of argv.input) {
files.push({
name: path.basename(input),
data: await parseChunked(fs.createReadStream(input)),
});
}
const prepared = prepareWithJora(files);
const result = prepared.query(query);
const outputStream = stringifyStream(result);
outputStream.pipe(process.stdout);
await waitFinished(outputStream);
},
);
}
```
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.