text:
Good News Magazine
Leading United Methodists to a Faithful Future
Protocol on Track
Progressives Launch Denomination
The Joy of Providing Food
Creating in Chaos
The Zacchaeus Surprise
The Indecency of Hope
General Conference Options
Don't Take My Word for It: Read Wesley Yourself
Glide Leaves Methodism
Popes, Politicians & Perkins
Jack Hayford: Pastor to Pastors
Cotton Candy Christianity
Learning God's Ways
Of What Spirit are We?
Snake in the Manger
Life matters: A Christmas meditation
European Conferences Move toward LGBT Affirmation
New Liberationist Denomination?
Separation and Self-Determination
Understanding the Christmas Covenant
Options for General Conference
Traditionalist Apprehension about a Post-Separation UMC
What Is a Traditional Methodist?
Making Moral Choices
Confusion About God
Losing the Gospel
Stick to the Path
Reconnecting the Connection
Remembering Bishop John Yambasu
Marriage: A School for Discipleship
Coping with Covid-19 and washing dishes with love
The Way of Humility, Honesty, and Courage
Looking for Accountability in North Katanga
Violations in Central Congo
Images of UM Fracture
One Step Back
The Future of Pastoral Training
William J. Abraham Named Inaugural Director of the Newly Established Wesley House of Studies at Baylor University's George W. Truett Theological Seminary
Finding God in a Crisis
Lord give us eyes to see
The Role of Conferences in the New Methodism
An Eternal Perspective
Human Plans and the Coronavirus
All In the News Posts
About the Movement
Form 990 Report
2018 Audit
The History of Good News
Good News Board Members
Junaluska Affirmation w/ Preamble
Wesleyan Christianity
La misión de Good News
La Afirmación de Junaluska
El legado del liberalismo teológico
La minoría silenciosa del metodismo
New Traditional Methodist Denomination
General Conference Legislation
Holy Conversations: The WCA Podcast
Wesley21.com
Transforming Congregations
Renew Women's Ministry
Renewal and Reform Coalition responds to statement from retired bishops
April 1, 2011 By Good News
In early February 2011, a group of retired United Methodist bishops issued "A Statement of Counsel to the Church—2011" in which they called upon The United Methodist Church to remove statements in ¶ 304.3 of The Book of Discipline that declare "The practice of homosexuality is incompatible with Christian teaching" and instruct that "self-avowed practicing homosexuals are not to be certified as candidates, ordained as ministers, or appointed to serve in The United Methodist Church."
The decision on our church's doctrine and polity on these matters is reserved solely to the delegates to General Conference, and this group of retired bishops has neither voice nor vote in such deliberations. We are dismayed that bishops who have agreed to live within the covenant defined by our Book of Discipline and who are charged in the Book of Discipline "to uphold the discipline and order of the Church" are undercutting that very discipline and order, encouraging dissension and disunity, and advocating on behalf of positions that have been repeatedly rejected by our General Conference after focused prayer, study, and holy conferencing.|
The retired bishops who have joined in the statement are a minority of the active and retired bishops who are part of the Council of Bishops. We call upon the Council of Bishops as a whole to defend the church's belief and discipline, and to hold one another accountable for such defense.
After ten General Conferences (1972-2008), numerous dialogues, at least two General Church study commissions, official study resources, dozens of convocations, a plethora of books, demonstrations and disruptions of the General Conference business, and extended impassioned debate, our denomination has consistently affirmed a holistic position that is pastoral and biblical, compassionate and redemptive.
The denomination's statement on the practice of homosexuality is a balanced position that affirms the "sacred worth" of all persons, even while acknowledging that as Christians we cannot affirm every expression of human sexuality. Clearly, there are certain sexual practices that contradict biblical standards, and as faithful disciples we must be willing to declare them to be incompatible with Christian teachings. The United Methodist position does this with mercy and grace.
The retired bishops' statement is woefully inadequate in its failure to address the clear pronouncements of Scripture in both the Old and New Testaments and almost 2,000 years of Christian history. The teaching of The United Methodist Church on human sexuality is consistent with the teaching of the Church universal.
In essence, the retired bishops' statement is a plea for the church to accommodate to the world and compromise with the relativism of our age. Scripture and Christian history steadfastly warn against such accommodation and compromise.
To a watching world, the position of The United Methodist Church is a necessary and reasonable statement of ethical clarity in an age of murky morality. It is a statement of theological honesty in an age of religious ambiguity. It is a prophetic statement to a world that offers no boundaries to sexual expression.
As recognized in our Book of Discipline, faithful followers of Jesus Christ are called to celibacy in singleness and fidelity in marriage. The Scriptures and almost 2000 years of Christian theology have permitted sexual activity only within the boundary of marriage. The Church universal in its orthodox expressions has defined marriage as the covenantal relationship of supreme love between a man and a woman. The United Methodist position is and must remain consistent with this understanding. The retired bishops' statement provides no rationale for deviating from this position, except for arguments based in convenience—convenience for those who find difficulty administering the church's position rightly and for those who choose to persist in engaging in sinful practices. Maintaining our position keeps faith with the supremacy of Scripture and accords with tradition, experience, and reason.
The position of The United Methodist Church is a prophetic message of life to a broken and hurting world. The biblically prophetic message has always been more interested in truth and transformation than in consensus and conformity to the propositions advanced by the world. What the world often finds excusable and acceptable, the church does not and cannot. Even though our debates have historically focused exclusively on homosexuality, The United Methodist Church must learn how to provide effective and compassionate ministry to all persons who struggle to live lives of sexual purity. All persons, whatever their sexual temptations or inclinations, are welcome in The United Methodist Church, but sexual relationships outside the biblically and historically defined boundary of Christian marriage between a man and a woman must be named for what they are—sin. The Gospel also includes God's gracious promise that those who confess and repent will be given the power for new life and transformation.
We live in a hypersexualized culture—as evidenced by the more than 40-year-obsession of those who would change our sexual ethics. United Methodism must deal seriously—and here we are speaking to conservatives as well as liberals and moderates—with the crippling spiritual devastation that sexual brokenness brings into our local congregations. Many who sit next to us in our pews have been victimized by sexual abuse or by an unfaithful spouse. Others in our congregations struggle with promiscuity, are addicted to pornography, suffer with sexually transmitted diseases, are confused about their sexual identity, or wrestle with same-sex attractions. All such persons need to know that The United Methodist Church is prepared to minister to their needs while uncompromisingly standing for biblical truth and the transformative power of a relationship with Jesus Christ.
The path urged by the retired bishops, if adopted, will leave The United Methodist Church barely distinguishable from the culture, particularly in the Christian West. All this would be done for the sake of expediency and convenience, a desire for "relevance," and a misapplied sense of social justice. In reality, the retired bishops' position is in a distinct minority across the Church universal and has only resulted in dissension, schism, and the weakening of the Church where it has been adopted. We urge our brothers and sisters in Christ in The United Methodist Church to reject the counsel of these retired episcopal leaders.
Endorsed by The Renewal and Reform Coalition:
The Confessing Movement within The United Methodist Church
United Methodist Action
Filed Under: Latest Articles Tagged With: March-April 2011
Click here to sign up to our email lists:
•Perspective Newsletter (weekly)
• Transforming Congregations Newsletter (monthly)
• Renew Newsletter (monthly)
Archives Select Month January 2021 (18) December 2020 (4) November 2020 (21) October 2020 (4) September 2020 (18) August 2020 (5) July 2020 (19) June 2020 (6) May 2020 (22) April 2020 (3) March 2020 (21) February 2020 (6) January 2020 (26) December 2019 (5) November 2019 (21) October 2019 (4) September 2019 (21) August 2019 (6) July 2019 (23) June 2019 (3) May 2019 (22) April 2019 (11) March 2019 (21) February 2019 (20) January 2019 (32) December 2018 (4) November 2018 (20) October 2018 (8) September 2018 (20) August 2018 (5) July 2018 (23) June 2018 (7) May 2018 (22) April 2018 (6) March 2018 (21) February 2018 (7) January 2018 (19) December 2017 (5) November 2017 (26) October 2017 (5) September 2017 (22) August 2017 (10) July 2017 (25) June 2017 (7) May 2017 (22) April 2017 (11) March 2017 (17) February 2017 (7) January 2017 (19) December 2016 (24) November 2016 (6) October 2016 (20) September 2016 (6) August 2016 (23) July 2016 (12) June 2016 (28) May 2016 (16) April 2016 (32) March 2016 (10) February 2016 (8) January 2016 (18) December 2015 (1) November 2015 (23) October 2015 (3) September 2015 (2) August 2015 (15) July 2015 (4) June 2015 (18) May 2015 (12) April 2015 (15) March 2015 (17) February 2015 (3) January 2015 (4) December 2014 (16) November 2014 (19) October 2014 (7) September 2014 (16) August 2014 (2) July 2014 (15) June 2014 (3) May 2014 (16) April 2014 (7) March 2014 (7) February 2014 (19) January 2014 (6) December 2013 (18) November 2013 (7) October 2013 (23) September 2013 (35) August 2013 (3) July 2013 (18) June 2013 (6) May 2013 (27) March 2013 (14) February 2013 (2) January 2013 (24) December 2012 (2) November 2012 (17) October 2012 (2) September 2012 (18) August 2012 (19) June 2012 (30) May 2012 (23) April 2012 (37) January 2012 (26) December 2011 (17) September 2011 (17) August 2011 (7) July 2011 (15) May 2011 (18) April 2011 (26) March 2011 (9) February 2011 (5) January 2011 (18) November 2010 (16) October 2010 (21) September 2010 (13) July 2010 (32) April 2010 (13) December 2009 (17) October 2009 (15) August 2009 (13)
Copyright © 2021 · GOOD NEWS. · All Rights Reserved.
P.O. Box 132076 | The Woodlands, TX
Privacy Policy Refund Policy Terms and Conditions


text:
Oud-Beijerland () is een plaats en voormalige gemeente in de Nederlandse provincie Zuid-Holland. Het gelijknamige dorp is qua inwoneraantal de grootste plaats in de Hoeksche Waard. Het aantal inwoners per  bedroeg  (bron: CBS).

Oud-Beijerland was een agrarische gemeente, maar is nu een forensendorp. Het heeft bovendien een regionale centrumfunctie. Het dorp is gelegen aan het Spui en aan de Oude Maas en heeft een jachthaven.

Sinds 1 januari 2019 maakt Oud-Beijerland samen met de gemeenten Korendijk, Strijen, Cromstrijen en Binnenmaas onderdeel uit van de gemeente Hoeksche Waard.

Geschiedenis
Na de Sint Elisabethsvloed in 1421 veranderden grote delen van Putten en de Groote Waard in een gebied van kleiplaten en gorzen, die bij hoog water regelmatig overspoelden. Hierdoor was het gebied nauwelijks door mensen bewoond. In de eeuwen na de ramp werden stukken land weer omdijkt.

Oud-Beijerland is in 1559 door graaf Lamoraal van Egmont gesticht als Beierland, vernoemd naar diens vrouw Sabina van Beieren. Egmont verwierf na de dood van zijn broer Karel in 1541 de rechten van het gebied, en liet het in 1557 bedijken. Vanaf de al bestaande Stougjesdijk werden de nieuwe dijken Oostdijk, Molendijk, Zinkwegsedijk, Vuurbakensedijk, en Beijerlandsedijk aangelegd. Deze polder kreeg de lange naam Beijerland, Moerkerken, Cromstrijen en de Greup. Rond 1624 kwamen er de kleine polders Bosschenpolder en Nieuwlandpolder nog bij.

In 1582 veranderde de naam van het dorp in Oud-Beijerland, ter onderscheiding van het nieuwe dorp Nieuw-Beijerland dat enkele kilometers westwaarts werd gesticht.

Lamoraal van Egmont heeft niet lang van zijn bezit kunnen genieten. In 1568 werd hij op bevel van koning Philips II op de Markt te Brussel onthoofd, samen met de graaf van Horne. De executie leidde tot groot protest en wordt wel beschouwd als het definitieve begin van de gewapende Nederlandse Opstand.

In 1604 kreeg het dorp de kerktoren en een luidklok ten geschenke van Sabina van Egmond, dochter van Lamoraal van Egmont en Sabina van Beieren. Sabina van Egmond had toen inmiddels de rechten op Beijerland geërfd en was daarmee vrouwe van Beijerland geworden. Na haar overlijden in 1614 werd ze op haar verzoek begraven in de dorpskerk. De rechten op Beijerland gingen vervolgens over op Sabina's broer Karel. Hij verkocht deze rechten in 1619 aan de Staten van Holland en West-Friesland.

In 1622 werd het Dorpshuis over de Vliet gebouwd. Vanuit dit gebouw bestuurden schout en schepenen en sprak de vierschaar recht. Het gebouw, vandaag de dag beter bekend onder de naam Oude Raadhuis, is een rijksmonument. Tot diep in de jaren zeventig van de 20e eeuw zetelde het gemeentebestuur van Oud-Beijerland er.

Oud-Beijerland werd al snel na haar ontstaan een van de belangrijkste handelsplaatsen van de Hoeksche Waard. Het dorp leefde van handel, landbouw en visserij. De rijkdom die dit bracht is nog terug te vinden in de statige herenhuizen langs de Vliet en aan de Havendam. In de haven was het vaak een drukte van belang. De suikerfabriek, een sigarenfabriek, een cementfabriek, een paling- en zalmrokerij en andere bedrijven zorgden vanaf de negentiende eeuw bovendien voor veel industriële activiteit in het centrum.

Met de komst van de Barendrechtse brug in 1888 en de RTM stoomtram naar Rotterdam in 1898 ontstonden heuse vervoersstromen en een sterk verbeterde verbinding met de omliggende gebieden. Daarmee kregen ook de handel en industrie een nieuwe impuls. Eind jaren zestig werd de Heinenoordtunnel geopend ter vervanging van de verouderde Barendrechtse brug, terwijl de tramlijn al in 1956 was stilgelegd.

De meeste industrieën zijn inmiddels uit het centrum verdwenen. Veel bedrijven uit Oud-Beijerland en omgeving vestigden zich op de bedrijventerreinen De Bosschen en De Hoogerwerf.

Winkelen en wonen
In de decennia na de oorlog is het dorp flink gegroeid, van een kleine zevenduizend inwoners in de jaren veertig naar ruim vierentwintigduizend inwoners anno 2021.
De nieuwbouwwijken, zonder hoogbouw, zijn ruim van opzet. Er is veel groen en de speelgelegenheden voor kinderen hebben veel aandacht gekregen.

Oud-Beijerland heeft een centrumfunctie in de Hoeksche Waard op het gebied van wonen, winkelen, werk en onderwijs. Het karakteristieke centrum telt circa 130 detailhandelszaken en 30 horecazaken. Het centrum kampt, net als veel andere winkelgebieden in Nederland, met problemen zoals leegstand. Om die problemen tegen te gaan wordt gewerkt aan een 'Masterplan Centrum 2025' en zijn inmiddels bijvoorbeeld al grote historische muurschilderingen aangebracht om het centrum te verfraaien.

Recente grootschalige projecten in het dorp zijn de bouw van nieuwbouwwijk Poortwijk (1995-2021) met meer dan 1500 woningen en woonzorgcomplex Rembrandt (2015-2016) met bijna 200 appartementen en 68 woningen.

Vervoer
Oud-Beijerland ligt aan de provinciale weg N217, die het dorp in het oosten verbindt met de A29 bij de Heinenoordtunnel en in het westen met het veer van Nieuw-Beijerland naar Spijkenisse. De N217 vormt ook een groot gedeelte van de rondweg van Oud-Beijerland, die een ontsluiting vormt voor de wegen binnen het dorp.

Er zijn busverbindingen met Rotterdam Zuidplein, Station Rotterdam Lombardijen en de meeste plaatsen in de Hoeksche Waard. In 2021 zou Oud-Beijerland een R-net verbinding met Rotterdam Zuidplein krijgen.[11]

Er is een veerpont van Oud-Beijerland naar Rhoon en naar Spijkenisse.

In de zomer van 2017 en 2018 stopte de Waterbus Haringvliet Expeditie ook in Oud-Beijerland. De vaarverbinding naar en over het Haringvliet maakte onderdeel uit van het Droomfondsproject Haringvliet. Dit project is in het leven geroepen om het natuurgebied Haringvliet een ecologische en economische impuls te geven.

Overige kernen in de voormalige gemeente
 Greup
 Vuurbaken
 Zinkweg

Greup is een dijkdorp dat voor de fusie tot Hoeksche Waard gedeeltelijk binnen de gemeente Oud-Beijerland ligt. Het overige gedeelte behoorde toe aan de gemeente Binnenmaas. Inmiddels ligt het dorp volledig in de gemeente Hoeksche Waard.

De Zinkweg ligt tussen Oud-Beijerland en Nieuw-Beijerland in. Het is een lange dijk, beginnend in het centrum van Oud-Beijerland, in de polder tussen beide dorpen. In de Tweede Wereldoorlog was er de Verzetsgroep Zinkweg, die het de Duitse bezetter moeilijk maakte. Anno 2017 is de dijk nog voornamelijk bekend van de voetbalclub die er resideert, de VV Zinkwegse Boys, uitkomend in de derde klasse van de KNVB.

Aan het eind van de Zinkweg (vanaf Oud-Beijerland gezien) loopt de dijk uit op Het Vuurbaken. In feite niets meer dan een stukje Zinkweg, maar dan met een kromming in de dijk.

Kerken
Oud-Beijerland kent een groot aantal kerken. Opvallend is de grote Hervormde Gemeente en de vele reformatorische kerken, onder meer een Gereformeerde Gemeente, een Hersteld Hervormde Kerk en een Oud Gereformeerde Gemeente in Nederland. Daarnaast kent Oud-Beijerland meerdere Evangelische Gemeenten, waarvan de EGHW (Evangelische Gemeente Hoeksche Waard) de grootste is.

Politiek
De gemeenteraad van Oud-Beijerland bestond uit 19 zetels. Hieronder staat de samenstelling van de gemeenteraad van 1990 tot en met 2018:

Stedenbanden
Oud-Beijerland heeft stedenbanden met
  Lidzbark Warmiński (Polen)
  Zottegem (België)

Cultuur
Raadhuis Klassiek was een jaarlijks terugkerend klassiek concert in het centrum van Oud-Beijerland. Het orkest bestond uit leden van het Rotterdams Philharmonisch Orkest. Het concert werd georganiseerd door leden van de werkgroep Raadhuis Klassiek. In 2015 vond de 25ste en laatste editie plaats.

Van 2007 tot 2017 vond jaarlijks een cultureel festival plaats in het Laningpark onder de naam 'De Parkdagen'. Dit festival bood een podium voor verenigingen, instellingen en inwoners van de Hoeksche Waard. In 2017 en 2018 werd het festival voortgezet onder de naam 'Parkdag' en in 2019 onder de naam 'Toostfestival'.

In het centrum van Oud-Beijerland is een cultuurroute uitgestippeld. Met behulp van een kaartje en het scannen van QR-codes bij monumenten en bijzondere locaties, kan men meer te weten komen over Oud-Beijerland.

Monumenten
De plaats telt 28 rijksmonumenten en verder zijn er een diverse gemeentelijke en oorlogsmonumenten, zie:
 Lijst van rijksmonumenten in Oud-Beijerland
 Lijst van gemeentelijke monumenten in Oud-Beijerland
 Lijst van oorlogsmonumenten in Oud-Beijerland

Kunst in de openbare ruimte
In Oud-Beijerland zijn diverse beelden, sculpturen en objecten geplaatst in de openbare ruimte, zie:
 Lijst van beelden in Oud-Beijerland

Onderwijsinstellingen

Basisscholen
 OBS de Zevensprong (de Hoeksche School)
 OBS de Tandem (de Hoeksche School)
 OBS de Klinker (de Hoeksche School)
 OBS het Pluspunt (speciaal onderwijs)(de Hoeksche School)
 CBS de Hoeksteen (CSG de Waard)
 CBS Keuchenius (CSG de Waard)
 CBS de Kriekenhof (CSG de Waard)
 CBS Sabina van Egmond (CSG de Waard)
 CBS Willem Alexander (speciaal onderwijs)(CSG de Waard)
 CBS de Ark (speciaal onderwijs)(CSG de Waard)
 Rudolf Steiner (vrije school)
 Leeuwenhartschool (vrije school)
 Eben-Haëzerschool (VCOHW)
 RKBS Willibrordus

Voortgezet Onderwijs
 Actief College (RSG-groep)
 Hoeksch Lyceum (RSG-groep)
 CSG Willem van Oranje

Herdenkingsmunt
 Ter ere van het 450-jarig bestaan van Oud-Beijerland in 2009 is er een, door Els in `t Veld ontworpen, herdenkingsmunt, geslagen: het Lamoraaltje, genoemd naar graaf Lamoraal van Egmond.

Geboren in Oud-Beijerland
 Philip van Dijk (1683 - 1753), schilder, tekenaar, kunsthandelaar
 Abraham Frank (1838-1917), rabbijn
 Simon Philip Goudsmit (1844-1889), ondernemer
 Carla Benschop-de Liefde (1950-2006), basketbalster en gymnastieklerares
 Renée Jones-Bos (1951), topambtenaar en diplomate
 Adri van Tiggelen (1957), voetballer
 Wim Kooiman (1960), voetballer
 Ria Visser (1961), schaatsster en televisiecommentatrice
 Benno de Goeij (1975), producer
 Rogier Molhoek (1981), voetballer
 Vivienne van den Assem (1983), actrice en presentatrice
 Barbara Sloesen (1988), actrice

Afbeeldingen

Zie ook
 Lijst van burgemeesters van Oud-Beijerland

Externe link
 Gemeente Oud-Beijerland

Plaats in Zuid-Holland
Geografie van Hoeksche Waard
Voormalige gemeente in Zuid-Holland

redpajama_set_name: RedPajamaWikipedia


text:
Blue Care partners with Queensland Health for regional palliative care
Blue Care are proud to have been awarded the palliative care tender from Queensland Health to deliver important in-home palliative care to people in regional, rural and remote areas of Queensland from October.
In a joint statement, Queensland Premier Annastacia Palaszczuk and Health Minister Yvette D'Ath announced that Blue Care have won the tender to deliver care across 9 hospital and health services in regional Queensland.
"Blue Care had a proven record as a palliative care provider, with the capability to operate in regional, rural and remote areas" Ms D'Ath said.
"This $55 million will fund new community-based palliative care initiatives to increase home-based and after-hours care across 9 Hospital and Health Services.
"We want to ensure Queenslanders can exercise genuine choice at end of life and die with dignity," she said.
The introduction of in-home palliative care services will allow patients the peace of mind to be cared for in the comfort of their own home.
Commencing in October, Blue Care will be delivering in-home palliative care through the hospital at home program in the following regional areas:
Cairns and Hinterland
Darling Downs
"This $55 million will fund new community-based palliative care initiatives to increase home-based and after-hours care across nine Hospital and Health Services.
"Blue Care will provide holistic palliative care including home care support, bereavement and support services, telehealth and on-call and 24/7 nursing care, depending on the stage of a person's illness and the care needed as they approach end of life," Ms D'Ath said.
Cathy Thomas, Group Executive of Aged Care & Community Services at UnitingCare said "we are proud to be able to expand our palliative care services, alongside Queensland Health."
"Every Queenslander deserves the peace of mind to be able to receive quality palliative care in the comfort of their own home."

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Android: Accessing and querying properly using Raw Contact Id So my app is attempting to integrate a sync adapter to the android native contact manager. This is all running smoothly except once a contact is synced, I am unable to update it. Details on this particular problem can be found here: Android: Content resolver query returning 0 rows when it ought not to But I can sum it up simply by just saying my content resolver query is returning 0 values because I am querying the wrong URI, I believe.
When I write the raw contact id to the phone, I do it with the following code:
public ContactSyncOperations(Context context, String username,
        String accountName, BatchOperationForSync batchOperation) {

    this(context, batchOperation);
    mBackReference = mBatchOperation.size();
    mIsNewContact = true;
    mValues.put(RawContacts.SOURCE_ID, username);
    mValues.put(RawContacts.ACCOUNT_TYPE, "com.tagapp.android");
    mValues.put(RawContacts.ACCOUNT_NAME, accountName);
    mBuilder = newInsertCpo(RawContacts.CONTENT_URI, true).withValues(mValues);
    mBatchOperation.add(mBuilder.build());
}

This constructor method is called when you are adding a new contact to the sync list:
private static void addContact(Context context, String account, Contact contact, BatchOperationForSync batchOperation) {
    ContactSyncOperations contactOp = ContactSyncOperations.createNewContact(context, contact.getUsername(), account, batchOperation);//constructor called @ this line
    contactOp.addName(contact.getFirstName(), contact.getLastName());
    contactOp.addEmail(contact.getEmail());
    contactOp.addPhone(contact.getPhoneNumber(), Phone.TYPE_MOBILE);
    contactOp.addPhone(contact.getHomePhone(), Phone.TYPE_HOME);
    contactOp.addPhone(contact.getWorkPhone(), Phone.TYPE_WORK);
    contactOp.addProfileAction(contact.getUsername());
    Log.e("Adding contact", "Via sync");
}

As you can see in the constructor, I am calling a method called newInsertCpo, which can be viewed here:
private void addInsertOp() {
    if(!mIsNewContact) {
        mValues.put(Phone.RAW_CONTACT_ID, mRawContactId);
    }
    mBuilder = newInsertCpo(addCallerIsSyncAdapterParameter(Data.CONTENT_URI), mYield);
    mBuilder.withValues(mValues);
    if(mIsNewContact) {
        mBuilder.withValueBackReference(Data.RAW_CONTACT_ID, mBackReference);
    }
    mYield = false;
    mBatchOperation.add(mBuilder.build());
}

Now that you can see the code, let me explain the problem. When I am creating and writing the raw contact id, I am doing so to RawContacts.CONTENT_URI:
mBuilder = newInsertCpo(RawContacts.CONTENT_URI, true).withValues(mValues);

However, when I query the uri, I am querying as so:
Cursor cursor = resolver.query(Data.CONTENT_URI, DataQuery.PROJECTION, DataQuery.SELECTION, new String[] {String.valueOf(rawContactId)}, null);

From Data.CONTENT_URI. I believe this is where my problem is occurring. I used the sample code from Android's official dev site and tailored it for my own uses, but this part is pretty true to the example. Yet it is not working. My lead is what I said, I'm writing to one Uri and querying another. But I've attempted to change the query to RawContacts.CONTENT_URI (which caused an exception), and also changing the Uri I write to Data.CONTENT_URI, which also causes an exception. What's even more confusing is that I get raw contact ids from Data.CONTENT_URI when I do my lookupRawContactId method:
private static long lookupRawContact(ContentResolver resolver, String username) {
    Log.e("Looking up Raw Contact", username);
    long authorId = 0;
    Cursor cursor = resolver.query(Data.CONTENT_URI, UserIdQuery.PROJECTION, UserIdQuery.SELECTION, new String[] {username}, null);

    try {
        if(cursor != null && cursor.moveToFirst()) {
            authorId = cursor.getLong(UserIdQuery.COLUMN_ID);
        }
    } finally {
        if(cursor != null) {
            cursor.close();
        }
    }
    return authorId;
}

So yea, if I get a cursor returning rawcontactId, why would I get 0 values querying that same Uri with that same rawcontactId i was returned? It doesn't make any sense! Does anyone have any insight? Thanks all.

A: The lookupRawContactId method should look like this instead:
private static long lookupRawContact(ContentResolver resolver, String username) {
    Log.e("Looking up Raw Contact", username);
    long authorId = 0;
    Cursor cursor = resolver.query(RawContacts.CONTENT_URI, UserIdQuery.PROJECTION, UserIdQuery.SELECTION, new String[] {username}, null);

    try {
        if(cursor != null && cursor.moveToFirst()) {
            authorId = cursor.getLong(UserIdQuery.COLUMN_ID);
        }
    } finally {
        if(cursor != null) {
            cursor.close();
        }
    }
    return authorId;
}

Notice the query is searching RawContacts.CONTENT_URI instead.

redpajama_set_name: RedPajamaStackExchange


Come August 28 and Netherlands Board of Tourism & Conventions (NBTC) embarks on a three-day Holland Sales Mission 2018 in India. Organised from August 28 to 30, the B2B sales mission takes place in Delhi on August 28 followed by Bengaluru, and Mumbai on August 29 and 30th respectively.
The mission aims to educate and update the Indian trade buyers about the destination and its diverse tourism offerings in order to corner an increasing share of one of the fastest growing outbound tourism source markets in the world. The Indian market gave remarkable performance for the Netherlands in 2017 with a robust 27 per cent growth last year.
Several leading Dutch suppliers including Lovers Canal Cruise, Efteling Theme Park, Henri Willig Cheese Farm, Madurodam Theme Park, and ITO Tours, as well as KLM Royal Dutch Airlines and Jet Airways, are attending the event in order to showcase their products and offerings to trade buyers from the three cities. The Sales Mission is expected to attract close to 100 trade buyers in each of the three cities.
According to SanJeet, India Representative of Netherlands Tourism, "Indian outbound to the Netherlands has been growing rapidly, owing to the fact that the destination caters to the demands of all age groups. This growth will surge in the coming years." The escalation in arrivals, in his opinion, can be attributed to major metros as well as feeder markets. "There has also been a steady increase in MiCE movement, as well as FITs and small groups travelling from India," he adds.


text:
Woman Completes Film Without Banging It Into Other Film
KATHRYN Bigelow was last night honoured for completing a film without bumping it into any other films in the immediate vicinity.
The director of The Hurt Locker became the first woman to win an Oscar for managing to put a film in a cinema without having a nervous breakdown, tearfully swapping insurance details with another director or leaving it poking out of the cinema at a really selfish angle.
She said: "There were times when I thought, 'this is too difficult' and this camera thingy doesn't work properly and all the other films are too close together.
"I almost swapped seats with my husband and told him to finish it. But then I took a big, deep breath, moved the film back to where I started and tried another 68 times."
According to the poster The Hurt Locker tells the story of the emotional traumas of a group of 19th century deep sea divers who find themselves caught up in the chaos of post war Iraq.
After realising they are trapped in the future they decide to make themselves useful by defusing bombs while protected by their heavy boots and shiny, bulbous helmets.
Elsewhere Jeff Bridges finally became the first Jeff Bridges to win Best Actor for his 18th portrayal of a very slightly different version of himself.
Sandra Bullock became only the 82nd woman to win Best Actress for her portrayal of one of those screechy, under-educated mothers that Americans seem to love but everyone else would like to stab in the arm and push into a shark tank.
James Cameron's Avatar was inexplicably nominated for nine awards but took just three, including Best Eight Foot Tall Blue Cat People Made on a Laptop, Best Three Dimensional Exploding Tree and Best Film in an Embarrassing Made-Up Language.
Meanwhile Sandy Powell was the only British triumph of the evening, winning Best Costume Design for dressing lots of actors playing Victorians in Victorian costumes that she obviously just copied out of a book.
Nostradamus Predicted 2010 'Would Be Bad Year For Buy-To-Let'
THE prophecies of Nostradamus include warnings about fluctuations in the UK property market, it was claimed yesterday.
The Institute for Studies has examined the more obscure writings of the 16th-century seer, discovering quatrains foretelling the current dip in house prices, including:
Many shall be beguiled by the two-headed beast, 'Kirstyanphil
They will buy in supposedly 'up-and-coming areas'
They will make some mainly cosmetic changes
But then all the money fucks up and a new age of darkness does commence.
Nostradamus's other predictions included warnings that new build 'designer' flats are unlikely to hold their value, and that buying anywhere near Richmond is a bad idea as it will be completely destroyed in the War of the Many Headed Sea Dragons, sometime in the latter half of 2013.
Professor Henry Brubaker said: "The buy-to-let market was one of Nostradamus's main interests, after the occult.
"Indeed, historical records show that during the Great Plague he used his powers of prophecy to predict the areas which would remain unaffected by pestilence and therefore desirable.
"He then bought several properties with excellent potential as 'projects' and decorated them in a style five years' ahead of its time.
"He was like a bearded Sarah Beeney, but not quite as creepy."
Historians believe Nostradamus's house price predictions came when he entered a trance-like state, during which he would commune with a group of smug demons at a kind of metaphysical Satanic dinner party where the culinary theme would be 'modern eclectic dining' and the background music sounded a bit like Corinne Bailey-Rae.
The BBC, and seven other things much more popular than Boris Johnson he can kill to win the nation round


Dave manages all of the operations for the three Architecture buildings (N), Design I (I-1), and Design II(I-2) including the Arch Woodshop and the Arch Digital Fabrication lab and Construction Management classroom areas in Building J. Dave has a staff of four plus several student assistants. Dave's hours are 10 am to 6 pm. Dave can typically be found in the main Architecture Building (N) room N014 or N003. Please contact by email dave_peeples@kennesaw.edu with any questions.


text:
A Proposal to Ban Muslim Immigration Disappears From Trump Website
ABC News reports that a statement calling for a total ban of Muslims entering the United States has disappeared from Trump's website.
Early into his campaign for the presidency, Donald Trump stoked his supporters by proposing a ban on the immigration of Muslims to the United States in response to fear of terrorist attacks. On the campaign trail, he altered the proposition by saying the ban should be on immigration from countries with connections to terrorism—not Muslims specifically.
In December, the statement read, in part: "Until we are able to determine and understand this problem and the dangerous threat it poses, our country cannot be the victims of horrendous attacks by people that believe only in Jihad, and have no sense of reason or respect for human life."
The ban proposal was quietly dropped from his site five days prior to election day. Possibly due to its impracticality or in response to the criticism from opponents who called the proposal xenophobic.
RELEVANT November 10, 2016
46.6% of Eligible Voters in the U.S. Didn't Vote
Three States Just Voted to Keep the Death Penalty


text:
Kit Harrington Joins the Cast of Marvel's 'Eternals'!
Jake McDaniel
Kit Harington may be done with his role as Jon Snow but he isn't taking a break from working anytime soon. The actor will be joining the Marvel Cinematic Universe, as revealed as Disney Expo this weekend. In addition to some major announcements, it was revealed that Kit Harington has joined the cast for Marvel's upcoming Eternals film, which is slotted for the Marvel Cinematic Universe's Phase 4. Rumors of Harington's enjoyment were propagating for sometime but it was confirmed when Harrington joined his fellow cast and crew on stage August 24th. Image via Pinkvilla Kit Harington has been …
Kit Harrington Joins the Cast of Marvel's 'Eternals'!
Previously Undiscovered Arthurian Manuscript Found In Bristol
Josh Plainse
King Arthur, The Knights of the Round Table, Genevieve, Lancelot, Merlin, Yonec, Lanval, the dead nightingale from Laüstic—some of the most beloved characters have been derived from Medieval literature. We've all come to know and love the kind of chivalry and courtly fraternity found in classic tales like The Story of the Holy Grail, Lancelot: The Knight of the Cart, Sir Gawain and the Green Knight, The Death of King Arthur/Le Morte d'Arthur (thanks Lancelot, you backstabbing womanizer), and films such as Monty Python and the Holy Grail… Image Via Giphy.com We may feel like we know these tales well, but a surprise twist …


New home Mountain View Income Producer, Unique Property in Quepos, located in a small subdivision of 11 quality homes, with awesome mountain views and close to everything. Located in Finca Los Alfaro you are in a private setting nestled among a few homes in a valley behind Quepos but only 800 meters to town.
This side by side duplex is a for sure income producer that is tastefully designed using natural elements and a has a modern feel. Both units come with fully equipped with appliances and funishings.
There are 2 units: Both have a 2 bedroom and 1 bathroom. Both units are plumbed for a dishwasher, water to the refrigerator and each has their own power, water supply, air conditioning, separate laundry areas, full kitchens in each, and separate driveways. A pool can be installed for about $15,000.
Each side should rent on a long-term basis for a minimum of $600 per month.


Notes: words and music by Malvina Reynolds; copyright 1977 Schroder Music Company, renewed 2005.
Henry Ford's engine has to go.
So Henry Ford's engine has to go.
And Henry Ford's engine is the death of you and me.
Or hitch up the horse and buggy and go driving down the lane.


text:
Research outcomes and impact
AHRC research outcomes and impact
Videogame design innovations solving real-world problems
A Dundee-based research and development centre is showing how videogame design techniques, tools and technologies can be used to solve real-world problems.
They may be fun to play, but videogames also have serious potential when it comes to meeting real-world challenges. Recent developments at a UKRI-funded innovation hub show how insights from game designers can help address problems ranging from obesity to unhealthy dairy cows.
InGAME is the UK's only dedicated research and development centre for videogame design. It is part of the Creative Industries Cluster Programme, and funded by UKRI through the Arts and Humanities Research Council (AHRC). The centre is based in Dundee, where some of the world's most successful videogames were created, including Grand Theft Auto, Lemmings and the console version of Minecraft.
Dr Chris Lowthorpe, Senior Fellow and Head of Collaborative R&D at InGAME, described the centre's five-year mission: "With our core team of experts, our aim is to increase the scale and value of the Dundee videogames cluster, driving innovation. Early on we saw that there were major opportunities for growth in applying videogames in the wider world."
"That means not just using videogame tools and technologies, but also the design processes that lead to the development of new games," he continued. "These can all be harnessed to help solve real-world problems."
Many of InGAME's collaborative research and development activities have developed from its Applied Games Lab (AGL). The AGL is an 'innovation playground' which explores the potential of videogame design techniques, tools and technologies to address a range of pressing issues. InGAME now works with partners from around the world to define the challenges that they have and begin to co-design solutions.
Impacts of the project
Project SmARtview is a UKRI-funded feasibility study involving the University of Abertay, local game studio Pocket Sized Hands, Agri-Tech Innovation Centre Agri-EPI and animal welfare specialist vetPartners. The study, which received a £250,000 award from UKRI, aimed to create a new augmented reality tool to make improvements in dairy farming.
Building on early work carried out at the AGL, the project uses artificial intelligence to identify individual cows through their distinctive markings. The tool will visualise real-time data in a way that allows vets to see at a glance how productive and healthy particular animals are. This will enable them to make quicker and more accurate interventions to improve animal welfare.
Insights from the AGL's work in game design and immersive technologies are also useful for identifying and avoiding risks related to product development, as well as coming up with possible solutions.
"Games studios are often small, and it can be hard for them to lift their head above the parapet of day-to-day game creation," explained Dr Lowthorpe. "But we can introduce them to the wider opportunities that are available, for applying their creativity and expertise outside of game-making."
InGAME will soon be launching a series of 'applied games catalysers': challenging others to apply videogame tools and ideas to real-world problems. The first is in partnership with the innovation agency Nesta, and aims to help people lead longer, more healthy lives, in particular through efforts to reduce obesity.
"We're challenging game designers to help people make better choices," said Lowthorpe. "As well as being experts in visualising data, game designers are great at creating 'choice architecture' – they, better than anyone, understand how nudge theory works in practice. You can encourage people to have a healthier lifestyle by giving them small incentives."
Read the article Videogame technology used to enhance cow health at dairy farms on the Abertay University website.
Read more about the SmARtview project on Gateway to Research.
Read more about InGAME on the centre website.
Top image: InGAME co-investigator Professor Ruth Falconer on site at the South West Dairy Development Centre.
https://www.ukri.org/about-us/how-we-are-doing/research-outcomes-and-impact/ahrc/videogame-design-innovations-solving-real-world-problems


The brand creates handmade accessories using genuine leather in different textures. The Dark accessories is an ode to dark-worship and luxury, freedom for desires and self-expression with a role of androgynous edge. The collection expands upon the innovative use of various leathers in detailed layers and new ways of bonding material to form rich appliquéd and metal combined surfaces.
The main material for creation is genuine leather, also a lot of designs are produced from python. Sharp and soft lines of accessories are designed for men and women with strong character and unconventional style.
between the age of late 20 to above 45. The Dark targets a chick clientele that belongs to the new generation of international trend setters.


Burgoyne and his troops cross the Hudson River, gearing up for battle.
View of Saratoga Falls. Courtesy of Hudson Crossing Park.
Bridge of Boats by Tim Forbes. Courtesy of Hudson Crossing Park.
Bridge of Boats. Provided courtesy of Hudson Crossing Park.
A natural bend in the Hudson River here creates a narrowing below the Saratoga Falls and the mouth of the Batten Kill, which has served as a river crossing since the last Ice Age. It was a well-worn Indian path by the time the first Europeans arrived. In 1709, the British constructed a military road to bring troops and supplies to the frontlines against their French adversaries during the early Wilderness War, and this is where Burgoyne and his army crossed the Hudson River in August 1777.
By crossing from the east to the west bank of the Hudson, Burgoyne and his troops would be able to march more easily south to Albany. On the west side, Burgoyne's army would have access to the British-built military road. The terrain on the east side of the river was much hillier. The British had an enormous amount of equipment to carry and the river crossing was often flooded, so Burgoyne built a bridge of boats across the Hudson. Burgoyne's troops lashed bateaux (oversized rowboats) side-by-side across the river and covered them with planks. They were anchored to both shores and provided a quick—if somewhat wobbly—bridge. Heavy rains caused the bridge to break apart, briefly dividing Burgoyne's army on both sides of the river. Repairs were made, and Burgoyne's men began their advance.
After the troops crossed, Burgoyne had the bridge dismantled, which meant that all communication with Canada was voluntarily cutoff. The supplies were floated down stream in bateaux to a large sheltered bay now called Coveville.
Along New York State's Historic Scenic Byway, Route 4, this site overlooks the Hudson River at the Saratoga Dam. Part of the larger Hudson Crossing Park, this is a great spot to watch birds or picnic. Hike the Hudson Crossing Park Sensory Trail to the Dix Bridge. It is believed that if you look up-river to the north, you can still see the cuts in the riverbank where Burgoyne's men anchored the boats to the shore. Park on the left, at the pocket park, and listen to Track 26.


text:
Kiyonari Shibata (; born 27 March 1973) is a Japanese former track and field athlete and middle-distance runner.

He is the current Japanese record holder for the mile run, with a personal best of 3:58.89 minutes. His time, set on 11 May 1996, made him the second Japanese man to run a sub-four-minute mile, after Takashi Ishii, who had done so nearly twenty years earlier in 1977. Shibata's 1500 metres best of 3:39.45 minutes is also among the best times for the event by a Japanese, behind Fumikazu Kobayashi and Ishii.

Despite his breaking a long-standing national record, Shibata only won at the Japan Championships in Athletics on one occasion, taking the 1500 m title in 1997. That same year he won a gold medal in the event at the East Asian Games in a then games record time of 3:49.90 minutes. The following year he won the second and final international medal of his career at the 1998 Asian Athletics Championships by finishing as runner-up behind multiple Asian champion Mohamed Suleiman. He also ran at the 1998 Asian Games and placed seventh in the 1500 m final.

He represented his home region, Toyama Prefecture, twice at the All-Japan Interprefectural Ekiden Championships.

References

External links

Living people
1973 births
Sportspeople from Toyama Prefecture
Japanese male middle-distance runners
Asian Games competitors for Japan
Athletes (track and field) at the 1998 Asian Games
Japan Championships in Athletics winners
20th-century Japanese people


text:
Three reconstructed Lapita plainware pots from Caution Bay, south coast of mainland Papua New Guinea
David, Bruno, McNiven, Ian J., Jones-Amin, Holly, Connaughton, Sean P., Parkinson, Charles, Rowe, Cassandra, Richards, Thomas, Leavesley, Matthew, Barker, Bryce, Mandui, Herman, Campanelli, Gisella, and Flood, Nick (2013) Three reconstructed Lapita plainware pots from Caution Bay, south coast of mainland Papua New Guinea. University of Otago Studies in Archaeology, 25. pp. 157-170.
View at Publisher Website: http://www.otago.ac.nz/anthropology/arch...
[Extract] Lapita ceramics have been found on islands across a vast stretch of the western Pacific Ocean, spanning some 4500 km from the Bismarck Archipelago in the west to Tonga and Samoa in the east, with recent finds (David et al. 2011; McNiven et al. 2011) extending their distribution to the south coast of mainland Papua New Guinea (PNG). While Lapita ceramics have long been recognised by their iconic (comb) dentate-stamped designs that include a range of largely geometric shapes (e.g. linear or curved motifs, including labyrinths), usually in bands or demarcated zones on the upper portions of pots (Kirch 1997: 13), they are also characterised by a broad range of distinctive vessel forms including but not limited to collared and carinated jars and bowls with everted rims (of a range of rim courses) and globular bodies, flat dishes, and rare cylinder stands. While decorated vessels are typically highlighted as characteristic of Lapita in many studies, >90% of sherds in most archaeological assemblages are undecorated (e.g. Burley et al. 2010; Kirch 1997: 146; for exceptions from more westerly assemblages, see Kirch 2000; Sand 2001). Such high proportions of plain sherds are due to a combination of sherds from plainware vessels and from undecorated parts of decorated wares. However, it is not usually possible to determine which of these two options the plain sherds represent (although conjoining of sherds and matching against various characteristics of decorated sherds can in some circumstances shed light on this issue). Plainwares enable us to better understand relationships between vessel form and decoration – and with this the culture of Lapita ceramics generally – by comparing how vessel shape changes with, and without, decoration through time. However, plainwares are rarely reported in any detail, making it difficult to compare the broader distribution of full assemblage characteristics across space and time. Here we report three Lapita pots from Caution Bay, south coast of mainland PNG, recently substantially reconstructed from conjoined sherds during the course of conservation work by the Centre for Cultural Materials Conservation at the University of Melbourne. Our aim is, firstly, to document vessel form for one newly revealed Lapita region (Caution Bay, south coast of mainland PNG) through hitherto poorly documented plain body ceramics that require substantial reconstruction to make morphological sense of otherwise relatively small sherds, and, secondly, to discuss how such vessel forms change with the demise of Lapita at Caution Bay after 2600–2500 cal. BP. These pots represent the first substantial excavated Lapita vessels from mainland PNG.
ceramic; pottery; Lapita; Caution Bay; Papua New Guinea; ceramic reconstruction; pottery reconstruction
Australian Research Council (ARC), QEII Fellowship, DORA Fellowship
ARC Discovery grant, QEII Fellowship, DORA Fellowship DP0877782, DORA Fellowship DP130102514
21 HISTORY AND ARCHAEOLOGY > 2101 Archaeology > 210106 Archaeology of New Guinea and Pacific Islands (excl New Zealand) @ 50%
21 HISTORY AND ARCHAEOLOGY > 2101 Archaeology > 210102 Archaeological Science @ 50%
95 CULTURAL UNDERSTANDING > 9505 Understanding Past Societies > 950599 Understanding Past Societies not elsewhere classified @ 100%


Image Title: Wall Track Lighting Above Mirror In Bathroom Decorating My Home Intended For Idea 6. Post Title: Bathroom Track Lighting. Filename: wall-track-lighting-above-mirror-in-bathroom-decorating-my-home-intended-for-idea-6.jpg. Image Dimension: 334 x 500 pixels. Images Format: jpg/jpeg. Publisher/Author: Quentin McLaughlin. Uploaded Date: Wednesday - October 24th. 2018 17:32:13 PM. Category: Design. Image Source: homedecor.com. 87 Exceptionally Inspiring Track Lighting Ideas To Pursue Within Bathroom Inspirations 8. Wall Track Lighting Above Mirror In Bathroom Decorating My Home Intended For Idea 6. Track Lighting For Bathroom Ceiling Cute Fan Light Covers Within Plan 2. Bathroom Track Lighting Ideas Home Design Regarding Idea 19. Practical Bathroom Track Lighting Modern With Idea 12. Track Lighting For Bathroom Ceiling Great Lowes Fans With In Prepare 10. Track Lighting For Bathroom Ceiling Perfect Home Depot Remodel 1. Bathroom Track Lighting Fixtures Over Vanity Modern With Plan 3. Track Lighting For Bathroom Ceiling Fresh Lowes Lights Flush Inside Idea 16. Captivating Track Lighting For Bathroom Vanity Full Size Of In Inspirations 9.


NEWARK, N.J. and PETALUMA, Calif., Feb. 12, 2018 /PRNewswire/ — Panasonic Corporation of North America today announced a strategic partnership with Enphase Energy Inc. (NASDAQ: ENPH), the world's leading supplier of solar microinverters, for the development of high efficiency AC Modules (ACMs). To support this partnership, the 320W Enphase IQ 7X Microinverter™ offers compatibility with Panasonic's N Series Photovoltaic (PV) Modules HIT® (N325/N330), and will be made available to distributors starting May 2018.
The Enphase IQ 7X Microinverter is compatible with Panasonic's HIT® modules, and the partnership will continue with the co-development of AC Modules (ACM) that will offer significant advantages to integrators and installers. A recent Enphase market survey of installers nationwide affirmed the value-add of AC modules, with significantly lower install times, and additional savings on logistics and overhead costs, making it a preferred choice for installers. Installers and Integrators also benefit from fewer inspection steps with factory-assembled and tested ACM products.
Panasonic's N Series HIT® Modules are among the most efficient panels on the market, with high power outputs and greater energy yields due to their industry-leading temperature coefficient of -0.258% /⁰C. Panasonic solar modules keep at least 90.76% of their initial power output even after 25 years of use.
As part of Enphase's seventh-generation microinverter platform, the IQ 7X Micro leads the industry with broad regulatory compliance, advanced "Smart Grid" features, and the high fire safety rating. The IQ 7X Micro will support 96-cell PV modules up to 400W with peak AC output power of 320W and a Maximum Power Point (MPP) tracking range of 53-64V.


text:
var path = require('path');
var glob = require('glob');

var Patcher = require('./utils/Patcher');
var browserSyncServer = require('./utils/browserSyncServer');

function parseOptions(opts) {
    var result = {};
    opts = opts || [];
    opts.forEach(function(opt) {
        var parts = opt.split(/=/);
        result[parts[0].replace(/^-+/, '')] = parts[1] || true;
    });
    return result;
}

module.exports = function(context) {
    var options = parseOptions(context.opts.options.argv);

    if (typeof options['live-reload'] === 'undefined') {
        return;
    }

    // TODO - Add back ignored option
    // TODO - Enable live reload servers

    var platforms = ['android', 'ios'];
    var patcher = new Patcher(context.opts.projectRoot, platforms);

    var bs = browserSyncServer(function(defaults) {
        defaults.files.push({
            match: ['www/**/*.*'],
            fn: function(event, file) {
                if (event === 'change') {
                    context.cordova.raw.prepare().then(function() {
                        patcher.addCSP();
                        bs.reload();
                    });
                }
            }
        });

        defaults.server = {
            baseDir: platforms.map(patcher.getWWWFolder.bind(patcher)),
            routes: {}
        }

        platforms.forEach(function(platform) {
            var www = patcher.getWWWFolder(platform);
            defaults.server.routes['/' + www] = path.join(context.opts.projectRoot, www);
        });

        return defaults;
    }, function(err, servers) {
        patcher.patch({
            servers: servers
        });
    });
}

redpajama_set_name: RedPajamaGithub


Well here I am with yet another blog. This one seems to have a nice fit for me though. I am going to be trying different things so bear with me here while I get my bearings on this darn technology thing. It would be nice if I didn't have to learn all this stuff and just focus on writing but then again, that would be all too easy now wouldn't it. Besides, what better place for a writer to stand on her soapbox and spew thoughts about right?


Neurons communicate with each other and other cells at specialised junctions called synapses, a term introduced by Charles Sherrington in 1897. Sherrington was convinced, from his physiological and anatomical studies of reflex functions of the spinal cord, that the transfer of signals between cells is a different type of process from the transfer of signals within a cell. It was not until the electron microscope was developed, 50 years after this, that the structure of synapses could be examined in detail. Synapses are tiny, and also very diverse. Sometimes a functional connection between two neurons is composed of just a single synaptic structure but more commonly there are several. Sometimes thousands of discrete anatomical contacts make up a connection between two neurons. A complex neuron such as a vertebrate motor neuron typically receives several tens of thousands of individual synapses from a variety of sources.
Figure2.7 Operation of the three main types of synapse between nerve cells. (a) Schematic arrangement for recording the transfer of signals across a synapse by inserting electrodes close to the presynaptic and postsynaptic sites. (b) Recordings of presynaptic and postsynaptic potentials at the three types of synapse.
across a synapse can be studied by using two microelectrodes, one to record presynaptic potential and the other to record postsynaptic potential (Fig. 2.7). A significant majority of synapses are chemical synapses at which signals are transferred by way of chemicals such as acetylcholine or some amino acids that act as neurotransmitters.
The postsynaptic signal is called the postsynaptic potential, usually abbreviated to PSP. There is a delay, usually of about a millisecond, between the spike and the PSP. Generally, a spike in a presynaptic neuron, about 100 mV in amplitude, causes a PSP that is much smaller, a few millivolts in amplitude, although a few synapses are specialised to act as relays where the PSP is strong enough to trigger a spike in the postsynaptic neuron. At some synapses, the PSP excites the postsynaptic neuron by depolarising it and these PSPs are called excitatory postsynaptic potentials (EPSPs). At other synapses, the PSP hyperpolarises and inhibits the postsynaptic neuron and these PSPs are inhibitory postsynaptic potentials (IPSPs).
When a neuron is excited, it is more likely to release neurotransmitter and so pass signals to its postsynaptic targets. This is because the amount of neurotransmitter that is released depends on the membrane potential at the presynaptic sites. The way that membrane potential is linked to neurotransmitter release is by calcium ions which enter the presynaptic terminal through voltage-sensitive channels. Like the voltage-sensitive sodium channels that cause the upswing of a spike in an axon, these calcium channels open in response to depolarising signals. When a spike invades a pre-synaptic terminal, it depolarises the membrane strongly for a short time, so there is a strong pulse of calcium entry into the terminal and a brief squirt of neurotransmitter is released. Most of the delay in transmission across a chemical synapse is due to the time it takes for the voltage-activated calcium channels to open.
Spikes are not necessary for neurotransmitter release, and the link between membrane potential and the rate of neurotransmitter release is used by many neurons to transmit information in a graded manner. Such neurons have been studied in various visual systems (see section 5.3) and the motor systems of arthropods (see section 8.8), and are called non-spiking neurons because they normally operate without producing spikes. Instead, small variations in membrane potential regulate the amount of neurotransmitter release, probably because the rate of calcium entry into the presynaptic terminals is directly controlled by voltage-sensitive calcium channels. Rather than being released in squirts, neurotransmitter tends to dribble from the presynaptic terminals of these neurons, and some of them sustain a steady leakage.
Neurotransmitter diffuses extremely rapidly across the cleft that separates the membranes of the presynaptic and postsynaptic neurons. Some of its molecules attach to receptor proteins on the postsynaptic membrane and cause the shape of the receptor to alter. Some receptors are parts of ion channels, and a frequent action of neurotransmitter is to cause this type of ion channel to open. As with voltage-sensitive channels, these chemical-sensitive channels allow particular types of ions to pass through when they are open, and the direction and strength of flow are governed by the con centration and electrical gradients across the membrane. Many of these transmitter-activated channels allow sodium ions to pass through, and sodium will tend to enter the neuron, exciting it by causing an EPSP. Other transmitter-activated channels allow chloride ions to pass, and these ions tend to enter the neuron causing an IPSP. Potassium-conducting transmitter-activated channels also mediate IPSPs. Integration involves weighing up the balance of EPSPs and IPSPs within a cell and this determines how excited it is.
At a few synapses, electrical current can flow directly from one neuron to another. These are called electrical synapses (see Heitler, 1990, for a review). Under an electron microscope, an electrical synapse can be recognised as a region where the cell membranes of two neurons come close and touch. Protein channels called connexons link the two cells so that, when the synapse is active, the cytoplasm in the two cells is in direct contact, forming a conductive pathway for the electrical current. Sometimes electrical synapses conduct equally well in both directions, so that each neuron is both presynaptic and postsynaptic. A signal passes from one cell to another with negligible delay at an electrical synapse (Fig. 2.7b), which means that information passes across electrical synapses slightly more rapidly than across chemical synapses. Possibly associated with this, some of the best-known electrical synapses occur in pathways concerned with rapid escape responses (see Chapter 3). Electrical synapses can also help ensure that the neurons they connect are excited synchronously, which is useful for the coordination of some motor activities. This is also useful in some sensory systems such as the retina, in which electrical coupling helps to filter out real signals from extraneous noise. However, compared with chemical synapses, the scope for integration offered by electrical synapses is limited.


Notice Spaceify is intended to be run on a dedicated edge node computer. We recommend to do a system backup, before Spaceify is installed to "home" or "office" computer. Install Spaceify at your own discretion.
Spaceify currently runs on Ubuntu 16.04.x operating system. The amount of required memory, CPU power, or hard drive space is not specified. Spaceify requires two network adapters. One of the adapters is required for internet traffic and the other for clients connecting to the Spaceify Edge computer. Typical configuration is to have ethernet and wireless (Wi-Fi) adapters. The client connection can be provided by internal wireless adapter or external wireless router.
Notice Spaceify's installation turns the computer into a wireless access point with open network.
Below on the image are possible networ configurations.
Spaceify's Debian package is available in Spaceify's repository. Before Spaceify itself can be installed, there are some prerequisities to install. Installing them is required only when Spaceify is installed for the first time. Updating does not require the reinstallation of the prerequisities.
The installation process takes few minutes. There are some questions asked during the installation.
Select the network adapter that is connected to Internet.
Usually this is the wireless network adapter, ike eth0.
Select the appropriate wireless or wireless connected adapter.
a wired adapter connected to an external wireless access point.
If internal wireless adapter (for example, wlan0) was selected in Question 2, select "Internal". If the wireless connection is external, like a Wi-Fi router, select "External".
Create an admin password for this Spaceify edge node.
The password is used in administrative actions performed from Spaceify's web page. For example, logging into Spaceify AppStore requires the password.
When Spaceify is installed, an unique registration identifier is creted for it. This identifier is stored to Spaceify's cloud and is used there to differentiate installations. The identifier is used, for example, with Spaceify's remote operation system. The identifier is also stored as a file to Spaceify's installation directory.
it uses the same registration. This way the registration and all the associations linked to it are retained.
Complete removal of dependencies after Spaceify is removed.


text:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Javanotes 6.0, Section 8.3 -- Exceptions and try..catch</title>
<link type="text/css" rel="stylesheet" href="../javanotes.css">

        [  Previous Section |
           Next Section |
           Chapter Index |
        Main Index ]

Subsections

Exceptions and Exception Classes

The try Statement

Throwing Exceptions

Mandatory Exception Handling

Programming with Exceptions

Section 8.3

Exceptions and try..catch

<big>G</big>etting a program to work under ideal circumstances
is usually a lot easier than making the program robust.
A robust program can survive unusual or "exceptional"
circumstances without crashing. One approach to writing robust programs is to
anticipate the problems that might arise and to include tests in the program
for each possible problem. For example, a program will crash if it tries to use
an array element A[i], when i is not within the declared
range of indices for the array A. A robust program must anticipate the
possibility of a bad index and guard against it.  One way to do this is to
write the program in a way that ensures (as a postcondition of the code that
precedes the array reference) that the index is in the legal range.
Another way is to test whether the index value is legal before using it in the array.
This could be done with an if statement:

if (i < 0 || i >= A.length) {
   ...  // Do something to handle the out-of-range index, i
}
else {
   ...  // Process the array element, A[i]
}

There are some problems with this approach. It is difficult and sometimes
impossible to anticipate all the possible things that might go wrong. It's not
always clear what to do when an error is detected. Furthermore, trying to
anticipate all the possible problems can turn what would otherwise be a
straightforward program into a messy tangle of if statements.

8.3.1  Exceptions and Exception Classes

We have already seen in Section 3.7
that Java (like its cousin, C++) provides a neater, more structured alternative
technique for dealing with errors that can occur while a program is running. The
technique is referred to as exception handling.  The
word "exception" is meant to be more general than "error." It includes any
circumstance that arises as the program is executed which is meant to be
treated as an exception to the normal flow of control of the program. An
exception might be an error, or it might just be a special case that you would
rather not have clutter up your elegant algorithm.

When an exception occurs during the execution of a program, we say that the
exception is thrown. When this happens, the normal
flow of the program is thrown off-track, and the program is in danger of
crashing. However, the crash can be avoided if the exception is
caught and handled in some way.  An exception can be thrown in
one part of a program and caught in a different part. An exception that is not
caught will generally cause the program to crash. (More exactly, the thread
that throws the exception will crash. In a multithreaded program, it is
possible for other threads to continue even after one crashes.  We will
cover threads in Chapter 12. In particular, GUI
programs are multithreaded, and parts of the program might continue to
function even while other parts are non-functional because of exceptions.)

By the way, since Java programs are executed by a Java interpreter, having a
program crash simply means that it terminates abnormally and prematurely. It
doesn't mean that the Java interpreter will crash. In effect, the interpreter
catches any exceptions that are not caught by the program. The interpreter
responds by terminating the program. In many other programming languages, a
crashed program will sometimes crash the entire system and freeze the computer
until it is restarted. With Java, such system crashes should be impossible -- which
means that when they happen, you have the satisfaction of blaming the
system rather than your own program.

Exceptions were introduced in Section 3.7, along with the
try..catch statement, which is used to catch and handle exceptions.
However, that section did not cover the complete syntax of try..catch
or the full complexity of exceptions.  In this section, we cover these topics in
full detail.

When an exception occurs, the thing that is actually "thrown" is an object.
This object can carry information (in its instance variables) from the point
where the exception occurs to the point where it is caught and handled. This
information always includes the subroutine call stack,
which is a list of the subroutines that were being executed when
the exception was thrown. (Since one subroutine can call another, several
subroutines can be active at the same time.) Typically, an exception object
also includes an error message describing what happened to cause the exception,
and it can contain other data as well.   All exception objects must belong to
a subclass of the standard class java.lang.Throwable.
In general, each different type of exception is represented by
its own subclass of Throwable, and these subclasses
are arranged in a fairly complex class hierarchy that shows the relationship
among various types of exception.
Throwable has two direct
subclasses, Error and Exception.
These two subclasses in turn
have many other predefined subclasses. In addition, a programmer can create new
exception classes to represent new types of exception.

Most of the subclasses of the class Error represent serious errors
within the Java virtual machine that should ordinarily cause program
termination because there is no reasonable way to handle them. In general, you should not
try to catch and handle such errors.  An example is a
ClassFormatError, which occurs when the Java virtual machine finds
some kind of illegal data in a file that is supposed to contain a compiled Java
class. If that class was being loaded as part of the program, then there is
really no way for the program to proceed.

On the other hand, subclasses of the class Exception represent
exceptions that are meant to be caught. In many cases, these are exceptions
that might naturally be called "errors," but they are errors in the program or
in input data that a programmer can anticipate and possibly respond to in some
reasonable way. (However, you should avoid the temptation of saying, "Well,
I'll just put a thing here to catch all the errors that might occur, so my
program won't crash." If you don't have a reasonable way to respond to the
error, it's best just to let the program crash, because trying to go on
will probably only lead to worse things down the road -- in the worst case, a
program that gives an incorrect answer without giving you any indication that
the answer might be wrong!)

The class Exception has its own subclass,
RuntimeException. This class groups together many common exceptions,
including all those that have been covered in previous sections.  For example,
IllegalArgumentException and NullPointerException
are subclasses of RuntimeException.
A RuntimeException generally
indicates a bug in the program, which the programmer should fix.
RuntimeExceptions and Errors share the property that a
program can simply ignore the possibility that they might occur. ("Ignoring"
here means that you are content to let your program crash if the exception
occurs.) For example, a program does this every time it uses an array reference
like A[i] without making arrangements to catch a possible
ArrayIndexOutOfBoundsException. For all other exception classes
besides Error, RuntimeException, and their subclasses,
exception-handling is "mandatory" in a sense that I'll discuss below.

The following diagram is a class hierarchy showing the class
Throwable and just a few of its subclasses. Classes that require
mandatory exception-handling are shown in red:

The class Throwable includes several instance methods that can
be used with any exception object.  If e is of type Throwable
(or one of its subclasses), then e.getMessage() is a function that returns a
String that describes the exception.  The function e.toString(),
which is used by the system whenever it needs a string representation of the object,
returns a String that contains the name of the class to which the
exception belongs as well as the same string that would be returned by e.getMessage().
And the method e.printStackTrace() writes a stack trace to standard output that tells
which subroutines were active when the exception occurred.
A stack trace can be very useful when you
are trying to determine the cause of the problem.  (Note that if an exception is not
caught by the program, then the default response to the exception  prints the stack trace to standard output.)

8.3.2  The try Statement

To catch exceptions in a Java program, you need a try statement.
We have been using such statements since Section 3.7, but the
full syntax of the try statement is more complicated than what
was presented there.  The try statements that we have used so
far had a syntax similar to the following example:

try {
    double determinant = M[0][0]*M[1][1] - M[0][1]*M[1][0];
    System.out.println("The determinant of M is " + determinant);
}
catch ( ArrayIndexOutOfBoundsException e ) {
   System.out.println("M is the wrong size to have a determinant.");
   e.printStackTrace();
}

Here, the computer tries to execute the block of statements following the word
"try". If no exception occurs during the execution of this block, then
the "catch" part of the statement is simply ignored. However, if an
exception of type
ArrayIndexOutOfBoundsException occurs, then the computer jumps
immediately to the catch clause of the try statement.
This block of statements is said to be an exception handler for
ArrayIndexOutOfBoundsException. By handling the exception in this way,
you prevent it from crashing the program.  Before the body of the catch clause
is executed, the object that represents the exception is assigned to the variable e,
which is used in this example to print a stack trace.

However, the full syntax of the try statement allows more than one
catch clause.  This makes it possible to catch several different types
of exception with one try statement.  In the above example, in addition
to the possible ArrayIndexOutOfBoundsException, there is a
possible NullPointerException which will occur if the value
of M is null.  We can handle both possible exceptions by
adding a second catch clause to the try statement:

try {
    double determinant = M[0][0]*M[1][1] - M[0][1]*M[1][0];
    System.out.println("The determinant of M is " + determinant);
}
catch ( ArrayIndexOutOfBoundsException e ) {
   System.out.println("M is the wrong size to have a determinant.");
}
catch ( NullPointerException e ) {
   System.out.print("Programming error!  M doesn't exist." + );
}

Here, the computer tries to execute the statements in the try clause.
If no error occurs, both of the catch clauses are skipped.  If an
ArrayIndexOutOfBoundsException occurs, the computer executes
the body of the first catch clause and skips the second one.  If a
NullPointerException occurs, it jumps to the second
catch clause and executes that.

Note that both ArrayIndexOutOfBoundsException and
NullPointerException are subclasses of RuntimeException. It's
possible to catch all RuntimeExceptions with a single catch
clause. For example:

try {
    double determinant = M[0][0]*M[1][1] - M[0][1]*M[1][0];
    System.out.println("The determinant of M is " + determinant);
}
catch ( RuntimeException err ) {
   System.out.println("Sorry, an error has occurred.");
   System.out.println("The error was: " + err);
}

The catch clause in this try statement will catch
any exception belonging to class RuntimeException or to
any of its subclasses.  This shows why exception classes are organized into a
class hierarchy. It allows you the option of casting your net narrowly to catch
only a specific type of exception. Or you can cast your net widely to catch a
wide class of exceptions.  Because of subclassing, when there are multiple catch clauses
in a try statement, it is possible that a given exception might
match several of those catch clauses.  For example, an exception of
type NullPointerException would match catch
clauses for NullPointerException, RuntimeException,
Exception, or Throwable.  In this
case, only the first catch clause that matches the exception
is executed.

The example I've given here is not particularly realistic. You are not very
likely to use exception-handling to guard against null pointers and bad array
indices. This is a case where careful programming is better than exception
handling: Just be sure that your program assigns a reasonable,
non-null value to the array M. You would certainly resent it
if the designers of Java forced you to set up a try..catch
statement every time you wanted to use an array! This is why handling of
potential RuntimeExceptions is not mandatory. There are just too many
things that might go wrong! (This also shows that exception-handling does not
solve the problem of program robustness. It just gives you a tool that will in
many cases let you approach the problem in a more organized way.)

I have still not completely specified the syntax of the try statement.
There is one additional element: the possibility of a finally clause
at the end of a try statement.  The complete syntax of the try
statement can be described as:

try {
   statements
}
optional-catch-clauses
optional-finally-clause

Note that the catch clauses are also listed as optional.
The try statement can include zero or more catch clauses and,
optionally, a finally clause.  The try statement must include
one or the other.  That is, a try statement can have
either a finally clause, or one or more catch clauses, or both.  The
syntax for a catch clause is

catch ( exception-class-name variable-name ) {
   statements
}

and the syntax for a finally clause is

finally {
   statements
}

The semantics of the finally clause is that the block of statements
in the finally clause is guaranteed to be executed as the last step in
the execution of the try statement, whether or not any exception occurs and
whether or not any exception that does occur is caught and handled. The
finally clause is meant for doing essential cleanup that under no
circumstances should be omitted.  One example of this type of cleanup is
closing a network connection.  Although you don't yet know enough about networking
to look at the actual programming in this case, we can consider some pseudocode:

try {
   open a network connection
}
catch ( IOException e ) {
   report the error
   return  // Don't continue if connection can't be opened!
}

// At this point, we KNOW that the connection is open.

try {
   communicate over the connection
}
catch ( IOException e ) {
   handle the error
}
finally {
   close the connection
}

The finally clause in the second try statement
ensures that the network connection will definitely be closed, whether or
not an error occurs during the communication.  The first try statement
is there to make sure that we don't even try to communicate over the network
unless we have successfully opened a connection.  The pseudocode in this
example follows a general pattern that can be used to robustly obtain a resource,
use the resource, and then release the resource.

8.3.3  Throwing Exceptions

There are times when it makes sense for a program to deliberately throw an
exception. This is the case when the program discovers some sort of exceptional
or error condition, but there is no reasonable way to handle the error at the
point where the problem is discovered. The program can throw an exception in
the hope that some other part of the program will catch and handle the
exception.  This can be done with a throw statement.
You have already seen an example of this in Subsection 4.3.5.
In this section, we cover the throw statement more fully.
The syntax of the throw statement is:

throw  exception-object ;

The exception-object must be an object
belonging to one of the subclasses of Throwable. Usually, it will in
fact belong to one of the subclasses of Exception. In most cases, it
will be a newly constructed object created with the new operator. For
example:

throw new ArithmeticException("Division by zero");

The parameter in the constructor becomes the error message in the exception
object; if e refers to the object, the error message can be retrieved
by calling e.getMessage().
(You might find this example a bit odd, because you might expect the
system itself to throw an ArithmeticException when an attempt is made
to divide by zero. So why should a programmer bother to throw the exception?
Recall that if the numbers that are being divided are of
type int, then division by zero will indeed throw an
ArithmeticException. However, no arithmetic operations with
floating-point numbers will ever produce an exception. Instead, the special
value Double.NaN is used to represent the result of an illegal
operation.  In some situations, you might prefer to throw an
ArithmeticException when a real number is divided by zero.)

An exception can be thrown either by the system or by a throw
statement. The exception is processed in exactly the same way in either case.
Suppose that the exception is thrown inside a try statement. If that
try statement has a catch clause that handles that type of
exception, then the computer jumps to the catch clause and executes
it. The exception has been handled. After handling
the exception, the computer executes the finally clause of the
try statement, if there is one. It then continues normally with the
rest of the program, which follows the try statement. If the exception
is not immediately caught and handled, the processing of the exception will
continue.

When an exception is thrown during the execution of a subroutine and the
exception is not handled in the same subroutine, then that subroutine is
terminated (after the execution of any pending finally clauses). Then
the routine that called that subroutine gets a chance to handle the exception.
That is, if the subroutine was called inside a try statement that has
an appropriate catch clause, then that catch clause will be
executed and the program will continue on normally from there. Again, if the second
routine does not handle the exception, then it also is terminated and the
routine that called it (if any) gets the next shot at the exception. The
exception will crash the program only if it passes up through the entire chain
of subroutine calls without being handled.  (In fact, even this is not quite true:
In a multithreaded program, only the thread in which the exception occurred is terminated.)

A subroutine that might generate an exception can announce this fact by
adding a clause "throws exception-class-name"
to the header of the routine. For example:

/**
 * Returns the larger of the two roots of the quadratic equation
 * A*x*x + B*x + C = 0, provided it has any roots.  If A == 0 or
 * if the discriminant, B*B - 4*A*C, is negative, then an exception
 * of type IllegalArgumentException is thrown.
 */
static public double root( double A, double B, double C )
                              throws IllegalArgumentException {
    if (A == 0) {
      throw new IllegalArgumentException("A can't be zero.");
    }
    else {
       double disc = B*B - 4*A*C;
       if (disc < 0)
          throw new IllegalArgumentException("Discriminant < zero.");
       return  (-B + Math.sqrt(disc)) / (2*A);
    }
}

As discussed in the previous section,
the computation
in this subroutine has the preconditions that A != 0 and B*B-4*A*C
>= 0. The subroutine throws an exception of type
IllegalArgumentException when either of these preconditions is
violated. When an illegal condition is found in a subroutine, throwing an
exception is often a reasonable response.  If the program that called the
subroutine knows some good way to handle the error, it can catch the exception.
If not, the program will crash -- and the programmer will know that the program
needs to be fixed.

A throws clause in a subroutine heading can declare several different
types of exception, separated by commas.  For example:

void processArray(int[] A) throws NullPointerException,
                                         ArrayIndexOutOfBoundsException { ...

8.3.4  Mandatory Exception Handling

In the preceding example, declaring that the subroutine root() can
throw an IllegalArgumentException is just a courtesy to potential
readers of this routine. This is because handling of
IllegalArgumentExceptions is not "mandatory." A routine can throw an
IllegalArgumentException without announcing the possibility. And a
program that calls that routine is free either to catch or to ignore the
exception, just as a programmer can choose either to catch or to ignore an
exception of type NullPointerException.

For those exception classes that require mandatory handling, the situation
is different. If a subroutine can throw such an exception, that fact
must be announced in a throws clause in the routine definition.
Failing to do so is a syntax error that will be reported by the compiler.
Exceptions that require mandatory handling are called checked exceptions.
The compiler will check that such exceptions are handled by the program.

Suppose that some statement in the body of a subroutine can generate a
checked exception, one that requires mandatory handling. The statement could be a
throw statement, which throws the exception directly, or it could be a
call to a subroutine that can throw the exception. In either case, the
exception must be handled. This can be done in one of two ways: The first way
is to place the statement in a try statement that has a catch
clause that handles the exception; in this case, the exception is handled within the
subroutine, so that any caller of the subroutine will never see the exception.
The second way is to declare that the subroutine can throw the exception. This is done by
adding a "throws" clause to the subroutine heading, which alerts any callers
to the possibility that an exception might be generated when the subroutine is executed.
The caller will, in turn, be forced either to handle the exception in a try
statement or to declare the exception in a throws clause in its own
header.

Exception-handling is mandatory for any exception class that is not a
subclass of either Error or RuntimeException.
These checked exceptions generally represent conditions that are outside the
control of the programmer. For example, they might represent bad input or an
illegal action taken by the user.  There is no way to avoid such errors,
so a robust program has to be prepared to handle them.  The design of Java makes it
impossible for programmers to ignore the possibility of such errors.

Among the checked exceptions are several that can
occur when using Java's input/output routines. This means that you can't even
use these routines unless you understand something about exception-handling.
Chapter 11 deals with input/output and uses mandatory exception-handling
extensively.

8.3.5  Programming with Exceptions

Exceptions can be used to help write robust
programs. They provide an organized and structured approach to robustness.
Without exceptions, a program can become cluttered with if statements
that test for various possible error conditions. With exceptions, it becomes
possible to write a clean implementation of an algorithm that will handle all
the normal cases. The exceptional cases can be handled elsewhere, in a
catch clause of a try statement.

When a program encounters an exceptional condition and has no way of
handling it immediately, the program can throw an exception. In some cases, it
makes sense to throw an exception belonging to one of Java's predefined
classes, such as IllegalArgumentException or IOException.
However, if there is no standard class that adequately represents the
exceptional condition, the programmer can define a new exception class. The new
class must extend the standard class Throwable or one of its
subclasses. In general, if the programmer does not want to require
mandatory exception handling,
the new class will extend RuntimeException (or
one of its subclasses).  To create a new checked exception class, which does require
mandatory handling, the programmer can extend one of the other subclasses of
Exception or can extend Exception itself.

Here, for example, is a class that extends Exception, and therefore
requires mandatory exception handling when it is used:

public class ParseError extends Exception {
   public ParseError(String message) {
         // Create a ParseError object containing
         // the given message as its error message.
      super(message);
   }
}

The class contains only a constructor that makes it possible to create a
ParseError object containing a given error message. (The statement
"super(message)" calls a constructor in the superclass,
Exception. See Subsection 5.6.3.) Of course the
class inherits the getMessage() and printStackTrace()
routines from its superclass. If e refers to an object of type
ParseError, then the function call e.getMessage() will
retrieve the error message that was specified in the constructor. But the main
point of the ParseError class is simply to exist. When an object of
type ParseError is thrown, it indicates that a certain type of error
has occurred. (Parsing, by the way, refers to
figuring out the syntax of a string. A ParseError would indicate,
presumably, that some string that is being processed by the program does not have the
expected form.)

A throw statement can be used in a program to throw an error of
type ParseError. The constructor for the ParseError object
must specify an error message. For example:

throw new ParseError("Encountered an illegal negative number.");

or

throw new ParseError("The word '" + word
                               + "' is not a valid file name.");

If the throw statement does not occur in a try statement
that catches the error, then the subroutine that contains the throw
statement must declare that it can throw a ParseError by
adding the clause "throws ParseError" to the subroutine heading. For
example,

void getUserData() throws ParseError {
   . . .
}

This would not be required if ParseError were defined as a subclass
of RuntimeException instead of Exception, since in that case
 ParseErrors would not be checked exceptions.

A routine that wants to handle ParseErrors can use a try
statement with a catch clause that catches ParseErrors. For
example:

try {
   getUserData();
   processUserData();
}
catch (ParseError pe) {
   . . .  // Handle the error
}

Note that since ParseError is a subclass of Exception, a
catch clause of the form "catch (Exception e)" would also
catch ParseErrors, along with any other object of type
Exception.

Sometimes, it's useful to store extra data in an exception object. For
example,

class ShipDestroyed extends RuntimeException {
   Ship ship;  // Which ship was destroyed.
   int where_x, where_y;  // Location where ship was destroyed.
   ShipDestroyed(String message, Ship s, int x, int y) {
         // Constructor creates a ShipDestroyed object
         // carrying an error message plus the information
         // that the ship s was destroyed at location (x,y)
         // on the screen.
       super(message);
       ship = s;
       where_x = x;
       where_y = y;
   }
}

Here, a ShipDestroyed object contains an error message and some
information about a ship that was destroyed. This could be used, for example,
in a statement:

if ( userShip.isHit() )
   throw new ShipDestroyed("You've been hit!", userShip, xPos, yPos);

Note that the condition represented by a ShipDestroyed object might
not even be considered an error. It could be just an expected interruption to
the normal flow of a game. Exceptions can sometimes be used to handle such
interruptions neatly.

The ability to throw exceptions is particularly useful in writing
general-purpose methods and classes that are meant to be used in more than
one program. In this case, the person writing the method or class often has
no reasonable way of handling the error, since that person has no way of
knowing exactly how the method or class will be used. In such
circumstances, a novice programmer is often tempted to print an error message
and forge ahead, but this is almost never satisfactory since it can lead to
unpredictable results down the line. Printing an error message and terminating
the program is almost as bad, since it gives the program no chance to handle
the error.

The program that calls the method or uses the class needs to know that
the error has occurred. In languages that do not support exceptions, the only
alternative is to return some special value or to set the value of some
variable to indicate that an error has occurred. For example, the
readMeasurement() function in Subsection 8.2.2 returns
the value -1 if the user's input is illegal. However, this only does any good
if the main program bothers to test the return value.  It is very easy to be lazy about
checking for special return values every time a subroutine is called.
And in this case, using
-1 as a signal that an error has occurred makes it impossible to allow
negative measurements.  Exceptions are a cleaner way for a subroutine to react
when it encounters an error.

It is easy to modify the readMeasurement() function to use
exceptions instead of a special return value to signal an error. My modified
subroutine throws a ParseError when the user's input is illegal, where
ParseError is the subclass of Exception that was defined
above. (Arguably, it might be reasonable to avoid
defining a new class by using the standard exception class
IllegalArgumentException instead.) The changes from the original
version are shown in red:

/**
 * Reads the user's input measurement from one line of input.
 * Precondition:   The input line is not empty.
 * Postcondition:  If the user's input is legal, the measurement
 *                 is converted to inches and returned.
 * @throws ParseError if the user's input is not legal.
 */
static double readMeasurement() throws ParseError {

   double inches;  // Total number of inches in user's measurement.

   double measurement;  // One measurement,
                        //   such as the 12 in "12 miles."
   String units;        // The units specified for the measurement,
                        //   such as "miles."

   char ch;  // Used to peek at next character in the user's input.

   inches = 0;  // No inches have yet been read.

   skipBlanks();
   ch = TextIO.peek();

   /* As long as there is more input on the line, read a measurement and
      add the equivalent number of inches to the variable, inches.  If an
      error is detected during the loop, end the subroutine immediately
      by throwing a ParseError. */

   while (ch != '\n') {

       /* Get the next measurement and the units.  Before reading
          anything, make sure that a legal value is there to read. */

       if ( ! Character.isDigit(ch) ) {
           throw new ParseError("Expected to find a number, but found " + ch);
       }
       measurement = TextIO.getDouble();

       skipBlanks();
       if (TextIO.peek() == '\n') {
          throw new ParseError("Missing unit of measure at end of line.");
       }
       units = TextIO.getWord();
       units = units.toLowerCase();

       /* Convert the measurement to inches and add it to the total. */

       if (units.equals("inch")
               || units.equals("inches") || units.equals("in")) {
           inches += measurement;
       }
       else if (units.equals("foot")
                  || units.equals("feet") || units.equals("ft")) {
           inches += measurement * 12;
       }
       else if (units.equals("yard")
                  || units.equals("yards") || units.equals("yd")) {
           inches += measurement * 36;
       }
       else if (units.equals("mile")
                  || units.equals("miles") || units.equals("mi")) {
           inches += measurement * 12 * 5280;
       }
       else {
           throw new ParseError("\"" + units
                                + "\" is not a legal unit of measure.");
       }

       /* Look ahead to see whether the next thing on the line is
          the end-of-line. */

       skipBlanks();
       ch = TextIO.peek();

   }  // end while

   return inches;

} // end readMeasurement()

In the main program, this subroutine is called in a try statement
of the form

try {
   inches = readMeasurement();
}
catch (ParseError e) {
   . . .  // Handle the error.
}

The complete program can be found in the file LengthConverter3.java.
From the user's
point of view, this program has exactly the same behavior as the program
LengthConverter2
from the previous section.
Internally, however, the programs are significantly
different, since LengthConverter3 uses exception handling.

        [  Previous Section |
           Next Section |
           Chapter Index |
        Main Index ]


class="post-template-default single single-post postid-374875 single-format-standard group-blog masthead-fixed full-width singular wpb-js-composer js-comp-ver-5.7 vc_responsive"
Former Duck, Chief, Raider, and Eagle hopes to make a difference for area youth on Wednesday.
Former NFL player, Brandon Bair, will be the keynote speaker on Wednesday at the Panhandle Youth Leadership Day.
The event is sponsored by Monument Prevention and the Human Performance Project and will take place from 8 a.m. to 3 p.m. at the UNL Panhandle Extension Center in Scottsbluff.
The all day leadership conference for high school students will feature keynotes and presentations from Bair and WNCC men's basketball coach, Cory Fehringer.
Brandon Bair played his college football at the University of Oregon (where he played under then assistant coach, Scott Frost) and then went on to play five seasons in the NFL with the Kansas City Chiefs, Oakland Raiders, and Philadelphia Eagles.
Bair really had an outstanding playing career. During his four seasons at Oregon, he had 25.5 tackles for loss, five sacks, and 12 passes defended. Along with being a team captain, Bair was named 2nd team All-Pac 10 in 2009 and 2010.
Bair now devotes his time to speaking with students, athletes, coaches, and businesses around the world; both on his own and for an organization called the Human Performance Project.
Along with Bair and Coach Fehringer there will also be presentations by Monica Shambaugh with the NE Deptartment of Education and Jerry Mack and Craig Nobiling with Chadron High School.
The event runs from 8 a.m. to 3 p.m. on Wednesday at the UNL Extension Center in Scottsbluff.