text:
const LPCSTR relationsLtxSection	= "game_relations";
const LPCSTR ratingField			= "rating_names";
const LPCSTR reputationgField		= "reputation_names";
const LPCSTR goodwillField			= "goodwill_names";

ref_shader	g_BuyMenuShader			= NULL;
ref_shader	g_EquipmentIconsShader	= NULL;
ref_shader	g_MPCharIconsShader		= NULL;
ref_shader	g_tmpWMShader			= NULL;
static CUIStatic*	GetUIStatic				();

typedef				std::pair<CHARACTER_RANK_VALUE, shared_str>	CharInfoStringID;
DEF_MAP				(CharInfoStrings, CHARACTER_RANK_VALUE, shared_str);

CharInfoStrings		*charInfoReputationStrings	= NULL;
CharInfoStrings		*charInfoRankStrings		= NULL;
CharInfoStrings		*charInfoGoodwillStrings	= NULL;

void InventoryUtilities::CreateShaders()
{
	g_tmpWMShader.create("effects\\wallmark",  "wm\\wm_grenade");
}

void InventoryUtilities::DestroyShaders()
{
	g_BuyMenuShader.destroy			();
	g_EquipmentIconsShader.destroy	();
	g_MPCharIconsShader.destroy		();
	g_tmpWMShader.destroy			();
}

bool InventoryUtilities::GreaterRoomInRuck(PIItem item1, PIItem item2)
{
	Ivector2 r1,r2;
	r1.x			= item1->GetGridWidth();
	r1.y			= item1->GetGridHeight();
	r2.x			= item2->GetGridWidth();
	r2.y			= item2->GetGridHeight();

	if(r1.x > r2.x)			return true;

	if (r1.x == r2.x)
	{
		if(r1.y > r2.y)		return true;

		if (r1.y == r2.y){
			if(item1->object().cNameSect()==item2->object().cNameSect())
				return (item1->object().ID() > item2->object().ID());
			else
				return (item1->object().cNameSect()>item2->object().cNameSect());

		}

		return				false;
	}
   	return					false;
}

bool InventoryUtilities::FreeRoom_inBelt	(TIItemContainer& item_list, PIItem _item, int width, int height)
{
	bool*				ruck_room	= (bool*)alloca(width*height);

	int		i,j,k,m;
	int		place_row = 0,  place_col = 0;
	bool	found_place;
	bool	can_place;

	for(i=0; i<height; ++i)
		for(j=0; j<width; ++j)
			ruck_room[i*width + j]	= false;

	item_list.push_back	(_item);
	std::sort			(item_list.begin(), item_list.end(),GreaterRoomInRuck);

	found_place			= true;

	for(xr_vector<PIItem>::iterator it = item_list.begin(); (item_list.end() != it) && found_place; ++it)
	{
		PIItem pItem = *it;
		int iWidth	= pItem->GetGridWidth();
		int iHeight = pItem->GetGridHeight();
		//ïðîâåðèòü ìîæíî ëè ðàçìåñòèòü ýëåìåíò,
		//ïðîâåðÿåì ïîñëåäîâàòåëüíî êàæäóþ êëåòî÷êó
		found_place = false;

		for(i=0; (i<height - iHeight +1) && !found_place; ++i)
		{
			for(j=0; (j<width - iWidth +1) && !found_place; ++j)
			{
				can_place = true;

				for(k=0; (k<iHeight) && can_place; ++k)
				{
					for(m=0; (m<iHeight) && can_place; ++m)
					{
						if(ruck_room[(i+k)*width + (j+m)])
								can_place =  false;
					}
				}

				if(can_place)
				{
					found_place=true;
					place_row = i;
					place_col = j;
				}

			}
		}

		//ðàçìåñòèòü ýëåìåíò íà íàéäåííîì ìåñòå
		if(found_place)
		{
			for(k=0; k<iHeight; ++k)
			{
				for(m=0; m<iWidth; ++m)
				{
					ruck_room[(place_row+k)*width + place_col+m] = true;
				}
			}
		}
	}

	// remove
	item_list.erase	(std::remove(item_list.begin(),item_list.end(),_item),item_list.end());

	//äëÿ êàêîãî-òî ýëåìåíòà ìåñòà íå íàøëîñü
	if(!found_place) return false;

	return true;
}

ref_shader& InventoryUtilities::GetBuyMenuShader()
{
	if(!g_BuyMenuShader)
	{
		g_BuyMenuShader.create("hud\\default", BUY_MENU_TEXTURE);
	}

	return g_BuyMenuShader;
}

ref_shader& InventoryUtilities::GetEquipmentIconsShader()
{
	if(!g_EquipmentIconsShader)
	{
		g_EquipmentIconsShader.create("hud\\default", EQUIPMENT_ICONS);
	}

	return g_EquipmentIconsShader;
}

ref_shader&	InventoryUtilities::GetMPCharIconsShader()
{
	if(!g_MPCharIconsShader)
	{
		g_MPCharIconsShader.create("hud\\default",  MP_CHAR_ICONS);
	}

	return g_MPCharIconsShader;
}

//////////////////////////////////////////////////////////////////////////

const shared_str InventoryUtilities::GetGameDateAsString(EDatePrecision datePrec, char dateSeparator)
{
	return GetDateAsString(Level().GetGameTime(), datePrec, dateSeparator);
}

//////////////////////////////////////////////////////////////////////////

const shared_str InventoryUtilities::GetGameTimeAsString(ETimePrecision timePrec, char timeSeparator)
{
	return GetTimeAsString(Level().GetGameTime(), timePrec, timeSeparator);
}

//////////////////////////////////////////////////////////////////////////

const shared_str InventoryUtilities::GetTimeAsString(ALife::_TIME_ID time, ETimePrecision timePrec, char timeSeparator)
{
	string64 bufTime;

	ZeroMemory(bufTime, sizeof(bufTime));

	u32 year = 0, month = 0, day = 0, hours = 0, mins = 0, secs = 0, milisecs = 0;

	split_time(time, year, month, day, hours, mins, secs, milisecs);

	// Time
	switch (timePrec)
	{
	case etpTimeToHours:
		sprintf_s(bufTime, "%02i", hours);
		break;
	case etpTimeToMinutes:
		sprintf_s(bufTime, "%02i%c%02i", hours, timeSeparator, mins);
		break;
	case etpTimeToSeconds:
		sprintf_s(bufTime, "%02i%c%02i%c%02i", hours, timeSeparator, mins, timeSeparator, secs);
		break;
	case etpTimeToMilisecs:
		sprintf_s(bufTime, "%02i%c%02i%c%02i%c%02i", hours, timeSeparator, mins, timeSeparator, secs, timeSeparator, milisecs);
		break;
	case etpTimeToSecondsAndDay:
		{
			int total_day = (int)( time/(1000*60*60*24) );
			sprintf_s(bufTime, sizeof(bufTime), "%dd %02i%c%02i%c%02i", total_day, hours, timeSeparator, mins, timeSeparator, secs);
			break;
		}
	default:
		R_ASSERT(!"Unknown type of date precision");
	}

	return bufTime;
}

const shared_str InventoryUtilities::GetDateAsString(ALife::_TIME_ID date, EDatePrecision datePrec, char dateSeparator)
{
	string32 bufDate;

	ZeroMemory(bufDate, sizeof(bufDate));

	u32 year = 0, month = 0, day = 0, hours = 0, mins = 0, secs = 0, milisecs = 0;

	split_time(date, year, month, day, hours, mins, secs, milisecs);

	// Date
	switch (datePrec)
	{
	case edpDateToYear:
		sprintf_s(bufDate, "%04i", year);
		break;
	case edpDateToMonth:
		sprintf_s(bufDate, "%02i%c%04i", month, dateSeparator, year);
		break;
	case edpDateToDay:
		sprintf_s(bufDate, "%02i%c%02i%c%04i", day, dateSeparator, month, dateSeparator, year);
		break;
	default:
		R_ASSERT(!"Unknown type of date precision");
	}

	return bufDate;
}

LPCSTR InventoryUtilities::GetTimePeriodAsString(LPSTR _buff, u32 buff_sz, ALife::_TIME_ID _from, ALife::_TIME_ID _to)
{
	u32 year1,month1,day1,hours1,mins1,secs1,milisecs1;
	u32 year2,month2,day2,hours2,mins2,secs2,milisecs2;

	split_time(_from, year1, month1, day1, hours1, mins1, secs1, milisecs1);
	split_time(_to, year2, month2, day2, hours2, mins2, secs2, milisecs2);

	int cnt		= 0;
	_buff[0]	= 0;

	if(month1!=month2)
		cnt = sprintf_s(_buff+cnt,buff_sz-cnt,"%d %s ",month2-month1, *CStringTable().translate("ui_st_months"));

	if(!cnt && day1!=day2)
		cnt = sprintf_s(_buff+cnt,buff_sz-cnt,"%d %s",day2-day1, *CStringTable().translate("ui_st_days"));

	if(!cnt && hours1!=hours2)
		cnt = sprintf_s(_buff+cnt,buff_sz-cnt,"%d %s",hours2-hours1, *CStringTable().translate("ui_st_hours"));

	if(!cnt && mins1!=mins2)
		cnt = sprintf_s(_buff+cnt,buff_sz-cnt,"%d %s",mins2-mins1, *CStringTable().translate("ui_st_mins"));

	if(!cnt && secs1!=secs2)
		cnt = sprintf_s(_buff+cnt,buff_sz-cnt,"%d %s",secs2-secs1, *CStringTable().translate("ui_st_secs"));

	return _buff;
}

//////////////////////////////////////////////////////////////////////////

void InventoryUtilities::UpdateWeight(CUIStatic &wnd, bool withPrefix)
{
	CInventoryOwner *pInvOwner = smart_cast<CInventoryOwner*>(Level().CurrentEntity());
	R_ASSERT(pInvOwner);
	string128 buf;
	ZeroMemory(buf, sizeof(buf));

	float total = pInvOwner->inventory().CalcTotalWeight();
	float max	= pInvOwner->MaxCarryWeight();

	string16 cl;
	ZeroMemory(cl, sizeof(cl));

	if (total > max)
	{
		strcpy(cl, "%c[red]");
	}
	else
	{
		strcpy(cl, "%c[UI_orange]");
	}

	string32 prefix;
	ZeroMemory(prefix, sizeof(prefix));

	if (withPrefix)
	{
		sprintf_s(prefix, "%%c[default]%s ", *CStringTable().translate("ui_inv_weight"));
	}
	else
	{
		strcpy(prefix, "");
	}

	sprintf_s(buf, "%s%s%3.1f %s/%5.1f", prefix, cl, total, "%c[UI_orange]", max);
	wnd.SetText(buf);
	//	UIStaticWeight.ClipperOff();
}

//////////////////////////////////////////////////////////////////////////

void LoadStrings(CharInfoStrings *container, LPCSTR section, LPCSTR field)
{
	R_ASSERT(container);

	LPCSTR				cfgRecord	= pSettings->r_string(section, field);
	u32					count		= _GetItemCount(cfgRecord);
	R_ASSERT3			(count%2, "there're must be an odd number of elements", field);
	string64			singleThreshold;
	ZeroMemory			(singleThreshold, sizeof(singleThreshold));
	int					upBoundThreshold	= 0;
	CharInfoStringID	id;

	for (u32 k = 0; k < count; k += 2)
	{
		_GetItem(cfgRecord, k, singleThreshold);
		id.second = singleThreshold;

		_GetItem(cfgRecord, k + 1, singleThreshold);
		if(k+1!=count)
			sscanf(singleThreshold, "%i", &upBoundThreshold);
		else
			upBoundThreshold	+= 1;

		id.first = upBoundThreshold;

		container->insert(id);
	}
}

//////////////////////////////////////////////////////////////////////////

void InitCharacterInfoStrings()
{
	if (charInfoReputationStrings && charInfoRankStrings) return;

	if (!charInfoReputationStrings)
	{
		// Create string->Id DB
		charInfoReputationStrings	= xr_new<CharInfoStrings>();
		// Reputation
		LoadStrings(charInfoReputationStrings, relationsLtxSection, reputationgField);
	}

	if (!charInfoRankStrings)
	{
		// Create string->Id DB
		charInfoRankStrings			= xr_new<CharInfoStrings>();
		// Ranks
		LoadStrings(charInfoRankStrings, relationsLtxSection, ratingField);
	}

	if (!charInfoGoodwillStrings)
	{
		// Create string->Id DB
		charInfoGoodwillStrings			= xr_new<CharInfoStrings>();
		// Goodwills
		LoadStrings(charInfoGoodwillStrings, relationsLtxSection, goodwillField);
	}

}

//////////////////////////////////////////////////////////////////////////

void InventoryUtilities::ClearCharacterInfoStrings()
{
	xr_delete(charInfoReputationStrings);
	xr_delete(charInfoRankStrings);
	xr_delete(charInfoGoodwillStrings);
}

//////////////////////////////////////////////////////////////////////////

LPCSTR InventoryUtilities::GetRankAsText(CHARACTER_RANK_VALUE rankID)
{
	InitCharacterInfoStrings();
	CharInfoStrings::const_iterator cit = charInfoRankStrings->upper_bound(rankID);
	if(charInfoRankStrings->end() == cit)
		return charInfoRankStrings->rbegin()->second.c_str();
	return cit->second.c_str();
}

//////////////////////////////////////////////////////////////////////////

LPCSTR InventoryUtilities::GetReputationAsText(CHARACTER_REPUTATION_VALUE rankID)
{
	InitCharacterInfoStrings();

	CharInfoStrings::const_iterator cit = charInfoReputationStrings->upper_bound(rankID);
	if(charInfoReputationStrings->end() == cit)
		return charInfoReputationStrings->rbegin()->second.c_str();

	return cit->second.c_str();
}

//////////////////////////////////////////////////////////////////////////

LPCSTR InventoryUtilities::GetGoodwillAsText(CHARACTER_GOODWILL goodwill)
{
	InitCharacterInfoStrings();

	CharInfoStrings::const_iterator cit = charInfoGoodwillStrings->upper_bound(goodwill);
	if(charInfoGoodwillStrings->end() == cit)
		return charInfoGoodwillStrings->rbegin()->second.c_str();

	return cit->second.c_str();
}

//////////////////////////////////////////////////////////////////////////
// ñïåöèàëüíàÿ ôóíêöèÿ äëÿ ïåðåäà÷è info_portions ïðè íàæàòèè êíîïîê UI
// (äëÿ tutorial)
void InventoryUtilities::SendInfoToActor(LPCSTR info_id)
{
	if (GameID() != GAME_SINGLE) return;

	CActor* actor = smart_cast<CActor*>(Level().CurrentEntity());
	if(actor)
	{
		actor->TransferInfo(info_id, true);
	}
}

u32 InventoryUtilities::GetGoodwillColor(CHARACTER_GOODWILL gw)
{
	u32 res = 0xffc0c0c0;
	if(gw==NEUTRAL_GOODWILL){
		res = 0xffc0c0c0;
	}else
	if(gw>1000){
		res = 0xff00ff00;
	}else
	if(gw<-1000){
		res = 0xffff0000;
	}
	return res;
}

u32 InventoryUtilities::GetReputationColor(CHARACTER_REPUTATION_VALUE rv)
{
	u32 res = 0xffc0c0c0;
	if(rv==NEUTAL_REPUTATION){
		res = 0xffc0c0c0;
	}else
	if(rv>50){
		res = 0xff00ff00;
	}else
	if(rv<-50){
		res = 0xffff0000;
	}
	return res;
}

u32	InventoryUtilities::GetRelationColor(ALife::ERelationType relation)
{
	switch(relation) {
	case ALife::eRelationTypeFriend:
		return 0xff00ff00;
		break;
	case ALife::eRelationTypeNeutral:
		return 0xffc0c0c0;
		break;
	case ALife::eRelationTypeEnemy:
		return  0xffff0000;
		break;
	default:
		NODEFAULT;
	}
#ifdef DEBUG
	return 0xffffffff;
#endif
}

redpajama_set_name: RedPajamaGithub


The fine folks at the Vintage and Anchor Tumblr account have compiled a list of the ten oldest books known to man.
"Terrific ham. The best. Terrific eggs. Were they green? Who knows? So many years." In case you missed it, the best tweets from yesterday's #TrumpBookReport trend. Pair with our own Claire Cameron's translation of Lauren Groff's Fates and Furies for Twitter.


text:
Barry Blumenfeld
Ask the Experts: Ballet History Apps
Q: I want my students to get excited about ballet history. What apps do you suggest?
A: Teaching ballet and its history should be fun. There's no shortage of ho-hum ballet apps that function like dictionaries, with pictures and names of positions. But a new app, Ballet Society: Conversations on Dance, takes an interesting approach.
Tap on a photo to see its caption. Dig deeper by either tapping on a brain icon to get a thoughtful question to stimulate discussion, or by touching the lowercase "i" to get detailed information about the picture. You can use this app when teaching ballet history to stimulate conversation and put it into context.
If you want to get your students just as excited about choreography, try Passe-Partout. It's a fun, experiential app that allows the user to "choreograph" a contemporary ballet dance with New York City Ballet dancers Justin Peck and Daniel Ulbricht. There are five videos of dancers with music. You can watch (and listen) to each one on its own or overlay them (each one becomes translucent) to get a multiple-dance effect.
Save the dance you create and share it, or start all over to find a new way to configure the dancers. The possibilities are limitless.
Barry Blumenfeld teaches at the Friends Seminary in New York City. He is an adjunct professor at New York University and on faculty at the Dance Education Laboratory of the 92nd Street Y.
Photo courtesy of Barry Blumenfeld

redpajama_set_name: RedPajamaCommonCrawl


Want to save money and/or increase results on your next direct mail project. Read our tips below and start reaping the benefits today!
NOTE: These tips are in Adobe® Acrobat® Format for which Adobe® Acrobat Reader® or Adobe Acrobat are requried to read the files. To download a free copy of Adobe Acrobat Reader follow this link.


This document contains information and guidelines about contributing to this project. Please read it before you start participating.
We don't use GitHub as a support forum. For any usage questions that are not specific to the project itself, please ask on Stack Overflow instead with the tag SwifterSwift. By doing so, you'll be more likely to quickly solve your problem, and you'll allow anyone else with the same question to find the answer. This also allows us to focus on improving the project for others.
If you're new to Open Source or Swift the SwifterSwift community is a great place to get involved.
Your contribution is always welcomed, no contribution is too small.
Make sure no similar extension already exist in SwifterSwift.
by doing this we can merge new pull-requests into master branch as soon as they are accepted, and add them to the next releases once they are fully tested.
A pull request should only add one extension at a time.
Do not use an existing SwifterSwift extension inside another SwifterSwift extension. All extensions should be able to be copied and pasted and work immediately without having to copy another extension.
Always declare extensions as public.
All extensions names should be as clear as possible.
Avoid using custom classes and objects the goal for this library is to extend the standards types available natively in Swift, iOS, macOS, watchOS, tvOS and Linux.
All extensions should be tested. See Adding Tests to know more.
Files are named based on the type that the contained extensions extend.
Add subspec if you submit extensions for a module that is not presented in podspec file yet.
Every extended SwifterSwift type should have one specific subclass of XCTestCase.
There should be a one to one relationship between methods/properties and their backing tests.
Tests should be named using the same API of the extension it backs.
All test files are named based on the extensions which it tests.
The subclass should be marked as final.
All extensions files and test files have a one to one relationship.
Tests are ordered inside files in the same order as extensions. See Adding new Extensions to know more.
/// - Parameter <Paramenter>: <Description>.
/// SwifterSwift: Sum of all elements in array.
/// - Returns: Sum of the array's elements.
///   - component: component type.
///   - value: new value of component to change.
In Xcode select a method and press command + alt + / to create a documentation template!
The Changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project. Please make sure to add a changelog entry describing your contribution to it every time there is a notable change.
The Changelog Guidelines contains instructions for maintaining (or adding new entries) to the Changelog.
A great way to contribute to the project is to send a detailed issue when you encounter a problem. We always appreciate a well-written, thorough bug report.
Check that the project issues page doesn't already include that problem or suggestion before submitting an issue. If you find a match, add a quick "+1" or "I have this problem too". Doing this helps prioritize the most common problems and requests.
This information will help us review and fix your issue faster.
If you made it all the way to the end, bravo dear user, we love you. You can include the 🚀 emoji in the top of your ticket to signal to us that you did in fact read this file and are trying to conform to it as best as possible: :rocket:.


text:
NFL Draft stock report: Arizona State's Jaelen Strong looks pro ready
By Dan Kadar Sep 25, 2013, 8:00am EDT
Share All sharing options for: NFL Draft stock report: Arizona State's Jaelen Strong looks pro ready
Stephen Lam
Last year, the hottest junior college transfer in college football was Tennessee's Cordarrelle Patterson. He parlayed a single highlight-making season with the Volunteers into a first-round placement in the draft. This year's version of Patterson looks to be Arizona State's Jaelen Strong.
Anyone who listened to last week's Mocking the Draft podcast would have been clued in about Strong. A redshirt sophomore, Strong is in his first FBS season after transferring from junior college.
On Saturday against Stanford (a 42-28 Cardinal win), Strong stood out. He finished the game with 12 receptions for 168 yards and a touchdown. It was his second consecutive game of more than 100 yards receiving after he had 104 against Wisconsin in Week 2. At 6'3, 205 pounds, Strong plays a lot like Demaryius Thomas of the Denver Broncos. He can go up and catch tough passes and is dangerous on vertical routes.
Strong may not be one-and-done at Arizona State like Patterson was at Tennessee, but he sure looks NFL ready at this point.
Stock up:
George Uko, defensive tackle, Southern California
As bad as the Southern California offense is, the unique 5-2 defense is good. Namely against Utah State, defensive tackle George Uko was active and disruptive. Uko plays a combo end/tackle position and looks most comfortable shooting gaps. He was consistently getting penetration on Saturday, finishing with five tackles and a sack. As a mid- to late-round prospect, Uko should provide a team a good depth piece.
Morgan Breslin, outside linebacker/defensive end, Southern California
Everyone knows that Breslin is a good pass rusher. He proved last year that he's speedy and can get into the backfield. He proved as much against Utah State with three tackles for loss and two sacks. The sacks on Chuckie Keeton won't do a lot to change his NFL Draft status. It was a play later in the game that will be more important for his highlight reel.
Utah State was setting up a screen pass, but Breslin stopped it from happening. He was blitzing on the play and deciphered the screen and dropped into coverage to blow the play up.
James Hurst, offensive tackle, North Carolina
It's true that Hurst gave up a sack to Georgia Tech's Jeremiah Attaochu on Saturday. But for much of the game, Hurst impressed. Remember when the Atlanta Falcons took Sam Baker with the 21st pick in the 2008 draft? He was a solid college player and has been above-average as a pro. That's the type of player Hurst profiles as. He's not going to be a top-10 pick, but he may be a first-round pick because of the position he plays. Against Georgia Tech, Hurst looked particularly good as a run blocker. He got up to the second level and neutralized a linebacker to open up a hole. The run went for eight yards. Certainly not a huge gain, but the type of routine block that some linemen just don't show.
Vic Beasley, defensive end, Clemson
This is already the second time this season Beasley is being featured in the stock up portion of the report. Not bad for playing just three games. He looked just as fast against North Carolina State as he did in the season opener against Georgia. Last Thursday, he was consistently the first player off the line of scrimmage and got into the backfield for three sacks. Beasley also helped himself by knocking down two passes.
Throughout the season, look for Beasley to get compared to Georgia Tech's Jeremiah Attaochu. The ACC's top two pass rushers do a lot of things the same. Attaochu is probably the more complete player at this point, but Beasley is really coming along.
Stock down:
Taylor Lewan, offensive tackle, Michigan
We've seen Michigan struggle two straight weeks, first against lowly Akron and then to Connecticut on Saturday. In both of those games, Lewan has looked only average. Notably, his feet look heavy and he doesn't move around swiftly. The gap between Texas A&M's Jake Matthews and the rest of the offensive tackle prospects gets wider each week.
Anthony Johnson, defensive tackle, LSU
If there is one thing a defensive tackle can't let happen, it's allowing linemen to sustain him. That's what happened to Johnson against Auburn. Johnson didn't stay low out of his stance and allowed Auburn's linemen to get under his pads. Johnson is direly in need of some splash plays to be considered more than just a serviceable lineman. Through four games, he has just 2.5 tackles for loss, no sacks and just a single quarterback hurry.
More from SB Nation NFL:
Follow @SBNationNFL
• Nate Burleson breaks arm saving a falling pizza
• NFL power rankings: Only 7 undefeated teams left
• Celebrity Hot Tub's Post-Mortem: Death by Brian Hoyer
• Fumblr: Kill this mascot
• The Jay Cutler high school slam dunk mix tape | #Lookit


text:
Christmas Hound by Paula Douglas
Pippa (Hutiwai) is a Christmas hound. Adopted by her human dad (Hamish) just days after her second birthday, she was gifted to her human mum (Paula) a week later on Christmas day. In order for Pippa to be a surprise, there had to be a crafty plan in place to keep her existence secret. How did Hamish manage to adopt Pippa and keep her hidden away for a week? And how did the surprise go down on Christmas morning?
Paula had been hinting to Hamish for quite some time that she wanted to adopt a greyhound. They had talked about what they would need to do to prepare (like build a fence!) and why a greyhound would be a great fit for their lifestyle. Paula would regularly visit the Greyhounds as Pets (GAP) website and show pictures to Hamish of the hounds that were up for adoption. To help manifest the dream, in May 2020 Paula decided to change her phone background to a beautiful blue greyhound standing in some daffodils.
"The image made me determined to get a greyhound by spring. My birthday is in September and I told Hamish that I wanted a fence for my birthday, so that we could then get a greyhound and re-enact the photo."
The screenshot of Pixie's ad on the GAP website
Spring came and went, daffodils too, and there still wasn't a fence! Paula did get a lovely necklace for her birthday though - the first piece of jewellery that Hamish had bought for her. When Hamish started asking what Paula wanted for Christmas, of course it was still a fence.
"Hamish started a building apprenticeship after lockdown, so I thought it would be a great project for him to practice his skills. I said that I would pay for all the materials if he would build the fence."
On 27 November, Paula thought she had found the hound that was for them! Pixie (Metronomic) – female, cat trainable, only 2 years old! Perfect J Hamish wasn't there at the time so Paula took a screenshot of the ad on her phone to show to him later.
"I can't remember why, but I never ended up showing Hamish the screenshot. The lead-up to Christmas is always a busy time and I guess it just slipped my mind. Hamish was doing his apprenticeship during the week, working at a butchers shop on Saturdays, and doing beekeeping in his free time, so we didn't have much time together."
Little did Paula know, but Hamish had decided that he was going to get her a greyhound for Christmas. He was keen to see three or four hounds, but one that he liked already had a home waiting, so it ended up just being two. On Friday 18 December, Hamish headed out to meet Rachel Foster from GAP and the two hounds – Pixie and Pippa.
"They were really similar. I took both of them for a lead. Neither of them looked at me much. I decided to adopt Pippa because she was younger. Pixie was 4 (although it said 2 in the ad) and cat trainable, and Pippa was 2 but not cat trainable. We don't actually have cats, so it didn't really matter."
It just so happened that Hamish's car was getting a WOF and he had taken Paula's car for the day. He covered the seats with towels to ensure that no tell-tale signs of a dog were left behind, then he took Pippa off to his parents' place where she would be kept in secret for the next week. Their place is fully fenced, so at this point it didn't matter that there still wasn't a fence at home. Hamish had a solution up his sleeve anyway.
"I'm always excited about Christmas, but I was extra-excited this time! I couldn't wait to give Paula her present. The next day I had to go into Christchurch to pick up another part of the present. I got my car out and attached the trailer. When Paula asked what I needed the trailer for, I said her present wouldn't fit in the car!"
When Hamish got back from Christchurch, he had to get Paula's help to lift the 70kg box off the trailer and put it under the Christmas tree. It was an awkward long rectangular shape and made a slight 'clang' as they put the box down, but Paula was completely clueless as to what might have been inside.
"I thought it might have been one of those garden swing seat things. But then 70kg is probably a bit heavy for one of them. I don't know. I had no idea what it was."
Over the next week, Hamish went to visit Pippa every day and she started warming up to him. After all, he did bring her tasty treats like pigs ears! Pippa had a canine companion at her temporary home, and they would spend time together running around the section or lazing in the sun. She started coming out of her shell and showing her personality by doing things like collecting empty bottles and placing them in a pile. Paula never suspected a thing.
"Because Hamish always has so much on, it wasn't out of the ordinary for him to be coming home a bit later than usual, especially with trying to get everything done before Christmas."
Hamish's next challenge was the delivery of the gift. How to get Pippa home and under the Christmas tree without Paula noticing. Greyhounds don't tend to bark much, and so far Pippa had proven to be a quiet hound, apart from whining at night. Fair enough, considering all the new things she had to deal with, and the unexpected cold & wet weather for the time of year! Again, Hamish had a cunning plan.
Temperatures were up and down throughout December and dropped quite low at the end of the month
"We were going to have Christmas lunch with Paula's family, and Christmas dinner with my family. I suggested that we have my parents around for Christmas breakfast too. Thankfully Paula was keen to do this and didn't need convincing."
Christmas morning arrived and was like any other Christmas morning with Hamish bouncing out of bed super-early and donning a Santa hat. He had placed several more gifts under the tree next to the big long box and kept saying to Paula that he was so excited to give her presents to her. Paula is used to not opening any presents until after breakfast, so as curious as she was, she didn't open anything. Then, not long before his parents were due to arrive for breakfast, Hamish told Paula that there was one present that he was extra-excited to give her and that he wanted her to have it now. He handed her a note with a string attached to it and told her to read the note, wait a bit, then follow the string. Hamish started unwinding the string and headed outside.
"I was thinking that he would be leading me on a wild goose chase through the yard and around the back into the garage or something. Anyway, I followed his instructions and after waiting a bit I started to follow the string."
Paula with Pippa under the Christmas tree
Paula didn't get very far. When she slid the front door open, there was Hamish with Pippa! Following the string was merely a distraction so Hamish had time to go and get Pippa from his parents who had brought Pippa with them and were waiting down the road. Click here to watch the video to see Paula's reaction!
"I couldn't comprehend how Hamish had got a greyhound. I thought that there was no way we could get one because we still didn't have a fence. I was dumbfounded, saying 'How on earth?' and 'I never would have guessed'."
It's safe to say that it wasn't long before the fence was built so that Pippa could have complete freedom in the back yard. She spends most of her time out there during the day, and has her kennel and run to keep her cosy on cold and wet winter days. In summer she spent nights outside too, but now she is allowed inside at night and has several beds to choose from, including the couch!
If you're wondering what the other gifts were, they were a 3m x 4m run (that 70kg big long box!), Pippa's GAP paperwork, her muzzle, and her food bowl. As for Pixie, it wasn't long before she found a home too.


text:
Retirement »
IRS extends emergency relief on RMDs to everyone
By James Royal,
Bankrate.com
The IRS just plugged a big hole in the relief package offered to American retirees earlier this year as part of efforts to mitigate the financial effects of the coronavirus.
But Americans will have to act fast to take advantage of the new rules, which affect anyone taking a required minimum distribution (RMD) from a tax-deferred retirement account such as a traditional 401(k) or traditional IRA.
Details on the new IRS ruling
The new IRS decision ensures that anyone who took a RMD in 2020 will be able to return it to their account and avoid the tax consequences – if they act before Aug. 31.
That decision corrects the effects of previous legislation and IRS rulings, which may have left out retirees who took distributions earlier in 2020.
On March 27, President Donald Trump signed the CARES Act into law, eliminating the need for Americans to take required minimum distributions in 2020 from their retirement accounts. The aim of the provision was to allow the value of retirement accounts a chance to recover from the surging volatility in the stock and bond markets following the coronavirus panic.
Those who had taken a distribution before that date may have been excluded from its benefits.
Even if a retiree was not initially covered by the March legislation, the IRS allows as a matter of course for a distribution to be replaced in a retirement account within 60 days of a withdrawal. An April decision from the IRS also allowed those who took a required distribution between Feb. 1 and May 15 to replace the money by July 15 without incurring a penalty.
But even that rule change left those who took a distribution in January out in the cold. The latest IRS ruling changes that.
"This puts retirees who took RMDs in January on equal footing with those who'd taken one in later months and already had the flexibility to return the money," says Greg McBride, CFA, Bankrate chief financial analyst.
Should you return the money?
The question of whether it makes sense to return the money depends heavily on your own financial situation. It could be a great move if you're able to do so without economic hardship, because you may be able to benefit in two ways.
"Putting that unneeded RMD back into a tax-advantaged account not only rescinds the tax liability that resulted from the withdrawal but allows the money to grow before it is ultimately withdrawn at a future date," McBride says.
By putting that money back in the market, it has the ability to increase substantially over time. And if you don't need the money, a retirement account can help protect you from taxes on those gains.
If you've taken a RMD, you can return the money to the account you withdrew it from or put it into another tax-deferred account. For example, a distribution from a traditional 401(k) can be returned to that account or deposited into a traditional IRA.
Even if you don't have a traditional IRA at the moment, you can quickly open one, if needed, and replace any required distribution in the account.
If you're looking to take advantage of this new IRS ruling, act quickly. You have only until the end of August to replace the funds, and with all retirees now on the same footing, it's not a good bet that the IRS will extend this kind of relief any further.
For more news you can use to help guide your financial life, visit our Insights page.
© Copyright 2020 Bankrate, Inc. All rights reserved.
Solo aging: How to find patient support
Splitting up your nest egg in a gray divorce
Small changes for a big impact on saving
Stimulus and retirees: What you should know
See all Retirement articles
Retirement Calculators & Tools


The Joplin Eagles ran 77 plays. However, only one play mattered most as they dealt the Parkview Vikings a 35-21 loss on Friday night at JFK Stadium.
Joplin started the second half at the Parkview 20, and senior quarterback Skyler Duley handed the ball to senior Adam Norsworthy, who headed toward his left tackle, looking for a gap.
"I saw my tackles' (backside) turn and I knew I could get outside," Norsworthy said.
And outside Norsworthy flew and down the left sideline for an 80-yard game-tying touchdown, and Joplin rode the momentum to an Ozark Conference victory.
"We were just trying to keep (Norsworthy) out of the end zone," Parkview coach Anthony Hays said. "That was a big one after halftime."
After Norsworthy's shocker to start the second half, the Vikings responded with an almost-tying score, moving from their 36 to the Joplin 5. But Joplin recovered a fumble.
Joplin then drove 95 yards on 18 plays, including 41 yards from Norsworthy to lead 21-14 with 3:06 left in the third quarter. Joplin followed with an 8-yard run by Dooley with 11:39 left, for a 28-14 lead.
Norsworthy was a handful all night, rushing for 257 yards and four touchdowns.
Parkview looked to be the dangerous team when Nick Cole hit a wide-open a Connor Ratcliff for an 48-yard touchdown pass with 5:32 left in the first quarter, breaking a scoreless tie 7-0.
It took Joplin until the end of the quarter for Norsworthy to score his first touchdown on a 42-yard dash. The senior plowed into the line and then bounced outside to run it in.
Parkview's final score of the half came on a nifty misdirection play to Ratcliff, who sliced through the center of the line and went 35 yards to score. The Vikings led 14-7.
Parkview had one last drive,, a two-play, 80-yard romp that was highlighted by a 72-yard run by Ratcliff with 10:34 left. The Vikings had another chance but the drive died on downs.
Norsworthy scored his last touchdown with 2:46 left on a 6-yard run.


text:
Le patronyme Fassiaux, Fassiau, Fassieaux ou Fassieau provient de l'ancien français faisceau.

Françoise Fassiaux-Looten (1946-), femme politique belge.

redpajama_set_name: RedPajamaWikipedia


Samantha is graduating from Ludlow High School in 2019! The future is wide open for Sam! While she's undecided on what she will be studying, she is definitely excited to explore all that college has to offer. We had a super fun afternoon exploring the Ludlow Mills for her senior photos.
This was the last weekend to squeeze out those colorful fall photos and boy was it spectacular!
Congrats Sam! Enjoy your last year of high school!


text:
Q: Best way to retrieve K largest elements from large unsorted arrays? I recently had a coding test during an interview. I was told:

There is a large unsorted array of one million ints. User wants to retrieve K largest elements. What algorithm would you implement?

During this, I was strongly hinted that I needed to sort the array.
So, I suggested to use built-in sort() or maybe a custom implementation if performance really mattered. I was then told that using a Collection or array to store the k largest and for-loop it is possible to achieve approximately O(N), in hindsight, I think it's O(N*k) because each iteration needs to compare to the K sized array to find the smallest element to replace, while the need to sort the array would cause the code to be at least O(N log N).
I then reviewed this link on SO that suggests priority queue of K numbers, removing the smallest number every time a larger element is found, which would also give O(N log N). Write a program to find 100 largest numbers out of an array of 1 billion numbers
Is the for-loop method bad? How should I justify pros/cons of using the for-loop or the priorityqueue/sorting methods? I'm thinking that if the array is already sorted, it could help by not needing to iterate through the whole array again, i.e. if some other method of retrieval is called on the sorted array, it should be constant time. Is there some performance factor when running the actual code that I didn't consider when theorizing pseudocode?

A: This is a classic problem that can be solved with so-called heapselect, a simple variation on heapsort. It also can be solved with quickselect, but like quicksort has poor quadratic worst-case time complexity.
Simply keep a priority queue, implemented as binary heap, of size k of the k smallest values. Walk through the array, and insert values into the heap (worst case O(log k)). When the priority queue is too large, delete the minimum value at the root (worst case O(log k)). After going through the n array elements, you have removed the n-k smallest elements, so the k largest elements remain. It's easy to see the worst-case time complexity is O(n log k), which is faster than O(n log n) at the cost of only O(k) space for the heap.

A: Here is one idea. I will think for creating array (int) with max size (2147483647) as it is max value of int (2147483647). Then for every number in for-each that I get from the original array just put the same index (as the number) +1 inside the empty array that I created.
So in the end of this for each I will have something like [1,0,2,0,3] (array that I created) which represent numbers [0, 2, 2, 4, 4, 4] (initial array).
So to find the K biggest elements you can make backward for over the created array and count back from K to 0 every time when you have different element then 0. If you have for example 2 you have to count this number 2 times.
The limitation of this approach is that it works only with integers because of the nature of the array...
Also the representation of int in java is -2147483648 to 2147483647 which mean that in the array that need to be created only the positive numbers can be placed.
NOTE: if you know that there is max number of the int then you can lower the created array size with that max number. For example if the max int is 1000 then your array which you need to create is with size 1000 and then this algorithm should perform very fast.

A: I think you misunderstood what you needed to sort.
You need to keep the K-sized list sorted, you don't need to sort the original N-sized input array. That way the time complexity would be O(N * log(K)) in the worst case (assuming you need to update the K-sized list almost every time).
The requirements said that N was very large, but K is much smaller, so O(N * log(K)) is also smaller than O(N * log(N)).
You  only need to update the K-sized list for each record that is larger than the K-th largest element before it. For a randomly distributed list with N much larger than K, that will be negligible, so the time complexity will be closer to O(N).
For the K-sized list, you can take a look at the implementation of Is there a PriorityQueue implementation with fixed capacity and custom comparator? , which uses a PriorityQueue with some additional logic around it.

A: There is an algorithm to do this in worst-case time complexity  O(n*log(k)) with very benign time constants (since there is just one pass through the original array, and the inner part that contributes to the log(k) is only accessed relatively seldomly if the input data is well-behaved).

*

*Initialize a priority queue implemented with a binary heap A of maximum size k (internally using an array for storage). In the worst case, this has O(log(k)) for inserting, deleting and searching/manipulating the minimum element (in fact, retrieving the minimum is O(1)).

*Iterate through the original unsorted array, and for each value v:

*

*If A is not yet full then

*

*insert v into A,

*else, if v>min(A) then (*)

*

*insert v into A,

*remove the lowest value from A.

(*) Note that A can return repeated values if some of the highest k values occur repeatedly in the source set. You can avoid that by a search operation to make sure that v is not yet in A. You'd also want to find a suitable data structure for that (as the priority queue has linear complexity), i.e. a secondary hash table or balanced binary search tree or something like that, both of which are available in java.util.
The java.util.PriorityQueue helpfully guarantees the time complexity of its operations:

this implementation provides O(log(n)) time for the enqueing and dequeing methods (offer, poll, remove() and add); linear time for the remove(Object) and contains(Object) methods; and constant time for the retrieval methods (peek, element, and size).

Note that as laid out above, we only ever remove the lowest (first) element from A, so we enjoy the O(log(k)) for that. If you want to avoid duplicates as mentioned above, then you also need to search for any new value added to it (with O(k)), which opens you up to a worst-case overall scenario of O(n*k) instead of O(n*log(k)) in case of a pre-sorted input array, where every single element v causes the inner loop to fire.

A: Another way of solving this is using Quickselect. This should give you a total average time complexity of O(n). Consider this:

*

*Find the kth largest number x using Quickselect (O(n))

*Iterate through the array again (or just through the right-side partition) (O(n)) and save all elements ≥ x

*Return your saved elements

(If there are repeated elements, you can avoid them by keeping count of how many duplicates of x you need to add to the result.)
The difference between your problem and the one in the SO question you linked to is that you have only one million elements, so they can definitely be kept in memory to allow normal use of Quickselect.

A:
There is a large unsorted array of one million ints. The user wants to retrieve the K largest elements.
During this, I was strongly hinted that I needed to sort the array.
So, I suggested using a built-in sort() or maybe a custom
implementation

That wasn't really a hint I guess, but rather a sort of trick to deceive you (to test how strong your knowledge is).
If you choose to approach the problem by sorting the whole source array using the built-in Dual-Pivot Quicksort, you can't obtain time complexity better than O(n log n).
Instead, we can maintain a PriorytyQueue which would store the result. And while iterating over the source array for each element we need to check whether the queue has reached the size K, if not the element should be added to the queue, otherwise (is size equals to K) we need to compare the next element against the lowest element in the queue - if the next element is smaller or equal we should ignore it if it is greater the lowest element has to be removed and the new element needs to be added.
The time complexity of this approach would be O(n log k) because adding a new element into the PriorytyQueue of size k costs O(k) and in the worst-case scenario this operation can be performed n times (because we're iterating over the array of size n).
Note that the best case time complexity would be Ω(n), i.e. linear.
So the difference between sorting and using a PriorytyQueue in terms of Big O boils down to the difference between O(n log n) and O(n log k). When k is much smaller than n this approach would give a significant performance gain.
Here's an implementation:
public static int[] getHighestK(int[] arr, int k) {
    Queue<Integer> queue = new PriorityQueue<>();

    for (int next: arr) {
        if (queue.size() == k && queue.peek() < next) queue.remove();
        if (queue.size() < k) queue.add(next);
    }

    return toIntArray(queue);
}

public static int[] toIntArray(Collection<Integer> source) {
    return source.stream().mapToInt(Integer::intValue).toArray();
}

main()
public static void main(String[] args) {
    System.out.println(Arrays.toString(getHighestK(new int[]{3, -1, 3, 12, 7, 8, -5, 9, 27}, 3)));
}

Output:
[9, 12, 27]

Sorting in O(n)
We can achieve worst case time complexity of O(n) when there are some constraints regarding the contents of the given array. Let's say it contains only numbers in the range [-1000,1000] (sure, you haven't been told that, but it's always good to clarify the problem requirements during the interview).
In this case, we can use Counting sort which has linear time complexity.  Or better, just build a histogram (first step of Counting Sort) and look at the highest-valued buckets until you've seen K counts.  (i.e. don't actually expand back to a fully sorted array, just expand counts back into the top K sorted elements.)  Creating a histogram is only efficient if the array of counts (possible input values) is smaller than the size of the input array.
Another possibility is when the given array is partially sorted, consisting of several sorted chunks. In this case, we can use Timsort which is good at finding sorted runs. It will deal with them in a linear time.
And Timsort is already implemented in Java, it's used to sort objects (not primitives). So we can take advantage of the well-optimized and thoroughly tested implementation instead of writing our own, which is great. But since we are given an array of primitives, using built-in Timsort would have an additional cost - we need to copy the contents of the array into a list (or array) of wrapper type.

redpajama_set_name: RedPajamaStackExchange


text:
COVER STORY: INTERNATIONAL AFFAIRS: The legacy of John Paul II
EDITORIAL: Telstra: the latest push for privatisation
CANBERRA OBSERVED: Howard to use Canberra power against states
EDUCATION: Cutting university places in the not-so-clever country
TRADE: Where do we go next with Japan?
FAMILY LAW: 'No-fault' principle undermines marriage
HISTORY: The Vietnam War - 30 years on
STRAWS IN THE WIND: A society of hoons? / The Nobel committee's Syllabus of Errors / The triumph of Roma
ASIA: China's burgeoning naval power
ECONOMIC DEVELOPMENT: Taiwan's high-tech industry: lessons for Australia
INDONESIA: Obstacles to an Indonesian partnership
CLIMATE: Kyoto: why we should be sceptical
BOOKS: FORGOTTEN ARMIES: The Fall of British Asia, 1941-1945
BOOKS: Despite the Barking Dogs, by Stanislaw Gotowicz
Telstra: the latest push for privatisation
News Weekly, April 23, 2005
If the Federal Coalition succeeds in securing the full privatisation of Telstra, it will be even less capable of protecting Australian consumers from the telecommunication giant's anti-competitive conduct.
The Federal Coalition, which secures control of the Senate from July 1, has launched a new inquiry into competition in the telecommunications industry, at the same time that Telstra has hired Merrill Lynch and Co., the world's largest securities firm, to advise it on how to sell off the Government's remaining 51 per cent stake, estimated to be worth about $30 billion.
The Swiss-based UBS AG, the largest corporate adviser on share issues in Australia, was appointed last month to recommend on the structure and timing of the Government's sale of its stake in Telstra. Caliburn Partnership, which provides merger and acquisition advice to companies in Australia and New Zealand, was named as the Government's business adviser.
The new inquiry being conducted by the Department of Communications has strictly limited terms of reference.
The Federal Government has closed off the possibility that this inquiry could recommend the physical separation of Telstra into two entities: the infrastructure continuing to be a publicly-owned utility, while a privatised retail company would run things such as Telstra Broadband, Telstra's mobile phone business, and its TV interests - which already operate in competition with the private sector.
Ideological
The Government stand is based on its long-standing ideological commitment to Telstra's total privatisation, and its desire to get its hands on the full $30 billion which will come from the sale of the company.
The problem it faces, however, is highlighted in its Discussion Paper. In March last year - following an outcry from Telstra BigPond's competitors - the competition watchdog, the Australian Competition and Consumer Commission (ACCC), issued a formal notice to Telstra, to warn it against using its monopoly power to cripple competitors of its internet services.
ACCC Chairman Graeme Samuel said at the time: "The ACCC believes that Telstra has engaged, or is engaging, in anti-competitive conduct in relation to Telstra's wholesale pricing of high-speed internet."
Since its partial privatisation, Telstra has attracted strong criticism from other communications companies, including Optus, as well as end-users, for its pricing policies.
In 2001, the ACCC issued a notice against Telstra, alleging that it had engaged in anti-competitive behaviour. Telstra aggressively contested the claim, and called for the Trade Practices Act to be amended to "call off the dogs". It was later supported by the free-market-oriented Productivity Commission which conducted its own inquiry into telecommunications industry regulation.
Separately, the Estens Inquiry in 2002 received hundreds of submissions which showed that many Australians living outside the capital cities had a second-class telecommunications system.
It said: "Concerns have been expressed, through submissions to the Inquiry, about the reliability of Telstra's telephone network, and the speed of available Internet services in regional, rural and remote areas. The Inquiry finds that there are particular areas in rural Australia where improvements need to be made to network reliability."
The Federal Government responded to these concerns by allocating more than $1 billion to improve existing telecommunications services, particularly in regional, rural and remote areas.
If, however, Telstra is fully privatised, the existing restraint on the abuse of Telstra's monopoly powers - mainly government pressure -will be removed.
Once it has been sold off at the highest price, shareholders will expect - and the sharemarkets will demand - that Telstra maximise its dividends. Market forces, which in recent years have been seen to be inadequate to protect Telstra's competitors and consumers, will be even less effective in the future.
What is to be done? It is extremely important that people who use Telstra's services, including users of Telstra's fixed line, mobile and internet services, make contributions to the current inquiry.
In the absence of a full separation of Telstra's retail business from its infrastructure network, it is important to support the ACCC's submission that there be an internal separation of Telstra between its "retail business" supplying services to end-users, and its "network business". This is necessary for both consumers and for other communications companies so that they can compete on a transparent and fair basis with Telstra.
Additionally, there should be operational separation of Telstra's infrastructure business from its retail business, not only with regard to existing technologies, but also new services such as optical-fibre networks.
It should be said that an accounting separation, even when fully implemented, is unlikely to adequately detect and prevent anti-competitive conduct, because Telstra itself determines the notional rather than actual allocation of costs, revenues and assets across its various commercial units.
Until Telstra is actually privatised, only public pressure can hold both Telstra, and the Government, accountable.
Peter Westmore is president of the National Civic Council


text:
Immigration and Welfare Support in Germany
In recent years, several international-comparative studies have analyzed the relationship between migration and native populations' decreasing support for redistributive policies. However, these studies use cross-sectional designs and aggregate the number of foreign-born residents at the national level. Both aspects are theoretically and methodologically problematic. We address these shortcomings by investigating cross-sectional as well as longitudinal effects in the case of Germany, using a combination of individual- and regional-level data for several time points from 1994 to 2010.
From Patrick to John F.: Ethnic Names and Occupational Success in the Last Era of Mass Migration
Taking advantage of historical census records that include full first and last names, we apply a new approach to measuring the effect of cultural assimilation on economic success for the children of the last great wave of immigrants to the United States. We created a quantitative index of ethnic distinctiveness of first names and show the consequences of ethnic-sounding names for the occupational achievement of the adult children of European immigrants.
Civic Stratification and the Exclusion of Undocumented Immigrants from Cross-border Health Care
This paper proposes a theoretical framework and an empirical example of the relationship between the civic stratification of immigrants in the United States, and their access to healthcare. We use the 2007 Pew Hispanic Center/Robert Wood Johnson Foundation Hispanic Healthcare Survey, a nationally representative survey of U.S. Latinos (N = 2,783 foreign-born respondents) and find that immigrants who are not citizens or legal permanent residents are significantly more likely to be excluded from care in both the United States and across borders.
Health Assimilation among Hispanic Immigrants in the United States: The Impact of Ignoring Arrival-cohort Effects
A large literature has documented that Hispanic immigrants have a health advantage over their U.S.-born counterparts upon arrival in the United States. Few studies, however, have disentangled the effects of immigrants' arrival cohort from their tenure of U.S. residence, an omission that could produce imprecise estimates of the degree of health decline experienced by Hispanic immigrants as their U.S. tenure increases.
Sharing the Emotional Load: Recipient Affiliation Calms Down the Storyteller
In conversational storytelling, the recipients are expected to show affiliation with the emotional stance displayed by the storytellers. We investigated emotional arousal-related autonomic nervous system responses in tellers and recipients of conversational stories. The data consist of 20 recordings of 45- to 60-minute dyadic conversations between female university and polytechnic students. Conversations were videotaped and analyzed by means of conversation analysis (CA), with a special emphasis on the verbal and nonverbal displays of affiliation in storytelling.
(-) Remove Consumption filter Consumption
(-) Remove Immigrants filter Immigrants
(-) Remove Ethnomethodology/Conversational Analysis filter Ethnomethodology/Conversational Analysis


text:
Q: Continuity of a convex function I'm trying to solve the following problem:
Let $f:K\rightarrow \mathbb{R} $, $f$ convex and $K \subseteq \mathbb{R}^n$ convex. Then $f$ is continuous on $K$.
I have proved the only case $n=1$, but for an arbitrary $n$??

A: A hypercube in dimension $n$ has $2n$ hyperfaces, not $2^n$.
Apparently Bacon does not like this to be corrected
(https://math.stackexchange.com/review/suggested-edits/827072).
I do not have enough reputation for a proper comment, I'll delete this as soon as someone put it correctly.

A: $K$ need not be convex, but it should be open.
(In fact, $K=[0,1]\subset\mathbb R^1$ is convex and $f\colon K\to \mathbb R$ with $f(x)=0$ for $0<x<1$ and $f(0), f(1)$ arbitrary positive is convex but not continuous.)
The proof for $K$ open is by induction on $n$, the case $n=0$ being trivial.
Let $x_0\in K$ be any point in $K$.
Then there exists $r>0$ such that the closed cube $$Q=\{x\in\mathbb R^n\mid ||x-x_0||_\infty\le r\}$$
is contained in $K$.
The $2^n$ hyperplanes $H_{i,e}$, $1\le i\le n$, $e\in\{\pm1\}$ given by $x^{(i)}=x_0^{(i)}+e r$ can each be identified with $\mathbb R^{n-1}$. Thus the convex function $f|_{K\cap H_{i,e}}$ is continuous and hence $f$ is bounded on each of the $2^n$ compact faces $Q\cap H_{i,e}$ making up the boundary $\partial Q$ of $Q$.
Let $M$ be a bound, i.e. $|f(x)|<M$ for all $x\in\partial Q$.
Consider an arbitrary point $x\in Q\setminus\{x_0\}$.
Then
$$g(t)=x_0+(x-x_0)\cdot t$$
describes the line through $x_0$ and $x$. It passes through $\partial Q$ at $t=t_1=\frac r{||x-x_0||_\infty}\ge 1$ and at $t=-t_1$. Thus $h=f\circ g$ is convex on $[-t_1,t_1]$ and hence
$$ h(1)\le \frac {h(t_1)+(t_1-1)h(0)}{t_1}$$
and
$$ h(0)\le \frac{t_1h(1)+h(-t_1)}{t_1+1}.$$
Solving both for $h(1)-h(0)$, we find
$$ \frac{h(0)-h(-t_1)}{t_1}\le  h(1)-h(0)\le \frac{h(t_1)-h(0)}{t_1}. $$
Using $h(0)=f(x_0)$, $h(1)=f(x)$, $|h(-t_1)|< M$, $|h(t_1)|< M$ and $0<\frac1{t_1}=\frac{||x-x_0||_\infty}r\le\frac{||x-x_0||_2}r$ we obtain
$$|f(x)-f(x_0)|\le \frac {(M+|f(x_0)|)}r\cdot ||x-x_0||_2$$
and finally that $f$ is continuous at $x_0$:
$$|f(x)-f(x_0)|<\varepsilon \text{ for all }x\text{ with }|x-x_0|<\delta:=\min\left\{r, \frac{r\varepsilon}{(M+|f(x_0)|)}\right\}.$$


Cowen lowers its rating for Chipotle shares to underperform from market perform, citing a consumer survey pointing to a slower than expected sales rebound.
The firm lowers its price target for restaurant chain's shares to $250 from $370, representing 21 percent downside from Thursday's close.
The August 2017 survey of 2,500 consumers revealed the "food quality and trustworthiness" perception for Chipotle was back near its lowest levels since the 2015 food safety crisis.
A turnaround for Chipotle is nowhere in sight, according to one Wall Street firm.
Cowen lowered its rating for the burrito restaurant chain to underperform from market perform, citing the firm's negative consumer survey results for Chipotle's brand.
"Proprietary survey data indicates Chipotle's quality and value perceptions remain near trough levels, leading us to believe the sales recovery will continue to trail investor expectations," analyst Andrew Charles wrote in a note to clients Friday. "We are concerned upcoming efforts to drive sales are not enough to improve these measures and in turn will not drive upside to investor same store sales expectations."
Charles lowered his price target for Chipotle shares to $250 from $370, representing 21 percent downside from Thursday's close.
The company's stock has underperformed the market this year. It is down 16 percent year to date through Thursday compared with the S&P 500's 10 percent gain.
Chipotle's problems with E. coli food safety issues in 2015 resulted in a steep drop in revenue and its stock price. In addition, the chain also faced a norovirus incident at one of its restaurants in July earlier this year.
Charles cited how his August 2017 survey of 2,500 consumers revealed the "food quality and trustworthiness" perception for Chipotle was back near its lowest levels since the 2015 food safety crisis.
As result, the analyst lowered his second half 2017 same-store comparable sales growth estimate to 0.75 percent from 3 percent.
"Looking ahead to 2018, we believe management's plans to take 5% pricing over the next 2-4 quarters will weigh on traffic in a fragile industry backdrop," he wrote. "We fear Chipotle is looking to drive comps through pricing given the difficulty of regaining traffic over the last 18 months."


text:
"""Test driver for module banking"""

import unittest
from identifiers.banking import BIC, IBAN
from identifiers.ibanregistry import IBAN_REGISTRY, get_iban_spec

class BICTest(unittest.TestCase):

    def test_constructor(self):
        # wrong type of argument
        self.assertRaises(TypeError, BIC, 14)
        # wrong number of chars
        self.assertRaises(ValueError, BIC, 'ABCDBEBBXX')
        self.assertRaises(ValueError, BIC, 'ABCDEFG')
        # wrong chars
        self.assertRaises(ValueError, BIC, 'abcdbebbxxx')
        self.assertRaises(ValueError, BIC, 'ABCDBEBBXXÜ')
        # unknown country
        self.assertRaises(ValueError, BIC, 'ABCDBXBBXXX')
        # correct BIC
        arg = 'ABCDBEBBXXX'
        bic = BIC(arg)
        self.assertEqual(str(bic), arg)
        arg = ' ABCDBEB5  \n'
        bic = BIC(arg)
        self.assertEqual(str(bic), arg.strip())
        # ensure slot-only instance
        self.assertRaises(AttributeError, getattr, bic, '__dict__')

    def test_elements(self):
        bic = BIC('ABCDBEB3XXX')
        self.assertEqual(bic.party_prefix, 'ABCD')
        self.assertEqual(bic.country_code, 'BE')
        self.assertEqual(bic.party_suffix, 'B3')
        self.assertEqual(bic.branch_code, 'XXX')
        self.assertEqual(bic.elements(), ('ABCD', 'BE', 'B3', 'XXX'))
        bic = BIC('ABCDBEB3')
        self.assertEqual(bic.party_prefix, 'ABCD')
        self.assertEqual(bic.country_code, 'BE')
        self.assertEqual(bic.party_suffix, 'B3')
        self.assertEqual(bic.branch_code, '')
        self.assertEqual(bic.elements(), ('ABCD', 'BE', 'B3', ''))

class IBANTest(unittest.TestCase):

    def test_constructor_1(self):
        # wrong number of arguments
        self.assertRaises(TypeError, IBAN, 'JU', 147)
        # wrong type of argument
        self.assertRaises(TypeError, IBAN, 147)
        # unknown country
        self.assertRaises(ValueError, IBAN, 'JU11CBJO0010000000000131AVH302')
        # wrong number of chars
        self.assertRaises(ValueError, IBAN, 'JO11CBJO0010000000000131AVH')
        self.assertRaises(ValueError, IBAN, 'JO11CBJO0010000000000131AVH3029')
        # wrong chars
        self.assertRaises(ValueError, IBAN, 'JO11CBJ00010000000000131AVH302')
        self.assertRaises(ValueError, IBAN, 'JO11CBJO001C000000000131AVH302')
        # wrong check digits
        self.assertRaises(ValueError, IBAN, 'JO71CBJO0010000000000131AVH302')
        # correct IBAN
        arg = 'JO11CBJO0010000000000131AVH302'
        iban = IBAN(arg)
        self.assertEqual(iban._id, arg)
        arg = ' JO11CBJO0010000000000131AVH302  \n'
        iban = IBAN(arg)
        self.assertEqual(iban._id, arg.strip())
        # ensure slot-only instance
        self.assertRaises(AttributeError, getattr, iban, '__dict__')

    def test_constructor_3(self):
        # wrong type of argument
        self.assertRaises(TypeError, IBAN, 38, 147, 'ABC')
        self.assertRaises(TypeError, IBAN, 'JO', 147.0, 10000000000131)
        self.assertRaises(TypeError, IBAN, 'JO', 'CBJO3845', 3.9)
        # invalid / unknown country code
        self.assertRaises(ValueError, IBAN, 'JO47', 'CBJO',
                          '0010000000000131AVH302')
        self.assertRaises(ValueError, IBAN, 'xx', 'CBJO',
                          '0010000000000131AVH302')
        # wrong number of chars
        self.assertRaises(ValueError, IBAN, 'JO', 'CBJO0000', '000000131AVH')
        self.assertRaises(ValueError, IBAN, 'JO', 'CBJO', '0010080131AVH3029')
        # wrong chars
        self.assertRaises(ValueError, IBAN, 'JO', 'CBJ00010',
                          '000000000131AVH302')
        self.assertRaises(ValueError, IBAN, 'JO', 'CBJO001C',
                          '000000000131AVH302')
        # correct IBAN
        args = ('JO', 'CBJO0010', '000000000131AVH302')
        iban = IBAN(*args)
        self.assertEqual(iban._id, 'JO11CBJO0010000000000131AVH302')
        args = ('DE', 10000000, 1020304050)
        iban = IBAN(*args)
        self.assertEqual(iban._id, 'DE53100000001020304050')

    def test_elements(self):
        iban = IBAN('JO11CBJO0010000000000131AVH302')
        self.assertEqual(iban.country_code, 'JO')
        self.assertEqual(iban.check_digits, '11')
        self.assertEqual(iban.bank_identifier, 'CBJO0010')
        self.assertEqual(iban.bank_account_number, '000000000131AVH302')
        self.assertEqual(iban.elements(), ('JO', '11', 'CBJO0010',
                                           '000000000131AVH302'))
        iban = IBAN('MT84MALT011000012345MTLCAST001S')
        self.assertEqual(iban.country_code, 'MT')
        self.assertEqual(iban.check_digits, '84')
        self.assertEqual(iban.bank_identifier, 'MALT01100')
        self.assertEqual(iban.bank_account_number, '0012345MTLCAST001S')
        self.assertEqual(iban.elements(), ('MT', '84', 'MALT01100',
                                           '0012345MTLCAST001S'))

    def test_examples(self):
        for country_code in IBAN_REGISTRY:
            iban_spec = get_iban_spec(country_code)
            for exmpl in iban_spec.examples:
                self.assertTrue(IBAN(exmpl))

    def test_str(self):
        iban = IBAN('JO11CBJO0010000000000131AVH302')
        self.assertEqual(str(iban), 'JO11 CBJO 0010 0000 0000 0131 AVH3 02')
        iban = IBAN('MT84MALT011000012345MTLCAST001S')
        self.assertEqual(str(iban), 'MT84 MALT 0110 0001 2345 MTLC AST0 01S')


text:
Category Archives: Asian Gaelic Games
2014 Asian Gaelic Games – Kuala Lumpur – 10th to 12th October
September 21, 2014 Ross Hennessy	Leave a comment
It's that time of year again! The Asian Gaelic Games (AGG) has come around again quickly and the Celts have been busy preparing since June for the biggest tournament of the year. The men's and ladies teams have been training three times a week to ensure they are in top form for the championships. We have seen great levels of commitment and effort from all players this year in what has been an incredibly hot summer in Taipei.
The club has welcomed many new players since last years games and unfortunately has said goodbye to some former players. This year promises to be a another memorable AGG with the Celts displaying a great mix of youth, experience, talent and commitment.
Good luck to all our players and we look forward to a great performance in the games and the countless stories and memories that it will bring!
See all you need to know about the games here –
http://www.asiangaelicgames.info/2014/
2013 Asian Gaelic Games
July 24, 2013 taiwancelts	Leave a comment
The buildup to the 2013 Asian Gaelic games has begun. Who will host the Brady Cup this year? At this time, the early favourite from the bookies is the Taiwan Celts. You heard it here first, the Taiwan Celts are the odds on favourites to win the 2013 Asian Gaelic Games.
Now, if we could only find out when and where the games are being hosted.
Final Preparations for the Asian Gaelic Games
September 20, 2010 taiwancelts	Leave a comment
We started the season back in March; guys and girls all resident in Taiwan but with 12 different nationalities represented in the club this year!
Many new players came out to try Gaelic Football for their first time: we had basketball players and volley ball players, surfers and runners, ice-hockey players and Aussie-Rulers! As always our buddies from the Taipei Baboons Rugby Club joined in for training and practice games. The lads from Rogue FC and Taipei City FC soccer clubs got more involved with their second sport, Gaelic Football, in 2010! We also saw a big increase in the number of girls joining in throughout the season.
Now 6 months later, after grueling sessions under typhoon rains and in the roasting summer heat, through all the bangs and bumps and the patient hours of practicing the Gaelic Football 'Solo', having survived the physical, verbal, and emotional abuse inflicted by the cruel team trainers (we love ye really!!), 24 players from Taiwan head to Hong Kong on September 24th to compete in both the Mens and the Ladies 2010 Asian Gaelic Games tournaments.
You can keep up-to-date with the progress of the Taiwan teams by checking us out on Facebook for the latest updates throughout the weekend.
2010 Taiwan Celts Squad Members
Andy Roji (Australia)
Barry Cahill (Ireland)
Bryndis Henrikson (Canada)
David Langeland (Denmark)
David McEneaney (Ireland)
Duncan Murtagh (Ireland)
Felicia Rodrigues (Canada)
Graham Harvey (England)
Holly Itoga (USA)
Irina Tsikun (Russia)
Judy Fong (Canada)
Karen Wong (Australia)
Karsten Tonnesen (Denmark)
Lasse Bigum (Denmark)
Laurence Kenny (Ireland)
Liz Lu (Canada)
Meredith Ch (Taiwan)
Michael Carmody (Australia)
Peter Grogan (Ireland)
Ronan Quinlan (Ireland)
Scott Milne (USA)
Sean Costello (Ireland)
Sean McNally (USA)
Tony Lonergan (Ireland)
Record numbers to take part in the 2010 Asian Gaelic Games
July 4, 2010 taiwancelts	Leave a comment
Taiwan Celts GAA will be making their 15th consecutive appearance this year at the largest GAA tournament in Asia. The 2010 Asian Gaelic Games will take place in Hong Kong from Saturday 25th to Sunday 26th of September, and already close to 70 teams throughout the region are in training for this amateur sporting event.
There'll be a number of Mens Gaelic Football competitions running during the weekend, with 4-in-a-row A division Champions Hong Kong GAA looking to retain the Derek Brady Cup on their home turf, no doubt against some stiff competition from all sides!
2009 Ladies Champions "Singapore Lions" will be tested this year with record numbers of ladies teams expected at the tournament. Our Taiwan Celts girls are training each weekend in Taipei in preparation for the event. New players welcome along to join in!
There is also a lot of new interest in the Taiwan Celts Men's team this season. The 2010 squad already consists of players from Ireland, UK, US, Australia, Canada, Denmark, France, South Africa. Many first-timers who plan to don the Taiwan jersey in Hong Kong this coming September.
The tournament is hosted this year by the htHong Kong GAA and governed by the Asian County Board (ACB). In addition to Taiwan, GAA Clubs and teams expected to compete hail from Malaysia, Singapore, Hong Kong, Korea, Japan, Shanghai, Beijing, Vietnam, Dubai, India, Philippines, and many more.
Asian Gaelic Games, Photos
2009 Bangkok Asian Gaelic Games
October 25, 2009 taiwancelts	Leave a comment
The Taiwan Celts Men's team traveled to Bangkok to participate in the 2009 AGG, reaching the plate quarter-finals before they were defeated by eventual plate winners, Suzhou Celts. The Taiwan Nu's joined up with the Shanghai team for the ladies tournament.
Continue reading 2009 Bangkok Asian Gaelic Games →
Asian Gaelic Games, Tour Report
2009 Bangkok Tour Report
October 25, 2009 tonylonergan	Leave a comment
t was an amazing weekend of sports, music, craic and wicked thunder storms in Bangkok last weekend. The Taiwan Celts made their 15th consecutive appearance at the tournament with a full Mens squad and Nu's players Holly and Felicia joining the Shanghai Ladies team for the 2009 competition.
Continue reading 2009 Bangkok Tour Report →
Penang 2008 Tour Report
The Committee had spent weeks arranging hotels and travel arrangements, and the team had spent many Friday nights at D'Monkey drinking and Saturday afternoons at Bailin fields training for the 2008 Asian Gaelic games.
So in the early hours of Friday, Taiwan's best gathered to meet the bus at Da An Park; but it was soon noticeable that the bus had too many empty seats.
Many phone calls were made. Sean was awake but would make his own way to the Airport after waking up late. Brian having had Barry banging on his door for many minutes with no response was still not answering his phone and John Long, who is still scared of Mobile phones after watching enemy of the state and lives his life off the grid, was not contactable.
With the prospect of starting the weekend two players down, but with hope they would magically appear at the airport, the team proceeded to the airport.
Because Friday was the 10/10 Holiday in Taiwan, the Ladies night at D'Monkey on the Thursday night was a last opportunity for a pre-tour team building that could not be missed. Many retired from the team building at sensible hours to spend time with WAGS or finish up packing. Brian, John and myself stayed for a little longer. I'm hazzy on what happened, but I remember Brian knocking back Tequila with some eye candy, and I left at kicking out time.
After many calls to try and rouse the absent Brian during the journey to the airport, and while waiting to board the plane, our hopes of a grand last minute entrance were dashed, so we boarded the plane for the uneventful flight to Penang. The only highlight of the flight was Barry being cut off from the alcohol by the air hostess after, in her opinion, sinking a few too many in-flight G&Ts.
On arriving in Penang Sean powered up his blackberry to find a few work emails for his attention from "one of the missing" copied verbatim below.
Boys,
I'm in a bad spot. I can't explain this morning and I've been on the phone with the travel agent and the airline and I can't get a flight through. Sunday afternoon is the earliest I can get there, so it looks like I'm out. I seriously apologize, best of luck to the team.
Shamefully,
Everyone checked in to our base for the weekend, the Shangri-la Traders Penang. Although it was very nice it did not have the same recreational facilities as its sister hotels, so we headed off to spend the afternoon in the pool and sinking cocktails.
With the coming of the evening, all headed back to the hotel to apply after-sun and kit up for the welcome dinner and drawing of first round games.
The spread was fantastic and the camaraderie was better, meeting friends form GAA tournaments past and former Taiwan Celts who have moved to other parts of Asia.
In a very unusual turn of events, the Taiwan Celts were all tucked up in bed before midnight; dreaming and aspiring of greatness qualified with silverware.
Game 1 Vs Thailand with former Taiwan chairman John Campbell within their ranks the form from past years tournaments of the Thailand team was regarded as pretty good, the expected form was not to be. Instead of hitting the sack early on Friday, Thailand had been drinking and singing round the hotel lobby piano with others until the early hours.
Thailand were, it's fair to say, still hurting from the night before when an unfortunate event happened: one of the Thailand team made an optomistic challange for the ball and connected with Sean's knee. After some treatment from the magic sponge, Sean was back on his feet; but the Thailand player was carried off by the medical team to the local hospital with a broken leg.
The game finished with a win for Taiwan, only conceeding a few points and best wishes for the fallen Thai player.
Game 2 Vs Singapore C, although they were only the third string team from Singapore their skill and fitness was greater than the level that could be mustered from the Taiwan team. I can't remember the score but suffice to say Singapore grabed the victory.
Game 3 Vs Hong Kong B, a game we were not expecting to win and we were not dissaponited.
Game 4 Vs Orang Eire Blue, being new kids (only Malaysia's Second games) they were an unknown quantity, the game was closely fought but the game finished with Orang Eire up 2-3 to 0-2.
Thailand's games had gone particularly bad after starting the tounament without a full team and loosing two players to hospitalizing injures, understandably the remaining players lost all apetite for the competition and withdrew from the second day.
The misfortune of Thailand gifted us with only one game on the Sunday afternoon, the Bowl Final Vs Penang.
As Taiwan Celts ACB representative Barry attended the AGM while the rest of the team headed off in to Georgetown for the night where we enjoyed a cracking Curry and drinks far to late in to the night.
The Bowl final found us matched against a team from Penang who had not been spending more hours in pubs and clubs than on the training field.
Because of the great relationship between Taiwan and Thailand, for the final we were brought up to a full complement on the subs bench by some of the Thailand team. To me it seemed a good omen that we had a Mathew, Mark and Luke (names of the apostles) on the subs bench who nows what would have happened if John Long had made the trip .
Because of the superior fitness of the Penang team, the subs bench was used to full effect and it was down to the greater physicality in contact and sheer tenacity of the team not to loose, that at full time it was all square on the points board (can't remember the score). So with one player down because of a red card late in normal time the Taiwan Celts were forced to play extra time.
Both teams were completely exhausted during extra time and because there was no change in the scores we were foced in to a golden point situation.
The whole team was physically and mentally wiped, but from somewhere every one managed to dig down deep and put David (Hoff) Grimes in a position to take the golden point and bring the bowl back to Taiwan.
After a very physical game Penang were extremely gracious in defeat; and due to being under-aged and good Muslim boys, their coach gave us their beer tokens. But I think they said they would be back to beat us in 2009.
Tour report by Graham Harvey 2008 GAA tour virgin
2008 Penang Asian Gaelic Games
Taiwan Celts Men's Squad compete in the 2008 Asian Gaelic Games in Penang Malaysia, winning the Bowl competition for the second straight year.
2008_Penang_AGG_01
Singapore 2007 Tour Report
June 28, 2007 taiwancelts	Leave a comment
Blood, sweat, more sweat and tears doesn't even begin to describe the pain and effort that went into an historic victory by the Taiwan Celts Men's Team to win the Bowl final in Singapore and a narrow defeat in the semi's for the Taiwan Celts Ladies Team in a very competitive Plate competition.
The club went to the Games with high expectations after the Girl's won the Bowl competition in Shanghai last year, but to come away with silverware two years in a row is truly fantastic. Every player gave their all on the field of battle and were left with nothing in reserve when they left the pitch. The sheer level of commitment and sportsmanship from both of the Taiwan Celts Teams was awesome and this showed in the popularity of the Men's Team's win, which was heralded as a mighty triumph.
Throughout the weekend the Taiwan Celts played, sang and drank themselves into the hearts of all the participants, which included teams from Thailand, Vietnam (North & South), Malaysia, Singapore, Japan, Korea, Dubai and China (Shanghai, Beijing, Shenzhen, Hong Kong).
At the end of the day the Ladies Team lost narrowly in their Plate semi-final against the Singapore Exiles, while the Men faced off the Singapore Barbarians Rugby Team, who were captained by none other than former English International Rugby player Phil Greening. However, Greening and the physical nature of the Rugby team was no match for Captain Fantastic Ronan Quinlan and the superhuman skills and speed of the Taiwan Celts who ran out victors by 4 points and signed themselves into the Asian Gaelic Games history books.


text:
Debrzno (plaats), plaats in Polen
 Debrzno (gemeente), gemeente in Polen


text:
return require('lib/tap')(function (test)
  test("basic tcp server and client (ipv4)", function (print, p, expect, uv)
    local server = uv.new_tcp()
    assert(uv.tcp_bind(server, "127.0.0.1", 0))
    assert(uv.listen(server, 128, expect(function (err)
      p("server on connection", server)
      assert(not err, err)
      uv.close(server)
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local client = uv.new_tcp()
    local req = assert(uv.tcp_connect(client, "127.0.0.1", address.port, expect(function (err)
      p("client on connect", client, err)
      assert(not err, err)
      uv.shutdown(client, expect(function (err)
        p("client on shutdown", client, err)
        assert(not err, err)
        uv.close(client, expect(function ()
          p("client on close", client)
        end))
      end))
    end)))
    p{client=client,req=req}
  end)

  test("basic tcp server and client (ipv6)", function (print, p, expect, uv)
    local server = uv.new_tcp()
    local _, err = uv.tcp_bind(server, "::1", 0)
    if err then
      p("ipv6 unavailable", err)
      uv.close(server)
      return
    end
    assert(uv.listen(server, 128, expect(function (err)
      p("server on connection", server)
      assert(not err, err)
      uv.close(server)
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local client = uv.new_tcp()
    local req = assert(uv.tcp_connect(client, "::1", address.port, expect(function (err)
      p("client on connect", client, err)
      assert(not err, err)
      uv.shutdown(client, expect(function (err)
        p("client on shutdown", client, err)
        assert(not err, err)
        uv.close(client, expect(function ()
          p("client on close", client)
        end))
      end))
    end)))
    p{client=client,req=req}
  end)

  test("tcp echo server and client", function (print, p, expect, uv)
    local server = uv.new_tcp()
    assert(uv.tcp_bind(server, "127.0.0.1", 0))
    assert(uv.listen(server, 1, expect(function ()
      local client = uv.new_tcp()
      assert(uv.accept(server, client))
      assert(uv.read_start(client, expect(function (err, data)
        p("server read", {err=err,data=data})
        assert(not err, err)
        if data then
          assert(uv.write(client, data))
        else
          assert(uv.read_stop(client))
          uv.close(client)
          uv.close(server)
        end
      end, 2)))
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local socket = assert(uv.new_tcp())
    assert(uv.tcp_connect(socket, "127.0.0.1", address.port, expect(function ()
      assert(uv.read_start(socket, expect(function (err, data)
        p("client read", {err=err,data=data})
        assert(not err, err)
        assert(uv.read_stop(socket))
        uv.close(socket)
      end)))
      local req = assert(uv.write(socket, "Hello", function (err)
        p("client onwrite", socket, err)
        assert(not err, err)
      end))
      p{socket=socket,req=req}
    end)))
  end)

  test("tcp echo server and client with methods", function (print, p, expect, uv)
    local server = uv.new_tcp()
    assert(server:bind("127.0.0.1", 0))
    assert(server:listen(1, expect(function ()
      local client = uv.new_tcp()
      assert(server:accept(client))
      assert(client:read_start(expect(function (err, data)
        p("server read", {err=err,data=data})
        assert(not err, err)
        if data then
          assert(client:write(data))
        else
          assert(client:read_stop())
          client:close()
          server:close()
        end
      end, 2)))
    end)))

    local address = server:getsockname()
    p{server=server,address=address}

    local socket = assert(uv.new_tcp())
    assert(socket:connect("127.0.0.1", address.port, expect(function ()
      assert(socket:read_start(expect(function (err, data)
        p("client read", {err=err,data=data})
        assert(not err, err)
        assert(socket:read_stop())
        socket:close()
      end)))
      local req = assert(socket:write("Hello", function (err)
        p("client onwrite", socket, err)
        assert(not err, err)
      end))
      p{socket=socket,req=req}
    end)))
  end)

  test("tcp invalid ip address", function (print, p, expect, uv)
    local ip = '127.0.0.100005'
    local server = uv.new_tcp()
    local status, err = pcall(function() uv.tcp_bind(server, ip, 1000) end)
    assert(not status)
    p(err)
    assert(err:find(ip))
    uv.close(server)
  end)

  test("tcp close reset client", function(print, p, expect, uv)
    local server = uv.new_tcp()
    assert(uv.tcp_bind(server, "127.0.0.1", 0))
    assert(uv.listen(server, 1, expect(function ()
      local client = uv.new_tcp()
      assert(uv.accept(server, client))
      assert(uv.read_start(client, expect(function (err, data)
        p("server read", {err=err,data=data})
        if data then
          assert(uv.write(client, data))
        else
          assert(err=='ECONNRESET')
          assert(uv.read_stop(client))
          uv.close(client)
          uv.close(server)
        end
      end, 2)))
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local socket = assert(uv.new_tcp())
    assert(uv.tcp_connect(socket, "127.0.0.1", address.port, expect(function ()
      assert(uv.read_start(socket, expect(function (err, data)
        p("client read", {err=err,data=data})
        assert(not err, err)
        assert(uv.read_stop(socket))
        uv.tcp_close_reset(socket, expect(function()
          assert(uv.is_closing(socket))
          _, err = uv.shutdown(socket)
          assert(err:find('^ENOTCONN'))
        end))
      end)))
      local req = assert(uv.write(socket, "Hello", function (err)
        p("client onwrite", socket, err)
        assert(not err, err)
      end))
      p{socket=socket,req=req}
    end)))
  end, "1.32.0")

  test("tcp close reset after shutdown", function(print, p, expect, uv)
    local server = uv.new_tcp()
    assert(uv.tcp_bind(server, "127.0.0.1", 0))
    assert(uv.listen(server, 1, expect(function ()
      local client = uv.new_tcp()
      assert(uv.accept(server, client))
      assert(uv.read_start(client, expect(function (err, data)
        p("server read", {err=err,data=data})
        if data then
          assert(uv.write(client, data))
        else
          assert(uv.read_stop(client))
          uv.close(client)
          uv.close(server)
        end
      end, 2)))
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local socket = assert(uv.new_tcp())
    assert(uv.tcp_connect(socket, "127.0.0.1", address.port, expect(function ()
      assert(uv.read_start(socket, expect(function (err, data)
        p("client read", {err=err,data=data})
        assert(not err, err)
        assert(uv.read_stop(socket))
        uv.shutdown(socket, expect(function()
          uv.close(socket)
        end))
        _, err = uv.tcp_close_reset(socket)
        assert(err:find('^EINVAL'))
      end)))
      local req = assert(uv.write(socket, "Hello", function (err)
        p("client onwrite", socket, err)
        assert(not err, err)
      end))
      p{socket=socket,req=req}
    end)))
  end, "1.32.0")

  test("tcp close reset accepted", function(print, p, expect, uv)
    local server = uv.new_tcp()
    assert(uv.tcp_bind(server, "127.0.0.1", 0))
    assert(uv.listen(server, 1, expect(function ()
      local client = uv.new_tcp()
      assert(uv.accept(server, client))
      assert(uv.read_start(client, function (err, data)
        p("server read", {err=err,data=data})
        assert(uv.read_stop(client))
        if data then
          assert(uv.write(client, data, function()
            client:close_reset(function()
              server:close()
            end)
          end))
        end
      end))
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local socket = assert(uv.new_tcp())
    assert(uv.tcp_connect(socket, "127.0.0.1", address.port, expect(function ()
      assert(uv.read_start(socket,function (err, data)
        p("client read", {err=err,data=data})
        if not data then
          assert(err=='ECONNRESET' or err==nil)
          uv.close(socket)
        end
      end))
      local req = assert(uv.write(socket, "Hello", function (err)
        p("client onwrite", socket, err)
        assert(not err, err)
      end))
      p{socket=socket,req=req}
    end)))
  end, "1.32.0")

  test("tcp close reset accepted after shutdown", function(print, p, expect, uv)
    local server = uv.new_tcp()
    assert(uv.tcp_bind(server, "127.0.0.1", 0))
    assert(uv.listen(server, 1, expect(function ()
      local client = uv.new_tcp()
      assert(uv.accept(server, client))
      assert(uv.read_start(client, expect(function (err, data)
        p("server read", {err=err,data=data})
        if data then
          assert(uv.write(client, data, expect(function()
            uv.shutdown(client, function() end)
            _, err = uv.tcp_close_reset(client)
            assert(err:find('^EINVAL'))
          end)))
        else
          uv.close(client)
          uv.close(server)
        end
      end, 2)))
    end)))

    local address = uv.tcp_getsockname(server)
    p{server=server,address=address}

    local socket = assert(uv.new_tcp())
    assert(uv.tcp_connect(socket, "127.0.0.1", address.port, expect(function ()
      assert(uv.read_start(socket, expect(function (err, data)
        p("client read", {err=err,data=data})
        assert(not err, err)
        uv.close(socket)
      end)))
      local req = assert(uv.write(socket, "Hello", function (err)
        p("client onwrite", socket, err)
        assert(not err, err)
      end))
      p{socket=socket,req=req}
    end)))
  end, "1.32.0")

  test("socketpair ping pong", function(print, p, expect, uv)
    local PING = "PING\n"
    local PONG = "PONG\n"
    local NUM_PINGS = 4

    local fds = assert(uv.socketpair("stream", 0, {nonblock=true}, {nonblock=true}))

    local pinger = uv.new_tcp()
    pinger:open(fds[2])

    local ponger = uv.new_tcp()
    ponger:open(fds[1])

    local ping = function()
      assert(pinger:write(PING, expect(function(err)
        assert(not err, err)
      end)))
    end

    local pongs = 0
    ping()

    assert(pinger:read_start(function(err, chunk)
      assert(not err, err)
      if chunk == nil then
        return
      end
      assert(chunk == PONG)
      pongs = pongs + 1
      if pongs == NUM_PINGS then
        ponger:close()
        pinger:close()
      else
        ping()
      end
    end))

    assert(ponger:read_start(function(err, chunk)
      assert(not err, err)
      if chunk == nil then
        return
      end
      assert(chunk == PING)
      ponger:write(PONG, expect(function(err)
        assert(not err, err)
      end))
    end))
  end, "1.41.0")
end)


text:
RSA director to leave in June
Caitlin Morrison
He has been at RSA for 25 years, working in a number of commercial roles at the provider's offices in Aberdeen, Glasgow, Manchester and London.
Mr Sime said: "I started at RSA when I was only 17, so while it's been a tough decision to make, I think the time is right for me to see what other opportunities are out there.
"I've really enjoyed my time here and wish all my colleagues luck in the future."
Dan Wilkinson, RSA UK & Western Europe mid-market director, commented: "Chris has been a key