text:
Tag Archives: Tucson
June 7, 2019 · 11:00 pm
Bernstein or Towering Based on a true story by Randy Ford and Neil Bernstein
International known artist and memorial builder (Bernstein}, whose work includes memorials to holocaust victims, 9/11 victims. border crossers who died in the Arizona desert. and destruction and loss life by storm Sandy, art that stirs such emotion that it leads to destruction of the artist's work and attempt on his life and then a mental breakdown, incarceration, divorce, protracted custody battle, stint in the Arizona State Hospital, and finally triumph.
Randy Ford Author- WORLD TRADE CENTER ARTWORKS DESTROYED
Facts about the Art Piece
By Neil Bernstein
Created in 1968 at El Ojito Center of Creativity, 4 th Ave Tucson, Arizona
Created after "The Golden Gates Bridge Over Trouble Borders" was first constructed in the Arizona desert.
Created in reaction to censorship and alteration of another one of Neil's art pieces by Diner Ware Art Gallery in Tucson. The art gallery's director had blood removed from that piece, which angered Neil and led him to picket the gallery. He was also reacting to the reaction of other artist who pulled out of El Ojito because of his exhibit at the gallery.
The artist as part of the work placed the tears in the work.
Neils 9/11 & Katrina work has been appraised by Bernard Ewell, art appraiser.
Up until now I have intentionally not implicated anyone or any entity in Santa Fe. Let me make it clear that it was in Santa Fe that the 9/11 and Hurricane Katrina Debris Works were destroyed. It was also in Santa Fe where once again "The Golden Gates Bridge Over Trouble Borders" was destroyed again and again (two or three times) and finally dismantled by the host of the exhibit. It was also in Santa Fe where Neil was intentionally run down with a truck while he was standing on a sidewalk. (Neil was seriously injured, and his recovery was very slow.)
Bernstein survives. He is still Bernstein. His ideas are just as big, and since they lead us back to and confront us with some of the most horrific events of our time they will always make some people's blood boil. It is the use of ash from the Trade Center rubble, his own blood, and the blood of an African American survivor of Katrina, used as glue in his work, that sometimes turns people off, while it certainly inspires more people than it shocks. This bold risk-taking is also what sets Bernstein apart and when all is said and done makes him, I think, an important American artist.
"Neil David Bernstein A.K.A. "BEN DAVID ARIEL" known in the media (Telemundo 2008) as "Architect Of The People" Formulated a new art and architecture beginning at The World Trade Center Site in September 2001, as means to assist those suffering world-wide. Bernstein's "CRRREATORS"-First Responder Arts Army is the secure international agency for political and tactical responsibility and revolution in the arts."
"THE GOLDEN GATES BRIDGE OVER TROUBLED BORDERS
NEIL BERNSTEIN ARCHITECT STOLEN TV NEWS FOOTAGE RECOVERED! GOLDEN GATES BRIDGE OVER TROUBLED BORDERS
Neil Bernstein Artist At War In Santa Fe
By Gunther Blitz
At the settlement conference, in federal court in Albuquerque, attorney Hatchet of Santa Fe offered Bernstein $10,000 to settle his 2 million dollar federal court case, after Matt Romero admitted, during his deposition, that he did, in fact, "run Neil Bernstein down with his four-wheel-drive pickup,and push him 30 feet until Neil disappeared under his truck."
Mr. Hatchet also submitted paperwork to destroy world-renowned art appraiser Bernard Ewell (Neil's principal professional witness) if he dared to testify on Bernstein's behalf.
Neil's X-attorney Jam Shavez-a personal injury lawyer from Albuquerque, repeatedly refused to take the deposition of Hallie Fuller or petition the internal investigation report from Santa Fe Police Detective Lieutenant Lentenberger.
Neil and his attorney motioned Judge Hererra in Federal Court to move the case out of New Mexico and into Philadelphia so that "these people can no longer intimidate court personnel, witnesses, attorneys, politicians and jurors. We will never get a fair trial in The State Of New Mexico, because the politicos who own Santa Fe own the state."
Neil then said:
" Lets face it, if this case ever gets to an honest courtroom and an honest jury, allot of people from Santa Fe and Albuquerque are going to fry. Hatchet and Matt Romero are simply pawns in a much bigger game that includes crooked-for sale politicians, cops, judges and lawyers all the up the ladder.
Now they are scrambling to keep Judge Hererra, and, The United States Federal Court Of New Mexico from re-opening the case after they, without my knowledge, authority, presence or permission, fraudulently- very quietly settled and vacated my 2 million dollar case for a measly ten-thousand ($10,000) dollars.
I don't think that Judge Herarra is going to be too pleased when she sees what these guys did to pull the wool over her eyes, and, the eyes of The Federal Government Of The United States.
That court in Santa Fe had better re-open my $869,000 case against El Museo, which was also fraudulently settled by Mr. Hatchet and his co-conspirators for less than three-thousand ($3,000) dollars. I spent tens of thousands of dollars and years pursuing that case, and, the document is obviously forged. The date for the destruction of the 9/11, Katrina, and Border museum-works is more than a year off, and, its not even notarized."
"The record clearly shows that Hatchet-the Santa Fe defense, Jam Shavez the personal injury lawyer, and others involved , did "SETTLE AND VACATE" Neil's 2 million dollar case on January 29th 2013 at 1:30pm in The United States District Court Of New Mexico before The Honorable Judge Hererra, without Neil Bernstein's knowledge, presence or consent.""The assailant-DEFENDANT Matthew A. Romero, admitted, after, telling several other versions of his story to the media and under oath, in his deposition, that, he did, in fact intentionally assault and run down Neil Bernstein with his four-wheel-drive pickup truck, and, that he pushed Neil Bernstein about thirty feet until he disappeared under his truck."
911 First-Responder Memorial-Media Arts AMERICA: 9-11 Art Show
Neil Bernstein Drives "THE NEW LINCOLN VETERANS MEMORIAL" to VETERANS DAY RALLY at the PHOENIX VA Bernstein says, "this is Veterans art made by guys who have been shot, tortured, disowned, rejected, arrested and thrown into jail and institutions by the very society they or we (Neil is a veteran who served in Germany) sacrifice our minds, well-being and lives to protect.".
The Politics of Haunting and Memory in International Relations
"AMERICA-9.11"AMERICA 911 EXHIBITIONS
Navy Distress Flag, PTSD Veterans blood, American Muscle Car (68′ Shelby-Bullit GT) paint, Air Force DD-979 Hazard Tag on canvas fixed to flag.
"ARRANCAR-THE PROMISED LAND FOR THE PEOPLE" Educational centerpiece from THE NEW JERSEY CENTER FOR THE VISUAL ARTS INTERNATIONAL COMPETITION (Telemundo, Univision, PBS-"Golden Gates Bridge Over Troubled Borders Immigration Gateways to U.S.)
http://neilbernsteinarchitectartistimages.blogspot.com/
THE NEW LINCOLN VETERANS MEMORIAL signed by Veterans.
"AMERICA-9.11 !" " FLAG SERIES CREATIVE DEPT OF DEFENSE Begin Friday 13th January 2017 ESPRESSO ART 924 E University Ave Tucson, Arizona 85719
"PRESIDENT TRUMP CHECKS THE PLA 2017" Navy Distress Flag, PTSD Veterans blood, TRUMP campaign sign, American Muscle Car (68′ Shelby-Bullit GT) paint, Air Force DD-979 Hazard Tag on canvas fixed to flag.
"AMERICA-911"
INTERNATIONAL UNIVERSITY SERIES 2017-
https://www.youtube.com/watch?v=E1WSoUYDME0
http://vahealthbears.blogspot.com/#!/2015/01/the-new-lincoln-veterans-memorial.html
The Great Wall-Ark of The United State
Induced by the tempests of public need, our studios breed mythological icons for the interpretation of historically significant events. Catalytic cyclones, the works shape clandestine materials, classic cars, carnival implements and other exciting materials into unusual contemporary representations of historically significant events.
2017: "Presidential Distress" GDCA Gallery Downtown Los Angeles
2017: Presidential Exhibition-NBC News, Phoenix, Arizona
2017 ACLU-NBC News
2017: NPR "Veterans Corner" 1 hour live interview
2016: New 911 wreckage-debris paintings released
2016 "AMERICAN PIE" series
2016: FILM-"BERNSTEIN!" underway
2016: established "The CREATIVE DEPARTMENT OF DEFENSE" interface and spx-operations agency international. Launched from Los Angeles, California and Washington, D.C.
2016: The New Lincoln Veterans Memorial Los Angeles, California
2015: "The Politics of Haunting and Memory in International Relations by Jessica Aucther released on Amazon (immigration bridges)
2014-2016: "THE NEW LINCOLN VETERANS MEMORIAL"-(return from the ashes) Cross-country-major TV news-media. Classic Lincoln Towncar covered in signatures from the foxhole to The Pentagon to effect influence to U.S. Congress to repair the crippled VA
2013: Orange County Contemporary Arts
2013: Jailed-hospitalized due to "Psychosis induced by improper medications by under-funded VA Healthcare system"
2012: "WASTED MANAGEMENT" FEMA Area 3-Seaside Heights, New Jersey
2010: New Amsterdam
2009: "NEW CENTURY ARTISTS" Chelsea, N.Y.,N.Y.
2008: Santa Fe Railyard-Golden Gates Bridge
2008: "The Golden Gates Bridge(s) Over Troubled Borders" (7) Water-filled 80′ life-saving bridges along and across the U.S.-Mexico borders
2008: PBS Special
2007: El Ojito Center Tucson, Az. One Man 911 Arizona Border Exhibition
2007: University of Louisiana Museum Of Art-"UPROOTED" Lower 9th Ward Debris Works-spokesperson WBRZ
2006-2007: "THE BOTTOM OF THE 9th-Ward site-specific exhibition over the FEMA barricades of New Orleans from the wreckage and "Clandestine" materials of Hurricane Katrina-Rita
2006: Pennsylvania State Art Museum. "Art of the State"
2006: Jones Center/Museum for Contemporary Art. "New American Talents", juried by Aimee Chang, director of Orange County Museum of Contemporary Art, LA, CA.
2005: Allentown Museum of Art, Allentown, PA. – Juried exhibition.
2005: Pennsylvania State Museum, Harrisburg, PA. – "Art of the State" juried exhibit. Juror: Kathrine Calley Galitz, Metropolitan Museum of Art.
2005: Allentown Museum of Art, Allentown, PA. – "Myth and Magic" group exhibit
2004: Radio Europa, Cazenovia College, Syracuse, NY. – Lecture Series "The Arts of Terrorism"
2004: Europe mecca tv, art and terrorism. Bucks College, Newtown, PA. – Lecture Series "The Arts of Terrorism"
2003: Sofia Museum of Art, Sofia, Bulgaria – Ground Zero Memorial Works- One man exhibition.
2003: Tv Good Morning South Africa. Johannesburg Museum of Art, Johannesburg, South Africa – Ground Zero Memorial Works – One man exhibition.
2002: World Trace Center area, NY, NY – Ground Zero One Man 3000 square ft exhibition adjacent to ground zero.
2000: PNI Gallery, Philadelphia, PA. – Holocaust One Man Show
1998: Highwire Gallery, Philadelphia, PA. – Cutting Edge
1995: SteamRoller Gallery, Clinton, NJ. – One Man Show
1993: Port of History Museum, Philadelphia, PA. "Art On The Edge "
1991: Penn state college Reddins, PA. – "Art Now" TV Series guest speaker
1991-1996: HighWire Gallery, Philadelphia, PA. – One Man Shows
1991: Yeshiva, Old Jerusalem, Israel – Holocaust Works
1991: Massada, Israel – Dead Sea Siteworks.
1989-1990: Kunstenarts Contemporary Arts, Amsterdam, Netherlands-Ten revolutionary american artists (co-ordinated w/Van Gogh
retrospective, 1990)-active in demolition-special interface operations Berlin Wall-Iron Curtain, Eastern Europe
1988: Day of the Dead Architectural Towers, Philadelphia, PA.
1980-1984: New Hope Artsl, New Hope, PA.
1979: Auswitz, Germany -Site work outside the gates of prison camp.
1978: Dachau, West Germany – Holocaust Works at the gates of Dachau.
1976: Fort Gordon, GA. –(10) Building M
Filed under Art, Neil Bernstein, Randy
Tagged as Art, New York Art, Tucson
The Writer Studio-Cash and Awards for Dyslexic Students & College Scholarships— $40,000 will be awarded in 2017 & Writing Classes
Any human anywhere will blossom in a hundred unexpected talents and capacities simply by being given the opportunity to do so. — Doris Lessing
View this in your browser
Update For Potential Students and Others Interested In Our School
Cash and Awards for Dyslexic StudentsYoung writers age 7-17 Creative Writing Awards. Deadline is January 21, 2017. Cash Prizes: http://www.dyslexicadvantage.org/dyslexic-advantage-karina-young-writers-awards/
Also, College Scholarships— $40,000 will be awarded in 2017: http://www.dyslexicadvantage.org/dyslexic-advantage-programs/karina-eide-awards/
A Good Week to Join Us For A Reading in NYCSunday, January 22, 2017, 7 p.m.
Writers Studio Level III and IV Students
Readings by Maria Galeano, Hani Omar Khalil, Corey Sabourin and Emily Stutz
KGB Bar, 85 East 4th Street, New York
Free (1 drink minimum)
Complete calendar of readings here.
Last Call For Winter Classes
Click any underlined text for more info and to register or call us 212-255-7075 <you many enter a class up to two weeks late>Online I starts
January 17NYC I in the West Village starts
January 23 NYC I in Brooklyn starts
Hudson Valley Workshop starts
January 17Tucson Workshop starts
January 17Amsterdam Workshop Started
January 9 < you may enter up to 2 weeks late>
Calling All Poets
If you have an MFA in Poetry or have taken four or more post graduate poetry classes, take one of these classes:
NYC Advanced Poetry in the West Village Started
You may enter either class up to 2 weeks late. Use discount code onlinepo for $30 discount
Tutorials Start Whenever
More info is here.
"The emphasis on the persona narrator keeps me focused on the emotion and not disconnected. Also I have learned to take risks and not be afraid to embarrass myself." — Catherine Wolf, Online Advanced Poetry student
Read more student feedback here.
Forward to Someone
Inspiration, Opportunities
Events, Offers
Our lives begin to end the day we become silent about things that matter. — Martin Luther King, Jr.
NYC – Tucson – San Francisco – Amsterdam – Online – Kids Write – Hudson.
Filed under Guest Bloggers
Tagged as $40.000 will be awarded, Cash and Awards for Dyslexic StudentsYoung writers age 7-17 Creative Writing Awards, Hudson Valley Workshop, Tucson, Writers Studio 2017, Writing Courses, Writing tuturials 2017
BORDERLANDS THEATER- Shadow Puppetry Master Class with Shadow Master Larry Reed!
Shadow Puppetry Master Class with Shadow Master Larry Reed!
Seven day intensive: May 23-29
M-F: 5pm-9pm & Sat & Sun: 2pm-6pm
(If you have a day job, ok to come after 5pm on weeknights)
La Pilita Community Center
420 S Main Ave. Tucson, AZ
To register email pinate39@gmail.com
Appropiate for all levels of experience. Learn or grow in the craft of Shadow Puppetry with nationally and internationally acclaimed shadow master, LarryReed, a trailblazer in the contemporary shadow theatre field. We're fortunate enough to have him in town for a week!
We are living in what American Theatre magazine recently called, "a puppet moment." Broadway hits starting with Lion King, Avenue Q, and Warhorse have put puppets in the spotlight. Shadow puppetry is possibly the oldest form of puppetry and the most magical. Larry Reed's Master Class is perfect for novice and experienced puppeteers looking to widen their skill set: teachers or anyone working with youth, visual artists, theater students, and any one interested in craftwork and fun!
Class participants will make one complete story from start to finish, including:
A variety of puppet designs/styles
Shadow masks
Backgrounds and acetate slides
Overview of the shadow theatre lighting system
Puppeteering technique
Shadow special effects, and tricks of the trade
Scholarship Option: Take the master class for free in exchange for staying on to build puppets and backdrops during the building phase May 31- July 24 Building sessions will take place three days a week, Tuesdays & Thursdays 6-9pm and Sundays 2-6pm. A minimum of 20 volunteer hours required over the 8 week build period.
The build is in service of the Sonoran Shadows workshop production, October 14-15, 2016. Paid puppeteer positions will be available for Sonoran Shadows.
Larry Reed Biography
founded ShadowLight Productions in 1972 to nurture indigenous shadow theater traditions, and to explore and expand the possibilities of the shadow theatre medium. He is one of the first Westerners to have trained in the traditional Balinese shadow theatre (wayang kulit) and is a "dalang," or "shadow master," who manipulates over 20 carved leather shadow puppets while simultaneously serving as the conductor of the accompanying gamelan orchestra, the director, and the stage manager. Over the years, he has performed over 250 shows in this tradition around the world. In the early 1990's, Reed entered a new phase of his career by inventing an ingenious shadow casting method, integrating traditional shadow theater techniques with film, modern theatre and dance styles. His major works include In Xanadu, The Wild Party, Coyote's Journey, A (Balinese) Tempest,Monkey King at Spider Cave, Ghosts of the River, The Good-for-Nothing Lover, andPoro Oyna: The Myth of the Aynu. These and other original works have been seen at festivals and venues such as Henson International Festival of Puppet Theater, Britt Festival, the Spoleto Festival USA, World Puppetry Festival, Huddersfield Festival in England, Walter Spies Festival in Bali, Eugene O'Neill Theater Center's National Puppetry Conference, Fort Mason Center, Theatre Artaud, San Francisco Insitute for the Arts, and University of Hawaii-Manoa. Shadow Master (1979), his unique "dramatic documentary" on the family of a Balinese shadow artist, has been shown on PBS and Discovery Channel. Reed has garnered numerous awards and honors, and was named one of Top 50 artists in the SF Bay Area by Metropolitan Magazine in 1995 and 1996.
Visit Shadow Light website here!
Watch a sample of Larry Reeds shadow work, Ghosts of the River here!
Forward this email
Borderlands Theater, 40 W. Broadway Blvd, Tucson, AZ 85701
Filed under play, Tucson
Tagged as Borderlands Theater, Larry Reed, Shadow Master Larry Reed, Shadow Pupetry, Shadow Pupetry Master Class, Shadowlight Productions, Tucson
Gecko Gals Ink, LLC- ALL-ZONA BOOK FEST
Gecko Gals Ink, LLC
Authors who are "Differently Expertised"
PO Box 35271, Tucson, AZ 85740-5271
We offer writing workshops for those who wish to compose, whether for private use or publication.
Sign up for our newsletter at our blog: http://geckogalsink.blogspot.com
Mark your calendars now for the ALL-ZONA BOOK FEST Sunday, October 12, 2014
St. Francis Cabrini Church
3201 East Presidio Road
Filed under Workshops & Conferences
Tagged as All-Zona Book Fest, Authors, Book Fest, Geck Gals Inc LLC, Tucson, Writing workshops
January 25, 2013 · 11:17 pm
Chamber Music Plus- Presents Harry Clark's CONFIDIENTIALLY, CHAIKOYSKI January 27, 2012
Chamber Music PLUS
CMP Website
Directions to the Berger
Tucson Desert Song Festival
BECOME A PRODUCTION SPONSOR
We're looking for individuals, couples and businesses willing to underwrite the unique offerings of the highest artistic level that Chamber Music PLUS creates. For this support, CMP will personalize its thank-you bouquet with proper recognition in all its media, complimentary tickets, intimate meetings with the artists, opportunities to attend private rehearsals, and other flowers that the sponsor might enjoy.
To learn how to join Laurie and Tom Pew, Arch and Laura Brown, and Edythe and Bruce Gissing as this season's major production sponsors, call 400-5439, or e-mail executive director James Reel at james@chambermusicplus.org.
Confidientially, Chaikovski This Sunday!
We're just a few days away from a Chamber Music PLUS show about one of the most beloved of all composers, and the most intense relationship of his life.
Nadezhda Philaretovna von Meck was a wealthy Russian widow of 45 when she first heard Tchaikovsky's music, appropriately a symphonic fantasy called The Tempest. Overwhelmed by the beauty of the work, she decided to use part of her large fortune to support the composer, who was 36 at the time. Thus ensued a vast correspondence between the two, stretching from 1876 to 1890, when von Meck stopped sending Tchaikovsky money, for reasons that remain obscure.
She steadfastly refused to meet the composer (a refusal with which he was in agreement), though they did occasionally make eye contact at concerts or at the opera house. Once they even came face-to-face in the street, but both turned away, embarrassed.
In 1893, three years after his last letter to Nadezhda von Meck, Tchaikovsky died from cholera. Within three months his "Beloved Friend," too, was dead.
Their extraordinary correspondence is the basis of the next Chamber Music PLUS production, Confidentially, Chaikovski. Author/cellist Harry Clark blames the nonstandard spelling of the composer's name on the Library of Congress; he'll probably justify it, and offer lots of other tidbits, in his pre-performance talk starting 30 minutes before the show.
That performance is slated for this Sunday, Jan. 27 at 3 p.m. at the Berger Center for the Performing Arts, 1200 W. Speedway Blvd. (on the campus of the Arizona State Schools for the Deaf and the Blind). Harry Clark and Sanda Schuldmann will play music for cello and piano by Tchaikovsky and other like-minded composers. Tchaikovsky and von Meck will be portrayed by Richard Thomas and Michael Learned, performing together for the first time since The Waltons. This could be our most in-demand show of the season, so obtain your tickets now by calling 400-5439. You can find out more about the show and its featured performers, and order tickets online, here.
And remember–our subscribers can always purchase additional tickets for $30, which is 25-percent off the single-ticket price!
Chamber Music PLUS | 5020 N. Campana Dr. | Tucson | AZ | 85718
Filed under Performances
Tagged as Chamber Music Plus, Harry Clark, Nadezhda Philaretovna von Meck, Sanda Schuldmann, Tchaikovsky, Tucson
19th Annual Tucson Earth Day Festival & 4th Annual Water Festival
The Earth Day Festival and The Water Festival partner for a big community event for learning and family-friendly fun on Sunday, April 21, 2013 9am-2pm, at Reid Park. Register as a sponsor, exhibitor, artist, workshop leader, or volunteer. More information is available at http://www.tucsonearthday.org and http://www.WaterFestivalTucson.org.
REGISTER AS AN EXHIBITOR, ARTIST OR PARADE ENTRANT FOR THE
Pima County, AZ – Share your eco-friendly message for Earth Day at the Annual Tucson Earth Day Festival and Parade in combination with The Water Festival on Sunday, April 21, 2013. The event is from 9 a.m. to 2 p.m. at Reid Park, off Country Club Road north of 22nd Street. The Parade starts at 10 a.m. The registration deadline for exhibitors and parade entries is March 29, 2013.
In its 19th year, the Tucson Earth Day Festival and Parade with the theme "Green Planet, Green Future" is partnering with the 4th Annual Water Festival, presented by Tucson Arts Brigade, for this 2013 event.
Who's invited? Non-profit organizations, private businesses, government agencies, clubs, families, artists, youth groups and community groups who have an eco-friendly message to share.
Sponsors have the opportunity to receive advertising benefits and recognition for their stewardship at each or both festivals. Businesses are encouraged to apply early to maximize their benefits.
Exhibits should provide information on environmental products or issues such as water conservation, water quality, air quality, household hazardous waste, habitat conservation, sustainability or other "eco" topics. Exhibitors should provide engaging, hands-on activities with take-away information about how to preserve earth's resources for our children of the future. In addition, the Earth Day Festival features a Farmer's Market and The Water Festival features water-inspired entertainment and workshops.
Parade entrants should share eco-friendly messages and can reflect the parade theme "Green Planet, Green Future." Environmentally themed floats must be human-powered or use alternate fuel.
Alternate-Fuel Vehicle Exhibitors featured at the Earth Day Festival can show how their auto, bike or motorcycle runs on clean fuels such as biodiesel, compressed natural gas, electricity, ethanol, propane and even waste vegetable oil.
The Model Solar Race Car/Solar House Competition is open to middle school students who will show off their design and construction skills. Kits for this competition are available from the Society of Women Engineers at www.swetucson.org/solar.
Art Show, "The Vibe" Live Art Happenings, and Design for Water Solutions Contest, featured at The Water Festival, invites artists to show their water-inspired visual and performing arts, plus compete for a winning creative proposal for a water solution.
For more info and registration for The Tucson Earth Day Festival and Parade, go to http://www.tucsonearthday.org, call (520) 206-8814 or e-mail tucsonearthday@yahoo.com. Find us on Facebook at Tucson Earth Day Festival and The Water Project. To register at The Water Festival, go to http://www.WaterFestivalTucson.org, call (520) 623-2119 or e-mail info@WaterFestivalTucson.org.
Tagged as 19th Annual Tucson Earth Day Festival, 4th Annual Water Festival, Eco topics, Eco-friendly message, Tucson, Tucson Arts Brigade
National Writers Union Tucson Unit- Open Mic Monday Night January 21, 2013
The National Writers Union will be having an open mic on Monday, January 21, at Fronimo's Greek Cafe at 3242 E. Speedway Blvd. in Tucson. This month there will be, in addition to the open mic, a brief discussion of the NWU's successful campaign on behalf of unpaid freelance writers writing for Heart and Soul magazine.
The open mic is for spoken word only, but is open to all forms of spoken word (fiction, essays, poetry, articles, polemics, etc.). So bring something to read!
The evening will start at 5:30 or so for those who want to have dinner; the open mic will start at 6:15. Fronimo's is on Speedway just past Country Club (heading east) in a small strip mall next to the Walgreens. Parking is in the rear and can be accessed by turning into the Walgreens parking lot from Speedway and then proceeding to the mall.
National Writers Union
(UAW Local 1981/AFL-CIO)
Tucson Unit
nwutucson@yahoo.com
http://www.orgsites.com/az/nwu
Filed under Randy
Tagged as Authors, Heart and Soul magazine, National Writers Union Tucson Unit-, Open Mic for Spoken Word Tucson, Open Mic Tucson, Tucson


Savannah Dooley, a 24- year-old writer in Los Angeles, just moved back home with her mother.
Dooley is bunking with mom again for expediency, but she is hardly an example of the recession-fueled trend of "boomerang" kids who can't support themselves. Dooley moved back home because she and her mother, Winnie Holzman, have been handed a 10-episode order for a new dramedy series, "Huge," on ABC Family. They've been spending so much time together writing scripts that once the lease on Dooley's apartment ran out, it just seemed to make sense for her to move back home for a while.
"It's sort of a sitcom around here," Holzman jokes. Dooley sounds like a proud daughter, emphasizing how much they are in synch, as roommates and as writing partners.
Holzman is an accomplished TV, film and legit scribe, known as the creator/exec producer of "My So-Called Life," among other shows, and for penning the book for the smash hit tuner "Wicked." But "Huge," based on the book by Sasha Paley, was largely shepherded to its series pickup by Dooley, who began working on it while she was still a student at Bennington College in Vermont. (She graduated in 2007).
The project came to Dooley through a longtime family friend, multihyphenate Robin Schiff, who at present is an exec producer on ABC Family's "10 Things I Hate About You." ABC Family wanted to adapt Paley's book, which follows the lives of six teens who attend a weight-loss summer camp, as a telepic.
Schiff was interested in directing the project but was not as eager to tackle the screenplay adaptation. Having been a writing mentor to Dooley for years, Schiff had a feeling that the bright young woman would be a perfect fit with the material. Schiff and Dooley worked out the pitch and story outline, and then Dooley delivered a script that went over very well with ABC Family brass. But everything ground to a halt when the writers strike ensued in November 2007.
After the picket signs came down, Dooley began working with a different writing partner on a number of projects, and she also spent time developing ideas and scripts with her mother. Dooley was tapped by CBS to tackle a script for a pilot that never got off the ground but proved to be an invaluable learning experience.
From her vantage point, Holzman could see that no matter how much she and others tried to explain the development process to Dooley, there's no better way than to learn by doing.
"Just doing a lot of writing in a short amount of time is one of the best ways to become a better writer," Holzman says.
Eventually, ABC Family came back to Dooley and Schiff with a surprising idea: The cabler wanted to do "Huge" as a series rather than a telepic. Dooley was eager to dive in but Schiff was now occupied by "10 Things." They would need a seasoned TV writer-producer to get the show on its feet. Schiff once again had a strong instinct on who might be just right for the job, even though she also knew that Holzman wasn't pursuing TV work.
Gayle Abrams, and another exec producer, Kim Rozenfeld.
While Holzman wanted to make sure she had the flexibility in her deal with ABC Family to move on to other projects if she desired, she indicated that she intends to keep her focus on "Huge" for now.
For such a young scribe, Dooley has an impressive ability to write characters with great depth and clear subtext to the situation she portrays, says Kate Juergens, ABC Family's exec veep of original programming and development.
Dooley, of course, has had a front row seat to the highs and lows of the life of a showbiz scribe. She doesn't have strong memories of the hubbub that surrounded "My So-Called Life" in the 1994-95 season, but is well aware of the heartbreak her mother endured. The ABC series about a teenage girl, played by Claire Danes, was praised to the skies by critics but low-rated, and its cancellation sparked an impressive grassroots "Save 'My So-Called Life' " campaign in the days before the Internet could easily drive such efforts.


The key to making an informed decision about your breast enlargement surgery is information. The more you know about the different breast implant choices you have available, the better equipped you'll be to make a proper choice.
In this article, we'll discuss the benefits and risks associated with saline breast implants. Take note of all the facts before you make your decision.
With a saline breast implant, there is an outer shell of silicone in which the saline is placed. These implants are the most commonly used here in the United States. They come in an array of sizes, textures, shapes, and profiles. The best way to find the saline breast implant that's right for you is to find an experienced surgeon who understands your body.
Of course, with every surgery there are some risks. The most common problems associated with saline breast implants are capsular contracture, rupturing of the implant, and the need for follow-up surgeries. As always, you should discuss these possibilities with your surgeon before you agree to surgery.
Allergan is a pharmaceutical company who makes a broad range of products. Recently, the Allergan saline implant became available to plastic surgeons throughout the country. These implants are the same ones that have been used for years under the "Inamed" name. Allergan simply bought out the company a few years ago.
Women can effectively experience dramatic breast reconstruction with saline implants. The variety in the shapes, sizes, and textures of saline breast implants makes them a popular choice for breast enlargement surgery.
As with all medical decisions, you should always learn as much as you can about the advantages and disadvantages of saline implants before you decide to go under the knife. Ask your surgeon if he feels saline implants are right for you. Read our questions for your doctor and other frequently asked questions.


text:
Articles / Desktop Programming / WPF
Revisions (2)
140 bookmarked
A Graph Tree Drawing Control for WPF
darrellp
23 Feb 2009CPOL10 min read
This article describes and implements a graph drawing control for tree structures structured in a WPF panel.
Download source files (includes Silverlight version) - 75.13 KB
This article includes two very different basic assemblies and a couple of test assemblies for WPF. The first basic assembly is GraphLayout which implements the Reingold-Tilford algorithm, described here, to determine the placement of nodes in a tree structure. This tree is structured as a top down tree with the root at the top and the leaves at the bottom. This algorithm is entirely independent of any actual drawing of those nodes and so can be used for any purpose where such positioning is required. It includes options for vertical justification for nodes, collapsing of nodes, distance between sibling nodes and distance between non-sibling nodes. This assembly is not WPF specific and could easily be used to produce a GDI+ tree drawer (though I haven't included any here). It also includes a list of endpoints for lines which can be drawn as connectors between nodes. Currently, these lines are simply straight lines from the bottom center of the parent node to the top center of the child node, though it would be easy enough to modify them to draw different kinds of connectors.
The second assembly is a WPF control subclassed from Panel which uses GraphLayout to determine where to place its child controls in a tree. Each non-root node has a dependency property for its parent node's name which is how the graph is strung together. Since this is a subclassed panel, the individual nodes can be any type of WPF control desired. This allows the tree to be specified in XAML as demonstrated in the TreeContainerTest test app or in code as demonstrated in the VisLogTree.
It also contains a Silverlight control which does the same thing. The primary difference with the Silverlight control is that the connections have to be added as a Path child to the tree container rather than painting the connections directly onto the control. Silverlight doesn't support the OnRender function for controls where they can be drawn to. I prefer the drawing method used in the WPF control so that there's not this "dangling" path control, but it really doesn't seem to be an option in Silverlight. I just got started with Silverlight a couple of days ago so if anybody knows better, I'd love to hear about it. The GraphLayout DLL had to be recompiled so it would be linked with the Silverlight libraries but otherwise was used unchanged. After figuring out all the little Silverlight quirks, the new Silverlight control worked the first time I tried it testifying to some extent to the universality of GraphLayout.
There are several WPF controls which I could locate which make some effort to produce trees in WPF but so far as I can find, there are no free assemblies/source code which give a proper implementation of the Reingold-Tilford algorithm in a standard WPF fashion (i.e., a subclassed panel which can be implemented in XAML) and it seems like an obvious and valuable thing to do, so I've done it. There are LOTS of extensions which I can think of making here, but this seems pretty valuable as it is so I'm putting it out there and moving on to other things for the moment.
The Reingold-Tilford algorithm can easiest be described as "recursively drawing all child graphs then jamming them all to the left as far as you can, leaving a fixed distance between nodes and finally cleaning up interior nodes which are jammed to the left but can be moved to the right for centering purposes". I know that's not incredibly intuitive - especially the last part - but reading the article cited above gives all the details (albeit not in a terribly clear manner in my estimation, nor in a way that corresponds very directly to my code which I implemented before reading this article and with not much more than the sketchy description given here - carefully slogging through the walkthrough is the only way I really understood it, even when I knew the basics of the algorithm).
I tried to test all the cases, but I might have missed a few - there are lots of trees out there, so please mail me if you find any bugs. For the most part, if I found inconsistencies with the Parenting within the WPF control, I just didn't position the corresponding controls at all so they end up in the upper left of the TreeContainer control. This is so XAML isn't constantly blowing up and showing you nothing because of a thrown exception. If you see nodes in the upper left of your TreeContainer control, go in and check for consistency in your Parent properties.
Using GraphLayout
GraphLayout (which probably should more properly be called TreeLayout although in the future I may add other Graph type layouts to it) provides an ITreeNode interface which represents (you guessed it) the nodes in the tree. GraphLayout.LayeredTreeDraw is the class which calculates all node positions. Its constructor takes an ITreeNode which represents the root of the tree and some global parameters which affect the positioning (minimum distance between nodes, vertical justification, etc.) and sets properties on all the nodes giving their proper positions in the final graphical tree.The ITreeNode interface is fairly simple. It includes TreeWidth and TreeHeight properties which return the width and height of the node. It also includes the boolean Collapsed property which is a readonly property telling whether the node should be collapsed. How this information is kept and set on the node is up to the implementation. The most important property is TreeChildren which returns the children of this node in a TreeNodeGroup collection. TreeNodeGroup is a simple enough class with an Add function to add ITreeNode objects to its collection. Finally, LayeredTreeDraw needs a place to poke its own private information into each node. You must implement PrivateNodeInfo which takes an object, stores it into the node and retrieves it back later.
There are three buffer distances associated with trees. The vertical buffer distance is the minimum distance between the layered rows of the tree. The horizontal buffer distance is the minimal distance between sibling nodes in the graph. The horizontal subtree distance is the minimal distance between nodes which are not direct siblings. This makes some graphs look better by further separating subtrees further than individual siblings.
After constructing the LayeredTreeDraw object, you simply call LayoutTree() on it and then retrieve the information back from it. The X and Y coordinates for a given node are retrieved from a LayeredTreeDraw object called ltd with ltd.X(treeNode) and ltd.Y(treeNode) where "treeNode" is the ITreeNode in question. ltd.PxOverallWidth() and ltd.PxOverallHeight() return the width and height of the resultant tree. ltd.Connections() returns a list of TreeConnection objects. Each object has a parent ITreeNode and a child ITreeNode along with a list of DPoints which give a path of lines from the parent to the child. Since WPF and GDI+ use different definitions for "Point" I decided to implement a very lightweight DPoint structure which always uses doubles for the coordinates and can be used from either WPF or GDI+ (or anywhere else for that matter). Currently, these connectors give a single line between the parent and the child but this wouldn't be hard to change. Really, I was going to provide a set of different types of connectors, but maybe that will be something for the future. As it is, it is possible with different sized vertical nodes that a connector from a short node could overlap with a taller sibling node. One of the things I thought about doing was giving broken lines which would avoid this possibility.
That is pretty much it for GraphLayout. It's simple enough to use but definitely the most complicated part under the covers.
Using TreeContainer
TreeContainer is a WPF control subclassed from Panel which uses GraphLayout to layout its children. To be used properly, we have to know the tree structure of the children. This is handled by having a dependency property called "Root" which is set on the TreeContainer and has the string value of the name of the node which is the root of the tree. The children of the TreeContainer must all be TreeNodes which are content controls which may hold whatever controls you like. The TreeNodes have a TreeParent property which tells which node is their parent in the tree - again, a string value with the name of the parent node. Every TreeNode in the TreeContainer must have a parent property except the root node. There is also a Collapsible and Collapsed property on each TreeNode. If the Collapsible property is set to false for a node, it cannot be collapsed. It it is true, then the value of Collapsed determines whether a node is collapsed or not. In the VisLogTree sample, the nodes are buttons which toggle the collapse of the tree below them when pressed. These properties are all XAML settable.
TreeContainer also contains some utility routines for creating the TreeNodes programmatically. This includes Clear() which clears all nodes from the TreeContainer and routines to add roots or interior nodes. At their simplest, these never have to deal directly with names in which case the code produces internal names. So, for instance, AddNode(Object, TreeNode) wraps the object in a new TreeNode, gives it a name and sets its parent to the TreeNode passed in. The TreeNode produced to wrap the object is returned. See the VisLogTree for an example of how to use these to easily produce the trees in a TreeContainer at runtime.
The TreeNode containers implement the ITreeNode interface and hence are themselves the ITreeNodes necessary for GraphLayout's calculations.
There are many additions which could easily be added to this control. I've mentioned several in the text already - arbitrary pen for drawing connections, different types of connections, different orientations for the graph (i.e., left to right or bottom to top), a routed event for when nodes get collapsed or uncollapsed, etc. It seems like a valuable control at this point, however, and to be honest, I'm anxious for new territory to cover so I'm putting it out there as is.
The algorithm proved to be much trickier than I had initially supposed. There are a fair number of exceptions and gotchas to the algorithm as I originally read it. It might have been easier to just blindly follow the algorithm as described in Dr. Dobb's article in the hyperlink above, but I didn't have that article ahead of time and there are a few things I'm not fond of in the algorithm as written there.
There are two samples. One is an XAML version of the graph used in the paper mentioned above just to verify that it turned out correctly as described in the paper. The other gives the visual and logical tree for a dialog loosely based on one in "WPF Unleashed" by Adam Nathan, an excellent book. It's the dialog that Nathan uses to illustrate logical and visual trees so you can check that it gives the right information. The nodes in the second one are buttons which toggle whether their subgraphs are collapsed or not. There is also a button to remove or add back in the label at the top of the dialog which I used for debugging and left in there.
A point I wasn't aware of until working on this control is the RegisterName/UnregisterName methods on FrameworkElements. When I first tried to create the tree control programmatically, I naively set the name on my TreeNodes and then used FindName() to locate them later. Wrong! If you do the same, you will be told that no such control name exists. You must use the RegisterName() method to register the name with the parent in order to make this work. Similarly, if you remove a control you really should do an UnregisterName(). I've read a lot on WPF and this is the first time I've ever seen this. It seems like this should be a little more visible in the documentation out there. The utilities on the TreeContainer which allow easy production of the TreeNodes takes care of all this automatically.
9-20-2008 First version
2-21-2009 Added Silverlight control
I've been doing programming for close to 30 years now. I started with C at Bell Labs and later went to work for Microsoft for many years. I currently am a partner in Suckerpunch LLC where we produce PlayStation games (www.suckerpunch.com).
I am mainly interested in AI, graphics and more mathematical stuff. Dealing with client/server architectures and business software doesn't do that much for me. I love math, computers, hiking, travel, reading, playing piano, fruit jars (yes - I said fruit jars) and photography.
nuaz27-Jan-09 20:06
nuaz 27-Jan-09 20:06
Hi darrellp,
is there a way to use this control within silverlight ?
as u surely know, you can't add c#/wpf lib projects references to a silverlight one.
i tried by adding the code files as links in the silverlight app but there are many namespaces (e.g. System.Windows.Documents.Adorner) which doesn't exist in the silverlight ones.
nuaz
Re: silverlight
darrellp28-Jan-09 6:51
darrellp 28-Jan-09 6:51
I haven't messed with Silverlight too much yet but I think it's not too far off from normal WPF so I can imagine two possibilities here...
First is to modify the control given in this article. Since I haven't worked with Silverlight too much yet, I really can't say how easy/difficult this would be. I wouldn't think that hard, but I'm just not sure.
The second way is to use GraphLayout and do a new control or just use it to arrange controls on a canvas. It's really quite simple to use and gives you all the information you need to arrange your items. If all you wanted to do was a quick one shot thing, I'd think you could get them all placed on a canvas with a few lines of code. Just turn each item you want in the tree into an ITreeNode which gives its width, height and children and then call LayoutTree() on the root node. That gives all your placements and a list of the line placements. For each ITreeNode, put a control at the specified position and size on the canvas and for each line, place a Line element and you're done.
Even my full blown WPF control is done in a total of 600 lines of C# code so I can't imagine that doing a minimal silverlight version would be terribly difficult, especially if you use my TreeControl as a guide.
If you do it and it is publicly viewable on the net, it'd be cool if you'd give a link to where it shows up!
darrellp21-Feb-09 20:17
darrellp 21-Feb-09 20:17
I just got set up for Silverlight development a day ago and ported over the control. I submitted a revision of this article to CodeProject with the Silverlight version but I don't know how long it will take to actually make it in. If you want it quickly, send me some email and I'll send it back. Seems to work fine but let me know if you have any problems with it. Like I said, I've only started into Silverlight so I might have messed something subtle up.
jhuang7899-Sep-10 8:26
jhuang789 9-Sep-10 8:26
Have you published the SilverLight version of the control yet? I am interested to take a look of the example. Thanks.
darrellp9-Sep-10 13:38
darrellp 9-Sep-10 13:38
The code in the download includes both the WPF and the silverlight version
Changing layout of individual levels
Richard Spiers5-Jan-09 0:20
Richard Spiers 5-Jan-09 0:20
The main problem that I am having at the moment is that I need to display a lot of nodes on one level of hierarchy (I.e. one root node, three child nodes, then 100 (or some big number) of grand children nodes, then a small number of nodes etc )
My project is working at the moment, however it is not very usable as it looks like a very short and wide tree. I have to scroll for ages horizontally to look through the nodes.
Would it be possible to get some advice on how I could change this code to instead draw one layer in a cascading fashion or a grid fashion ? I'm trying to find some way of maximising the screen estate.
I have gone through numerous different attempts such as only drawing the nodes that a user selects from a list box / representing the information in a tree view with custom layouts / working with different wpf panels or different objects as the nodes in the tree etc.
I have also experimented with the code in DetermineFinalPositions from LayeredTreeDraw and the ArrangeOverride function in Treecontainer but am still pretty stuck as to how I can proceed.
Any advice would be greatly appreciated
How to remove a node from tree?
gecko00727-Nov-08 23:22
gecko007 27-Nov-08 23:22
This is a great utility. I was trying it out for one of my test applications for data visualization. My application requires changes in tree structure at runtime which and I am trying to get this to work with your utility.
I need to remove or shift nodes within the tree, but I am unable to find any standard method to do so. Which part of the code should I modify to get this to work?
Re: How to remove a node from tree?
darrellp28-Nov-08 9:57
darrellp 28-Nov-08 9:57
Oops - I was answering the question for a totally different article (graph isomorphism) that I'd done! Okay, we're talking about tree drawing here, Darrell...
The Tree is just implemented as a Collection of children on each TreeNode. Just remove the child you want from the collection of it's parent node and add it in to the collection of the new parent you want to move it to. You'll have to invalidate the control after you've made all the moves you want to make. I haven't actually done that, but I think it should be a piece of cake.
Horizontal and vertical alignment stretch
MBursill27-Oct-08 8:33
MBursill 27-Oct-08 8:33
Great control, just trying to tweak it a little to suit my needs.
I'd love to have the width and height of the graph take up all available space within the container.
<tc:TreeContainer tc:TreeContainer.Root="O" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="Tree" HorizontalBuffer="{Binding ElementName=Tree, Path=Width}" VerticalBuffer="50" HorizontalBufferSubtree="0" VerticalJustification="top">
I thought binding the HorizontalBuffer to the width might do the trick, but apparently that caused the width in szFinal of the panel's MeasureOverride to repeatedly grow and would lead to an instant crash.
-Mike.
Re: Horizontal and vertical alignment stretch
darrellp27-Oct-08 12:07
darrellp 27-Oct-08 12:07
Please read the entire response, even if you find it tedious. I didn't think of what I believe to be the best answer until the very end of the response.
Thanks. It's really difficult to do something like this in the control itself because it has to ask the nodes what size they are in order to arrange them properly so in the end it has to size itself according to what the underlying nodes tell it about their individual sizes. Also, it can't really tell each individual node a pre-assigned size since the size dependency flows from node to control rather than the other way around.
However, hope is not lost! Fortunately, WPF really has an answer for just about everything and I think your answer is the ViewBox which takes any control of any size and scales it to fit wherever the ViewBox is. So put the tree control in the ViewBox and then let your ViewBox expand to fit wherever you like. Of course, the nodes will be distorted by the scaling, but that's the only option I've got right now. In that sense, the control is more like a TextBox in that it really can't do much if it's nodes want to be a particular size.
The only other possibility is placing more or less space between the nodes but this is kind of ugly. Plus, it would really cause problems if, for instance, you were to place it in a scroll viewer which gives it "infinite room" since the scroll viewer will accommodate any size control. Here's some thoughts on what such a feature would entail...
I'd do it in the GraphLayout code rather than the TreeContainer code since that's really where the arranging should go on, plus this would extend it to anything else that might make use of the GraphLayout code. This means you have to pass down a desired width and height in addition to the root node. It also means that this needs to be an optional thing since it will generally make a lot of sense to allow a specific spacing. This would also have to be done after the entire graph had been layed out in the conventional manner since the position/sizes of all nodes is required before you can know the width of the graph and after that you'll have to determine the buffer space you need to insert to achieve your optimal size. So this entires a third pass through all the vertices. Finally, I'm not sure how you'd determine what spacing to use. The first intuition is to figure the difference between the "natural" width and the one you want, divide that by...what? You can't really say "the number of nodes wide the graph is" because that's not even well definied - different parts of the graph have different widths of layers. What you want is some set of nodes who independently determine the width of the tree and that's not an obvious thing to determine. Obviously, in some sense, the algorithm currently "determines" this, but only in the most roundabout way with the information being passed up and down in call trees and not specifically recorded so to try to determine this information after the fact would be difficult and I'm not even sure right off the bat how to keep track of the information during the running of the algorithm (though I'm sure it would be possible if push came to shove since, like I say, it's implicitly determined in the course of running the algorithm). Actually, even determining this isn't enough. If, for instance, you have three nodes that, together determine the width of the graph, there may be some set of 5 narrower nodes who are currently narrower than those three but if you add the same constant internode width to all nodes, those five will get wider faster than the three and may end up being the deciding factor which will throw off your original calculations. Yikes! It's harder than I had originally imagined!
All in all, I think this would be a very tough feature to implement as spacing between nodes and would actually break many things like scrollviews so I'm not really that motivated to take it on myself. I'd say if the ViewBox works, that's great. If you've got text in the nodes that you don't want distorted, one possibility is to use tooltips to indicate what's in each node. Not a great option I don't think but I'm just trying to think of all possibilities.
Actually, here's a final possibility which I would suggest. You could fiddle with the internode width yourself. For instance, in TreeContainer you could binary search, calling into the GraphLayout code with different internode widths until you got within some delta of the width you were looking for. It's pretty quick in general so I think you could probably get away with this and I think it's probably the closest you're going to get to a reasonable solution. So in MeasureOverride you'd put the constructor/layout calls to LayeredTreeDraw in a loop which does binary search on horizontal and vertical buffer widths until you were close to what you wanted. I'd still be tempted to put the whole result in a ViewBox so it would scale to exactly the size you were looking for. The binary search within TreeContainer would just get you near enough the "proper" value that the distortion from scaling wouldn't look too bad.
That's probably more than you cared to hear about the subject so I'll shut up and let you mull over things. I hope you can get something that suits you.
One last thought on the binary searching idea. Barring odd situations like I mentioned in the previous response, the relationship between control size and internode buffering is likely to be close to linear so you could use that to help narrow in to the "proper" internode buffering. It's not guaranteed because, like noted above, some other set of nodes may determine graph width as the buffering space changes, but that's only going to happen at discrete places so the linear assumption is probably a good heuristic.
MBursill27-Oct-08 12:31
MBursill 27-Oct-08 12:31
As is often said "the devil is in the details". I appreciate the long reply, it gives me some good ideas to tackle this problem. I'll certainly need some time to digest what you said, but I'm going to try and it get it to scale, sans distortion, one way or another.
Let me know if you come up with a good solution. I think the binary search is about as good as you're going to do. Good luck!
Great! However connections are not printed.
Patrick Lassalle23-Sep-08 7:22
Patrick Lassalle 23-Sep-08 7:22
First of all, let me congratulate you for this very interesting article (5 points of course)
You have choosen to display the connections in an adorner. Although I like this idea, I have seen a little problem with it. For instance, if you want to display the tree diagram, the 3 following lines can do it:
PrintDialog pd = new PrintDialog();
if ((bool)pd.ShowDialog())
pd.PrintVisual(this.tcMain, "Diagram");
The problem is that the connections are not printed because there are not placed in the TreeContainer. I don't know if there is an easy workaround for that. Perhaps you will have to display the connections directly on the TreeContainer like the TreeNode objects.
Re: Great! However connections are not printed.
darrellp23-Sep-08 10:45
darrellp 23-Sep-08 10:45
Thanks for the kind words.
Good point on the adorners though. There is a slightly clumsy workaround written up here:
But it is a clumsy workaround and I'm not really that wedded to the idea of an adorner in the first place so let me look into putting it directly on the control. It shouldn't be that difficult (famous last words! )
I'll respond to your message when it's all been cooked up properly.
Okay, it's done. Took longer to make the new submission than it did to make the code changes.
Hey - I see by looking at your web page that you've been over this territory (and more) before. Looks really nice!
Patrick Lassalle23-Sep-08 12:40
Patrick Lassalle 23-Sep-08 12:40
Yes! I am currently trying to create a WPF version of AddFlow and I hesitate between several methods. Currently I have two prototypes: one that uses the low level Visual objects to display nodes and links and one that use controls (as in the WPF Diagram Designer article).
Of course the first one is faster but the second one offers more possibilities. However, there are some other possible strategies (your article demonstrates one of them).
To be quite frank, I do not remember having faced so many difficulties when passing from the ActiveX technology to .NET!
Perhaps I am too old
Well, in the brave new world of WPF, it seems to me that a container which emphasizes the notion of placement is really the cat's meow for this sort of thing and not at all difficult as you can see here. Once I had the positions figured out in GraphLayout, it was a piece of cake to make it into a panel container. Given the number of nodes you're going to reasonably expect to fit onto the screen, it seems to me that performance isn't as much of an issue here as flexibility and the container gives you the maximum of that. Of course, people can put it under a scrolling container and you can fit as large a tree as you like but really, a small window on a big tree is pretty much impossible to grok, so for practical purposes, you're not really going to be drawing thousands of nodes with this control in the 99% case.
Well, that's my take on it anyway. Good luck on your project in any event!
I agree with you but I would replace "99%" by "80%" because I have allways been surprised by the number of customers that wish to work with very big diagrams with for instance 1000 or 5000 nodes.
darrellp24-Sep-08 6:33
darrellp 24-Sep-08 6:33
I'll have to take your word for it since you definitely would have a better feel for this sort of thing than I do. Thanks for an interesting and helpful thread!
Sacha Barber20-Sep-08 21:36
Sacha Barber 20-Sep-08 21:36
I was just about to post (today) an article very simliar to this. Mine had 2 layout options, I like yours and a another radial approach.
oh well Ill just do the radial one then
Sacha Barber
Microsoft Visual C# MVP 2008
Codeproject MVP 2008
Your best friend is you.
I'm my best friend too. We share the same views, and hardly ever argue
My Blog : sachabarber.net
Re: This is funny
Ah - sorry. I was going to do a radial maybe sometime in the future but glad that you're putting one out. This one's been on the back burner for a long time. I was just too lazy to do the HTML. I'm anxious to see how yours contrasts in approach.
Sacha Barber21-Sep-08 4:56
Sacha Barber 21-Sep-08 4:56
no worries, its always good to have more examples.
Mine is http://www.codeproject.com/KB/WPF/SpiderControl.aspx
though its quite different I think
I thought I recognized the name. I think I've stepped on your toes before - we both have cropping adorner articles on CodeProject. Maybe I should coordinate my next project with you!
Last Visit: 31-Dec-99 19:00 Last Update: 16-Jan-22 1:19 Refresh ᐊ Prev1234 Next ᐅ
Article Copyright 2008 by darrellp

redpajama_set_name: RedPajamaCommonCrawl


ROY HODGSON has been approached about the England manager's job, the Football Association have confirmed.
West Brom chairman Jeremy Peace today granted permission for the FA to hold talks with their 64-year-old manager, and Hodgson has already had a conversation with FA chairman David Bernstein.
No approach has been made to Tottenham boss Harry Redknapp, who had been viewed as the favourite to succeed Fabio Capello.
Bernstein said: "I'm grateful to Jeremy and all at West Bromwich Albion for their co-operation in allowing us to approach Roy, who I have since spoken with.
"Roy is the only manager we have approached and we remain on course to make an appointment within the timescale we set-out soon after Fabio Capello's departure.
"Further conversations will now take place with Roy and my Club England colleagues before any further announcements can be made."


THIS IS AN IMMACULATE 2 STORY VICTORIAN STYLE MOVE IN READY HOME,FEATURING HARDWOODS, GRAND ENTRY WAY, UPDATED KITCHEN & BATHS, WOOD BURNING FIREPLACE IN LG FORMAL LIVING ROOM, TREY CEILINGS,FORMAL DINING ROOM, FRENCH DOORS, KITCHEN W/BAR AREA, LARGE MASTER SUITE AS WELL 3 OTHER BEDROOMS, EXTRA ROOM,SUNPORCH, OFF STREET PARKING, LG TALL BASEMENT, NEW FURNACE & HOT WATER TANK & MUCH MUCH MORE!
Directions: From Brady Street, turn East on Long Avenue, second block up, house is on the right. Look for the At Home Realty sign.


The Hotel Trevi, located in one of the most exclusive areas of Rome, has spacious, relaxing and comfortable en suite rooms all with air conditioning and central heating, WiFi (extra cost), satellite TV, minibar, hairdryer and safe.
A buffet breakfast is served on the charming roof garden with views over Rome. There is a concierge service should you need to rent a car, purchase theatre and music tickets, book transfers to/from the airport and scenic tours of the city.
Additionally, a laundry/ironing service and babysitting is available (both extra cost). There is also a porter and free baggage storage plus a garage (extra cost) for those who come to Rome by car.
The Hotel Trevi is conveniently located in the heart of Rome, a short walk to the many beautiful sites the city has to offer. The hotels rooms are spacious and pleasantly decorated all with an en suite showeroom.


Save food from the Fridge!
I am always amazed how much practical knowledge we have lost over the years as we rely more and more on technology to provide for our solutions. This exciting project by Jihyun Ryou seeks to uncover the oral traditions that have been passed down from generation to generation (particularly focusing on the food preservation) and uses design to bring this knowledge back into everyday life.
Artist and activist Yann Arthus-Bertrand, is one of the most celebrated aerial photographers in the world. He uses beautiful imagery to highlight deeper environmental and social issues. In 2009 he created the movie HOME – Spanning 54 countries and 120 locations, all seen from the air, this film captures the Earth's most amazing landscapes, showcasing its incomparable beauty and acknowledging its vulnerability. HOME is a compelling emotional reminder of what is at stake: the Earth, in all its beauty, and the people who live on it.
A few years ago I read an intriguing book – the *Secret Life of Plants* by Peter Tompkins and Christopher Bird. It analysed the relationship between humans and plants, exploring the idea that plants may actually be sentient!! Well 37 years on scientists are still exploring these issues with some exciting discoveries!


text:
Q: reloading data of a table view is not working im making a tableview with checkboxes. I did implement the checkboxes with UIButtons and i can check and uncheck them without problems. The problem came up when i tried to make a "select/unselect all" button and this is the resultant code:
-(IBAction)select:(id)sender{
    if (all==YES) {
        all=NO;
    }
    else {
        all=YES;
    }
    [tblPeticiones reloadData];
}

The problem is that the table doesn't reload the data.
Any idea?
Thanks and regards.
EDIT:
I load de data like this
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  //Datos
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"dd-MM-yyyy"];

    NSString *fInicio = [dateFormatter stringFromDate:[(MAP_Gastos_CiberTRIPS *)[m objectAtIndex:indexPath.row] DEP_DATE]];
    NSString *loc = [(MAP_Gastos_CiberTRIPS *)[m objectAtIndex:indexPath.row] LOCATION];
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    [formatter setCurrencyCode:@"EUR"];
    [formatter setLocale:[NSLocale currentLocale]];
    NSString *precio = [formatter stringFromNumber:aux];
//Vista
    NSString *MyIdentifier = [NSString stringWithFormat:@"MyIdentifier %i", indexPath.row];

    CustomTVC *cell = (CustomTVC *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];

    if (cell == nil) {
        cell = [[[CustomTVC alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
        //CheckBox
        UIButton *checkButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

        [checkButton setFrame:CGRectMake(10, 10, 23, 23)];
        if (todos==NO) {
            [checkButton setBackgroundImage:[[UIImage imageNamed:@"checkNO.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal];
             checkButton.tag = 0;
        }
        else {
            [checkButton setBackgroundImage:[[UIImage imageNamed:@"checkSI.png"] str    etchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal];
            checkButton.tag = 1;
        }

        [checkButton addTarget:self action:@selector(checkAction:) forControlEvents:UIControlEventTouchUpInside];

        [cell addSubview:checkButton];
        [cell.contentView addSubview:checkButton];
  //fecha
        UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(40, 0, 70.0,tableView.rowHeight)] autorelease];
        [cell addColumn:0];
        label.tag = 1;
        label.font = [UIFont boldSystemFontOfSize:12.0];
        label.text = fInicio;
        label.textAlignment = UITextAlignmentLeft;
        label.textColor = [UIColor blackColor];
        //label.backgroundColor = [UIColor whiteColor];
        label.autoresizingMask = UIViewAutoresizingNone | UIViewAutoresizingFlexibleHeight;
        [cell.contentView addSubview:label];

        if (indexPath.row % 2 == 0){
            label.backgroundColor = [UIColor colorWithRed:233.0/255.0
                                               green:233.0/255.0
                                                blue:233.0/255.0
                                               alpha:1.0];
        } else {
            label.backgroundColor = [UIColor clearColor];

        }

        //localización
        label =  [[[UILabel alloc] initWithFrame:CGRectMake(115, 0, 75.0,tableView.rowHeight)] autorelease];
        [cell addColumn:180];
        label.tag = 2;
        label.font = [UIFont boldSystemFontOfSize:12.0];
        label.text = loc;
        label.textAlignment = UITextAlignmentLeft;
        label.textColor = [UIColor blackColor];
        //label.backgroundColor = [UIColor whiteColor];
        label.autoresizingMask = UIViewAutoresizingNone | UIViewAutoresizingFlexibleHeight;
        [cell.contentView addSubview:label];

        if (indexPath.row % 2 == 0){
            label.backgroundColor = [UIColor colorWithRed:233.0/255.0
                                                green:233.0/255.0
                                                 blue:233.0/255.0
                                                alpha:1.0];
        } else {
            label.backgroundColor = [UIColor clearColor];
        }
    }
    return cell;
}

A: Debug the problem
Check datasource methods of tableView  whether they are being called or not after reload?

A: You should store which rows are checked in an array. Then check this array when you load / reload the tableview (in cellForRowAtIndex) to see if the row should be checked.
Then if you want to select all or none, just delete or add them to the array and reload the tableview.
If you need help implementing this, let me know.

A: i found the problem. This is the working code:
-(IBAction)select:(id)sender{

    if (all==YES) {
        all=NO;
        [btnSelAll setBackgroundImage:[[UIImage imageNamed:@"checkSI.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal];

    }else {

        all=YES;
        [btnSelAll setBackgroundImage:[[UIImage imageNamed:@"checkNO.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal];
    }
    NSMutableArray *arrIndex = [NSMutableArray new];
    for(int i=0;i<[m count];i++) {
        [arrIndex addObject:[NSIndexPath indexPathForRow:i inSection:0]];
    }
    [self.tblPeticiones beginUpdates];
    [tblPeticiones reloadRowsAtIndexPaths:arrIndex withRowAnimation:UITableViewRowAnimationNone];
    [self.tblPeticiones endUpdates];
    [tblPeticiones reloadData];
}

A: Some comments about your code:

*

*There seems to be global variable called all, whose value you toggle, when button is pressed. However inside cellForRowAtIndexPath you check value of another global variable called todos. Is there some connection between these variables?

*You change checkbox background image only, when you create a new cell. Since cells are recycled, you need to move this code outside if (cell == nil) i.e. afterwards, where you are customizing a recycled cell

*You should only check whether if (todos) and if (!todos), don't compare to values like YES or NO. Also easiest way to toggle a boolean is todos = !todos :)

redpajama_set_name: RedPajamaStackExchange


Our Glasnevin Cemetry joiners are seasoned Uran Build certified craftsmen right on top of their profession. By utilizing the best tradesmen in the market our online reputation has been established as the 'go to' company when high quality and service matters. Their workmanship can be seen in some of city 's most exclusive addresses yet expenses are constantly tailored to match the job whether it be floors, staircases cupboards or total refurbishments. We can also give a 'team' of multi skilled tradespersons for very large tasks with each member being a specialist within their very own trade.
Offered 24 hours our joiners also provide emergency services for such things as doors, home windows, and robbery or accidental damage. Our tradesmen will certainly always make certain minimum interruption and that they leave your facilities clean and tidy following their visit.
joiners develop, set up or fix frameworks that are made from wood, steel or timber replacements. They could construct the frame of the house, walls and roofing system; mount doors, windows, floorings, cabinetry, ceiling floor tiles; erect scaffolding; total various other architectural work such as sub-floor framing; and may even repair damaged furnishings. Carpenters may specialise in a particular area of the trade, so be sure your selected expert has the ability to complete your certain task.
Layout/design: joiners should choose the products for the task and measure and mark them to guarantee that they are the appropriate measurements needed.
Reducing and signing up with products: Cutting could be finished with power or hand tools. The reducing stage additionally consists of any shaping that has to be done. Products are signed up with using nails, adhesive, screws or screws and rulers. Levels and various other framework devices are used to ensure accuracy in signing up with.
Estimation: joiners approximate the amount of materials that will certainly be required to finish a project.
Analysis: joiners analyze and read blueprints and other plans to discover what will certainly be needed for a job.
Comply with building guidelines: joiners are called for to comply with regional and nationwide building codes and requirements when dealing with any kind of job.
Doors: joiners mount, repair and change all kinds of doors from basic room doors to complicated elaborate doors. If the old door structure is no longer appropriate, they could install an entirely brand-new framework relying on your needs. See joiners – doors for more details.
Windows: As well as doors, joiners can install brand-new windows and repair service or replace old windows. They could likewise mount home window devices such as joints and openers. For more details see joiners – home windows.
Formwork: This is needed when concrete is layed on your property. A carpenter is the suitable specialist for developing, structure and dismantling formwork and guaranteeing it is durable and able to sustain the framework.
Handrails: These are needed to ensure staircases, porches, patios and decks are safe and protected. joiners are experienced at working with lumber, so can build a simple or ornate handrail to fit your home design and tastes. To find out more see joiners – hand rails.
Structure outdoor decking: A carpenter could create and develop a gorgeous deck, so you can appreciate your outside area year-round. They can also mount needed devices such as stairs, ramps and hand rails. See building wood decking for more.
Architraves: These are an appealing attribute in any house, as they walk around windows or doors to hide gaps between the home window or door framework and the wall (see architraves). joiners can help pick the optimal architrave and the appropriate type of fixing to match.
Residence frameworks: As the house framework is the skeletal system of the home, it is important to ensure it is erected properly. Carpenters could set up home frameworks for brand-new homes and extensions or enhancements, be it flat roofings, gable roofs or various other sorts of house structures. For more informatoin see carpenters – residence frames.
Ramps: joiners have the ability to build any kind of kind of ramp you call for, consisting of mobility device and access ramps, skate ramps, boat ramps and more. They can likewise help you acquire the required authorizations for the ramp, and design a ramp that is secure and suitable. See carpenters – ramps for additional information.
Improvements: Whether you are taking on little or huge improvements in your house, carpenters can aid throughout the procedure. They could assist install kitchen cabinets, include an expansion or deck, install new floors, closets and so forth. They could additionally help you get intending approvals and permits where called for and assist with the style of your improvement. For additional information see joiners – renovations.
Skirtings: Skirtings are a decorative feature that can help finish off the appearance of an area. Carpenters can install new skirtings or change old skirtings easily utilizing timber, MDF or plaster. See joiners – skirting for more options.
joiners will usually charge anywhere from EUR30 to EUR50 per hour, depending upon your place and their experience. This will include their time and you should confirm if products belong to any quote. More pricey wood timbers, for instance, will certainly carry a price costs over soft lumbers such as want. joiners can encourage you which type of wood is best suited to your job. If you are building a huge structure such as a hardwood deck, any quote needs to consist of itemised labour and products costings.
In some cities joiners are needed to be certified to do function above a specific value. This is a legal need and ensures your work is done by a qualified tradesperson. There is more details on licensing of carpenters on www.nationalguild.ie.
UrbanBuild is a Glasnevin Cemetry based carpentry, joinery & fitting firm with years of experience. Get your furniture solutions designed by reliable joiners joiners.


Emotional responding in amyotrophic lateral sclerosis.
Neuropathological background of phenotypical variability in frontotemporal dementia. FTD can be divided into three clinical subsyndromes: Services on Demand Demencia frontotemporal.
Presence of perseverance and demencia frontotemporal during the testing process is very typical and can help physicians differentiate bvFTD from other disorders. Signs and symptoms are classified demencia frontotemporal three groups based on the functions of the frontal and temporal lobes: Journal of Molecular Neuroscience ; Neuropathologic diagnostic and nosologic frontotwmporal for frontotemporal lobar degeneration: Genetic forms of frontotemporal dementia.
Recent studies over several years have developed new criteria demencia frontotemporal the diagnosis of behavioral variant frontotemporal dementia bvFTD. This review provides an update on the frontotmeporal genetic and neuropathologic demencia frontotemporal of ALS and Demencia frontotemporal and a characterization of their clinical presentation forms, based on the current diagnostic criteria. Servicio de Salud Matropolitano Sur. Biomarkers strongly indicative of Alzheimer disease or another neurodegenerative process a.
Perseveration, with repetitive and stereotyped behaviours tendency to repeat movements, sentences, stories, or jokesis another characteristic finding. Clinical and therapeutic approaches. Clarkson; Sebastien Ourselin; Janice L.
A clinical and neuropsychological study. J Clin Psychopharmacol, 20pp. Thus, patients who presented faster demencia frontotemporal according to the CDR-SB scale showed a predominantly frontal and frontotemporal pattern of atrophy with less pronounced temporal pole volume loss.
They found that anatomical subtype was the most demencia frontotemporal predictor variable for the course of the disease. Clinically, it manifests around 57 years-old, with same frontotempodal in men and women. Am J Neuroradiol ; 28 demencia frontotemporal However, as self-monitoring and somatic marker processes are so complex, it likely involves other brain regions.
Review of the literature frojtotemporal FTD published in the Pubmed and Scielo databases since the yearusing the keywords: Dissociative identity disorder Demencia frontotemporal amnesia Fugue state Depersonalization demenica. Theory of mind in patients with frontal variant frontotemporal dementia and Demencia frontotemporal disease: Neurology ; 76 Though patients with damage to the OFC retain intact knowledge of social norms, they fail to apply it to actual behaviour because they fail to generate social emotions that promote adaptive demencia frontotemporal behaviour.
Behavioural variant frontotemporal dementia bvFTD is the most frequent presentation in the clinical spectrum of frontotemporal dementia FTD and it is characterised by progressive changes in personality and conduct.
Development of methodology for conducting clinical trials demencia frontotemporal frontotemporal lobar degeneration.
Frontal-subcortical circuits and neuropsychiatric disorders. Managing the disease is unique to each individual, as different patients with FTD will display different demencia frontotemporal, sometimes of rebellious nature.
FUS-immunoreactive inclusions are a common feature in sporadic and non-SOD1 familial amyotrophic lateral sclerosis. Demencia frontotemporal el 12 de septiembre deaceptado el 20 de enero de Demencia frontotemporal Clin Neuropsychol, 24pp. Affective disorders range from affective flattening and emotional coldness to expansive affect with signs of hypomania. Histopathological evidence of FTLD in biopsy or at post-mortem.


Esther Jane Williams (born August 8, 1921, although some sources cite 1922) is a retired American competitive swimmer and MGM movie star. Williams set multiple national and regional swimming records in her late teens as part of the Los Angeles Athletic Club swim team. Unable to compete in the 1940 Summer Olympics because of the outbreak of World War II, Williams joined Billy Rose's Aquacade, where she took on the role vacated by Eleanor Holm after the show's move from New York City to San Francisco. There, she spent five months swimming alongside Olympic swimmer and Tarzan star, Johnny Weissmuller. It was at the Aquacade that Williams caught the attention of MGM scouts. After appearing in several small roles, alongside Mickey Rooney in an Andy Hardy film, and future five time co-star Van Johnson in A Guy Named Joe, Williams made a series of films in the 1940s and early 1950s known as "aquamusicals", which featured elaborate performances with synchronized swimming and diving. From 1945 to 1949, Williams had at least one film listed among the 20 highest grossing films of the year. In 1952, Williams appeared in her only biographical role, as Australian swimming star Annette Kellerman in Million Dollar Mermaid, which would go on to become her nickname while at MGM. Williams left MGM in 1956 and appeared in a handful of unsuccessful feature films, followed by several extremely popular water-themed television specials, including one from Cypress Gardens, Florida. Since her retirement from film in the 1960s, Williams has become a businesswoman, lending her name to a line of swimming pools and retro swimwear, instructional swimming videos for children, and serving as a commentator for synchronized swimming at the 1984 Summer Olympics in Los Angeles. As of 2011 Williams lives with her fourth husband, Edward Bell, in Beverly Hills. Description above from the Wikipedia article Esther Williams, licensed under CC-BY-SA, full list of contributors on Wikipedia.
Aug 8, 1921	In Inglewood, California, U.S.


text:
Dov Charney Was Fired for Making Employee His 'Sex Slave'
Phoenix Tso
It's tough to imagine which of his equally disturbing sex crimes finally motivated the American Apparel board to fire CEO Dov Charney. Now it's come out that a 2011 case, in which former employee Irene Morales accuses Charney of forcing her into "sex slavery," was the tipping point.
According to the New York Post, Charney also authorized an employee to post nude photos of Morales to a blog without her knowledge and consent, a move that is so wrong on a variety of moral, ethical, and legal levels:
The board's concern, according to sources, is that the blog not only harassed and defamed Morales, but also ran afoul of certain California laws that forbid falsely impersonating others online, as alleged in a suit at the time by Morales's lawyer Eric Baum.
Morales ended up suing Charney for $260 million, but her case was thrown out in 2012. It's good that she's finally getting some justice with the American Apparel board's recent move, but this still raises the question of why they didn't do more to help her when this incident came up three years ago.
Another factor in Charney's ouster could've been this video of him dancing buck naked in front of two female employees. As of Wednesday, Charney has been stripped of his chairman title and suspended as CEO.
American Apparel Terminating Dov Charney for Alleged Misconduct
American Apparel has been a brand long-steeped in controversy. It's been both criticized and…
Image via Getty.


text:
package capital.scalable.restdocs.example.items;

import static capital.scalable.restdocs.AutoDocumentation.embedded;
import static capital.scalable.restdocs.AutoDocumentation.links;
import static capital.scalable.restdocs.AutoDocumentation.requestFields;
import static capital.scalable.restdocs.AutoDocumentation.responseFields;
import static capital.scalable.restdocs.AutoDocumentation.sectionBuilder;
import static capital.scalable.restdocs.SnippetRegistry.AUTO_AUTHORIZATION;
import static capital.scalable.restdocs.SnippetRegistry.AUTO_REQUEST_FIELDS;
import static capital.scalable.restdocs.SnippetRegistry.AUTO_REQUEST_PARAMETERS;
import static capital.scalable.restdocs.SnippetRegistry.CURL_REQUEST;
import static capital.scalable.restdocs.SnippetRegistry.HTTP_RESPONSE;
import static capital.scalable.restdocs.SnippetRegistry.PATH_PARAMETERS;
import static capital.scalable.restdocs.SnippetRegistry.RESPONSE_FIELDS;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
import static org.springframework.restdocs.payload.PayloadDocumentation.relaxedResponseFields;
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName;
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import capital.scalable.restdocs.example.items.HypermediaItemResponse.EmbeddedDocumentation;
import capital.scalable.restdocs.example.items.HypermediaItemResponse.ExtendedLinksDocumentation;
import capital.scalable.restdocs.example.items.ItemResource.Command;
import capital.scalable.restdocs.example.items.ItemResource.CommandResult;
import capital.scalable.restdocs.example.testsupport.MockMvcBase;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders;

public class ItemResourceTest extends MockMvcBase {

    @Test
    public void getItem() throws Exception {
        mockMvc.perform(get("/items/1"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.id", is("1")))
                .andExpect(jsonPath("$.description", is("main item")))
                .andExpect(jsonPath("$.attributes.text", is("first item")))
                .andExpect(jsonPath("$.attributes.number", is(1)))
                .andExpect(jsonPath("$.attributes.bool", is(true)))
                .andExpect(jsonPath("$.attributes.decimal", is(1.11)))
                .andExpect(jsonPath("$.attributes.amount", is("3.14 EUR")))
                .andExpect(jsonPath("$.children").isArray())
                .andExpect(jsonPath("$.children", hasSize(1)))
                .andExpect(jsonPath("$.children[0].id", is("child-1")))
                .andExpect(jsonPath("$.children[0].description", is("first child")))
                .andExpect(jsonPath("$.children[0].attributes", nullValue()))
                .andExpect(jsonPath("$.children[0].children", nullValue()));
    }

    @Test
    public void getAllItems() throws Exception {
        mockMvc.perform(get("/items"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$").isArray())
                .andExpect(jsonPath("$", hasSize(2)))
                .andExpect(jsonPath("$[*].id", hasItems("1", "child-1")));
    }

    @Test
    public void addItem() throws Exception {
        mockMvc.perform(post("/items").with(userToken())
                .contentType(MediaType.APPLICATION_JSON)
                .content("{\"description\":\"Hot News\"}"))
                .andExpect(status().isCreated())
                .andExpect(header().string("location", is("/items/2")));
    }

    @Test
    public void updateItem() throws Exception {
        mockMvc.perform(put("/items/1").with(userToken())
                .contentType(MediaType.APPLICATION_JSON)
                .content("{\"description\":\"Hot News\"}"))
                .andExpect(jsonPath("$.id", is("1")))
                .andExpect(jsonPath("$.description", is("Hot News")))
                .andExpect(status().isOk());
    }

    @Test
    public void deleteItem() throws Exception {
        mockMvc.perform(delete("/items/1").with(userToken()))
                .andExpect(status().isOk());
    }

    @Test
    public void getChildItem() throws Exception {
        mockMvc.perform(get("/items/1/child-1"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.id", is("child-1")))
                .andExpect(jsonPath("$.description", is("first child")));
    }

    @Test
    public void searchItems() throws Exception {
        mockMvc.perform(get("/items/search")
                .param("desc", "main")
                .param("hint", "1"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.content").isArray())
                .andExpect(jsonPath("$.content", hasSize(1)))
                .andExpect(jsonPath("$.content[0].id", is("1")))
                .andExpect(jsonPath("$.content[0].description", is("main item")))
                // example for overriding path and preprocessors
                .andDo(document("{class-name}/search", commonResponsePreprocessor()));
    }

    @Test
    public void processAllItems() throws Exception {
        mockMvc.perform(post("/items/process")
                .contentType(MediaType.APPLICATION_JSON)
                .content("{ \"command\": \"cleanup\" }"))
                .andExpect(status().isOk())
                .andExpect(content().json("{ \"output\": \"processed\" }"))
                .andDo(commonDocumentation().document(
                        requestFields().requestBodyAsType(Command.class),
                        responseFields().responseBodyAsType(CommandResult.class)));
    }

    @Test
    public void processSingleItem() throws Exception {
        mockMvc.perform(post("/items/{itemId}/process", "1")
                .contentType(MediaType.APPLICATION_FORM_URLENCODED)
                .content("command=increase&tag=processed&page=1&name=myitem"))
                .andExpect(status().isOk())
                .andExpect(
                        content().json("{ \"output\": \"Command executed on item 1: increase, method: POST, " +
                                "tag: processed, data: myitem, errors: 0, " +
                                "Page request [number: 1, size 20, sort: UNSORTED]\" }"));
    }

    @Test
    public void validateMetadata() throws Exception {
        mockMvc.perform(post("/items/validateMetadata")
                .contentType(MediaType.APPLICATION_JSON)
                .content("{ \"type\": \"1\", \"tag\": \"myItem\" }"))
                .andExpect(status().isOk());
    }

    @Test
    public void cloneItem() throws Exception {
        mockMvc.perform(post("/items/cloneItem")
                .contentType(MediaType.APPLICATION_JSON)
                .content("{ \"name\": \"xyz\" }"))
                .andExpect(status().isOk());
    }

    /**
     * This test demonstrates that Spring REST Docs can be used in a Spring Auto REST Docs setup.
     *

     * All Spring Auto REST Docs snippets are created as well because of the setup in {@link MockMvcBase}.
     * This is not a requirement and one could use a pure Spring REST Docs setup here.
     *

     * The result of the manual documentation below ends up with section snippet using
     * classic Spring REST Docs' path-parameters.adoc and response-fields.adoc.
     * So there is no conflict and one is free to decide which snippets are included in the documentation.
     *

     * RestDocumentationRequestBuilders.get is required for Spring REST Docs' pathParameters to work.
     * Spring AUTO Rest Docs works with both MockMvcRequestBuilders and RestDocumentationRequestBuilders.
     */
    @Test
    public void getItemWithRestDocs() throws Exception {
        mockMvc.perform(RestDocumentationRequestBuilders.get("/items/{id}", 1))
                .andExpect(status().isOk())
                .andDo(commonDocumentation(
                        pathParameters(
                                parameterWithName("id").description("ID of the item.")),
                        relaxedResponseFields(fieldWithPath("id")
                                .description("There are more fields but only the ID field is documented.")),
                        sectionBuilder().snippetNames(
                                AUTO_AUTHORIZATION,
                                PATH_PARAMETERS, // classic snippet
                                AUTO_REQUEST_PARAMETERS,
                                AUTO_REQUEST_FIELDS,
                                RESPONSE_FIELDS, // classic snippet
                                CURL_REQUEST, // classic snippet
                                HTTP_RESPONSE // classic snippet
                        ).build()));
    }

    @Test
    public void getHypermediaItem() throws Exception {
        mockMvc.perform(get("/items/media/1").param("embedded", "true"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.id", is("1")))
                .andExpect(jsonPath("$.desc", is("hypermedia item")))
                .andExpect(jsonPath("$._links").exists())
                .andExpect(jsonPath("$._links.self").exists())
                .andExpect(jsonPath("$._links.self.href", is("http://localhost:8080/items/media/1?embedded=true")))
                .andExpect(jsonPath("$._links.classicItem").exists())
                .andExpect(jsonPath("$._links.classicItem.href", is("http://localhost:8080/items/1")))
                .andExpect(jsonPath("$._embedded").exists())
                .andExpect(jsonPath("$._embedded.children").isArray())
                .andExpect(jsonPath("$._embedded.children[0].id", is("child-1")))
                .andExpect(jsonPath("$._embedded.meta").exists())
                .andExpect(jsonPath("$._embedded.meta.type", is("1")))
                .andExpect(jsonPath("$._embedded.attributes").exists())
                .andExpect(jsonPath("$._embedded.attributes.number", is(1)))
                .andDo(commonDocumentation(
                        links().documentationType(ExtendedLinksDocumentation.class),
                        embedded().documentationType(EmbeddedDocumentation.class)
                ));
    }

    @Test
    public void getItemAsResource() throws Exception {
        mockMvc.perform(get("/items/resources/1"))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.id", is("1")))
                .andExpect(jsonPath("$._links").exists())
                .andExpect(jsonPath("$._links.self").exists())
                .andExpect(jsonPath("$._links.self.href", is("http://localhost:8080/items/resources/1")))
                .andDo(commonDocumentation(
                        links().documentationType(LinksDocumentation.class)
                ));
    }

    @Test
    public void getItemWithFilter() throws Exception {
        mockMvc.perform(get("/items/filtered?name=abc&tag=prod"))
                .andExpect(status().isOk());
    }

    @Test
    public void updateItemWithFilter() throws Exception {
        mockMvc.perform(put("/items/filtered/1").with(userToken())
                .contentType(MediaType.APPLICATION_JSON)
                .content("{\"description\":\"Hot News\"}"))
                .andExpect(status().isOk());
    }
}

redpajama_set_name: RedPajamaGithub