text:
Category: Roger Williams
November 24, 2022 December 10, 2022 zenlutheran church&state, culture wars, journal, Roger Williams, rule of law
Money changers in the temple? Justice Alito's leaks show dangers of too-cozy relationships between church, state
https://www.youtube.com/watch?v=LN_TcmU1-k4 https://www.youtube.com/watch?v=LN_TcmU1-k4 [Roger] Williams described the true church as a magnificent garden, unsullied and pure, resonant of Eden. The world he described as "the Wilderness," a word with personal resonance for him. Then he used for the first time a phrase he would use again, a phrase that although not commonly attributed to him has … Continue reading Money changers in the temple? Justice Alito's leaks show dangers of too-cozy relationships between church, state
September 10, 2022 September 12, 2022 zenlutheran church&state, journal, peace, Roger Williams
The score when Nixon spoke at a Billy Graham crusade at UT-Knoxville: Lions 0; Christians 1; First Amendment -1
https://upload.wikimedia.org/wikipedia/commons/f/f5/President_Richard_Nixon_and_Reverend_Billy_Graham_at_the_Podium_during_the_%22Crusade_for_Christ%22_at_Neyland_Stadium_in_Knoxville%2C_Tennessee.jpg Nixon and Billy Graham, UT-Knoxville, 1970 (Wikimedia Commons) "[Roger Williams] described the true church as a magnificent garden, unsullied and pure, resonant of Eden. The world he described as "the Wilderness," a word with personal resonance for him. Then he used for the first time a phrase he would use again, a phrase that … Continue reading The score when Nixon spoke at a Billy Graham crusade at UT-Knoxville: Lions 0; Christians 1; First Amendment -1
August 4, 2022 August 26, 2022 zenlutheran discernment, Dominicans, faith, Jesuits, pandemic, personal God, prayer, Roger Williams, spiritual practice, Swedes
'What am I doing for Christ?': An Ignatian triple colloquy F2F with Jesus via Zoom
Third in an occasional series of Ignatian colloquies ... Christ Pantocrator, Haiga Sophia, Istanbul, ca. 1080-1100 (Wikimedia Commons) Editor's (admin's) note. One of a series of posts in which I journal my attempts to incorporate Jesuit imaginative prayer exercises into my own prayer life. In today's, I try what is often known as the triple … Continue reading 'What am I doing for Christ?': An Ignatian triple colloquy F2F with Jesus via Zoom
July 30, 2022 July 30, 2022 zenlutheran church&state, culture wars, media ethics, Roger Williams
Notes & quotes: Alito's speech on First Amendment rights, free exercise clause at Notre Dame event in Rome
Content advisory: The speaker pictured in the video below is not Justice Samuel Alito but another political figure who shares a similar ideology. The video is embedded to share remarks by Amanda Tyler, executive director of the Baptist Joint Committee, regarding Alito's speech. https://www.youtube.com/watch?v=kht_3z3hrQs Amanda Tyler's remarks begin at 4:20. More than a year ago … Continue reading Notes & quotes: Alito's speech on First Amendment rights, free exercise clause at Notre Dame event in Rome
June 27, 2022 July 19, 2022 zenlutheran Augustana, church&state, creolization, culture wars, immigration, journal, Roger Williams, Swedes
What can Roger Williams and Swedish Lutherans of the 1850s tell us about the culture wars? A research proposal
Alonzo Chappel, "Landing of Roger Williams," 1857 (Wikimedia Commons) "I have to write to discover what I am doing. Like the old lady, I don't know so well what I think until I see what I say; then I have to say it again."― Flannery O'Connor, The Habit of Being: Letters of Flannery O'Connor, quoted in Goodreads. … Continue reading What can Roger Williams and Swedish Lutherans of the 1850s tell us about the culture wars? A research proposal
April 1, 2022 April 2, 2022 zenlutheran church&state, culture wars, Roger Williams
Book-burning white evangelical pastor in Middle Tennessee proves: Religion plus extremist politics equals extremist politics
[Roger] Williams described the true church as a magnificent garden, unsullied and pure, resonant of Eden. The world he described as "the Wilderness," a word with personal resonance for him. Then he used for the first time a phrase he would use again, a phrase that although not commonly attributed to him has echoed through … Continue reading Book-burning white evangelical pastor in Middle Tennessee proves: Religion plus extremist politics equals extremist politics
March 15, 2022 April 3, 2022 zenlutheran 1850s, Augustana, creolization, culture wars, folk churches, immigration, journal, Roger Williams, Swedes
For the futures file? Another look at 'Swedes in Roger Williams' Garden' in light of new circumstances
d r a f t In memoriam, Oley the Cat, ca. 2006-March 13, 2022. LTK Seems like the tectonic plates are shifting again, in my life and in the world at large ... In ways that may give a new context for my study of the church-planting stage of Swedish-American immigration and the foundation of … Continue reading For the futures file? Another look at 'Swedes in Roger Williams' Garden' in light of new circumstances
December 16, 2021 December 18, 2021 zenlutheran Augustana, creolization, culture wars, discernment, Dominicans, immigration, journal, Roger Williams, Swedes
19th-century Swedes in Roger Williams' Garden: Applying a Japanese discernment concept to a historical research project
With an awkward footnote preserving a middle-of-the-night scratch outline on how to further revise my ALPLM paper 'Swedes in Roger Williams' Garden: Acculturation in Immigrant Churches, 1848-1860.' A useful discernment or decision-making technique I learned in a class for Dominican lay associate candidates -- it's called ikigai, and I wish I'd known about it when … Continue reading 19th-century Swedes in Roger Williams' Garden: Applying a Japanese discernment concept to a historical research project
July 27, 2021 July 31, 2021 zenlutheran church&state, civil religion, Roger Williams
Baptist video shows Roger Williams, other religious figures in colonial America
d r a f t https://www.youtube.com/watch?v=Ut10jVFZDQw Segment on Roger Williams begins at 20:20, runs about 10 minutes ... Blurb on YouTube is as follows: Saints and Strangers addresses religious influences from the time of the Mayflower to the Great Awakening, from Plymouth Rock to the War of Independence. It examines the groups of the faithful … Continue reading Baptist video shows Roger Williams, other religious figures in colonial America
May 8, 2021 July 28, 2022 zenlutheran Augustana, church&state, culture wars, journal, pandemic, Roger Williams, Swedes
A dissent on the 'assertion of imaginary freedoms' in Trump's Supreme Court, by an English major turned jailhouse lawyer and armchair historian
"It was all Mrs. Bumble. She would do it," urged Mr. Bumble; first looking round, to ascertain that his partner had left the room.That is no excuse," returned Mr. Brownlow. "You were present on the occasion of the destruction of these trinkets, and, indeed, are the more guilty of the two, in the eye of … Continue reading A dissent on the 'assertion of imaginary freedoms' in Trump's Supreme Court, by an English major turned jailhouse lawyer and armchair historian

redpajama_set_name: RedPajamaCommonCrawl


Cenforce 200 Mg tablets USA are an impotence erectile dysfunction that allows a man to withstand straight male genitalia for up to 2 hours. This tablet has helped to reinstate sureness to lots of men from everywhere the world facing erectile dysfunction. Covering the active ingredient Cenforce 200 Mg tablets, is an approved medication with having safe, effective and long lasting features.
Cenforce 200 Mg is a well known drug, which is extensively used to treat erectile dysfunction, which is a shared sexual grievance in man. This drug embraced with generic Cenforce 200 as an active medicinal drug. This drug performances by just enhancing the source of the blood into the penile area. It should be taken one hour earlier of physical closeness, with a glass of water and milk the effectiveness of this drug last from 2 hours.


text:
Mancini embraces his role as veteran Oriole
It sounded strange to Trey Mancini. He won't be 27 until next month, and he's just starting his third full season in the major leagues, but he's one of the most veteran of this year's Orioles.
Last July's purge and the departure of Adam Jones leave eight players from the 2016 team on the 40-man roster. Mancini was one of three players named as a cornerstone by general manager Mike Elias in a November email to season ticket-holders.
Thirteen player on the 40-man roster are older than Mancini and five — Mark Trumbo, Chris Davis, Andrew Cashner, Richard Bleier and Alex Cobb — are over 30.
While Davis' contract runs through 2022, Mancini remains under club control until then. He won't be eligible for arbitration until a year from now.
Mancini, a political science graduate of Notre Dame, accepts his role as one of the more senior Orioles.
"It's obviously different," Mancini said at last Saturday's FanFest at the Baltimore Convention Center. "It's been the same core group here from 2012-2018, so it's a totally different feel, but it's actually really exciting."
Although manager Brandon Hyde has said little about his lineup, Mancini figures to be the regular left fielder while Davis begins the season at first base and Trumbo as the designated hitter.
Mancini could be joined by Cedric Mullins, another player mentioned by Elias as a building block, and perhaps Austin Hays, Joey Rickard, Anthony Santander, DJ Stewart—or someone from outside the organization in the outfield.
"To have a lot of young guys here, it's going to be an energetic team … and I'm really excited to get started," he said.
Mancini has been gracious to fans and media members, and he could become a go-to guy for the media, and his younger teammates.
"Life comes at you fast sometimes," Mancini said. "I've played just over two years here, and I'm considered a veteran. You can get thrown into the fire. It's happened to me before. I'm absolutely ready to take on that role."
Mancini made an unexpected debut in September 2016 when Steve Pearce suffered a calf injury. He had been in Sarasota working out when he got the call to come to Baltimore.
Mancini homered three times in five games and was on the roster for the 2016 wild-card game.
Mancini was converted from a first baseman to an outfielder the next season — first in right field, then in left — and hit .293 with 24 home runs and 78 RBIs. He finished third in the American League Rookie of the Year voting.
Mancini had an awful start to the 2018 season, hitting .216 at the All-Star break and .276 after it. His power numbers were consistent, 12 homers before and after the break, and 26 RBIs pre-break and 32 in the second half.
Mancini had a .715 OPS, down from .826 his rookie year.
"I'm just kind of sticking to what I did in the second half," Mancini said. "I think I tried to tinker too much last offseason and change a couple of things up. I probably didn't need to do that. I just went back to what I know how to do, and I'm still doing that."
Because only Manny Machado hit consistently in the first half, Mancini believes he was pressing.
"I think we all did that to a degree," Mancini said. "We kind of got off to a rough start last year and couldn't really recover from that, unfortunately, and we kind of let it spiral out of control. … Towards the end of the year, I thought we started playing a lot better."
The son of an OBGYN, who briefly considered medical school, Mancini is in favor of a greater emphasis on analytics.
"It's just a fact now that analytics are an important part of baseball," Mancini said. "I'm really looking forward to getting more information in that regard. I feel like that's what the new regime is really all about. I'm really looking forward to looking at some things and seeing some adjustments I can make personally, and things other guys can do personally to make themselves better."
As Mancini heads to Sarasota, Fla., for the start of spring training later this month, he realizes that he might be a leader.
"I've got to be a little more vocal," Mancini said. "I know towards the end of last year, a lot of guys were coming up to me, asking what they should do about their 401(k) plan, all that stuff. I just asked people that the year before. I had no idea. I'm trying to study up on that, get more educated as things about the union goes. In kind of those regards, I'm trying to step up to the plate a little bit."


text:
Q: PG::UndefinedColumn: ERROR: column courts.user_id does not exist This is the error I receive when I run a test for this file.
The error is in line 83 when I attempt to remove the user from the database using the 'destroy' method.
This is the repo in question frozen in time.
The error:
ActiveRecord::StatementInvalid:
       PG::UndefinedColumn: ERROR:  column courts.user_id does not exist
       LINE 1: SELECT "courts".* FROM "courts" WHERE "courts"."user_id" = $...

I'm trying to connect the table users with the table court this way:

*

*User is the administrator of many courts

*A court can have only one administrator
As you can see, 'Court' has a foreign key linked to 'users', but called 'administrator'.
I want 'administrator' to be the alias of a user because in the future User and Court might have more relationships: 'owner' for example.
I can see that active record is building this query:
SELECT "courts".* FROM "courts" WHERE "courts"."user_id" = $...

Maybe this can be solved if Active Record build a query this way
SELECT "courts".* FROM "courts" WHERE "courts"."administrator_id" = $...

But I don't know how to do it and if that would be prudent.
Maybe there is another way to do this. Something tidier, I feel I'm not doing the association properly.
What do you recommend?
models/user.rb
class User < ActiveRecord::Base
    before_save :format_input
    # extend Devise::Models
    # Include default devise modules        .
    devise  :database_authenticatable,
            # :validatable,
            # :recoverable,
            # :rememberable,
            # :trackable,
            # :confirmable,
            # :omniauthable,
            :registerable

    # note that this include statement comes AFTER the devise block above
    include DeviseTokenAuth::Concerns::User
    validates :first_name, presence: true, length: { in: 1..20 }
    validates :last_name, presence: true, length: { in: 1..20 }
    validates :email, uniqueness: true
    validates_format_of :email, with: /@/
    validates :password, presence: true, length: { in: 8..20 }, :on => :create

    has_many :courts, dependent: :destroy

    private

    def format_input
            self.first_name = first_name.downcase.titleize
            self.last_name = last_name.downcase.titleize
            self.email = email.downcase
    end
end

models/court.rb
class Court < ApplicationRecord

  belongs_to :administrator, :class_name => :user
  validates :name, presence: true, length: { in: 1..20 }
  validates :address, presence: true, length: { in: 1..50 }
  validates :description, presence: true, length: { in: 1..100 }
  validates :description, presence: true, length: { in: 1..100 }

end

A: The issue is on this line.
has_many :courts, dependent: :destroy

By default, ActiveRecord assumes the foreign key is named <lowercased_parent_class_name>_id. In this case, when you delete a user, ActiveRecord is trying to delete the associated courts using the user_id foreign key which doesn't exist. Pass the foreign_key option to the has_many call.
has_many :courts, dependent: :destroy, foreign_key: :administrator_id

From the docs:

:foreign_key
Specify the foreign key used for the association. By default this is guessed to be the name of this class in lower-case and _id suffixed. So a Person class that makes a has_many association will use person_id as the default :foreign_key.

There's another issue. You should pass the uppercased class name as a string in the belongs_to call in the Court model.
belongs_to :administrator, class_name: 'User'

This is unrelated to the question but you might want to check if it is okay to delete a court when the user record is deleted.

redpajama_set_name: RedPajamaStackExchange


I've decided to resurrect my blog.
Many of you may know that I began a Patreon page at the beginning of the year. With Patreon, people sign up to be supporters and pay small amounts on a monthly basis in return for rewards. For instance, for $3 a patron would get a printable coloring sheet every month, and for $12 I would mail you three greeting cards each month (as well as a coloring sheet).
My Patreon page has had slow growth since it started in January. And by slow growth I mean no growth from the original 4 wonderful, lovely people who signed up (one of whom was my husband whom I told to sign up so I can see what it looked like from a patron's point of view).
So, I've decided to call it quits. It was an experiment. Calling it an experiment makes me feel better for ending it.
I did like having the spot (my Patreon page) to write more extensive updates and share even more process videos/pictures than on my Instagram and Facebook. That got me thinking that I might like to resurrect this blog.
Blogging in some form or fashion has been apart of my life back since i had a Xanga in 2005. Oh, actually before that I had an anonymous "online diary" even in middle school/high school... That's before I even knew the word "blog"! Crazy. It was on diaryland.com (which is still around, I just found out!).
I considered not even sharing that I failed at Patreon. It's not very professional to go around pointing out how I tried something that didn't work. But then I decided that for that reason, I should share it.
This blog is not a marketing tool (i started thinking of it in that way in the past which is why I think I lost interest.) This is a space for me to share the thoughts/processes regarding my art-making and anything else that feels pertinent at the time. I will have zero expectations regarding comments/likes/traffic.
Join me if you like -- you can subscribe to get updates over there on the side bar (or perhaps on the bottom of the page if you're using a phone?). Or don't join me. Whatevs.
I will so join you here ... and applaud you for not letting time on Patreon go on and on when it wasn't working. You're smart.
And yes, "death does bring new life."


Celebrating the extraordinary creative talent of one of the most innovative designers of recent times, Alexander McQueen: Savage Beauty will be the first and largest retrospective of McQueen's work to be presented in Europe.
The original version of Alexander McQueen: Savage Beauty at the Metropolitan Museum of Art, New York in 2011 was organised by the Costume Institute and became one of the museum's top 10 most visited exhibitions.
The exhibition showcases McQueen's visionary body of work. Spanning his 1992 MA graduate collection to his unfinished A/W 2010 collection, McQueen's designs are presented with the dramatic staging and sense of spectacle synonymous with his runway shows.
The V&A experienced unprecedented demand for the exhibition, helping it become the most visited paid for exhibition in the UK ever, with 24 hour opening for its final three months.
Echo supported the exhibition with the production & installation of strikingly beautiful six metre high canvas graphics, full graphic flooring and detail throughout including signage and on-site silk screening in gold leaf.


The Badger character from Breaking Bad wrote this epically funny Star Trek animated video. A gentleman named Matt Czap really wrote the video which Vulture animated. We didn't know Vulture's could animate.


Currently obsessed with these Saint Laurent jeans! Check out how I paired them below. I'm loving that this look can easily be transformed from day to night time.
Follow me on Instagram for my daily looks @RoziSoraya.
Prom Dress Season Is Arriving!


Located close to the Arabian Gulf, Al Zahraa is a small community which can be spotted near Sheikh Rashid Bin Humaid Street. Though small, the residential area offers a pleasant mix of villas and apartments for those interested in renting or investing in Al Zahraa Ajman. Unlike other areas of Ajman, Al Zahraa is a fully developed community with no off plan properties.
The villas in Al Zahraa are high in demand, as per Bayut.com's Market Report for 2018 which ranks the area as the third most popular spot to buy villas.
Al Zahraa Ajman is a mixed-used community and home to many residents who belong to different cultures. At a glance, one will find more villas when compared to apartments for residential use. The villas do not look alike in terms of infrastructure but each villa has all the amenities needed.
Located some blocks away from Ajman Beach, Al Zahraa offers a modern lifestyle to its inhabitants unlike most areas of Ajman where there are still off-plan developments. Ajman, overall, has seen a massive influx of renters and buyers due to the conveniences and the affordability that the city offers.
In fact, this neighbourhood has a few things that a number of other communities do not offer. It scores more points because the land lies in a free zone region making it important for foreign buyers and investors.
The flats in Al Zahraa Ajman are not available for sale but several apartments are available on rent. The configuration of flats ranges from studios to 2-bedroom apartments. Some apartments also have a central heating system along with a central air-conditioning system. The rent of a 1-bedroom apartment ranges between AED 20k to AED 29k while a 2-bedroom flat ranges between AED 27k to 38k.
For those who have a big family and are looking for a more spacious property, the villas of Al Zahraa Ajman would be an idyllic place. The area has an abundance of houses for sale and rent.
Villas in Al Zahraa Ajman have a conventional appeal in them. They are available in either 3, 4 or 5-bedroom configurations. Besides an open-plan living room, they have large bedrooms, storage rooms, large majlises (traditional Arabic living room), tile flooring, a laundry room, two kitchens and rooms for the house help. It also contains a terrace that provides picturesque views of the Ajman shore. The houses here have a barbeque area and a kid's play area as well. Some properties also have an additional facility of electricity backup. The rental trend for a 5 bedroom villa fluctuates between AED 65k to AED 90k per year. For interested buyers and investors, a 5-bedroom villa is priced between AED 1M to AED 2.2M.
There are a few residential buildings for sale which come with some shops and mostly studios and 2-bedroom apartments. The buildings are centrally air-conditioned and feature amenities such as CCTV security monitoring, security staff, waste disposal, cleaning services and ample space for parking. They are priced between AED 6.2M to AED 17.5M.
There are limited parking spaces in Ajman which forces people to park their vehicles in sandy areas and unauthorised spaces. However, Al Zahraa Ajman is near areas such as Sheikh Humaid bin Rashid in Rumaila where there is an initiative to add 2,000 more parking spaces. This will eventually make it easier for people with more than one vehicle to utilise a paid parking slot as the residential buildings offer reserved parking space for one vehicle only. On the other hand, villas have parking spaces for two vehicles or more, depending on the size of the villa.
There is limited public transport in Ajman compared to Dubai and Abu Dhabi. There is only one bus stop in the area called Al Rawda Bus Stop. From here residents can hop on the AJ3 bus which connects to the rest of the city. However, the best option remains to travel using a car or a taxi.
There is a network of supermarkets near Al Zahraa. The nearest two are Nesto Supermarket and Shopper Gate Supermarket which operates 24/7. Others nearby include Taiba Supermarket, Apsara Supermarket, Choithrams and Ajson Supermarket. All of these are located close to each other.
Ajman is home to people of different beliefs. Muslims, Hindus, Christians and Sikhs make up the most of the population of expats in the emirate.
The nearest church from the area is Winners Chapel International in Rashidiya 1 situated at a distance of barely 10 minutes and it is the only church in Ajman. Others are around 25 minutes away in the neighbouring emirate of Sharjah.
There are no temples in Ajman, people who would like to visit one will have to travel to Dubai which is around 40 minutes by car.
Unlike the case with temples and churches, Ajman has plenty of mosques. There are quite a few mosques in Al Zahraa Ajman. Masjid Al Aqeel, Al Hamrani Masjid, Bin Jaber Mosque and Badu Masjid are all nearby.
There are no educational institutes in the community, there are quite a few schools near Al Zahraa Ajman. Many primary and secondary schools are situated in neighbouring areas. One of Ajman's most reputable schools The Bloomingdale Academy follows the National Curriculum of England. It is located nearby in Al Bustan. Schools offering the Indian curriculum include The Royal Academy Ajman, International Indian School Ajman and Al Ameer English School.
University options include the City University College Ajman in Al Tallah which is a 5-minute drive away. The UAE's premier medical educational institute Gulf Medical University is just 10 minutes away in Al Jerf.
The residents of the area can easily head to Northern Ahalia Medical Center and Amina Hospital as both are 5 minutes away. There are numerous pharmacies near Al Zahraa Ajman. Medicina Pharmacy, Naeema Pharmacy, Thumbay Pharmacy, and Life Pharmacy are scattered around Al Zahraa.
A few very well-known residential districts are located near the small community of Al Zahraa Ajman namely Al Nakhil, Al Bustan and one of the largest residential area of Ajman, Al Rashidiya. Al Zahraa is also close to Ajman Beach. Geographically it is a few miles away from the Arabian Gulf that flows through Ajman.
Safeer Hypermarket is one of the biggest malls in Ajman.
KM Trading is a retail store with a diverse clothing range and it has been operating in different emirates for over 25 years now. It is barely 6 minutes away from Al Zahraa Ajman. One of the biggest malls in Ajman, Safeer Mall is at a distance of roughly 10 minutes away from the area. It has multiple recreational options including kids play area, food court, retail stores, and grocery market. The City Centre Ajman is a mall near Al Zahraa, it is less than 10 minutes away and it also nestles a Carrefour Hypermarket on the ground floor.
Pak Ghazi is a popular Asian restaurant near Al Zahraa Ajman.
Ajman is a small city, and it is flooded with restaurants which makes it easy to reach your favourite eateries from any corner of the city. Near Al Zahraa there are multiple restaurants especially the ones that serve Asian cuisine.
Belal Restaurant and Shakoor Restaurant are Arab restaurants in Al Zahraa. Pak Ghazi, barely 3 minutes away, is a famous Pakistani restaurant known for serving authentic eastern food. Al Jadeed Restaurant is another Arabic restaurant and can be reached within a 5-minute drive.
One of the beaches near Al Zahraa is the Ajman Corniche. This is a spot that is favoured by everyone in Ajman. There are restaurants, fitness amenities and many other facilities to enjoy. There is a family only section of the beach so that the families can make the most of their time on the beach. People usually prefer walking on the tracks or hosting a barbecue at the Ajman Corniche. This public beach is hardly 5 minutes away from Al Zahraa.
Football lovers can reach Ajman Stadium in 10 minutes. Here is where the local football team, The Ajman Club plays and practices. This stadium is one of the major landmarks for Ajman and it quite popular during football season.
Al Zahraa Ajman is a small community and therefore, there are no parks within the premises. However, the residents of this area can always reach out to Rashidiya Park which is less than 10 minutes away.
There are a few well-equipped gyms near this district. Some of them are Al Mass Body Fitness, Zilina Fitness Gym, and Al Reem Body and Fitness Gym.
Some closely located salons where ladies can relax and have some me-time are S & M Salon, Al Warda Al Hamra Beauty Salon, and Rizwana Salon. Al Hawameer is a men's salon located right inside the community.
Al Zahraa is a mix-used community where families and individual both live. It is a quiet district away from Downtown Ajman. The best thing about living in Al Zahraa Ajman is that Sharjah is just 15 minutes away making it a considerable option for people working in Sharjah. One thing to consider is the lack of malls and schools within the premises. There are quite a few a short drive away.
Are you looking to buy or rent villa in AL ZAHRAA AJMAN?


Good nutrition is important for proper muscle development. The company offers many opportunities for professional development. The software is still in the early stages of development. I try to keep up with the latest developments in computer technology. Have there been any new developments in the case?
These example sentences are selected automatically from various online news sources to reflect current usage of the word 'development.' Views expressed in the examples do not represent the opinion of Merriam-Webster or its editors. Send us feedback.


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and
    limitations under the License.
-->
<!DOCTYPE Test SYSTEM "test.dtd">

<!--
Author: Valentin Al. Sitnick
Version: $Revision: 1.2 $
-->

<Test ID="CreateRawMonitor0101" date-of-creation="03-06-2005" timeout="1" >

    <Author value="Valentin Al. Sitnick"/>

    <Description>
        This is the test for JVMTI event: CreateRawMonitor0101.
        Checks that event will called if needed condition were created.

		Covered assertions assert_jvmti2151 assert_jvmti2154 assert_jvmti2148
    </Description>

    <Keyword name="simple"/>
    <Source name="CreateRawMonitor0101.cpp"/>
    <Source name="CreateRawMonitor0101.java"/>

    <Runner ID="RuntimeNegative">
        <Option name="runnerEMsg" value="passed"/>
        <Option value="-agentlib:CreateRawMonitor0101"/>
        <Option value="-showversion"/>
        <Param name="toRun" value="org.apache.harmony.vts.test.vm.jvmti.CreateRawMonitor0101"/>
    </Runner>

    <Restriction name="OtherVMOnly"/>
</Test>

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tests.gl_320.texture;

import com.jogamp.opengl.GL;
import static com.jogamp.opengl.GL2ES3.*;
import com.jogamp.opengl.GL3;
import com.jogamp.opengl.util.GLBuffers;
import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
import framework.BufferUtils;
import glm.glm;
import glm.mat._4.Mat4;
import framework.Profile;
import framework.Semantic;
import framework.Test;
import glf.Vertex_v2fv2f;
import glm.vec._2.Vec2;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.logging.Level;
import java.util.logging.Logger;
import jgli.Texture2d;

/**
 *
 * @author GBarbieri
 */
public class Gl_320_texture_streaming extends Test {

    public static void main(String[] args) {
        Gl_320_texture_streaming gl_320_texture_streaming = new Gl_320_texture_streaming();
    }

    public Gl_320_texture_streaming() {
        super("gl-320-texture-streaming", Profile.CORE, 3, 2);
    }

    private final String SHADERS_SOURCE = "texture-2d";
    private final String SHADERS_ROOT = "src/data/gl_320/texture";
    private final String TEXTURE_DIFFUSE = "kueken7_rgba8_srgb.dds";

    // With DDS textures, v texture coordinate are reversed, from top to bottom
    private int vertexCount = 6;
    private int vertexSize = vertexCount * Vertex_v2fv2f.SIZE;
    private float[] vertexData = {
        -1.0f, -1.0f,/**/ 0.0f, 1.0f,
        +1.0f, -1.0f,/**/ 1.0f, 1.0f,
        +1.0f, +1.0f,/**/ 1.0f, 0.0f,
        +1.0f, +1.0f,/**/ 1.0f, 0.0f,
        -1.0f, +1.0f,/**/ 0.0f, 0.0f,
        -1.0f, -1.0f,/**/ 0.0f, 1.0f};

    private class Buffer {

        public static final int VERTEX = 0;
        public static final int TRANSFORM = 1;
        public static final int MAX = 2;
    }

    private class Shader {

        public static final int VERT = 0;
        public static final int FRAG = 1;
        public static final int MAX = 2;
    }

    private IntBuffer vertexArrayName = GLBuffers.newDirectIntBuffer(1), textureName = GLBuffers.newDirectIntBuffer(1),
            bufferName = GLBuffers.newDirectIntBuffer(Buffer.MAX);
    private int programName, uniformTransform, uniformDiffuse;

    @Override
    protected boolean begin(GL gl) {

        GL3 gl3 = (GL3) gl;

        boolean validated = true;

        if (validated) {
            validated = initProgram(gl3);
        }
        if (validated) {
            validated = initBuffer(gl3);
        }
        if (validated) {
            validated = initVertexArray(gl3);
        }
        if (validated) {
            validated = initTexture(gl3);
        }

        return validated;
    }

    private boolean initProgram(GL3 gl3) {

        boolean validated = true;

        if (validated) {

            ShaderCode vertShaderCode = ShaderCode.create(gl3, GL_VERTEX_SHADER, this.getClass(), SHADERS_ROOT, null,
                    SHADERS_SOURCE, "vert", null, true);
            ShaderCode fragShaderCode = ShaderCode.create(gl3, GL_FRAGMENT_SHADER, this.getClass(), SHADERS_ROOT, null,
                    SHADERS_SOURCE, "frag", null, true);

            ShaderProgram shaderProgram = new ShaderProgram();
            shaderProgram.add(vertShaderCode);
            shaderProgram.add(fragShaderCode);

            shaderProgram.init(gl3);

            programName = shaderProgram.program();

            gl3.glBindAttribLocation(programName, Semantic.Attr.POSITION, "position");
            gl3.glBindAttribLocation(programName, Semantic.Attr.TEXCOORD, "texCoord");
            gl3.glBindFragDataLocation(programName, Semantic.Frag.COLOR, "color");

            shaderProgram.link(gl3, System.out);
        }
        if (validated) {

            uniformTransform = gl3.glGetUniformBlockIndex(programName, "Transform");
            uniformDiffuse = gl3.glGetUniformLocation(programName, "diffuse");
        }

        return validated & checkError(gl3, "initProgram");
    }

    private boolean initBuffer(GL3 gl3) {

        FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);
        IntBuffer uniformBufferOffset = GLBuffers.newDirectIntBuffer(1);

        gl3.glGenBuffers(Buffer.MAX, bufferName);

        gl3.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX));
        gl3.glBufferData(GL_ARRAY_BUFFER, vertexSize, vertexBuffer, GL_STATIC_DRAW);
        gl3.glBindBuffer(GL_ARRAY_BUFFER, 0);

        gl3.glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, uniformBufferOffset);
        int uniformBlockSize = Math.max(Mat4.SIZE, uniformBufferOffset.get(0));

        gl3.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.TRANSFORM));
        gl3.glBufferData(GL_UNIFORM_BUFFER, uniformBlockSize, null, GL_DYNAMIC_DRAW);
        gl3.glBindBuffer(GL_UNIFORM_BUFFER, 0);

        BufferUtils.destroyDirectBuffer(vertexBuffer);
        BufferUtils.destroyDirectBuffer(uniformBufferOffset);

        return true;
    }

    private boolean initTexture(GL3 gl3) {

        try {
            jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
            jgli.Gl.Format format = jgli.Gl.translate(texture.format());

            gl3.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

            gl3.glGenTextures(1, textureName);
            gl3.glActiveTexture(GL_TEXTURE0);
            gl3.glBindTexture(GL_TEXTURE_2D, textureName.get(0));
            gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
            gl3.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

            gl3.glTexImage2D(GL_TEXTURE_2D, 0,
                    format.internal.value,
                    texture.dimensions()[0], texture.dimensions()[1],
                    0,
                    format.external.value, format.type.value,
                    null);

            int textureSize = texture.size(0);

            int[] pixelBuffer = {0};
            gl3.glGenBuffers(1, pixelBuffer, 0);
            gl3.glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pixelBuffer[0]);
            gl3.glBufferData(GL_PIXEL_UNPACK_BUFFER, textureSize, null, GL_STREAM_DRAW);
            ByteBuffer pointer = gl3.glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, textureSize, GL_MAP_WRITE_BIT);
            pointer.put(texture.data(0)).rewind();
            gl3.glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);

            gl3.glTexSubImage2D(GL_TEXTURE_2D, 0,
                    0, 0, texture.dimensions()[0], texture.dimensions()[1],
                    format.external.value, format.type.value, 0);
            gl3.glDeleteBuffers(1, pixelBuffer, 0);

            gl3.glPixelStorei(GL_UNPACK_ALIGNMENT, 4);

        } catch (IOException ex) {
            Logger.getLogger(Gl_320_texture_streaming.class.getName()).log(Level.SEVERE, null, ex);
        }
        return true;
    }

    private boolean initVertexArray(GL3 gl3) {

        gl3.glGenVertexArrays(1, vertexArrayName);
        gl3.glBindVertexArray(vertexArrayName.get(0));
        {
            gl3.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX));
            gl3.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, 0);
            gl3.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, Vec2.SIZE);
            gl3.glBindBuffer(GL_ARRAY_BUFFER, 0);

            gl3.glEnableVertexAttribArray(Semantic.Attr.POSITION);
            gl3.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD);
        }
        gl3.glBindVertexArray(0);

        return true;
    }

    @Override
    protected boolean render(GL gl) {

        GL3 gl3 = (GL3) gl;

        {
            gl3.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.TRANSFORM));
            ByteBuffer pointer = gl3.glMapBufferRange(
                    GL_UNIFORM_BUFFER, 0, Mat4.SIZE,
                    GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

            Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f);
            Mat4 model = new Mat4(1.0f);
            Mat4 mvp = projection.mul(viewMat4()).mul(model);

            pointer.asFloatBuffer().put(mvp.toFa_());

            // Make sure the uniform buffer is uploaded
            gl3.glUnmapBuffer(GL_UNIFORM_BUFFER);
        }

        gl3.glViewport(0, 0, windowSize.x, windowSize.y);
        gl3.glClearBufferfv(GL_COLOR, 0, new float[]{0.0f, 0.0f, 0.0f, 1.0f}, 0);

        gl3.glUseProgram(programName);
        gl3.glUniform1i(uniformDiffuse, 0);
        gl3.glUniformBlockBinding(programName, uniformTransform, Semantic.Uniform.TRANSFORM0);

        gl3.glActiveTexture(GL_TEXTURE0);
        gl3.glBindTexture(GL_TEXTURE_2D, textureName.get(0));
        gl3.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM));
        gl3.glBindVertexArray(vertexArrayName.get(0));

        gl3.glDrawArraysInstanced(GL_TRIANGLES, 0, vertexCount, 1);

        return true;
    }

    @Override
    protected boolean end(GL gl) {

        GL3 gl3 = (GL3) gl;

        gl3.glDeleteBuffers(Buffer.MAX, bufferName);
        gl3.glDeleteProgram(programName);
        gl3.glDeleteTextures(1, textureName);
        gl3.glDeleteVertexArrays(1, vertexArrayName);

        BufferUtils.destroyDirectBuffer(bufferName);
        BufferUtils.destroyDirectBuffer(textureName);
        BufferUtils.destroyDirectBuffer(vertexArrayName);

        return true;
    }
}


text:
/*************************************************************************/
/*                                                                       */
/*                Centre for Speech Technology Research                  */
/*                     University of Edinburgh, UK                       */
/*                         Copyright (c) 1998                            */
/*                        All Rights Reserved.                           */
/*                                                                       */
/*  Permission is hereby granted, free of charge, to use and distribute  */
/*  this software and its documentation without restriction, including   */
/*  without limitation the rights to use, copy, modify, merge, publish,  */
/*  distribute, sublicense, and/or sell copies of this work, and to      */
/*  permit persons to whom this work is furnished to do so, subject to   */
/*  the following conditions:                                            */
/*   1. The code must retain the above copyright notice, this list of    */
/*      conditions and the following disclaimer.                         */
/*   2. Any modifications must be clearly marked as such.                */
/*   3. Original authors' names are not deleted.                         */
/*   4. The authors' names are not used to endorse or promote products   */
/*      derived from this software without specific prior written        */
/*      permission.                                                      */
/*                                                                       */
/*  THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK        */
/*  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      */
/*  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT   */
/*  SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE     */
/*  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    */
/*  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   */
/*  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          */
/*  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       */
/*  THIS SOFTWARE.                                                       */
/*                                                                       */
/*************************************************************************/
/*             Author :  Alan W Black and Paul Taylor                    */
/*             Date   :  February 1998                                   */
/*-----------------------------------------------------------------------*/
/*                                                                       */
/*  An implementation of Metrical Tree Phonology                         */
/*                                                                       */
/*=======================================================================*/

#include <cmath>
#include "festival.h"
#include "lexicon.h"
#include "../UniSyn/us_features.h"

EST_Features phone_def;

float local_cost(const EST_Item *s1, const EST_Item *s2);

static void mettree_add_words(EST_Utterance &u);

void construct_metrical_tree(EST_Utterance &word);
void add_end_silences(EST_Relation &segment);
void StrListtoString(EST_StrList &l, EST_String &s, EST_String sep=" ");

void parse_wsj_syntax(void);
static void apply_nsr(EST_Utterance &u, const EST_String &tree);
#if 0
static void remove_punctuation(EST_Utterance &u);
static void add_intonation(EST_Utterance &u, const EST_String &base_int,
			   float threshold);
#endif

void subword_list(EST_Item *w, EST_Relation &syllable,
		  EST_Relation &metricaltree);

void add_non_terminal_features(EST_Relation &r,
			       EST_Features &f);

void stress_factor1(EST_Utterance &u, const EST_String &base_stream,
		    const EST_String &m);
void stress_factor2(EST_Utterance &u, const EST_String &base_stream,
		    const EST_String &m);

void phrase_factor(EST_Utterance &u);

void main_stress(EST_Item *s);

void end_to_dur(EST_Relation &r);

void footing(EST_Item *n1);

LISP FT_Classic_Phrasify_Utt(LISP args);
LISP FT_Classic_POS_Utt(LISP args);
LISP FT_PParse_Utt(LISP args);
LISP FT_MultiParse_Utt(LISP utt);
void MultiParse(EST_Utterance &u);

void add_feature_string(EST_Relation &r, const EST_String &fname,
			const EST_String &f);

void add_monotone_targets(EST_Utterance &u, float start_f0,
				    float end_f0);

void clear_feature(EST_Relation &r, const EST_String &name);

typedef
float (*local_cost_function)(const EST_Item *item1,
			     const EST_Item *item2);

void subword_phonology(EST_Utterance &word);
void lex_to_phones(EST_Utterance &u, const EST_String &relname);

bool dp_match(const EST_Relation &lexical,
	      const EST_Relation &surface,
	      EST_Relation &match,
	      local_cost_function lcf,
	      EST_Item *null_syl);

//bool dp_match(EST_Relation &a, EST_Relation &b, EST_Relation &c,
//	      local_cost_function lcf, const EST_String &null_sym);
void lex_to_phones(const EST_String &name, const EST_String &pos,
		   EST_Relation &phone);

void subword_metrical_tree(EST_Relation &syllable,
			   EST_Relation &metricaltree);

int syllabify_word(EST_Item *nw, EST_Relation &phone,
		    EST_Relation &sylstructure, EST_Relation &syl, int flat);

void subword_metrical_tree(EST_Item *w, EST_Relation &syllable,
			   EST_Relation &metricaltree);

EST_Item *prev_match(EST_Item *n)
{
    EST_Item *p = iprev(n);
    if (p == 0)
	return 0;

    if (daughter1(p->as_relation("Match")) == 0)
	prev_match(p);

    return daughter1(p->as_relation("Match"));
}

void insert_schwa(EST_Item *n)
{
    EST_Item *p, *s;
    float pp_end = 0;
    float schwa_length = 0.01;

    if ((p = prev_match(n)) == 0)
    {
	cout << "Couldn't insert dummy schwa after " << *n << endl;
	return;
    }

    p = p->as_relation("SurfacePhone");
    pp_end = (iprev(p) != 0) ? iprev(p)->F("end",0.0) : 0.0;

    s = p->insert_after();

    s->set("name", "ax");
    s->set("stress_num", "0");

    if ((p->F("end",0) - pp_end) < schwa_length)
	schwa_length = p->F("dur") / 2.0;

    s->set("end", p->F("end",0));
    p->set("end", p->F("end",0) - schwa_length);
    s->set("start", p->F("end",0));

    s->set("df", phone_def.A("ax"));

//    cout << "end 1:" << s->f("end") << endl;
//    cout << "end 2:" << p->f("end") << endl;
}

void add_initial_silence(EST_Relation &lexical, EST_Relation &surface,
	       EST_Relation &match)
{
    EST_Item *s, *p, *n, *m;

    s = lexical.head();
    if ((s->f("name") != "pau") && (s->f("name") != "sil"))
    {
	p = s->insert_before();
	p->set("name", "pau");
	p->set("df", phone_def.A("pau"));

	n = surface.head();
	if ((n->f("name") == "pau") || (n->f("name") == "sil"))
	{
	    m = match.head()->insert_before(p);
	    m->append_daughter(n);
	}

    }
}

void add_even_segment_times(EST_Item *w, EST_Relation &phone)
{
    EST_Item *s;
    int i;
    float start,dur=0,n,div;

    start = w->F("start");
    dur = w->F("end") - start;
    n = (float)phone.length();
    div = dur/n;

    for (i = 0, s = phone.head(); s; s = inext(s), ++i)
    {
	s->set("start", start + div * (float) i);
	s->set("end", start + div * (float) (i + 1));
    }
}

#if 0
static void add_trans_phrase_phrase(EST_Utterance &utt)
{
    EST_Item *s, *t, *a, *r;
    EST_Item *first_accent = 0, *last_accent = 0;
    bool exist;

    // This looks insanely comlicated, but all it really does is
    // add phrase_start and phrase_end items to the root node of
    // each metrical tree and then places these in the right position
    // in the intonation relation.

    utt.create_relation("IntonationPhrase");

    for (s = utt.relation("MetricalTree", 1)->head(); s; s = inext(s))
	{
	    for (r = first_leaf_in_tree(s);
		 r != next_leaf(last_leaf_in_tree(s)); r = next_leaf(r))
		if (r->in_relation("IntonationSyllable"))
		    {
			if (first_accent == 0)
			    first_accent =
				parent(r->as_relation("IntonationSyllable"))
				->as_relation("Intonation");
			last_accent =
			    parent(r->as_relation("IntonationSyllable"))
			    ->as_relation("Intonation");
		    }

	    exist = false;
	    //	    cout << "\nroot node: " <<*s << endl;

	    if (first_accent)
		{
		    cout << "first accent: " << *first_accent << endl;
		    a = iprev(first_accent);

		    if (a->S("name","") != "phrase_start")
			a = first_accent->insert_before();
		}
	    else
		{
		    if (a == 0)
			a = utt.relation("Intonation")->prepend();
		    else
			a = a->insert_after();
		}

	    if (a->S("name","") != "phrase_start" ) // i.e. its a new one
		{
		    a->set("name", "phrase_start");
		    a->set("ev:f0", 100);
		}
	    // re-write position as relative to metrical tree
	    a->set("position", usf_int_start);
	    // add this as daughter to root node
	    t = utt.relation("IntonationPhrase")->append(s);
	    t->append_daughter(a);
	    exist = false;
	    //cout << "appended phrase end\n";

	    if (last_accent)
		{
		    cout << "last accent: " << *last_accent << endl;
		    a = inext(last_accent);
		    if (a->S("name","") != "phrase_end")
			a = last_accent->insert_after();
		}
	    else
		a = a->insert_after();

	    if (a->S("name","") != "phrase_end")
		{
		    a->set("name", "phrase_end");
		    a->set("ev:f0", 100);
		}
	    // re-write position as relative to metrical tree
	    a->set("position", usf_int_end);

	    // add this as daughter to root node
	    t->append_daughter(a);
	    //cout << "appended phrase start\n";
	    first_accent = 0; // trigger for first time operation of loop
	}

    // now join any other marked phrase_start/ends to intermediate
    // nodes in metrical tree.

    /*    for (s = u.relation("Intonation", 1)->head(); s; s = inext(s))
	{
	    if (!s->in_relation("IntonationPhrase") &&
		!s->in_relation("IntonationSyllable"))
		{
		    pos = s->F("position");

	}
    */

}
#endif

void add_single_phrase(EST_Utterance &utt, EST_Item *t)
{
    EST_Item *s=0, *a, *p;
    float pos, max, d = 0, start = 0.0;

    pos = t->F("time");
    max = 100000.0;

    for (p = utt.relation("Syllable")->head(); p; p = inext(p))
    {
	if (t->S("name") == "phrase_end")
	    d = fabs(pos - p->F("end"));
	else
	    d = fabs(pos - start);

	if (d < max)
	{
	    max = d;
	    s = p;
	}
	start = p->F("end");
    }

/*    if (s)
	 cout << "joining syllable " << *s << endl;
    else
	 cout << "No legal syllable " << endl;
     cout << "to " << *t << endl;

     cout << "d = " << d << endl;
*/

    if (!s->in_relation("IntonationSyllable"))
	a = utt.relation("IntonationSyllable")->append(s);
    else
	a = s->as_relation("IntonationSyllable");
    a->append_daughter(t);
    t->set("time_path", "IntonationSyllable");
    t->set_function("position", "standard+unisyn_tilt_phrase_position");
}

void add_times(EST_Relation &lexical, EST_Relation &surface,
	       EST_Relation &match)
{
    (void) surface;
    (void) match;
    EST_Item *s, *t, *p;
    float prev_end, inc, first_end, last_end;
    int i;

    // first pass, copy times as appropriate, and find first
    // and last defined ends
    // This is hacky and certainly won't work for many cases

    first_end = -1.0;
    prev_end = 0.0;
    last_end = 0.0;

//    cout << "surface: " << surface << endl;

    for (s = lexical.head(); s; s = inext(s))
    {
	if ((t = daughter1(s->as_relation("Match"))) != 0)
	{
	    s->set("end", t->F("end"));
	    s->set("start", t->F("start"));

	    last_end = t->F("end");
	    if (first_end < 0.0)
		first_end = t->F("end");
	}
    }

     if (!lexical.head()->f_present("end"))
     {
	 lexical.head()->set("end", first_end / 2.0);
	 lexical.head()->set("start", 0.0);
     }

     if (!lexical.tail()->f_present("end"))
     {
	 lexical.tail()->set("end", last_end + 0.01);
	 lexical.tail()->set("start", last_end);
     }

    for (s = lexical.head(); s; s = inext(s))
    {
	if (!s->f_present("end"))
	{
//	    cout << "missing end feature for " << *s << endl;
	    for (i = 1, p = s; p; p = inext(p), ++i)
		if (p->f_present("end"))
		    break;
	    inc = (p->F("end") - prev_end) / ((float) i);
//	    cout << "inc is : " << inc << endl;

//	    cout << "stop phone is " << *p << endl;

	    for (i = 1; s !=p ; s = inext(s), ++i)
	    {
		s->set("end", (prev_end + ((float) i * inc)));
		s->set("start", (prev_end + ((float) (i - 1 )* inc)));
	    }
	}
	prev_end = s->F("end");
    }
}

static void met_error(EST_Item *s)
{
    cerr << "Illegally named daughters of metrical node\n"
	 << "daughter1 : " << *daughter1(s) << endl
	 << "daughter2 : " << *daughter2(s) << endl;
    EST_error("");
}

void legal_metrical_tree(EST_Item *s)
{
    if (s == 0)
	return;

    if ((daughter1(s) == 0) || (daughter2(s) == 0))
	return;

    if ((daughter1(s)->S("MetricalValue") == "s")
	&& (daughter2(s)->S("MetricalValue") != "w"))
	met_error(s);
    else if ((daughter1(s)->S("MetricalValue") == "w")
	&& (daughter2(s)->S("MetricalValue") != "s"))
	met_error(s);
    else if ((daughter1(s)->S("MetricalValue") != "w")
	     && (daughter1(s)->S("MetricalValue") != "s"))
	met_error(s);

    legal_metrical_tree(daughter1(s));
    legal_metrical_tree(daughter2(s));
}

void parse_words(EST_Utterance &utt)
{
    utt.create_relation("Token");

    FT_Classic_POS_Utt(siod(&utt));
    FT_Classic_Phrasify_Utt(siod(&utt));
    MultiParse(utt);

    utt.relation("Syntax")->remove_item_feature("pos_index");
    utt.relation("Syntax")->remove_item_feature("pos_index_score");
    utt.relation("Syntax")->remove_item_feature("phr_pos");
    utt.relation("Syntax")->remove_item_feature("pbreak_index");
    utt.relation("Syntax")->remove_item_feature("pbreak_index_score");
    utt.relation("Syntax")->remove_item_feature("pbreak");
    utt.relation("Syntax")->remove_item_feature("blevel");
    utt.relation("Syntax")->remove_item_feature("prob");
}

void binaryize_tree(EST_Item *t)
{
    // terminating condition
    if (daughter1(t) == 0)
	return;

    // nodes with single children should be merged
    if (daughter2(t) == 0)
    {
//	cout << "Single daughter: " << *t << endl;
	EST_Item *d = daughter1(t);
	move_sub_tree(d, t);
    }

    for (EST_Item *p = daughter1(t); p; p = inext(p))
	binaryize_tree(p);
}

void binaryize_tree(EST_Utterance &utt, const EST_String &base_tree,
		    const EST_String &new_tree)
{
    utt.create_relation(new_tree);
    copy_relation(*utt.relation(base_tree), *utt.relation(new_tree));

    for (EST_Item *p = utt.relation(new_tree)->head(); p; p = inext(p))
	binaryize_tree(p);
}

void syntax_to_metrical_words(EST_Utterance &utt)
{
    utt.create_relation("MetricalWord");
    // copy syntax tree while merging single daughter nodes
    binaryize_tree(utt, "Syntax", "MetricalWord");
    // add strong and weak values
    apply_nsr(utt, "MetricalWord");
}

void add_metrical_functions(EST_Utterance &utt)
{
    // Note that we don't add "start" functions here as this depends on
    // pause behaviour
    add_feature_function(*utt.relation("Syllable"),
			 "vowel_start",
			 "unisyn_vowel_start");

    add_feature_function(*utt.relation("Syllable"),
			 "end", "standard+unisyn_leaf_end");
    add_feature_function(*utt.relation("Syllable"),
			 "start", "standard+unisyn_leaf_start");

    for (EST_Item *s = utt.relation("Syllable")->head(); s; s = inext(s))
	s->set("time_path", "SylStructure");

    EST_Features tf;
    tf.set_function("end", "standard+unisyn_leaf_end");
    tf.set_function("start","standard+unisyn_leaf_start");
    tf.set_function("dur","standard+unisyn_duration");

    tf.set("time_path", "MetricalTree");
    tf.set("time_path", "MetricalTree");

//    add_non_terminal_features(*utt.relation("MetricalTree"), tf);

    tf.set("time_path", "SylStructure");
    add_non_terminal_features(*utt.relation("SylStructure"), tf);

    add_feature_function(*utt.relation("Segment"),
			 "dur",
			 "standard+duration");

}

void auto_metrical_lex(EST_Utterance &utt)
{
    LISP l_pdef;

    utt.create_relation("Syllable");
    utt.create_relation("Segment");

    l_pdef = siod_get_lval("darpa_fs", NULL);
    lisp_to_features(l_pdef, phone_def);

    mettree_add_words(utt);

    LISP lt = siod_get_lval("us_base_int", NULL);
    EST_String base_int;
    if (lt == NIL)
	base_int = "Syllable";
    else
    {
	const char *x = get_c_string(lt);
	base_int = x;
    }

    // add_end_silences(*utt.relation("Segment"));

    add_metrical_functions(utt);
}

void extend_tree(EST_Item *m, EST_Item *p, const EST_String &terminal,
		 const EST_String &second_tree)
{
    EST_Item *d, *e;

    if (!daughter1(m))
    {
	if (m->in_relation(terminal)) // ie. really hit the bottom
	    return;
	m = m->as_relation(second_tree); // swap to a new tree
    }

    for (d = daughter1(m); d; d = inext(d))
    {
	e = p->append_daughter(d);
        extend_tree(d, e, terminal, second_tree);
    }
}

static void nsr(EST_Item *n)
{
    EST_Item *left, *right;
    left = daughter1(n);
    right = daughter2(n);
    if (left == 0)
	return;
    else
    {
	nsr(left);
	left->set("MetricalValue","w");
    }

    if (right == 0)
	return;
    else
    {
	nsr(right);
	right->set("MetricalValue","s");
    }
}

static void apply_nsr(EST_Utterance &u, const EST_String &tree)
{
    EST_Item *n;

    for (n = u.relation(tree)->head(); n; n = inext(n))
	nsr(n);
}

EST_Item *other_daughter(EST_Item *parent, EST_Item *daughter)
{
    return (daughter1(parent) == daughter) ? daughter2(parent) :
    daughter1(parent);
}

static void stress_factor1(EST_Item *s, int max_depth)
{
    EST_Item *a;
    EST_String val, pad;
    char *str;
    long n, i;
    float max;

    val = "";

    for (a = s; parent(a); a = parent(a))
	if (a->f("MetricalValue") == "s")
	    val += "2";
	else
	    val += "0";

    //    cout << "\nSyllable " << s << " has value " << val << endl;

    if (val.length() < max_depth)
	for (pad = "", i = 0; i < (max_depth - val.length()); ++i)
	    pad += "2";

    val += pad;
    //    cout << "Syllable " << s << " has padded value " << val << endl;

    str = strdup(val);
    max = pow(3.0, (float)max_depth) - 1.0;
    n = strtol(str, (char **)NULL, 3);
    //    cout << "decimal value: " << n;
    //    cout << " normalised: " << (float)n/max << endl;
    s->set("StressFactor1", ((float)n/max));
}

EST_Item * find_apex(EST_Item *n, int &num_nodes)
{
    EST_Item *p;
    p = parent(n);
    if (p == 0)
	return n;
    if (daughter2(p) == n)
	return find_apex(p, ++num_nodes);

    return p;
}

void find_leaf(EST_Item *n, int &num_nodes)
{
    if (n == 0)
	return;
    find_leaf(daughter1(n), ++num_nodes);
}

static void phrase_factor(EST_Item &syl, const EST_String &met_name)
{
    EST_Item *p;
    EST_String val, pad;
    int num_nodes = 1;

    //    cout << "Terminal Syl = " << syl << " f:" << syl.f << endl;

    p = find_apex(syl.as_relation(met_name), num_nodes);
    //    cout << "up nodes: " << num_nodes;
    //    cout << "Apex = " << *p << endl;
    find_leaf(daughter2(p), num_nodes);
    //    cout << " downp nodes: " << num_nodes << endl;

    syl.set("PhraseIndex", num_nodes);
}

static int max_tree_depth(EST_Utterance &u, const EST_String &base_stream,
			  const EST_String &mettree)
{
    EST_Item *s, *a;
    int depth;
    int max_depth = 0;

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
    {
	depth = 0;
	for (a = s->as_relation(mettree); parent(a); a = parent(a))
	    ++depth;
	if (depth > max_depth)
	    max_depth = depth;
    }
    return max_depth;
}

void stress_factor1(EST_Utterance &u, const EST_String &base_stream,
		    const EST_String &mettree)
{
    EST_Item *s;
    int max_depth = max_tree_depth(u, base_stream, mettree);

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
	stress_factor1(s->as_relation(mettree), max_depth);
}

EST_Item *strong_daughter(EST_Item *n)
{
    if (daughter1(n) == 0)
	return 0;
    return (daughter1(n)->f("MetricalValue") == "s")
	? daughter1(n) : daughter2(n);
}

EST_Item *weak_daughter(EST_Item *n)
{
    if (daughter1(n) == 0)
	return 0;
    return (daughter1(n)->f("MetricalValue") == "w")
	? daughter1(n) : daughter2(n);
}

static void fill_mini_tree(EST_Item *s, int val)
{
    if (s->f("MetricalValue") == "s")
	s->set("StressVal", val);
    else
	s->set("StressVal", 0);
    if (strong_daughter(s))
	fill_mini_tree(strong_daughter(s), val);

    if (weak_daughter(s))
	fill_mini_tree(weak_daughter(s), val - 1);
}

void stress_factor2(EST_Utterance &u, const EST_String &base_stream,
		    const EST_String &mettree)
{
    EST_Item *s;
    int sv = -1;
    float b;
    (void) base_stream;

    s = u.relation(mettree)->head();
    fill_mini_tree(s, sv);

    // normalise values
    sv = 0;
    for (s = u.relation(base_stream)->head(); s; s = inext(s))
	sv = Lof(s->I("StressVal"), sv);

    cout << "Max Stress: " << sv << endl;

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
    {
	b = (float)(s->I("StressVal") - sv + 1);
	if (s->f("MetricalValue") == "s")
	    s->set("StressFactor2", (b / float(sv)) * -1.0);
	else
	    s->set("StressFactor2", 0);
    }
}

void phrase_factor(EST_Utterance &u, const EST_String &base_stream,
		   const EST_String &mettree)
{
    EST_Item *s;
    float max_pf = 0;

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
	phrase_factor(*s, mettree);

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
	if (s->I("PhraseIndex") > max_pf)
	    max_pf = s->I("PhraseIndex");

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
    {
	s->set("PhraseFactor",
		(float)s->I("PhraseIndex")/max_pf);
	//	cout << *s << " pf = " <<
	//	    s->F("PhraseFactor") << endl;
    }

}

#if 0
static void remove_punctuation(EST_Utterance &u)
{
    // The syntactic grammar has unary rules for the preterminals
    // these would make the mtettrical tree have an extra layer
    // at the word level.  So here we remove that extra layer
    EST_Item *w;
    EST_Item *a, *b, *c, *od;

    for (w = u.relation("Word")->head(); w != 0; w = inext(w))
    {
	if (w->f("pos") == "punc")
	{
	    a = w->as_relation("Syntax");
	    b = parent(a);
	    c = parent(b);
	    od = other_daughter(c, b);
	    remove_item(b, "Syntax");
	    move_sub_tree(od, c);
	    remove_item(w, "Word");
	}
    }
}

static void add_intonation(EST_Utterance &u, const EST_String &base_stream,
			   float threshold)
{
    EST_Item *e, *s;

    cout << "Threshold = " << threshold << endl;

    for (s = u.relation(base_stream)->head(); s; s = inext(s))
    {
	if (s->F("StressFactor") > threshold)
	{
	    //	    cout << *s <<" **stress factor:" << s->F("StressFactor") << endl;
	    e = u.relation("IntSyl")->append();
	    e->insert_below(s);
	    e->set_name("Accent");
	    e->set("prominence", s->F("StressFactor"));
	    u.relation("Intonation")->append(e);
	}
    }
}

#endif

void add_monotone_targets(EST_Utterance &u, float start_f0,
				 float end_f0)
{
    EST_Item *t;
    float end;

    end = u.relation("Segment")->tail()->f("end");

    cout << "Phone ends\n";
    cout << *u.relation("Segment");

    cout << "last position is :" << end << endl;

    u.create_relation("Target");

    t = u.relation("Target")->append();
    t->set("f0", start_f0);
    t->set("pos", 0.0);

    // temporary - should disappear when awb changes code
    //    t->set("name", ftoString(start_f0));
    //    t->set("end", 0.0);

    t = u.relation("Target")->append();
    t->set("f0", end_f0);
    t->set("pos", end);

    // temporary - should disappear when awb changes code
    //    t->set("name", ftoString(end_f0));
    //    t->set("end", end);
}

static void mettree_add_words(EST_Utterance &u)
{
    EST_Utterance word;
    EST_Item *w;

    word.create_relation("Word");
    word.create_relation("Segment");
    word.create_relation("SylStructure");
    word.create_relation("Syllable");
    word.create_relation("WordStructure");

    for (w = u.relation("Word")->head(); w != 0; w = inext(w))
    {
	word.clear_relations();

	cout << "N:";
	cout << w->f("name") << " " << w->f("pos", "") << endl;
	lex_to_phones(w->f("name"), w->f("pos", "0"),
		      *word.relation("Segment"));

	EST_Item *nw = word.relation("Word")->append();
	nw->set("name", w->S("name"));

	syllabify_word(nw, *word.relation("Segment"),
		       *word.relation("SylStructure"),
		       *word.relation("Syllable"), 0);

	subword_metrical_tree(nw, *word.relation("Syllable"),
			      *word.relation("WordStructure"));

	utterance_merge(u, word, w, word.relation("Word")->head());
    }
}

void add_metrical_nodes(EST_Utterance &u, EST_Item *n, LISP lpos);

EST_String strip_vowel_num(EST_String p)
{
    if (p.contains(RXint))
	p = p.before(RXint);
    return p;
}

static void percolate(EST_Item *start)
{
    EST_Item *n;

    for (n = start; n; n = parent(n))
    {
	//	cout << "altering sister\n";
	if (iprev(n) != 0)
	    iprev(n)->set("MetricalValue", "w");
	else if (inext(n) != 0)
	    inext(n)->set("MetricalValue", "w");
    }
}

void main_stress(EST_Item *s)
{
    EST_Item *n;

    for (n = s; parent(n); n = parent(n))
  	n->set("MetricalValue", "s");

    n = s;
    percolate(n);
}

void footing(EST_Item *n1)
{
    EST_Item *n2, *n3, *n4, *p1, *p3, *r;

    r = parent(n1);		// root node
    p1 = daughter2(r);
    n2 = daughter1(p1);
    n3 = daughter2(p1);

    if (p1 == 0)
    {
	cerr << "Error: Empty 3rd node after " << *n1 << " in footing\n";
	return;
    }
    if (n2 == 0)
    {
	cerr << "Error: Empty 3rd node after " << *n1 << " in footing\n";
	return;
    }
    if (n3 == 0)
    {
	cerr << "Error: Empty 3rd node after " << *n1 << " in footing\n";
	return;
    }

    cout << "n1: " << *n1 << endl << endl;
    cout << "n2: " << *n2 << endl << endl;
    cout << "n3: " << *n3 << endl << endl;
    cout << "p1: " << *p1 << endl << endl;

    p3 = n1->insert_parent();
    n1 = daughter1(p3);
    n4 = p3->append_daughter();

    move_sub_tree(n2, n4);
    move_sub_tree(n3, p1);

    p3->set("MetricalValue", "w");
    p3->set("Altered_a", "DONE_W");

    n1->set("MetricalValue", "s");
    n1->set("Altered_b", "DONE_S");
}

#if 0
LISP FT_metrical_data(LISP lf_word, LISP lf_seg, LISP lf_int)
   {

   EST_Utterance word, *u = new EST_Utterance;
   EST_Relation phone;
   EST_Item *s, *p, *w, *nw, *n;
   EST_StrList plist;
   float phone_start, mid;
   LISP lutt;
   EST_Track fz;
   int i;

   u->create_relation("Word");
   u->create_relation("Segment");
   u->create_relation("Syllable");
   u->create_relation("MetricalTree");
   u->create_relation("LexicalMetricalTree");
   u->create_relation("SurfacePhone");
   u->create_relation("Surface");
   u->create_relation("Intonation");
   u->create_relation("IntonationSyllable");

   EST_String segfile = get_c_string(lf_seg);
   EST_String wordfile = get_c_string(lf_word);

   if (u->relation("Word")->load(wordfile) != format_ok)
   {
   cerr << "Couldn't load file " << get_c_string(lf_word) << endl;
   festival_error();
   }

   if ((segfile != "dummy") &&(u->relation("Segment")->
   load(get_c_string(lf_seg)) != format_ok))
   {
   cerr << "Couldn't load file " << get_c_string(lf_seg) << endl;
   festival_error();
   }

   if (lf_int != NIL)
   if (u->relation("Intonation")->load(get_c_string(lf_int)) != format_ok)
   {
   cerr << "Couldn't load file " << get_c_string(lf_int) << endl;
   festival_error();
   }

   u->f.set("fileroot", basename(wordfile, "*"));

   //    cout << "Words: " << *u->relation("Word");

   if (segfile != "dummy")
   phonemic_trans(*u->relation("Segment"));
   //    u->relation("Intonation")->load(get_c_string(lf_int));

   // tmp hack
   float prev_end = 0.0;

   for (w = u->relation("Word")->head(); w != 0; w = n)
   {
   n = inext(w);
   //	w->set("start", prev_end);
   w->f_remove("end");
   //	prev_end = w->F("end");
   if ((w->f("name") == "sil") || (w->f("name") == "pau"))
   u->relation("Word")->remove_item(w);
   }

   gc_protect(&lutt);
   lutt = siod_make_utt(u);

   cout << *u->relation("Word") << endl;

   FT_POS_Utt(lutt);
   FT_Phrasify_Utt(lutt);
   MultiParse(*u);

   //    remove_punctuation(*u);

   // Copy Syntax tree into a new Metrical Tree
   copy_relation(*u->relations.val("Syntax"),
   *u->relations.val("MetricalTree"));
   // flatten preterminal unary rules
   flatten_preterminals(*u);

   apply_nsr(*u);

   copy_relation(*u->relations.val("MetricalTree"),
   *u->relations.val("LexicalMetricalTree"));

   word.create_relation("Word");
   word.create_relation("Match");
   word.create_relation("NewMatch");
   word.create_relation("Segment");
   word.create_relation("SurfacePhone");
   word.create_relation("LexicalSylStructure");
   word.create_relation("SurfaceSylStructure");
   word.create_relation("LexicalSyllable");
   word.create_relation("SurfaceSyllable");

   word.create_relation("LexicalMetricalTree");
   word.create_relation("SurfaceMetricalTree");

   phone_start = 0.0;

   // Note starts are hardwired here because feature function thing
   // isn't fully operational and because deleting silence messes
   // it up.

   //    u->save("zz_parse.utt", "est");

   if (segfile != "dummy")
   {
   for (s = u->relation("Segment")->head(); s; s = inext(s))
   {
   s->set("start", phone_start);
   phone_start = s->F("end");
   }
   phone_start = 0.0;

   s = u->relation("Segment")->head();
   if ((s->f("name") == "pau") || (s->f("name") == "sil"))
   {
   w = u->relation("SurfacePhone")->append();
   w->set("name", "pau");
   w->set("end",  s->F("end"));
   w->set("start",  s->F("start"));
   }
   }

   //    cout <<"Surface 1:" << *u->relation("SurfacePhone") << endl;

   for (i = 0, w = u->relation("Word")->head(); w != 0; w = inext(w), ++i)
   {
   word.clear_relations();

   lex_to_phones(w->f("name"), w->f("pos"),
   *word.relation("Segment"));

   if (segfile == "dummy")
   *word.relation("SurfacePhone") = *word.relation("Segment");
   else
   trans_to_phones(w, *u->relation("Segment"),
   *word.relation("SurfacePhone"));

   //	cout << "lex phones: " << *word.relation("LexicalPhone") << endl;
   //	cout << "sur phones: " << *word.relation("SurfacePhone") << endl;

   if (siod_get_lval("mettree_phones_debug", NULL) != NIL)
   {
   cout << "phones for word" << *w << endl;
   cout << *word.relation("SurfacePhone") << endl;
   }

   nw = word.relation("Word")->append();
   nw->set("name", w->S("name"));

   syllabify_word(nw, *word.relation("LexicalPhone"),
   *word.relation("LexicalSylStructure"),
   *word.relation("LexicalSyllable"));

   subword_metrical_tree(nw, *word.relation("LexicalSyllable"),
   *word.relation("LexicalMetricalTree"));

   if (siod_get_lval("mettree_debug", NULL) != NIL)
   word.save("word_lex.utt", "est");

   //	copy_relation(*word.relation("LexicalMetricalTree"),
   //		      *word.relation("HackMT"));

   EST_Item xx;
   dp_match(*word.relation("LexicalPhone"),
   *word.relation("SurfacePhone"),
   *word.relation("Match"), local_cost, &xx);

   if (syllabify_word(nw, *word.relation("SurfacePhone"),
   *word.relation("SurfaceSylStructure"),
   *word.relation("SurfaceSyllable")) < 1)
   {
   cerr << "Pronuciation for \"" << w->S("name")
   << "\" doesn't contain a vowel: " <<
   *word.relation("SurfacePhone") << endl;
   //	    festival_error();
   }

   fix_syllables(nw, word);

   subword_metrical_tree(nw, *word.relation("SurfaceSyllable"),
   *word.relation("SurfaceMetricalTree"));

   if (siod_get_lval("mettree_debug_word", NULL) != NIL)
   word.save("word_dp.utt", "est");

   if (siod_get_lval("mettree_debug_word", NULL) != NIL)
   if (get_c_int(siod_get_lval("mettree_debug_word", NULL)) == i)
   word.save("word_nth.utt", "est");

   utterance_merge(*u, word, w, "LexicalMetricalTree");
   }

   //    u->save("zz_parse2.utt", "est");

   //    u->save("test.utt");

   //    cout <<"Surface 2:" << *u->relation("SurfacePhone") << endl;

   add_initial_silence(*u->relation("LexicalPhone"),
   *u->relation("SurfacePhone"),
   *u->relation("Match"));

   //    cout <<"Surface 3:" << *u->relation("SurfacePhone") << endl;

   add_times(*u->relation("LexicalPhone"), *u->relation("SurfacePhone"),
   *u->relation("Match"));

   u->relation("LexicalPhone")->f.set("timing_style", "segment");
   u->relation("SurfacePhone")->f.set("timing_style", "segment");
   //    u->relation("Word")->f.set("timing_style", "segment");

   u->relation("LexicalSyllable")->f.set("timing_style", "segment");
   u->relation("LexicalSyllable")->f.set("time_path",
   "LexicalSylStructure");

   //    u->relation("LexicalSylStructure")->f.set("timing_style", "segment");
   //    u->relation("LexicalSylStructure")->f.set("time_relation",
   //					 "LexicalPhone");

   u->relation("LexicalMetricalTree")->f.set("timing_style", "segment");

   //    if (lf_int != NIL)
   //	add_feature_function(*u->relation("LexicalSyllable"),"vowel_start",
   //			     vowel_start_time);

   //    add_feature_function(*u->relation("LexicalPhone"), "start",
   //			 ff_start_time);
   //    add_feature_function(*u->relation("SurfacePhone"), "start",
   //			 ff_start_time);
   //    add_feature_function(*u->relation("SurfacePhone"), "dur",
   //			 duration_time);

   //    add_feature_function(*u->relation("LexicalSyllable"),"end", leaf_end_time);

   EST_Features tf;
   tf.set("time_path", "LexicalMetricalTree");
   tf.set("end", leaf_end_time);

   //    add_feature_string(*u->relation("LexicalMetricalTree"), "time_path",
   //		       "LexicalMetricalTree");
   //    add_feature_string(*u->relation("LexicalSylStructure"), "time_path",
   //		       "LexicalSylStructure");
   //

   add_non_terminal_features(*u->relation("LexicalMetricalTree"),
   tf);

   tf.set("time_path", "LexicalSylStructure");

   add_non_terminal_features(*u->relation("LexicalSylStructure"),
   tf);

   //    add_feature_function(*u->relation("LexicalSyllable"),"start",
   //			 ff_start_time);
   //    add_feature_function(*u->relation("LexicalSyllable"),"dur", duration_time);

   //    cout << "ADDED Features to phone\n\n";
   //    cout << *(u->relation("LexicalPhone")) << endl << endl;

   //    cout << "ADDED Features\n\n";
   //    cout << *(u->relation("LexicalSyllable"));

   //    cout << "\nfinished\n\n";

   //    if (lf_int != NIL)
   //	add_trans_intonation(*u);

   //    cout <<"Lexical 3:" << *u->relation("LexicalPhone") << endl;

   //    end_to_dur(*u->relation("SurfacePhone"));
   //    end_to_dur(*u->relation("LexicalPhone"));

   //    cout <<"Lexical 3:" << *u->relation("LexicalPhone") << endl;

   //    clear_feature(*u->relation("SurfacePhone"), "end");
   //    clear_feature(*u->relation("LexicalPhone"), "end");

   if (siod_get_lval("mettree_debug", NULL) != NIL)
   u->save("met_data.utt", "est");

   gc_unprotect(&lutt);

   //    u->save("zz_parse3.utt", "est");

   return lutt;
   }
#endif