text:
Volcker Rule
With Friedberg Direct, education isn't an additional expense: it is part of your investment.
Friedberg Direct offers its clients a variety of tools and resources to help them become more educated and sophisticated traders.
The relationship between Friedberg Direct and FXCM was formed with the purpose to allow Canadian residents access to FXCM's suite of products.
Friedberg Direct
About Friedberg Direct
What Is The Volcker Rule?
The Volcker Rule prohibits American commercial banks and foreign banks that do business in the U.S. from trading for their own account. More specifically, it prevents them from owning or investing in hedge or private equity funds.
Banks are permitted to trade when it's necessary to run their business, such as to offset foreign currency or interest rate risk. They are also allowed to make trades for their customers.[1]
Banks may also trade in U.S. government obligations, including U.S. Treasury bonds and government-backed securities issued by Fannie Mae, Freddie Mac, Ginnie Mae and other government agencies.[2]
The Volcker Rule comprises Section 619 of the Dodd-Frank Wall Street Reform and Consumer Protection Act, which became law in 2010 in the wake of the global financial crisis. However, the U.S. federal agencies responsible for overseeing it did not implement the rule until 10 December 2013, and the rule became effective on 1 April 2014.[3]
Banks have been required to comply with the rule since 21 July 2015.
Who Is Volcker?
The rule was proposed by Paul Volcker, who was chairman of the Board of Governors of the U.S. Federal Reserve System from 1979 until 1987. He was originally appointed by President Carter and then reappointed by President Reagan. Prior to that he was president of the Federal Reserve Bank of New York.[4] Volcker proposed the rule while he chaired President Obama's 2009-11 economic advisory panel.
Five federal agencies are responsible for implementing and overseeing the rule: The Fed, the Securities and Exchange Commission, the Commodities Futures Trading Commission, the Federal Deposit and Insurance Corporation, and the Office of the Comptroller of the Currency.
Bank CEOs must personally verify in writing that they are complying with the rule. Also, every bank employee is legally and personally liable if they aren't in compliance.[1]
Why Is The Rule Necessary?
The Volcker Rule was designed to prevent another financial crisis. Many people believe that one of the causes of the crisis was the partial repeal of the Glass-Steagall Act, the 1933 law that was passed during the Great Depression and separated commercial and investment banking. Glass-Steagall was partially repealed by the Gramm-Leach-Bliley Act in 1999 and allowed commercial banks to own investment banks. Investment banking is generally considered to be riskier, although often more profitable, than commercial banking, which largely consists of taking deposits and making loans.[5]
The Volcker Rule was seen as a way to make banks safer by preventing them from placing investment bets, especially with depositors' money that is insured by the FDIC and ultimately backed by taxpayers. Not surprisingly, many banks oppose the rule because it restricts them from engaging in what are often more profitable activities. That's why it took five years between the enactment of Dodd-Frank and the implementation of the Volcker Rule, as the banking industry lobbied hard to prevent its enactment or to at least make it less restrictive.[1]
There are currently moves being made to loosen some of the restrictions in the Volcker Rule and to make it less complicated. The rule runs to more than 1,000 pages.
A Senate bill sponsored by Sen. Mike Crapo, R-Idaho, the chairman of the Senate Banking Committee, would roll back several aspects of the Dodd-Frank law, including exempting from the Volcker Rule banks with less than US$10 billion in assets.[6] That's in line with a 2017 recommendation by Treasury Secretary Steve Mnuchin.[1]
Other recommendations would make it clearer what activities banks could legally engage in, exempt some foreign banks from parts of the rule, and appoint a single lead regulator to oversee enforcement of the rule.[6]
Separately, Randal Quarles, the Fed's Vice Chairman for Supervision, said the Fed is looking at "broad revisions" to the rule to make it less complicated.
"I believe the regulation implementing the Volcker Rule is an example of a complex regulation that is not working well," he said in a speech to an international bankers' conference in March 2018. "We would like Volcker Rule compliance to be similar to compliance in other areas of our supervisory regime."[7]
The Volcker Rule is part of the Dodd-Frank Wall Street Reform and Consumer Protection Act, which was passed in 2010 in the wake of the global financial crisis. The rule prohibits banks from trading for their own account with their own or depositors' money. The rule was proposed by Paul Volcker, the former chair of the U.S. Federal Reserve Board who later chaired President Obama's 2009-11 economic advisory panel.
The rule has been criticised by the banking industry, which believes it is overly restrictive and too complicated. As of April 2018, the Fed, Congress and Trump Administration were working together to amend the rule to make it less onerous.
How Will A COVID-19 Vaccine Impact The Markets?
Trading The 2020 U.S. Election
How Would A Joe Biden Victory Impact The Markets?
Australian COVID-19 Stimulus Package And Government Response
Please SelectCanada----------AfghanistanAlbaniaAlgeriaAmerican SamoaAndorraAngolaAnguillaAntigua & BarbudaArgentinaArmeniaArubaAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBermudaBhutanBoliviaBosnia & HerzegovinaBotswanaBrazilBritish Virgin IslandsBruneiBulgariaBurkina FasoBurundiCambodiaCameroonCanadaCape VerdeCaribbean NetherlandsCayman IslandsCentral African RepublicChadChileChinaColombiaComorosCongo - BrazzavilleCosta RicaCôte d'IvoireCroatiaCubaCuraçaoCyprusCzechiaDenmarkDjiboutiDominicaDominican RepublicEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaEswatiniEthiopiaFalkland IslandsFaroe IslandsFijiFinlandFranceGabonGambiaGeorgiaGermanyGhanaGibraltarGreeceGreenlandGrenadaGuamGuatemalaGuernsey, Channel IslandsGuineaGuinea-BissauGuyanaHaitiHondurasHong Kong SAR ChinaHungaryIcelandIndiaIndonesiaIranIraqIrelandIsle of ManIsraelItalyJamaicaJapanJersey, Channel IslandsJordanKazakhstanKenyaKiribatiKosovoKuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacao SAR ChinaMadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMauritaniaMauritiusMexicoMicronesiaMoldovaMonacoMongoliaMontenegroMontserratMoroccoMozambiqueMyanmar (Burma)NamibiaNauruNepalNetherlandsNew ZealandNicaraguaNigerNigeriaNorth KoreaNorwayOmanPakistanPalauPalestinian TerritoriesPanamaPapua New GuineaParaguayPeruPhilippinesPolandPortugalPuerto RicoQatarRepublic of North MacedoniaRomaniaRussiaRwandaSamoaSan MarinoSão Tomé & PríncipeSaudi ArabiaSenegalSerbiaSeychellesSierra LeoneSingaporeSlovakiaSloveniaSolomon IslandsSomaliaSouth AfricaSouth KoreaSpainSri LankaSt HelenaSt Kitts & NevisSt LuciaSt MartinSt Vincent & GrenadinesSudanSurinameSwedenSwitzerlandSyriaTaiwanTajikistanTanzaniaThailandTimor-LesteTogoTongaTrinidad & TobagoTunisiaTurkeyTurkmenistanTurks & Caicos IslandsTuvaluUgandaUkraineUnited Arab EmiratesUnited KingdomUnited StatesUruguayUS Virgin IslandsUzbekistanVanuatuVenezuelaVietnamYemenZambiaZimbabwe Country *
Please SelectUSDCAD Select Currency *
I consent to receive educational trading material and information about Friedberg Direct's products and services.
You can opt-out at any time. Network charges may apply. Friedberg Direct will use data collected for the purposes of providing service, contacting, and sending you important information. To find out more, please visit our Privacy Policy.
There was a problem submitting the form. Please try again later or contact info@fxcm.ca. We apologize for the inconvenience.
Retrieved 07 Mar 2018 https://www.thebalance.com/volcker-rule-summary-3305905
Retrieved 07 Mar 2018 https://www.nerdwallet.com/blog/banking/volcker-rule-explained/#definition/
Retrieved 07 Mar 2018 https://www.federalreserve.gov/supervisionreg/srletters/sr1705.htm
Retrieved 07 Mar 2018 https://www.federalreservehistory.org/people/paul-a-volcker
Retrieved 07 Mar 2018 https://www.cato.org/publications/policy-analysis/repeal-glass-steagall-act-myth-reality
Retrieved 07 Mar 2018 https://www.cnbc.com/2018/02/28/us-regulators-examine-wall-streets-volcker-rule-wish-list-sources.html
Retrieved 07 Mar 2018 https://www.wsj.com/articles/fed-considering-broad-revisions-to-volcker-rule-compliance-1520274626/
Any opinions, news, research, analyses, prices, other information, or links to third-party sites contained on this website are provided on an "as-is" basis, as general market commentary and do not constitute investment advice. The market commentary has not been prepared in accordance with legal requirements designed to promote the independence of investment research, and it is therefore not subject to any prohibition on dealing ahead of dissemination. Although this commentary is not produced by an independent source, Friedberg Direct, FXCM or its affiliates takes all sufficient steps to eliminate or prevent any conflicts of interests arising out of the production and dissemination of this communication. The employees of Friedberg Direct and FXCM commit to acting in the clients' best interests and represent their views without misleading, deceiving, or otherwise impairing the clients' ability to make informed investment decisions. For more information about the Friedberg Direct's internal organizational and administrative arrangements for the prevention of conflicts, please refer to the Firms' Managing Conflicts Policy. Please ensure that you read and understand our Full Disclaimer and Liability provision concerning the foregoing Information, which can be accessed here.**
Order Execution Only
Regulatory Documents:
IIROC Brochure: How Can I Get My Money Back, How IIROC Protects Investors, IIROC Complaints Brochure, CIPF Brochure, CIPF Coverage Policy
The relationship between Friedberg Direct and FXCM was formed with the purpose to allow Canadian residents access to FXCM's suite of products, while maintaining their accounts with a regulated Canadian firm. All accounts are opened by and held with Friedberg Direct, a division of Friedberg Mercantile Group Ltd., a member of the Investment Industry Regulatory Organization of Canada (IIROC). Friedberg customer accounts are protected by the Canadian Investor Protection Fund within specified limits. A brochure describing the nature and limits of coverage is available upon request or at www.cipf.ca.
Friedberg Direct Policies
Traits of Successful Traders
Chat with a Service AgentChat Offline
High Risk Investment Warning: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss in excess of your deposit and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Please read our full risk warning.
Friedberg Direct is a division of Friedberg Mercantile Group Ltd. , a member of the Investment Industry Regulatory Organization of Canada (IIROC), the Canadian Investor Protection Fund (CIPF), and all Canadian Exchanges. Friedberg Mercantile Group Ltd. is headquartered at Friedberg Direct, 181 Bay St., Suite 250, Toronto, ON M5J 2T3, Canada.
Accounts are opened with and are held by Friedberg Direct which clears trades through a subsidiary within the FXCM group of companies (collectively, the "FXCM Group"). Customers of Friedberg Direct may, in part, be serviced through subsidiaries within the FXCM Group. The FXCM Group does not own or control any part of Friedberg Direct and is headquartered at 20 Gresham Street, 4th Floor, London EC2V 7JE, United Kingdom.
Please note the information on this website is primarily intended for retail customers.
Trading Execution Risks
181 Bay St., Suite 250, Toronto, ON M5J 2T3, Canada
Please note you are now leaving the main Friedberg Direct website and you are about to be redirected to https://www.fxcmapps.com/ ("FXCM Apps Store")
Friedberg Mercantile Group Ltd. ("Friedberg Direct") is an independent legal entity and does not own, control or operate the FXCM APPS store. Therefore, Friedberg Direct does NOT endorse or make any warranties regarding any product or service offered on the FXCM Apps Store, nor has reviewed or verified any information that might be presented and/or described on the FXCM Apps Store. The link is provided for your convenience only.
Please note you are now leaving the main Friedberg Direct website and you are about to be redirected to a third-party website.
Friedberg Mercantile Group Ltd. ("Friedberg Direct") is an independent legal entity and does not own, control or operate this third-party website. Therefore, Friedberg Direct does NOT endorse or make any warranties regarding any product or service offered on the website of the third-party, nor has reviewed or verified any information that might be presented and/or described on it. The link is provided for your convenience only.


text:
Sahā or more formally the Sahā world (Sanskrit: sahāloka or sahālokadhātu) in Mahāyāna Buddhism refers to the mundane world, essentially the sum of existence that is other than nirvana.

It is the entirety of conditioned phenomena, also referred to as the trichiliocosm.
As a term, its usage is comparable to the Earth (pṛthivī) or as the place where all beings are subject to the cycle of birth and death (saṃsāra). It is the place where both good and evil manifests and where beings must exercise patience and endurance (kṣānti). It is also described as the place where Śākyamuni Buddha teaches the Dharma.

The Sahā world is divided into three distinct realms or worlds (traidhātuka or trailokya).

Its ruler is Mahābrahmā Sahāmpati.

Etymology
Sahā is a Sanskrit term meaning "together" or "enduring."

Chinese texts sometimes translate the term as 忍土 (pinyin: Rěntǔ), literally "land of endurance."

Composition

Realm of Desire

The desire realm (kāmadhātu) is where all sentient beings consist of a physical body and are susceptible to the experience of sense faculties. These beings are generally composed of 18 elements (dhātu), that include the sense bases and their respective modes of consciousness.

In Buddhist cosmology, the desire realm is often described as being composed of four continents (cāturdvīpaka) which surround Mount Sumeru, which itself is surrounded by oceans and mountain ranges. The four continents are
Jambudvīpa in the South
Pūrvavideha in the East
Uttarakuru in the North
Avaragodānīya in the West

Realm of Form

Realm of Non-Form

As a Pure Land
The Vimalakirti Sutra further elaborates on the nature of the Sahā world. It is treated as a pure land of its own, under the jurisdiction of Śākyamuni Buddha. It has ten features distinct from other pure lands:
The poor are attracted by charity
The transgressors are attracted by pure precepts
The angry are attracted by forbearance
The lazy are attracted by exertion
The perturbed are attracted by meditation
The foolish are attracted by wisdom
Those who experience the eight difficulties are saved by explanation of how to eliminate difficulties
Those who take pleasure in the Hinayana are saved by the teaching of the Mahayana
Those without merit may be saved by the various good roots
The liberation of sentient beings is constantly being accomplished by means of the four attractions

See also
Buddhist cosmology
Trailokya
Saṃsāra (Buddhism)
Sahā Triad

References

Buddhist cosmology
Pure lands
Mahayana
Buddhist philosophical concepts

redpajama_set_name: RedPajamaWikipedia


Binance will start its second "Community Coin of the Month" program. The community coin that receives the most votes will earn the place to list on Binance exchange for free.
If you wish to nominate your coin for this round of voting, please send your request to communitycoin@binance.com. If you are not a core team member of the coin, please kindly ask one of their core team to make the request.
Please fill in the Community Coin Application form. We will have a strict screening process. If your coin is not selected for this month, feel free to apply again in the next round..
Application deadline: 2017/09/30 4:00 AM (UTC).
Voting time: From 2017/9/30/ 4:00 PM (UTC) to 2017/10/05 10:00 AM (UTC).
Each registered user can cast multiple votes (maximum one vote per candidate coin) and needs to pay 0.1 BNB per vote.
Upon completion of the voting process, Binance will list the coin on our exchange within a reasonable time frame. Depending on market response, we will try to conduct this event monthly. Binance reserves all rights to change the rules of this event without notification, including the revoking of results suspected of vote manipulation.


text:
"South Baseball - The Spirit of Winning" to Screen at Grunin Center
(TOMS RIVER, NJ) -- The documentary film South Baseball – The Spirit of Winning will premiere on Sunday, April 8 at 2:00pm at the Grunin Center for the Arts in Toms River. This is the first film to tell the story of legendary Toms River High School South Head Baseball Coach Ken Frank. Tickets are $5 and include a free reception following screening (refreshments provided by Jersey Mike's Toms River and Perlmutter Family ShopRites).
Coach Frank not only is New Jersey's winningest high school baseball coach, (ranked 15th nationally) he also is a dedicated mentor who has had a profound impact on the lives of countless players during the past 40+ years. The 2017 season was another winner, with the team clinching the Class A South title.
Twenty years after a 1998 Toms River team became Little League World Series Champions, the one-hour film highlights this area's passion for baseball. The film traces Todd Frazier's story – from starring on that Little League team, through successful seasons at High School South, Rutgers University, and as third baseman for the New York Yankees – and shows how this hometown hero serves as an inspiration to young players.
The film depicts former South Baseball players, many of whom regularly attend spirited games in Ken Frank Baseball Stadium, proudly watching their sons follow in their footsteps. It also includes interviews with sports insiders who share entertaining stories that gave rise to the legend of Coach Frank and Indians baseball. Interest in the film will extend beyond sports fans at the Jersey Shore, as the documentary shows how tough love can help young people win in sports and in life.
Veteran television journalist Sandra Levine, a Toms River native and South alumna who has been nominated 10 times for regional Emmy Awards, produced the film. In 2014 her poignant, one-hour documentary about Superstorm Sandy, Heartbreak & Healing After Sandy, premiered at the Grunin Center, and aired on public television stations (PBS) throughout New Jersey and in parts of the surrounding states.
Refreshments immediately after the screening provided by Jersey Mike's Toms River & Perlmutter Family ShopRites.
Tickets are available online at grunincenter.org, call 732-255-0500, or visit the Grunin Center Box Office, Monday to Friday, 10:00am to 5:00pm.
The screening takes place on the Main Stage, Grunin Center for the Arts, Ocean County College Main Campus, College Drive, Toms River, NJ. Please use Parking Lot #2.
WBGO Receives New Jersey State Council on the Arts CARES Grant
Paterson Music Project Presents MLK Celebration Virtual Concert On January 16
The Sundance ASCAP Music Cafe To Be Presented Virtually Jan 20 to Feb 1
New York Antiques Show To Be Presented Online January 29-31
Year-long WXPN Project Will Explore "Kanaval: Haitian Rhythms and The Music Of New Orleans"

redpajama_set_name: RedPajamaCommonCrawl


If you have even just a vague interest in iPhoneography or iPhone Video then you will undoubtedly have heard of the Olloclip – a clever 3-in-1 lens system that features a Wide Angle Lens, Macro lens and Fisheye lens. I wrote about it previously when I discovered that it could be used with the Fostex AR4i.
Sorry about the product shot from their website but there are no PR shots online as yet.


It seems that all these pieces are about to speak to me. I sat there mesmerized after downloading a lot of images of her work. Designer, ceramist grande old dame Eva Zeisel's work needs no introduction or great words. They just speak for themselves.
100 year old Eva Zeisel's more than 75 years of extraordinary work is so alive that it just pushes us to sit up and think about our own life.
"All my work is mother-and-child."- Eva Zeisel.
Her functional objects bend, stretch, reach. They recall birds, leaves, pregnant bodies, belly buttons and fruit with a pared-down elegance.
Her exuberant designs (above-belly button room dividers) show her playfulness.
Just a little curve that is perfect and never a wrong curve, that is what her designs is all about.
She is called an industrial (machine age modern) designer and her creations show 'friendliness', 'family relations'.
I keep wondering about her spirits and I keep saluting this unstoppable lady's works!
actually good and the viewers are in fact sharing pleasant thoughts.
around the web. Disgrace on the search engines for no longer positioning this post higher!
I do always give the name of the source I had taken image from. In this case too if you check I have already credited your web site albeit differently – under- "A few site to see her work"- pl click on (1).
Any way I am giving specific credit as you pointed out-right away.
Thank you very much for the visit and great info! I will be checking out her new product/s, I am sure these must be fantastic!
If you love Eva's old work you will absolutely love her most recent product releases through Eva Zeisel Originals. The set of four brass candlesticks with bronze finish are currently on pre-order and are going fast!!!
You are welcome vineeta! Yes, she is superb!
Superb! just recently another bloggers wrote about her- so i now knw. but thanx for the pictures- more the merrier. 100 and creating incredible beauty – thanx for the links!
You are right…her work is fanatistic!


text:
Yukon Government
Top / Regional / North America / Canada / Yukon / Government
Contains an overview of the department plus information on community development, consumer and protective services, news, resources and contacts.
Gives an overview of education in Yukon including information on branches, programs, services, legislation, education policies and contacts.
Department of Energy Mines and Resources
Offers news, information and resources including sections on agriculture, energy, forestry and mining.
Finance department provides details of services, publications, taxes, budgets, news releases, programs, branches and FAQs.
Department of Highways and Public Works
Department news and information including report downloads.
Justice department provides details of legislation, programs and services, publications, branches, resources, organizational structure and the justice system.
Department of Tourism and Culture
Describes the role of the department including information on programs, branches, policies and guidelines, visitor information, centres and tourism resources.
Elections Yukon
Provides details of the electoral commission, district boundaries, general elections, campaign financing, elections, publications and contacts.
French Language Services Directorate
Central agency assisting the government departments and agencies to serve the French speaking public provides details of role, responsibilities, services and events.
The official site. Gives the services, online forms, and services for residents and business.
Central agency providing human resource advice and support services. Includes information on programs, services, the Public Service Commissioner, publications and responsibilities.
Teslin Tlingit Council
Presents details of programs and services, land and heritage, news, events, governance, elders council and administration.
Yukon Economic Development
Features an overview of the department including information on services for business and a directory.
Yukon Energy Corporation
Energy corporation provides details of energy services and facilities, customer centre, environment, health and safety, news, notices, downloads and resources.
Yukon Executive Council Office
Council information including details of governance and capacity, intergovernmental relations, branches, audit services, land claims and self government, science advisor and statistics.
Yukon Health and Social Services
Presents details of programs, services, publication and resources plus an overview of the departments, news and a section for health professionals.
Yukon Housing Corporation
Housing corporation provides details of responsibilities, programs and services, publications, tenders, community housing, offices, legislation, forms and resources.
Yukon Liquor Corporation
Offers an overview of the corporation including details of licences and permits, news releases, publications, retail sales, social responsibility, liquor board and resources.
Yukon Women's Directorate
Supplies an overview of the department including information on policy and research, public education, funding, women's issues, initiatives and groups.
Yukon Workers Compensation Health and Safety Board
Presents information for workers and employers including sections on workplace safety, forms and reports, acts, policies and registration.
Regional: North America: Canada: Government
Search For Yukon Government on:


Awning ~ Race Trailer Awnings Image Ideas Awning Dometic Patio Metal Weathershield Rv For Sale Craigslist By 51 Race Trailer Awnings Image Ideas. Rv Power Awnings. Retractable Race Trailer Awnings For Sale By Owner. Motorsports Trailer Awnings For Sale By Owner.


A third-grade teacher in Boston donated $150,000 to her school after winning an online contest.
Nicole Bollerman, a 26-year-old teacher in Dorchester, won the prize money from a Capital One #WishForOthers contest that also gifted three books for each of her students.
Bollerman teaches third grade at the UP Academy Dorchester, a charter school that opened just last year. In that year, the school has seen a successful turnaround in the achievement of its 700 students. The once-failing school saw MCAS scores in math and English rise by the highest percentage of any school in the state's history, reports Fred Bever for WBUR.
"I'm a third-grade teacher in a low-income, high-risk elementary school in Boston, MA. My #wishforothers is that my voracious, adorable, hardworking, loving scholars all leave for their December break with a book in their hand," wrote Bollerman in her winning entry, according to the school's website.
Bollerman has been working with school officials to ensure her gift goes to benefit all students at the school, including increased computer access and coding classes, which she says will "improve the lives of the children," adding that she would like to see a greenhouse built on the roof of the school. No commitments have been made yet concerning how to spend the money.
Capital One allowed Bollerman to choose three books for her students. In the end, she chose "Diary of a Wimpy Kid: The Long Haul," a class favorite, "My Father's Dragon," which was one her favorite chapter books as a child, and "Where the Wild Things Are," so her students could have a picture book to share with their brothers and sisters.
Bollerman and her mother bought each child not in her class the three books as well so that all third-graders could have books to read over the December break.


text:
Mourinho Surprised Everyone By Doing This At The POTY Awards
By BF Staff | May 2, 2018 | 0
Reuters/Jason Cairnduff
Jose Mourinho seems to have gone for a taste of variety recently, as he made up his own Player of the Year award and handed it to a player of his choice.
It's not something which exists beyond the Under-16 Sunday leagues, however, the Portuguese tactician has taken the initiative to encourage the players who were overshadowed by skilful figures.
Displaying a marvellous campaign between the posts, David de Gea yet again secured Manchester United's Player of the Year title.
But the Mancunian gaffer named Scott McTominay his own Player of the Year, presenting the youngster with a trophy.
WATCH: Players Reaction To Real Madrid vs Bayern Munich 2-2
Mourinho has played the youngster on 20 occasions this term, which shows the faith he has installed in the central midfielder.
Gary Neville Wants This Manager To Be Jose Mourinho's Successor
Accordingly, the 21-year-old, who is now a Scotland international, was picked at the unexpected award ceremony at Tuesday's event.
Undoubtedly, the incident has attracted quite a lot of reactions on social media, with supporters flooding Twitter with their responses.
Looks like José has decided there should now be a manager's player of the year gong at the Mufc POTY of the year awards. This year he's chosen Scott McTominay
— Paul Hirst (@hirstclass) May 1, 2018
And here is Jose presenting @McTominay10 with his surprise award! #MUFCPOTY pic.twitter.com/dbTXhvl9ne
— Manchester United (@ManUtd) May 1, 2018
The boss' recognition would occur as a great deal of encouragement to the young player, and would certainly have an impact on his performances in the future. The award should also supply him with enough confidence to present his undying fidelity to the Mancunian club.
← English Side Submits €100m Bid For Real Madrid YoungsterChelsea Preparing A £45m Move For Toby Alderweireld →


text:
This 1,000HP Dodge Challenger Was Stolen and Crashed Before Still Making It To SEMA
by Steven Douglas November 8, 2019, 2:56 pm
When reading through the endless lists of high-powered, expensive, and perfectly engineered cars that are being shown at SEMA, you don't think of the security risk that these cars pose. With some of these build being priceless, it's no surprise that one of them was stolen.
This 1000hp Dodge Challenger Scat Pack, built for SEMA by the Quintin Brothers Auto and Performance, was stolen last week from a casino's overflow carpark according to local media. Four hours after it was stolen, the police tracked it down, but the driver rammed it into a police car and quickly got away.
The car was later crashed through a fence and onto a nearby kart track in the middle of an event before being abandoned and recovered. The driver was later arrested on the 5th November after shooting someone outside a grocery store. The victim was hospitalised with non-life-threatening injuries.
The car was hoever released from evidence and eventually made it to SEMA on time where it was covered in police tape and the story told to thousands of onlookers where it was voted the Number 1 best car at SEMA by FOX Sports.
Alfa Romeo Cancels The 4C and Plans For A New GTV Coupe And 8C In Favour Of SUVs
GM's UAW Strike Will Delay Chevrolet Corvette C8 Deliveries


text:
package net.floodlightcontroller.core.internal;

import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import net.floodlightcontroller.core.FloodlightContext;
import net.floodlightcontroller.core.IFloodlightProviderService;
import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.core.SwitchDriverSubHandshakeAlreadyStarted;
import net.floodlightcontroller.core.SwitchDriverSubHandshakeCompleted;
import net.floodlightcontroller.core.SwitchDriverSubHandshakeNotStarted;
import net.floodlightcontroller.core.IOFSwitch.PortChangeEvent;
import net.floodlightcontroller.core.IOFSwitch.PortChangeType;
import net.floodlightcontroller.core.ImmutablePort;
import net.floodlightcontroller.core.OFSwitchBase;
import net.floodlightcontroller.debugcounter.DebugCounter;
import net.floodlightcontroller.debugcounter.IDebugCounterService;
import net.floodlightcontroller.packet.ARP;
import net.floodlightcontroller.packet.Ethernet;
import net.floodlightcontroller.packet.IPacket;
import net.floodlightcontroller.packet.IPv4;

import org.junit.Before;
import org.junit.Test;
import org.openflow.protocol.OFFlowMod;
import org.openflow.protocol.OFMatch;
import org.openflow.protocol.OFMessage;
import org.openflow.protocol.OFPacketIn;
import org.openflow.protocol.OFPortStatus;
import org.openflow.protocol.OFType;
import org.openflow.protocol.OFPacketIn.OFPacketInReason;
import org.openflow.protocol.OFPhysicalPort.OFPortConfig;
import org.openflow.protocol.OFPhysicalPort.OFPortFeatures;
import org.openflow.protocol.OFPortStatus.OFPortReason;
import org.openflow.protocol.factory.FloodlightFactory;
import org.openflow.protocol.statistics.OFDescriptionStatistics;
import org.openflow.util.HexString;

public class OFSwitchBaseTest {
    private static final String srcMac = "00:44:33:22:11:00";
    IFloodlightProviderService floodlightProvider;
    Map<Long, IOFSwitch> switches;
    private OFMessage blockMessage;
    private OFPacketIn pi;
    private IPacket testPacket;
    private byte[] testPacketSerialized;

    private class OFSwitchTest extends OFSwitchBase {
        public OFSwitchTest(IFloodlightProviderService fp) {
            super();
            stringId = "whatever";
            datapathId = 1L;
            floodlightProvider = fp;
        }

        @Override
        public void setSwitchProperties(OFDescriptionStatistics description) {
            // TODO Auto-generated method stub
        }

        @Override
        public OFPortType getPortType(int port_num) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public boolean isFastPort(int port_num) {
            // TODO Auto-generated method stub
            return false;
        }

        @Override
        public void write(OFMessage msg, FloodlightContext cntx) {
            blockMessage = msg;
        }

        public void setThresholds(int high, int low, int host, int port) {
            sw.setInputThrottleThresholds(high, low, host, port);
        }

        public boolean inputThrottleEnabled() {
            return packetInThrottleEnabled;
        }

        @Override
        public String toString() {
            return "OFSwitchTest";
        }
    }
    private OFSwitchTest sw;
    private ImmutablePort p1a;
    private ImmutablePort p1b;
    private ImmutablePort p2a;
    private ImmutablePort p2b;
    private ImmutablePort p3;
    private final ImmutablePort portFoo1 = ImmutablePort.create("foo", (int)11);
    private final ImmutablePort portFoo2 = ImmutablePort.create("foo", (int)12);
    private final ImmutablePort portBar1 = ImmutablePort.create("bar", (int)11);
    private final ImmutablePort portBar2 = ImmutablePort.create("bar", (int)12);
    private final PortChangeEvent portFoo1Add =
            new PortChangeEvent(portFoo1, PortChangeType.ADD);
    private final PortChangeEvent portFoo2Add =
            new PortChangeEvent(portFoo2, PortChangeType.ADD);
    private final PortChangeEvent portBar1Add =
            new PortChangeEvent(portBar1, PortChangeType.ADD);
    private final PortChangeEvent portBar2Add =
            new PortChangeEvent(portBar2, PortChangeType.ADD);
    private final PortChangeEvent portFoo1Del =
            new PortChangeEvent(portFoo1, PortChangeType.DELETE);
    private final PortChangeEvent portFoo2Del =
            new PortChangeEvent(portFoo2, PortChangeType.DELETE);
    private final PortChangeEvent portBar1Del =
            new PortChangeEvent(portBar1, PortChangeType.DELETE);
    private final PortChangeEvent portBar2Del =
            new PortChangeEvent(portBar2, PortChangeType.DELETE);

    @Before
    public void setUp() throws Exception {
        blockMessage = null;
        // Build our test packet
        testPacket = new Ethernet()
        .setSourceMACAddress(srcMac)
        .setDestinationMACAddress("00:11:22:33:44:55")
        .setEtherType(Ethernet.TYPE_ARP)
        .setPayload(
                new ARP()
                .setHardwareType(ARP.HW_TYPE_ETHERNET)
                .setProtocolType(ARP.PROTO_TYPE_IP)
                .setHardwareAddressLength((byte) 6)
                .setProtocolAddressLength((byte) 4)
                .setOpCode(ARP.OP_REPLY)
                .setSenderHardwareAddress(Ethernet.toMACAddress("00:44:33:22:11:00"))
                .setSenderProtocolAddress(IPv4.toIPv4AddressBytes("192.168.1.1"))
                .setTargetHardwareAddress(Ethernet.toMACAddress("00:11:22:33:44:55"))
                .setTargetProtocolAddress(IPv4.toIPv4AddressBytes("192.168.1.2")));
        testPacketSerialized = testPacket.serialize();

        pi = ((OFPacketIn) FloodlightFactory.getInstance().getMessage(OFType.PACKET_IN))
                .setBufferId(-1)
                .setMatch(new OFMatch().setInPort(1))
                .setPacketData(testPacketSerialized)
                .setReason(OFPacketInReason.NO_MATCH)
                .setTotalLength((short) testPacketSerialized.length);
        floodlightProvider = createMock(IFloodlightProviderService.class);
        sw = new OFSwitchTest(floodlightProvider);
        IDebugCounterService debugCounter = new DebugCounter();
        sw.setDebugCounterService(debugCounter);
        switches = new ConcurrentHashMap<Long, IOFSwitch>();
        switches.put(sw.getId(), sw);
        expect(floodlightProvider.getSwitch(sw.getId())).andReturn(sw).anyTimes();
        expect(floodlightProvider.getOFMessageFactory())
                .andReturn(FloodlightFactory.getInstance()).anyTimes();
    }

    @Before
    public void setUpPorts() {
        ImmutablePort.Builder bld = new ImmutablePort.Builder();
        // p1a is disabled
        p1a = bld.setName("port1")
                 .setPortNumber((int)1)
                 .setPortStateLinkDown(true)
                 .build();
        assertFalse("Sanity check portEnabled", p1a.isEnabled());

        // p1b is enabled
        // p1b has different feature from p1a
        p1b = bld.addCurrentFeature(OFPortFeatures.OFPPF_1GB_FD)
                 .setPortStateLinkDown(false)
                 .build();
        assertTrue("Sanity check portEnabled", p1b.isEnabled());

        // p2 is disabled
        // p2 has mixed case
        bld = new ImmutablePort.Builder();
        p2a = bld.setName("Port2")
                .setPortNumber((int)2)
                .setPortStateLinkDown(false)
                .addConfig(OFPortConfig.OFPPC_PORT_DOWN)
                .build();
        // p2b only differs in PortFeatures
        p2b = bld.addCurrentFeature(OFPortFeatures.OFPPF_100MB_HD)
                 .build();
        assertFalse("Sanity check portEnabled", p2a.isEnabled());
        // p3 is enabled
        // p3 has mixed case
        bld = new ImmutablePort.Builder();
        p3 = bld.setName("porT3")
                .setPortNumber((int)3)
                .setPortStateLinkDown(false)
                .build();
        assertTrue("Sanity check portEnabled", p3.isEnabled());

    }

    /**
     * By default, high threshold is infinite
     */
    @Test
    public void testNoPacketInThrottle() {
        replay(floodlightProvider);
        /* disable input throttle */
        sw.setThresholds(Integer.MAX_VALUE, 1, 0, 0);
        for (int i = 0; i < 200; i++) {
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(blockMessage == null);
        assertFalse(sw.inputThrottleEnabled());
    }

    /**
     * The test sends packet in at infinite rate (< 1ms),
     * so throttling should be enabled on 100th packet, when the first
     * rate measurement is done.
     */
    @Test
    public void testPacketInStartThrottle() {
        floodlightProvider.addSwitchEvent(anyLong(),
                (String)anyObject(), anyBoolean());
        replay(floodlightProvider);

        int high = 500;
        sw.setThresholds(high, 10, 50, 200);
        // We measure time lapse every 1000 packets
        for (int i = 0; i < 1000; i++) {
            assertFalse(sw.inputThrottleEnabled());
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(sw.inputThrottleEnabled());
        assertTrue(sw.inputThrottled(pi));
        assertTrue(sw.inputThrottled(pi));
        assertTrue(blockMessage == null);
    }

    /**
     * With throttling enabled, raise the low water mark threshold,
     * verify throttling stops.
     * @throws InterruptedException
     */
    @Test
    public void testPacketInStopThrottle() throws InterruptedException {
        floodlightProvider.addSwitchEvent(anyLong(),
                (String)anyObject(), anyBoolean());
        expectLastCall().times(2);
        replay(floodlightProvider);

        sw.setThresholds(100, 10, 50, 200);
        // First, enable throttling
        for (int i = 0; i < 1000; i++) {
            assertFalse(sw.inputThrottleEnabled());
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(sw.inputThrottleEnabled());

        sw.setThresholds(Integer.MAX_VALUE, 100000, 50, 200);
        for (int i = 0; i < 999; i++) {
            assertTrue(sw.inputThrottled(pi));
            assertTrue(sw.inputThrottleEnabled());
        }
        // Sleep for 2 msec, next packet should disable throttling
        Thread.sleep(2);
        assertFalse(sw.inputThrottled(pi));
        assertFalse(sw.inputThrottleEnabled());
   }

    /**
     * With throttling enabled, if rate of unique flows from a host
     * exceeds set threshold, a flow mod should be emitted to block host
     */
    @Test
    public void testPacketInBlockHost() {
        floodlightProvider.addSwitchEvent(anyLong(),
                (String)anyObject(), anyBoolean());
        expectLastCall().times(2);
        replay(floodlightProvider);

        int high = 500;
        int perMac = 50;
        sw.setThresholds(high, 10, perMac, 200);
        // First, enable throttling
        for (int i = 0; i < 1000; i++) {
            assertFalse(sw.inputThrottleEnabled());
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(sw.inputThrottleEnabled());
        assertTrue(blockMessage == null);

        // Build unique flows with the same source mac
        for (int j = 0; j < perMac - 1; j++) {
            testPacketSerialized[5]++;
            pi.setPacketData(testPacketSerialized);
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(blockMessage == null);
        testPacketSerialized[5]++;
        pi.setPacketData(testPacketSerialized);
        assertFalse(sw.inputThrottled(pi));

        // Verify the message is a flowmod with a hard timeout and srcMac
        assertTrue(blockMessage != null);
        assertTrue(blockMessage instanceof OFFlowMod);
        OFFlowMod fm = (OFFlowMod) blockMessage;
        assertTrue(fm.getHardTimeout() == 5);
        OFMatch match = fm.getMatch();
        assertTrue((match.getWildcards() & OFMatch.OFPFW_DL_SRC) == 0);
        assertTrue(Arrays.equals(match.getDataLayerSource(),
                HexString.fromHexString(srcMac)));

        // Verify non-unique OFMatches are throttled
        assertTrue(sw.inputThrottled(pi));
    }

    /**
     * With throttling enabled, if rate of unique flows from a port
     * exceeds set threshold, a flow mod should be emitted to block port
     */
    @Test
    public void testPacketInBlockPort() {
        floodlightProvider.addSwitchEvent(anyLong(),
                (String)anyObject(), anyBoolean());
        expectLastCall().times(2);
        replay(floodlightProvider);

        int high = 500;
        int perPort = 200;
        sw.setThresholds(high, 10, 50, perPort);
        // First, enable throttling
        for (int i = 0; i < 1000; i++) {
            assertFalse(sw.inputThrottleEnabled());
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(sw.inputThrottleEnabled());
        assertTrue(blockMessage == null);

        // Build unique flows with different source mac
        for (int j = 0; j < perPort - 1; j++) {
            testPacketSerialized[11]++;
            pi.setPacketData(testPacketSerialized);
            assertFalse(sw.inputThrottled(pi));
        }
        assertTrue(blockMessage == null);
        testPacketSerialized[11]++;
        pi.setPacketData(testPacketSerialized);
        assertFalse(sw.inputThrottled(pi));

        // Verify the message is a flowmod with a hard timeout and per port
        assertTrue(blockMessage != null);
        assertTrue(blockMessage instanceof OFFlowMod);
        OFFlowMod fm = (OFFlowMod) blockMessage;
        assertTrue(fm.getHardTimeout() == 5);
        OFMatch match = fm.getMatch();
        assertTrue((match.getWildcards() & OFMatch.OFPFW_DL_SRC) != 0);
        assertTrue((match.getWildcards() & OFMatch.OFPFW_IN_PORT) == 0);
        assertTrue(match.getInputPort() == 1);

        // Verify non-unique OFMatches are throttled
        assertTrue(sw.inputThrottled(pi));
    }

    /**
     * Test whether two collections contains the same elements, regardless
     * of the order in which the elements appear in the collections
     * @param expected
     * @param actual
     */
    private static <T> void assertCollectionEqualsNoOrder(Collection<T> expected,
                                         Collection<T> actual) {
        String msg = String.format("expected=%s, actual=%s",
                                   expected, actual);
        assertEquals(msg, expected.size(), actual.size());
        for(T e: expected) {
            if (!actual.contains(e)) {
                msg = String.format("Expected element %s not found in " +
                        "actual. expected=%s, actual=%s",
                    e, expected, actual);
                fail(msg);
            }
        }
    }

    /**
     * Test "normal" setPorts() and comparePorts() methods. No name<->number
     * conflicts or exception testing.
     */
    @Test
    public void testBasicSetPortOperations() {
        Collection<ImmutablePort> oldPorts = Collections.emptyList();
        Collection<ImmutablePort> oldEnabledPorts = Collections.emptyList();
        Collection<int> oldEnabledPortNumbers = Collections.emptyList();
        List<ImmutablePort> ports = new ArrayList<ImmutablePort>();

        Collection<PortChangeEvent> expectedChanges =
                new ArrayList<IOFSwitch.PortChangeEvent>();

        Collection<PortChangeEvent> actualChanges = sw.comparePorts(ports);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertEquals(0, sw.getPorts().size());
        assertEquals(0, sw.getEnabledPorts().size());
        assertEquals(0, sw.getEnabledPortNumbers().size());

        actualChanges = sw.setPorts(ports);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertEquals(0, sw.getPorts().size());
        assertEquals(0, sw.getEnabledPorts().size());
        assertEquals(0, sw.getEnabledPortNumbers().size());

        //---------------------------------------------
        // Add port p1a and p2a
        ports.add(p1a);
        ports.add(p2a);

        PortChangeEvent evP1aAdded =
                new PortChangeEvent(p1a, PortChangeType.ADD);
        PortChangeEvent evP2aAdded =
                new PortChangeEvent(p2a, PortChangeType.ADD);

        expectedChanges.clear();
        expectedChanges.add(evP1aAdded);
        expectedChanges.add(evP2aAdded);

        actualChanges = sw.comparePorts(ports);
        assertEquals(0, sw.getPorts().size());
        assertEquals(0, sw.getEnabledPorts().size());
        assertEquals(0, sw.getEnabledPortNumbers().size());
        assertEquals(2, actualChanges.size());
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);

        actualChanges = sw.setPorts(ports);
        assertEquals(2, actualChanges.size());
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);

        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        assertTrue("enabled ports should be empty",
                   sw.getEnabledPortNumbers().isEmpty());
        assertTrue("enabled ports should be empty",
                   sw.getEnabledPorts().isEmpty());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(null, sw.getPort((int)3));
        assertEquals(null, sw.getPort("port3"));
        assertEquals(null, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Set the same ports again. No changes
        oldPorts = sw.getPorts();
        oldEnabledPorts = sw.getEnabledPorts();
        oldEnabledPortNumbers = sw.getEnabledPortNumbers();

        expectedChanges.clear();

        actualChanges = sw.comparePorts(ports);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertEquals(oldPorts, sw.getPorts());
        assertEquals(oldEnabledPorts, sw.getEnabledPorts());
        assertEquals(oldEnabledPortNumbers, sw.getEnabledPortNumbers());

        actualChanges = sw.setPorts(ports);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertEquals(oldPorts, sw.getPorts());
        assertEquals(oldEnabledPorts, sw.getEnabledPorts());
        assertEquals(oldEnabledPortNumbers, sw.getEnabledPortNumbers());
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        assertTrue("enabled ports should be empty",
                   sw.getEnabledPortNumbers().isEmpty());
        assertTrue("enabled ports should be empty",
                   sw.getEnabledPorts().isEmpty());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(null, sw.getPort((int)3));
        assertEquals(null, sw.getPort("port3"));
        assertEquals(null, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Remove p1a, add p1b. Should receive a port up
        oldPorts = sw.getPorts();
        oldEnabledPorts = sw.getEnabledPorts();
        oldEnabledPortNumbers = sw.getEnabledPortNumbers();
        ports.clear();
        ports.add(p2a);
        ports.add(p1b);

        // comparePorts
        PortChangeEvent evP1bUp = new PortChangeEvent(p1b, PortChangeType.UP);
        actualChanges = sw.comparePorts(ports);
        assertEquals(oldPorts, sw.getPorts());
        assertEquals(oldEnabledPorts, sw.getEnabledPorts());
        assertEquals(oldEnabledPortNumbers, sw.getEnabledPortNumbers());
        assertEquals(1, actualChanges.size());
        assertTrue("No UP event for port1", actualChanges.contains(evP1bUp));

        // setPorts
        actualChanges = sw.setPorts(ports);
        assertEquals(1, actualChanges.size());
        assertTrue("No UP event for port1", actualChanges.contains(evP1bUp));
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        List<ImmutablePort> enabledPorts = new ArrayList<ImmutablePort>();
        enabledPorts.add(p1b);
        List<Integer> enabledPortNumbers = new ArrayList<Integer>();
        enabledPortNumbers.add((int)1);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1b, sw.getPort((int)1));
        assertEquals(p1b, sw.getPort("port1"));
        assertEquals(p1b, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(null, sw.getPort((int)3));
        assertEquals(null, sw.getPort("port3"));
        assertEquals(null, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Remove p2a, add p2b. Should receive a port modify
        oldPorts = sw.getPorts();
        oldEnabledPorts = sw.getEnabledPorts();
        oldEnabledPortNumbers = sw.getEnabledPortNumbers();
        ports.clear();
        ports.add(p2b);
        ports.add(p1b);

        PortChangeEvent evP2bModified =
                new PortChangeEvent(p2b, PortChangeType.OTHER_UPDATE);

        // comparePorts
        actualChanges = sw.comparePorts(ports);
        assertEquals(oldPorts, sw.getPorts());
        assertEquals(oldEnabledPorts, sw.getEnabledPorts());
        assertEquals(oldEnabledPortNumbers, sw.getEnabledPortNumbers());
        assertEquals(1, actualChanges.size());
        assertTrue("No OTHER_CHANGE event for port2",
                   actualChanges.contains(evP2bModified));

        // setPorts
        actualChanges = sw.setPorts(ports);
        assertEquals(1, actualChanges.size());
        assertTrue("No OTHER_CHANGE event for port2",
                   actualChanges.contains(evP2bModified));
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts = new ArrayList<ImmutablePort>();
        enabledPorts.add(p1b);
        enabledPortNumbers = new ArrayList<Integer>();
        enabledPortNumbers.add((int)1);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1b, sw.getPort((int)1));
        assertEquals(p1b, sw.getPort("port1"));
        assertEquals(p1b, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2b, sw.getPort((int)2));
        assertEquals(p2b, sw.getPort("port2"));
        assertEquals(p2b, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(null, sw.getPort((int)3));
        assertEquals(null, sw.getPort("port3"));
        assertEquals(null, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Remove p1b, add p1a. Should receive a port DOWN
        // Remove p2b, add p2a. Should receive a port modify
        // Add p3, should receive an add
        oldPorts = sw.getPorts();
        oldEnabledPorts = sw.getEnabledPorts();
        oldEnabledPortNumbers = sw.getEnabledPortNumbers();
        ports.clear();
        ports.add(p2a);
        ports.add(p1a);
        ports.add(p3);

        PortChangeEvent evP1aDown =
                new PortChangeEvent(p1a, PortChangeType.DOWN);
        PortChangeEvent evP2aModified =
                new PortChangeEvent(p2a, PortChangeType.OTHER_UPDATE);
        PortChangeEvent evP3Add =
                new PortChangeEvent(p3, PortChangeType.ADD);
        expectedChanges.clear();
        expectedChanges.add(evP1aDown);
        expectedChanges.add(evP2aModified);
        expectedChanges.add(evP3Add);

        // comparePorts
        actualChanges = sw.comparePorts(ports);
        assertEquals(oldPorts, sw.getPorts());
        assertEquals(oldEnabledPorts, sw.getEnabledPorts());
        assertEquals(oldEnabledPortNumbers, sw.getEnabledPortNumbers());
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);

        // setPorts
        actualChanges = sw.setPorts(ports);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPorts.add(p3);
        enabledPortNumbers.clear();
        enabledPortNumbers.add((int)3);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(p3, sw.getPort((int)3));
        assertEquals(p3, sw.getPort("port3"));
        assertEquals(p3, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Remove p1b Should receive a port DELETE
        // Remove p2b Should receive a port DELETE
        oldPorts = sw.getPorts();
        oldEnabledPorts = sw.getEnabledPorts();
        oldEnabledPortNumbers = sw.getEnabledPortNumbers();
        ports.clear();
        ports.add(p3);

        PortChangeEvent evP1aDel =
                new PortChangeEvent(p1a, PortChangeType.DELETE);
        PortChangeEvent evP2aDel =
                new PortChangeEvent(p2a, PortChangeType.DELETE);
        expectedChanges.clear();
        expectedChanges.add(evP1aDel);
        expectedChanges.add(evP2aDel);

        // comparePorts
        actualChanges = sw.comparePorts(ports);
        assertEquals(oldPorts, sw.getPorts());
        assertEquals(oldEnabledPorts, sw.getEnabledPorts());
        assertEquals(oldEnabledPortNumbers, sw.getEnabledPortNumbers());
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);

        // setPorts
        actualChanges = sw.setPorts(ports);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPorts.add(p3);
        enabledPortNumbers.clear();
        enabledPortNumbers.add((int)3);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());

        assertEquals(p3, sw.getPort((int)3));
        assertEquals(p3, sw.getPort("port3"));
        assertEquals(p3, sw.getPort("PoRt3")); // case insensitive get
    }

    /**
     * Test "normal" OFPortStatus handling. No name<->number
     * conflicts or exception testing.
     */
    @Test
    public void testBasicPortStatusOperation() {
        OFPortStatus ps = (OFPortStatus)
                FloodlightFactory.getInstance().getMessage(OFType.PORT_STATUS);
        List<ImmutablePort> ports = new ArrayList<ImmutablePort>();
        ports.add(p1a);
        ports.add(p2a);

        // Set p1a and p2a as baseline
        PortChangeEvent evP1aAdded =
                new PortChangeEvent(p1a, PortChangeType.ADD);
        PortChangeEvent evP2aAdded =
                new PortChangeEvent(p2a, PortChangeType.ADD);

        Collection<PortChangeEvent> expectedChanges =
                new ArrayList<IOFSwitch.PortChangeEvent>();
        expectedChanges.add(evP1aAdded);
        expectedChanges.add(evP2aAdded);

        Collection<PortChangeEvent> actualChanges = sw.comparePorts(ports);
        assertEquals(0, sw.getPorts().size());
        assertEquals(0, sw.getEnabledPorts().size());
        assertEquals(0, sw.getEnabledPortNumbers().size());
        assertEquals(2, actualChanges.size());
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);

        actualChanges = sw.setPorts(ports);
        assertEquals(2, actualChanges.size());
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);

        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        assertTrue("enabled ports should be empty",
                   sw.getEnabledPortNumbers().isEmpty());
        assertTrue("enabled ports should be empty",
                   sw.getEnabledPorts().isEmpty());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // P1a -> p1b. Should receive a port up
        ports.clear();
        ports.add(p2a);
        ports.add(p1b);

        ps.setReason(OFPortReason.OFPPR_MODIFY);
        ps.setDesc(p1b.toOFPhysicalPort());

        PortChangeEvent evP1bUp = new PortChangeEvent(p1b, PortChangeType.UP);
        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        expectedChanges.add(evP1bUp);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        List<ImmutablePort> enabledPorts = new ArrayList<ImmutablePort>();
        enabledPorts.add(p1b);
        List<Integer> enabledPortNumbers = new ArrayList<Integer>();
        enabledPortNumbers.add((int)1);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1b, sw.getPort((int)1));
        assertEquals(p1b, sw.getPort("port1"));
        assertEquals(p1b, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // p2a -> p2b. Should receive a port modify
        ports.clear();
        ports.add(p2b);
        ports.add(p1b);

        PortChangeEvent evP2bModified =
                new PortChangeEvent(p2b, PortChangeType.OTHER_UPDATE);

        ps.setReason(OFPortReason.OFPPR_MODIFY);
        ps.setDesc(p2b.toOFPhysicalPort());

        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        expectedChanges.add(evP2bModified);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts = new ArrayList<ImmutablePort>();
        enabledPorts.add(p1b);
        enabledPortNumbers = new ArrayList<Integer>();
        enabledPortNumbers.add((int)1);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1b, sw.getPort((int)1));
        assertEquals(p1b, sw.getPort("port1"));
        assertEquals(p1b, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2b, sw.getPort((int)2));
        assertEquals(p2b, sw.getPort("port2"));
        assertEquals(p2b, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(null, sw.getPort((int)3));
        assertEquals(null, sw.getPort("port3"));
        assertEquals(null, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // p1b -> p1a. Via an OFPPR_ADD, Should receive a port DOWN
        ports.clear();
        ports.add(p2b);
        ports.add(p1a);

        // we use an ADD here. We treat ADD and MODIFY the same way
        ps.setReason(OFPortReason.OFPPR_ADD);
        ps.setDesc(p1a.toOFPhysicalPort());

        PortChangeEvent evP1aDown =
                new PortChangeEvent(p1a, PortChangeType.DOWN);
        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        expectedChanges.add(evP1aDown);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPortNumbers.clear();
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2b, sw.getPort((int)2));
        assertEquals(p2b, sw.getPort("port2"));
        assertEquals(p2b, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // p2b -> p2a. Via an OFPPR_ADD, Should receive a port MODIFY
        ports.clear();
        ports.add(p2a);
        ports.add(p1a);

        // we use an ADD here. We treat ADD and MODIFY the same way
        ps.setReason(OFPortReason.OFPPR_ADD);
        ps.setDesc(p2a.toOFPhysicalPort());

        PortChangeEvent evP2aModify =
                new PortChangeEvent(p2a, PortChangeType.OTHER_UPDATE);
        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        expectedChanges.add(evP2aModify);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPortNumbers.clear();
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(p2a, sw.getPort((int)2));
        assertEquals(p2a, sw.getPort("port2"));
        assertEquals(p2a, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // Remove p2a
        ports.clear();
        ports.add(p1a);

        ps.setReason(OFPortReason.OFPPR_DELETE);
        ps.setDesc(p2a.toOFPhysicalPort());

        PortChangeEvent evP2aDel =
                new PortChangeEvent(p2a, PortChangeType.DELETE);
        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        expectedChanges.add(evP2aDel);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPortNumbers.clear();
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(null, sw.getPort((int)2));
        assertEquals(null, sw.getPort("port2"));
        assertEquals(null, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // Remove p2a again. Nothing should happen.
        ports.clear();
        ports.add(p1a);

        ps.setReason(OFPortReason.OFPPR_DELETE);
        ps.setDesc(p2a.toOFPhysicalPort());

        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPortNumbers.clear();
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1a, sw.getPort((int)1));
        assertEquals(p1a, sw.getPort("port1"));
        assertEquals(p1a, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(null, sw.getPort((int)2));
        assertEquals(null, sw.getPort("port2"));
        assertEquals(null, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // Remove p1a
        ports.clear();

        ps.setReason(OFPortReason.OFPPR_DELETE);
        ps.setDesc(p1a.toOFPhysicalPort());

        PortChangeEvent evP1aDel =
                new PortChangeEvent(p1a, PortChangeType.DELETE);
        actualChanges = sw.processOFPortStatus(ps);
        expectedChanges.clear();
        expectedChanges.add(evP1aDel);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPortNumbers.clear();
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(null, sw.getPort((int)1));
        assertEquals(null, sw.getPort("port1"));
        assertEquals(null, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(null, sw.getPort((int)2));
        assertEquals(null, sw.getPort("port2"));
        assertEquals(null, sw.getPort("PoRt2")); // case insensitive get

        //----------------------------------------------------
        // Add p3, should receive an add
        ports.clear();
        ports.add(p3);

        PortChangeEvent evP3Add =
                new PortChangeEvent(p3, PortChangeType.ADD);
        expectedChanges.clear();
        expectedChanges.add(evP3Add);

        ps.setReason(OFPortReason.OFPPR_ADD);
        ps.setDesc(p3.toOFPhysicalPort());

        actualChanges = sw.processOFPortStatus(ps);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPorts.add(p3);
        enabledPortNumbers.clear();
        enabledPortNumbers.add((int)3);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(null, sw.getPort((int)1));
        assertEquals(null, sw.getPort("port1"));
        assertEquals(null, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(null, sw.getPort((int)2));
        assertEquals(null, sw.getPort("port2"));
        assertEquals(null, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(p3, sw.getPort((int)3));
        assertEquals(p3, sw.getPort("port3"));
        assertEquals(p3, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Add p1b, back should receive an add
        ports.clear();
        ports.add(p1b);
        ports.add(p3);

        PortChangeEvent evP1bAdd =
                new PortChangeEvent(p1b, PortChangeType.ADD);
        expectedChanges.clear();
        expectedChanges.add(evP1bAdd);

        // use a modify to add the port
        ps.setReason(OFPortReason.OFPPR_MODIFY);
        ps.setDesc(p1b.toOFPhysicalPort());

        actualChanges = sw.processOFPortStatus(ps);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPorts.add(p3);
        enabledPorts.add(p1b);
        enabledPortNumbers.clear();
        enabledPortNumbers.add((int)3);
        enabledPortNumbers.add((int)1);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1b, sw.getPort((int)1));
        assertEquals(p1b, sw.getPort("port1"));
        assertEquals(p1b, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(null, sw.getPort((int)2));
        assertEquals(null, sw.getPort("port2"));
        assertEquals(null, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(p3, sw.getPort((int)3));
        assertEquals(p3, sw.getPort("port3"));
        assertEquals(p3, sw.getPort("PoRt3")); // case insensitive get

        //----------------------------------------------------
        // Modify, but nothing really changed
        ports.clear();
        ports.add(p1b);
        ports.add(p3);

        expectedChanges.clear();

        // use a modify to add the port
        ps.setReason(OFPortReason.OFPPR_MODIFY.ordinal());
        ps.setDesc(p1b.toOFPhysicalPort());

        actualChanges = sw.processOFPortStatus(ps);
        assertCollectionEqualsNoOrder(expectedChanges, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
        enabledPorts.clear();
        enabledPorts.add(p3);
        enabledPorts.add(p1b);
        enabledPortNumbers.clear();
        enabledPortNumbers.add((int)3);
        enabledPortNumbers.add((int)1);
        assertCollectionEqualsNoOrder(enabledPorts, sw.getEnabledPorts());
        assertCollectionEqualsNoOrder(enabledPortNumbers,
                                   sw.getEnabledPortNumbers());
        assertEquals(p1b, sw.getPort((int)1));
        assertEquals(p1b, sw.getPort("port1"));
        assertEquals(p1b, sw.getPort("PoRt1")); // case insensitive get

        assertEquals(null, sw.getPort((int)2));
        assertEquals(null, sw.getPort("port2"));
        assertEquals(null, sw.getPort("PoRt2")); // case insensitive get

        assertEquals(p3, sw.getPort((int)3));
        assertEquals(p3, sw.getPort("port3"));
        assertEquals(p3, sw.getPort("PoRt3")); // case insensitive get
    }

    /**
     * Test exception handling for setPorts() and comparePorts()
     */
    @Test
    public void testSetPortExceptions() {
        try {
            sw.setPorts(null);
            fail("Excpeted exception not thrown");
        } catch (NullPointerException e) { };

        // two ports with same name
        List<ImmutablePort> ports = new ArrayList<ImmutablePort>();
        ports.add(ImmutablePort.create("port1", (int)1));
        ports.add(ImmutablePort.create("port1", (int)2));
        try {
            sw.setPorts(ports);
            fail("Excpeted exception not thrown");
        } catch (IllegalArgumentException e) { };

        // two ports with same number
        ports.clear();
        ports.add(ImmutablePort.create("port1", (int)1));
        ports.add(ImmutablePort.create("port2", (int)1));
        try {
            sw.setPorts(ports);
            fail("Excpeted exception not thrown");
        } catch (IllegalArgumentException e) { };

        // null port in list
        ports.clear();
        ports.add(ImmutablePort.create("port1", (int)1));
        ports.add(null);
        try {
            sw.setPorts(ports);
            fail("Excpeted exception not thrown");
        } catch (NullPointerException e) { };

        // try getPort(null)
        try {
            sw.getPort(null);
            fail("Excpeted exception not thrown");
        } catch (NullPointerException e) { };

        //--------------------------
        // comparePorts()
        try {
            sw.comparePorts(null);
            fail("Excpeted exception not thrown");
        } catch (NullPointerException e) { };

        // two ports with same name
        ports = new ArrayList<ImmutablePort>();
        ports.add(ImmutablePort.create("port1", (int)1));
        ports.add(ImmutablePort.create("port1", (int)2));
        try {
            sw.comparePorts(ports);
            fail("Excpeted exception not thrown");
        } catch (IllegalArgumentException e) { };

        // two ports with same number
        ports.clear();
        ports.add(ImmutablePort.create("port1", (int)1));
        ports.add(ImmutablePort.create("port2", (int)1));
        try {
            sw.comparePorts(ports);
            fail("Excpeted exception not thrown");
        } catch (IllegalArgumentException e) { };

        // null port in list
        ports.clear();
        ports.add(ImmutablePort.create("port1", (int)1));
        ports.add(null);
        try {
            sw.comparePorts(ports);
            fail("Excpeted exception not thrown");
        } catch (NullPointerException e) { };

        // try getPort(null)
        try {
            sw.getPort(null);
            fail("Excpeted exception not thrown");
        } catch (NullPointerException e) { };

    }

    @Test
    public void testPortStatusExceptions() {
        OFPortStatus ps = (OFPortStatus)
                FloodlightFactory.getInstance().getMessage(OFType.PORT_STATUS);

        try {
            sw.processOFPortStatus(null);
            fail("Expected exception not thrown");
        } catch (NullPointerException e)  { }

        // illegal reason code
        ps.setReason((byte)0x42);
        ps.setDesc(ImmutablePort.create("p1", (int)1).toOFPhysicalPort());
        try {
            sw.processOFPortStatus(ps);
            fail("Expected exception not thrown");
        } catch (IllegalArgumentException e)  { }

        // null port
        ps.setReason(OFPortReason.OFPPR_ADD.ordinal());
        ps.setDesc(null);
        try {
            sw.processOFPortStatus(ps);
            fail("Expected exception not thrown");
        } catch (NullPointerException e)  { }
    }

    /**
     * Assert that the expected PortChangeEvents have been recevied, asserting
     * the expected ordering.
     *
     * All events in earlyEvents have to appear in actualEvents before any
     * event in lateEvent appears. Events in anytimeEvents can appear at any
     * given time. earlyEvents, lateEvents, and anytimeEvents must be mutually
     * exclusive (their intersection must be none) and their union must
     * contain all elements from actualEvents
     * @param earlyEvents
     * @param lateEvents
     * @param anytimeEvents
     * @param actualEvents
     */
    private static void assertChangeEvents(Collection<PortChangeEvent> earlyEvents,
                                      Collection<PortChangeEvent> lateEvents,
                                      Collection<PortChangeEvent> anytimeEvents,
                                      Collection<PortChangeEvent> actualEvents) {
        String inputDesc = String.format("earlyEvents=%s, lateEvents=%s, " +
                "anytimeEvents=%s, actualEvents=%s",
                earlyEvents, lateEvents, anytimeEvents, actualEvents);
        // Make copies of expected lists, so we can modify them
        Collection<PortChangeEvent> early =
                new ArrayList<PortChangeEvent>(earlyEvents);
        Collection<PortChangeEvent> late =
                new ArrayList<PortChangeEvent>(lateEvents);
        Collection<PortChangeEvent> any =
                new ArrayList<PortChangeEvent>(anytimeEvents);

        // Sanity check: no overlap between early, late, and anytime events
        for (PortChangeEvent ev: early) {
            assertFalse("Test setup error. Early and late overlap",
                        late.contains(ev));
            assertFalse("Test setup error. Early and anytime overlap",
                        any.contains(ev));
        }
        for (PortChangeEvent ev: late) {
            assertFalse("Test setup error. Late and early overlap",
                        early.contains(ev));
            assertFalse("Test setup error. Late and any overlap",
                        any.contains(ev));
        }
        for (PortChangeEvent ev: any) {
            assertFalse("Test setup error. Anytime and early overlap",
                        early.contains(ev));
            assertFalse("Test setup error. Anytime and late overlap",
                        late.contains(ev));
        }

        for (PortChangeEvent a: actualEvents) {
            if (early.remove(a)) {
                continue;
            }
            if (any.remove(a)) {
                continue;
            }
            if (late.remove(a)) {
                if (!early.isEmpty()) {
                    fail(a + " is in late list, but haven't seen all required " +
                         "early events. " + inputDesc);
                } else {
                    continue;
                }
            }
            fail(a + " was not expected. " + inputDesc);
        }
        if (!early.isEmpty())
            fail("Elements left in early: " + early + ". " + inputDesc);
        if (!late.isEmpty())
            fail("Elements left in late: " + late + ". " + inputDesc);
        if (!any.isEmpty())
            fail("Elements left in any: " + any + ". " + inputDesc);
    }

    /**
     * Test setPort() with changing name / number mappings
     * We don't test comparePorts() here. We assume setPorts() and
     * comparePorts() use the same underlying implementation
     */
    @Test
    public void testSetPortNameNumberMappingChange() {

        List<ImmutablePort> ports = new ArrayList<ImmutablePort>();
        Collection<PortChangeEvent> early = new ArrayList<PortChangeEvent>();
        Collection<PortChangeEvent> late = new ArrayList<PortChangeEvent>();
        Collection<PortChangeEvent> anytime = new ArrayList<PortChangeEvent>();
        Collection<PortChangeEvent> actualChanges = null;

        ports.add(portFoo1);
        ports.add(p1a);
        sw.setPorts(ports);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Add portFoo2: name collision
        ports.clear();
        ports.add(portFoo2);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.setPorts(ports);
        early.add(portFoo1Del);
        late.add(portFoo2Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Add portBar2: number collision
        ports.clear();
        ports.add(portBar2);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.setPorts(ports);
        early.add(portFoo2Del);
        late.add(portBar2Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Set to portFoo1, portBar2. No collisions in this step
        ports.clear();
        ports.add(portFoo1);
        ports.add(portBar2);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.setPorts(ports);
        anytime.add(portFoo1Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Add portFoo2: name and number collision
        ports.clear();
        ports.add(portFoo2);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.setPorts(ports);
        early.add(portFoo1Del);
        early.add(portBar2Del);
        late.add(portFoo2Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Set to portFoo2, portBar1. No collisions in this step
        ports.clear();
        ports.add(portFoo2);
        ports.add(portBar1);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.setPorts(ports);
        anytime.add(portBar1Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Add portFoo1, portBar2 name and number collision
        // Also change p1a -> p1b: expect modify for it
        // Also add p3: expect add for it
        PortChangeEvent p1bUp = new PortChangeEvent(p1b, PortChangeType.UP);
        PortChangeEvent p3Add = new PortChangeEvent(p3, PortChangeType.ADD);
        ports.clear();
        ports.add(portFoo1);
        ports.add(portBar2);
        ports.add(p1b);
        ports.add(p3);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.setPorts(ports);
        early.add(portFoo2Del);
        early.add(portBar1Del);
        late.add(portFoo1Add);
        late.add(portBar2Add);
        anytime.add(p1bUp);
        anytime.add(p3Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
    }

    @Test
    public void testPortStatusNameNumberMappingChange() {
        List<ImmutablePort> ports = new ArrayList<ImmutablePort>();
        Collection<PortChangeEvent> early = new ArrayList<PortChangeEvent>();
        Collection<PortChangeEvent> late = new ArrayList<PortChangeEvent>();
        Collection<PortChangeEvent> anytime = new ArrayList<PortChangeEvent>();
        Collection<PortChangeEvent> actualChanges = null;

        // init: add portFoo1, p1a
        ports.add(portFoo1);
        ports.add(p1a);
        sw.setPorts(ports);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        OFPortStatus ps = (OFPortStatus)
                FloodlightFactory.getInstance().getMessage(OFType.PORT_STATUS);

        // portFoo1 -> portFoo2 via MODIFY : name collision
        ps.setReason(OFPortReason.OFPPR_MODIFY.ordinal());
        ps.setDesc(portFoo2.toOFPhysicalPort());
        ports.clear();
        ports.add(portFoo2);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.processOFPortStatus(ps);
        early.add(portFoo1Del);
        late.add(portFoo2Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // portFoo2 -> portBar2 via ADD number collision
        ps.setReason(OFPortReason.OFPPR_ADD.ordinal());
        ps.setDesc(portBar2.toOFPhysicalPort());
        ports.clear();
        ports.add(portBar2);
        ports.add(p1a);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.processOFPortStatus(ps);
        early.add(portFoo2Del);
        late.add(portBar2Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Set to portFoo1, portBar2
        ports.clear();
        ports.add(portFoo1);
        ports.add(portBar2);
        sw.setPorts(ports);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // portFoo1 + portBar2 -> portFoo2: name and number collision
        ps.setReason(OFPortReason.OFPPR_MODIFY.ordinal());
        ps.setDesc(portFoo2.toOFPhysicalPort());
        ports.clear();
        ports.add(portFoo2);
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.processOFPortStatus(ps);
        early.add(portFoo1Del);
        early.add(portBar2Del);
        late.add(portFoo2Add);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        //----------------------
        // Test DELETEs

        // del portFoo1: name exists (portFoo2), but number doesn't.
        ps.setReason(OFPortReason.OFPPR_DELETE.ordinal());
        ps.setDesc(portFoo1.toOFPhysicalPort());
        ports.clear();
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.processOFPortStatus(ps);
        anytime.add(portFoo2Del);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Set to portFoo1
        ports.clear();
        ports.add(portFoo1);
        sw.setPorts(ports);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // del portBar1: number exists (portFoo1), but name doesn't.
        ps.setReason(OFPortReason.OFPPR_DELETE.ordinal());
        ps.setDesc(portBar1.toOFPhysicalPort());
        ports.clear();
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.processOFPortStatus(ps);
        anytime.add(portFoo1Del);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // Set to portFoo1, portBar2
        ports.clear();
        ports.add(portFoo1);
        ports.add(portBar2);
        sw.setPorts(ports);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());

        // del portFoo2: name and number exists
        ps.setReason(OFPortReason.OFPPR_DELETE);
        ps.setDesc(portFoo2.toOFPhysicalPort());
        ports.clear();
        early.clear();
        late.clear();
        anytime.clear();
        actualChanges = sw.processOFPortStatus(ps);
        anytime.add(portFoo1Del);
        anytime.add(portBar2Del);
        assertChangeEvents(early, late, anytime, actualChanges);
        assertCollectionEqualsNoOrder(ports, sw.getPorts());
    }

    @Test
    public void testSubHandshake() {
        OFMessage m = FloodlightFactory.getInstance().getMessage(OFType.VENDOR);
        // test execptions before handshake is started
        try {
            sw.processDriverHandshakeMessage(m);
            fail("expected exception not thrown");
        } catch (SwitchDriverSubHandshakeNotStarted e) { /* expected */ }
        try {
            sw.isDriverHandshakeComplete();
            fail("expected exception not thrown");
        } catch (SwitchDriverSubHandshakeNotStarted e) { /* expected */ }

        // start the handshake -- it should immediately complete
        sw.startDriverHandshake();
        assertTrue("Handshake should be complete",
                   sw.isDriverHandshakeComplete());

        // test exceptions after handshake is completed
        try {
            sw.processDriverHandshakeMessage(m);
            fail("expected exception not thrown");
        } catch (SwitchDriverSubHandshakeCompleted e) { /* expected */ }
        try {
            sw.startDriverHandshake();
            fail("Expected exception not thrown");
        } catch (SwitchDriverSubHandshakeAlreadyStarted e) { /* expected */ }
    }

}

redpajama_set_name: RedPajamaGithub


Crews are preparing for the next phase of light rail construction on 112th Ave SE. Beginning next week, Sound Transit's contractor will begin construction of the temporary bypass road near Bellefield Residential. When completed, the bypass road will carry traffic during construction of the road over rail undercrossing. Work to construct the bypass road is expected to last for approximately three months.
24 hours. During construction of the bypass road, 112th Ave SE will be reduced to one lane in each direction near SE 15th. People walking will continue to use the sidewalk on the east side of 112th Ave SE. The map below, details what people walking, driving and riding bikes can expect. Please follow the direction of flaggers and signage to safely access your destination.
Monday-Friday 6 a.m. to 6 p.m. Work is set to begin on the light rail trench and guideway adjacent to Bellevue Way SE, between the South Bellevue Station site and the Wye at 112th Avenue SE. Throughout the project, two lanes will be maintained in the peak direction: northbound in the morning and southbound in the afternoon. Sound Transit's contractor will use cones and lane delineators to guide traffic along Bellevue Way SE. Please follow the direction of flaggers and signage to safely access your destination. More info on what to expect can be found at the East Link long-term and ongoing closures click page.
Monday-Friday 9 a.m. to 4 p.m. Daily closures of one southbound lane of 112th Avenue SE, between Main Street and SE 8th Street.


Spring Lake is conveniently located behind Carolina Forest Elementary School at the corner of Carolina Forest Blvd and Gateway Drive. Developed by Centex Homes of Myrtle Beach, this custom home community was the first one established in the heart of the Carolina Forest area. It's just seven miles to the beach and with access to an award-winning school district and an ideal spot for young families. Read more about Spring Lake real estate.
The neighborhood has 3, 4 and 5 bedroom floor plans starting at about 1,300 heated square feet and get as large as 3,000 square feet. The houses are located on elevated sites, many of which are wooded and or have pond views. The look and feel of Spring Lake stands out from the other communities within Carolina Forest. Spring Lake offers easy access to HWY 17 and 31.
In addition to its proximity to Carolina Forest shopping, hospitals and restaurants, Spring Lake is also just two miles from two major golf courses in the area. Within the community itself, residents can access a beautiful pool and children's play area, family fun is always just area the corner. Speaking of convenience, parents of young children might find the elementary school close by a comfort. Older children have easy access to Postal Way and Carolina Forest High School.


Red Bull Air Race Challenge!
Yep - got one. I think Stefan posted these to the profile posts instead of PMs - so you can see them on the profile posts thread under what's new. Emailed Stefan back and they want to do video content on the entries and displaying entries at the Red Bull Air Race event which means shipping the planes. I don't have a problem with this except I already started stripping the original for the next build.
wow, guess i got more work to do. in hindsight, should have known better.
thankfully i can laser cut a new one in minutes, graphics aren't a prob, 3D printer just went into overdrive, and now time to strip the old one.
guess i won't be walking away so soon.
Damn! That'll be costly all the way from New Zealand........and back!!
and we did a great job!. We have proof of flight and a plane that is still flying well. In fact, going to put three more flights on it tomorrow.Its all about having a positive attitude.
Before getting too far ahead, this was something they were thinking of doing - I was not sure from the email whether they absolutely need us to do this or not particularly as it will require a rebuild on my part (which I am willing to do but it will take some time), so I am waiting for a further response from Stefan. Did you guys get the email about shipping?
Dang - need to get one of those!
i responded late today here in AZ so i don't expect anything until tomorrow. i'm excited for all of us, can't wait to hear more.
i do have video and pics of my flight and will update, printer has completed control horns and is currently printing the skids. that will be done by the time i wake up, then the canopy will start printing. once done, the motor box. i may be able to salvage the old one, but plan on printing just incase. all 3d parts should be done by tomorrow night.
graphics will be printed tomorrow, then i will hopefully be able to laser cut several foam board kits.
looking at my "crashed" proto3. the only thing that died when i nosed it into the ground was the spinner. seems HK deosn thave them stocked in the USA, so not sure i will pull that off in time...Dave, got one?
the rest can be salvaged and will be read to fly.
Jason, I have two in transit from Hong Kong.. They may have already arrived. If not I will send you the one from prototype #2.
I will know by tomorrow am.
If its just for looks the fastest thing to do would be to go down to Hobby Town on Speedway and buy a 2" Dubro Red spinner.
Too busy packing up planes?
Yep. I live in Perth Western Australia which is pretty much the other side of the world from Ohio so its been interesting trying to figure out how to pack it all up. Finding a box big enough was also a challenge but fortunately a flying buddy hadn't thrown away the box from his last purchase so I will pick that up tomorrow after flying. I really hope it gets there intact.
I've only just found this forum page....I'm the Riddle guy.
First off, all of these builds have been absolutely awesome! Mine definitely doesn't compare. Between my excitement for the competition and preparing for the school year, I've only just realized this morning that part of the requirements was to have a Red Bull theme. Doh! Oh well, well done all!
Yep...working on getting mine all packed up. Going down to the UPS store this am. At least I am shipping mine state side.,lol..
So sounds like you guys got the same message - they want them shipped and preferably in operational condition. So I am going to be a little behind because I need to build her again.
@shhhhh! - UPS is the best option for shipping? Are you making a custom box or using a standard size?
I am checking UPS and FedEx. I will have them build the box,if they do that..
My plane is totally operational. I am even going to ship out my TX if they so desire. Then it is truly plug and play.
That way they don't have to start over with the trimming, etc....because that first flight is usually the most challenging.
Cool. Let me know what kind of quotes you get.
Did Stefan say they were definitely going to fly them? In that case I will have to maiden the new build first and if the Red Bull curse is still in effect .....!
I'll admit, I'm feeling a little under pressure on this.