text
stringlengths
454
608k
url
stringlengths
17
896
dump
stringclasses
91 values
source
stringclasses
1 value
word_count
int64
101
114k
flesch_reading_ease
float64
50
104
93 Section B: Regional News: Classified Ads page B 8 page B 9 page B 10 Section B: Regional News continued page B 11 page B 12 Section C: Features and Sports page B 13 page B 14 page B 15 page B 16 page B 17 page B 18 page B 19 page B 20 Full Text / SStion USPS 648-200 Three Sections Lake Butler, Ft orida Thursday, Nov. 16, 2006 '- LLEi - P-L .21-- w T n e e-mai: .im1es .te-n AfvLee Times extends deadline, announces holiday hours The Union County Times has extended its deadline for the Thanksgiving holiday. All submissions to the newspaper, including classified and display advertising, must be submitted by Monday, Nov. 20, at 3 p.m. The Times office will be closed on Tuesday, Nov. 21, Thursday, Nov. 23, and Friday, Nov. 24. The paper will come out on Tuesday. However, the Times office will be open on Wednesday, Nov. 22, from 8:30 a.m. to 5 p.m. The normal deadline and printing schedule will resume the week after Thanksgiving. Final Toys for Kids sign-up , Toys for Kids will hbld its- final sign-up time today, Nov. 16, from 4 6 p.m. at Lake Butler Elementary School: Toys for Kids helps families who need assistance at Christmas time. For more information, call (386) 496-3432. Celebrity bagging set for Nov. 18 The Eighth Annual Celebrity Bagging event is set for Saturday, Nov. 18, from 8 a.m. to 2 p.m. at Spires IGA in Lake Butler. Santa Claus will be at the event from 9 a.m. to noon, and Smoky Bear will also make an appearance. Union County High School's Beta and Interact clubs: will sell baked goods. All tips the celebrity baggers get will go to the Toys for Kids program. UCHS to present 'Arsenic and Old Lace' Union County High School's Drama Club will present the play "Arsenic and Old Lace," starting tonight, Nov.- 16, at 7:30 p.m. Admission is $5 at the door. The play will run on Friday and Saturday, Nov. 17 and 18, at 7:30 p.m. and on Sunday, Nov. 19, at3 p.m. The production is under the direction of UCHS's drama instructor Duane Archer. Worthington Springs Civic Club bazaar set for Saturday The Worthington Springs Civic Club will hold its annual Christmas Bazaar on Saturday, Nov. 18, from 9 a.m. until 2 p.m., at the Clubhouse. Chicken dinners, including chicken and rice, string beans, rolls and pickles, will be available for $5. Desserts can be\ purchased for an additional charge at the bake sale. Call (386) 496-3717 for: more information. Rural, urban residents are 'partners in progress' Dear we. What are we celebrating? The American economy 4is strong thanks to the interdependence of farms and cities. As the president of the Union See LETTER, p. 5A Firefighter of the future Lake Butler Volunteer Fire Department Chief Mike Banks adjusts Jody Dubose's helmet. Dubose was one of the few children in the younger group who was not scared when Banks walked into Little* Rainbows Learning Center entirely dressed in his Come see this 'killer' production fire suit. Dubose, who kept saying "fire truck," was eager to try on the hat, and outside, sound the truck sirens. See page 4A for more: photos of the fire prevention demonstration that Banks gave to the day care center. Whitehead says so long to school board BY LINDSEY KIRKLAND Times Editor After seeing the same face at the Union County School Board table representing District 5 for 14 years, some thought she would never leave. But school board member Sue Whitehead retired Tuesday, now former school board member, and a gathering was held in her honor at the board meeting room. Friends, family and coworkers gathered to share their memories., Superintendent of Schools Carlton Faulk presented Whitehead with a plaque for all her hardwork and dedication throughout the years; food was enjoyed and friends shared pictures and, stories of the leader they knew. What finally made Whitehead, vacate her seat? Her husband, Jim, said the answer was in their ages-71 and 72. "When you get our age,. it's time to let someone else have, it," he joked. Whitehead's husband said his wife had worked hard through her year's on the board, and their children agreed. Her son, Tim Whitehead, See RETIRE, p. 6A. Union County High School's Drama Club will kick off its first fall production tonight, Nov. 16, at 7:30 p.m. in the UCHS auditorium with the production of the 1940s hit comedy "Arsenic and Old Lace." Cast members are (front, I-r) Andrew Framer, Terri Brown, Alisha Hagan, Joey O'Hern, (middle) Patricia Geisenburg, Darren Clark, Elliot Willis, (back) Marshall Riggs, Roman West, Cody Tempest, Jami Mobley, James Wring and (not pictured) Celeste Wilson, Courtney Combs, Walter Littles and Tyler Gordon. The production is under the direction of drama teacher Duane Archer (not pictured). Meet the Brewsters. Jonathan looks like Boris Karloff. Teddy thinks he's Teddy Roosevelt. And their aunts-gentle, spinster sisters, Abby and Martha-make 'a "killer" elderberry wine. The Union County High School Drama Club will portray these characters from Joseph Kesselring's famous comedy, "Arsenic and Old FCCD needs donations Chapter 5 of the Florida Council on Crime and Lace," starting tonight, Nov. 16, at 7:30 p.m. in the UCHS auditorium. In one of America's classic comedies, these two sisters, with charity in their hearts and cadavers in their basement, will leave you screaming with laughter and shivering with excitement. This production was a smash hit in New York in the 1940s and will kick off what the Drama .Club hopes to be an Delinquency has a busy year planned in the area of community service. Several upcoming projects that FCCD has need community support, by way of annual fall production of plays. The show will run Thursday, Friday and Saturday evening, Nov. 16-18, at 7:30 p.m. and at 3 p.m. on Sunday, Nov. 19. Tickets are $5 at the door. This production is under the direction of UCHS drama teacher Duane Archer. Union County School Board Member Sue Whitehead shares a laugh with her daughter-in- law Carla Whitehead at Sue's retirement party on Tuesday., See FCCD, p.5A For crime, socials and editorials, see Regional News section. For sports, see Features and Sports section. Deadline noon Monday before publication 386-496-2261 (phone) 386-496-2858 (fax) 68906 63869 2 0 CENTS 5C Page 2A UNION COUNTY TIMES Nov. 16, 2006 Positive Tigers Lake Butler Middle School's Positive Tigers for October are sixth-graders (1-r) Chelsie Neal, Crystal Garcia, Alexis Smith, Dalton Townsend, Leslie Barnes and Tanner Lemay. Lake Butler Middle School's Positive Tigers for October are eighth-graders (front, I-r) Marih Cardona, April Cornett, Jacqueline Anderson, (back) Emily Holmes, Shelby McRae, Jesse Krazit and Cadi Bishop. LBMS names A-B honor roll students Fifth-graders making A-B honor roll for the first nine weeks at Lake Butler Middle School were Kylie Alvarez, William Anderson, Taylor Andrews, Tristan Andrews, Darren Barlow, Jonathan Besso, Mikayla Chandler, Randa Conner, Lauren Covin, Amber Crawford, Bradley, Deshong, Gabrielle Douglas, Quay Drawdy, Mitchell. Dukes,. Travis Durant, Daquain Edwards, David Elixson, Ryan Elliott, Ashley Feltner, Robert Gartman, Terra Godwin, Conner Gordon, Geordyn Green, Hannah Hicks, Kali Hill, Tina Hoffman, Denisha Holton, 'Kendallyn Johns, Krysten Johnson, Lauren Johnson, Andrew Jones, Beverly Jones, Taylor Joyner, Chelsea Kaser, -Madison Kellenberger, Colton Kelley, Justin Lindsey, Colten McAlister, Ashley Mock, Logan Morneau,.Kyle Mosher, Corey Palmer, Zackery Palmer, Molly Parker, Courtney Personette, Peyton Powell, John Provin, Benjamin Riggs, Michael Riggs, Makenzie Romrell, Rafael Sanchez-Gutierrez, Spencer, Shannon, Courtney" Shuford;""' Nancy .Slocum, Christopher Starling, Victoria Thompson, Lake Butler Elementary School names Tiger Cubs each week based on good behavior, grades or on a child's improvement in either of these two areas. . Students who received this award on Friday, Nov. 10, were:, Candace Suttles Alora Greek Nathainal Murkerson Hunter Collins Shannon Bostick Dustin Beckelheimer Hannah Cooke Austin Green SAlex Robinson Colby Bridgman Brittany Liston Chase English Kristen Horton Nicole White Rebecca Adkins Tiphanie Durham Abbagayl Hobbs. Angelica Hemaridez Ty Adkins Holly Tucker, Elizabeth Veals and Mari Ward. Sixth-graders making A-B honor roll for the first nine weeks at Lake Butler Middle School were Dylan Allen, Lesley Barnes, Dustin Bielling, Devin Boone, Mariah Bowen, Kavia Bradley, James Brown, Rhiannon Carroll, Victoria Castillo, Michael Ellis, Sarah Fischer, Crystal Garcia, Robert Gockley, Shakeylia Griffin, Caitlyn Halle, Ashlyn Harden, Rebekah Harden, Kelsey Harrison, Darci Hendricks, Shane Hendricks, Kristin Hodgson, Tyler. Hopkins, Troy Kite, Kendrick Langford, Cheyenne Lesch, Kierra Maxwell, Hailey McRee, Austin Morin, Stacy Norman, Caroline Rimes, Nicole Shaw, Caitlin Shealy, Drayton Shealy, Alexis Smith, Dalton Southerland, Mikayla Speer, Am b e r Templeton, Christopher Thornton, Haylee West, Victoria Whiteley, Christine Wight and Brittney Williams. Seventh-graders making A- B honor roll for the first nine weeks at Lake Butler Middle School were Ryan Adler, Ashtoni Bishop, Patricia Brooks, Dustin Burgess, " Garrett Crosby, Kiersten See LBMS, p. 5A Patrick Montalbano Ethan Redmond Hailey Clark Cody Stitt Corey Hill Kinsey O'Hem Nikki Christy Deanna Abraham Chritian Rainey Austin Morton Cody Gainey Kristyn Gutierrez Tarek Walker Karlie Hodgson Robbie Parrish Al-Jaron Williams Tariana Perry Wade Poteat Students receive a purple Tiger- Cub ribbon, a certifi- cate and their names are rec- ognized over the intercom and in the school newsletter. Tiger Cubs are also given. special privileges, such as being line leaders or running errands. HEAVY EQUIPMENT OPERATOR TRAINING FOR EMPLOYMENT Bulldozers, Backhoes, Loaders, Duinp Jif Trucks, Graders, Scrapers, Excavators .\ -Natiionjl Certification .-Job Placement Assistance 800-405-5833 Associated:Training Services .Mnion Count? t..ime . Subscription Rate $30.00 per year: $16,00 six months Outside Trade Are $30,00 per year: $16 in Trade Area Editor: 4 Lindsey Kirkland Sports Editor: Cliff Smelley Advertising: Kevin Miller .. Don Sams Darlene Douglass P,. Typesetting: Joalyce Graham Advertising and Newspaper Prod. Classified Adv. Bookkeeping: Earl W. Ray Virginia Daugherty Kathi Bennett Cole Temes, Teigan Rengering, Taylor Wilkins, Michaela Clemons and Corey Palmer. Lake Butler Middle School's Positive Tigers for Michaela Joiner, Kaci Graham, Antonio Henderson October are seventh-graders (I-r) Dustin Burgess, and Keanna Odom. Courtnee Hardin, Julie Nettles, Lindsey Hanson, III Union County Public Library Street 32054 S496-3432 496- 1285 http : //union. .newriver lib. fl .us Dear Library Supporter, .j.C- -- The Union County Public Library is getting ready to begin its construction project for a new, larger facility. In an effort to raise funds . for this much-needed building, the library is accepting donations for .. ' parts of the pictutre"shown on tie next page. The painting that was, - created for this project (painted by Marie Wiggs Tyre) will bej" ... - translated into a giant mural on the meeting room wall of the new -.. library building. It is estimated that each animal on the mural will be ..i& life-size or larger. Listed below are the prices for each item. Just think : of'the lasting benefits that you can have with your small investment- -, ' the name of your business listed in the library for years, your family's .a .'. .. name showing support of the library and our community's education, , dedication in memory of a loved one, and much more... --- Each item listed will have a plaque that corresponds to the item. '' Leaf on the Tree:......................... ..........$200 Flying Egrets.............................. $1..... $ ,000/pair Limb on the Tree: .......... ........................ $500 Large Bird:........................................... $1,000 Sm all B ird:............................ .....................$500 B ear:..................................................$1,000 Sm all Reptile:........................................... $500 A lligator: ................................................ $1,000 Squirrel:........................................................ $500 D eer:...........................$................... ...........$2,000 Raccoons:........................ $ 1,000/pair Panther:.....................................................$2,000 Trunk of Tree:......................................... $5,000 If you are interested in helping build your new library by making a donation for a part of the mural, please call Mary Brown, library director, at 386-.496-3432 Lake Butler Middle School's Positive Tigers for October are fifth-graders (1-r) Blade Stitt, Trey Owen, Tiger Cubs 175 West Main Lake Butler, Florida Phone (386) Fax (386) ;o, Nov. 16, 2006 UNION COUNTY TIMES Page 3A LBMS straight-A honor rol Fifth-graders making straight A's at Lake Butler Middle School for the first nine weeks were (front, I-r) Samantha Perez, Ariel Hardin, Breanna Moppert, Mileena McCarthy, Jacque Husted, Victoria Furukawa, (back) Joshua Mabry, Miranda Boyle, Cristina Hernandez, Breanna Bryan and Melissa Bair. Fifth-graders making straight A's at Lake Butler Middle School for the first nine weeks were (front, 1-r) Samuel Nelson, Kenneth Owen, Cole Temes, Haley Libby, Miranda Merritt, (back) Taylor Cross, Jordyn Driggers, Taylor Wilkins, Jordyn Addison, Zorria Corbitt, Michaela Clemons and Katie Tricocci. Not pictured: Savannah Chastain. Sixth-graders making straight A's at Lake Butler Middle School for the first nine weeks were (1-r) Clay Abraham, Tanner Lemay, Vanessa Love, Hailey McRee, Danielle Pate and Dalton Townsend. Not pictured: Emily Akridge. Seventh-graders making straight A's at Lake Butler Middle School for the first nine weeks were (front, I-r) Michaela Joyner, David Cornett, Brandon Hattie, William Riggs, (middle) Brittany Trowell, Kaci Graham, Ryan Perez, Kelly Gray, Brianna Langford,.Emma Howell, (back) Jennifer Dicks, Kayla Freeman, Albert Brand, Morgan Dukes, Jordane Spitze and Courtney Stephens. Eighth-graders making straight A's at Lake Butler Middle School for the first nine weeks were (1-r) Constance Driggers, April Cornett, Michael Howell and Brooks Palmer. Not pictured: Chelsie Hersey and Randall Norman. Three Springs holds fall fest Nov. 18 Three Springs of Raiford will hold a fall festival on Saturday, Nov. 18, at UJRF, 14692 C.R. 1.99, in Raiford. The festival lasts from 2 6 p.m. and admission is free. There will be crafts, an art gallery, games, prizes, raffles, food and a victim's candlelight memorial ceremony. All games are 25 cents to $1. Proceeds will benefit victims of abuse. An adult, 18 years or older, must accompany all children. For more information, call Misty at (3.86) 431-1999. Lutheran Mission to host dinner Starke Lutheran Mission will sponsor a spaghetti supper fund-raiser on Friday, Dec. 1, in the banquet hall of the Starke KOA Campground on South U.S. 301. Food will be served from 5:30-6:30 p.m. and the cost is. $5 per person." Tickets must be purchased in advanced and will be available at the KOA from 8 a.m. until 8 p.m., seven days a week. Proceeds will be matched by Thrivent Financial for Lutherans and will be used for the outreach ministry. IN THE CIRCUIT COURT OF THE EIGHTH JUDICIAL CIRCUIT, IN AND FOR UNION COUNTY, FLORIDA CASE NO.: 63-2006-DR-155 SEAN C. ROPER Petitioner and HEATHER POOLE ROPER Respondent NOTICE OF ACTION OF DISSOLUTION OF MARRIAGE TO: HEATHER POOLE ROPER, Rte. 3, Box 143-K, Lake Butler, FL, 32054. YOU ARE NOTIFIED that an action has been filed against you and that you are required to serve a copy of our written defenses, if any, to it on SEAN C. ROPER, whpse address is 175 SW Michigan sti Lake Gitv; FL. A 32025, on or before Nov. 17, 2006,i and file the original with the Clerk of the Court at: Oct. 20,2006 Clerk of the Circuit Court By: Lacey Renfroe Deputy Clerk 10/264tpd 11/16 application may be inspected by the public at 15 Northeast First Street, Lake buuer, Florida, during the hours of 8:00 a.m. through 12:00 p.m., Monday through Friday, excepting legal holidays. All interested parties may appear at the meeting and be heard with respect to the proposed application. 11/9 2tchg. 11.16 NOTICE OF PROPOSED APPROVAL OF AN APPLICATION FOR A ZONING CHANGE BY THE BOARD OF COUNTY COMMISSIONERS OF UNION COUNTY, FLORIDA ACTING AS THE PLANNING AND ZONING BOARD Notice is hereby given that on November 20, 2006, at 6:50 p.m., the Board of County Commissioners of Union County, Florida, acting as the Planning and Zoning Board, will meet in a Public Hearing to be held in Room 101 of the Union County Courthouse, Lake Butler, Florida, to consider an Application by Lamar Bear to change 5 acres from agriculture to industrial for the manufacture of portable buildings. . Said proposed application may be inspected by the public at 15 Northeast First Street, Lake Butler, Florida, during the hours of 8:00 a.m. through 12:00 p.m.,-Monday through' Friday., excepting legal holidays. All Also: Cheese Sticks Livers & Gizzards Sides S Beverages --kAA dITiIM!, ' FREE 2-PIECE SNACK BOX ' Limit 1 per coupon. | S2 coupons per customer. | -- Valid w/this coupon. Expires 11/25/06 eillm-mmmi imm-mm iIIil 280 W. Main Street MuUon.-Sat. (386,496-1514 (next to Sunrise Gas Stop) 10 n Call ahead and we'll have Lake Butler 9 a.m.-3'.m. your order ready lr yoeu - 0 [ 0TE ] :10 - 7 NRYS 8 WEEK Specializing in FRIED CHICKEN i interested parties may appear at the meeting and be heard with respect to the proposed application. 11/9 2tchg. 11.16 IN THE CIRCUIT COURT OF THE EIGHTH JUDICIAL CIRCUIT, IN AND FOR UNION COUNTY, FLORIDA CASE NO.: 63-2006-DR-0214 CYNTHIA W. RIVERA Petitioner and ROSOLF M. RIVERA Respondent NOTICE OF ACTION FOR DISSOLUTION OF MARRIAGE TO: ROSOLF M. RIVERA c/o TLC 7233 Southern Blvd., B-1 West Palm Beach, FL 33413 YOU ARE NOTIFIED that an action has been filed against you and that you are required to serve a copy of your written defenses, if any, to it on CYNTHIA W. RIVERA, whose address is 20614 E. S.R. 100, Lake Butler, FL 32054, on or before Dec. 7, 2006,' and file the original with the Clerk of the Court at 55 W. Main St., Room 103,: Nov. 6,2006 REGINA H. PARRISH Clerk of the Circuit Court By: Kimberlie Riggs Deputy Clerk 11/9 4tpd 11/30 INVITATION TO BID NOTICE is hereby given that sealed Bid Proposals will be received by the Union County'School Board, 55 SW 6th Street, Lake Butler, FL 32054 until 10:00 a.m., December 7,2006, for the furnishing of all materials, labor and equipment for the following projects (bid together): Lake. Butler MS Campus HVAC Renovation; Lake Butler HS Gymnasium HVAC Renovation; and Lake Butler HS Locker Room AC Addition. Plans and Specs may be obtained from Paul Stresing Associates, Inc., Architect, (#AA0003377), 14617 Main Street, Alachua, Florida 32615; Phone 386-462-6407 by depositing $150 (plus shipping) per set. Partial sets will not be issued. The Owner reserves the right to waive any irregularities and minor technicalities or to reject any and all bids. EQUAL OPPORTUNITY: The Union County School Board pledges itself to comply with the Civil Rights Act of 1964 (PL-88-352). _.. 1..... 11/16 3tchg. 1,1,3(L, r T ' Page4A UNION COUN-i liMES Nov. oo, ..;o Little Rainbows learn the basics of fire safety, 911 4. 1 I ABOVE: Jody Dubose checks out the steering and the siren on the fire truck. BELOW: They had never met him before, but after Chief Mike Banks presented emergency tips to (1-r) Brandon Smith, Cheyenne Johns, Anistin Arvip, (back) Madison Douglass and Katie Tomlinson, he could be their friend for life. While the pre-K students learned about how to dial 911, these Little Rainbows Learning Center children were a little too young to grasp the concept. Ho ever, they still enjoyed exploring the lights and sirens of the fire truck. Pictured are instructors (standing, I-r) Jodie Hurst, Theresa Odom (holding Christain Erwin), owner-Kim Bailey, Olivia Rawls and volunteer Angelina Boggs (holding Cailynn Boggs), BELOW: As LBVFD Chief Banks explains what the fire hoses are for, (1-r) A. J. Miller, Jimmy Waters, Anistin Arvin and. Brandon Seay are fascinated, as Kim Bailey looks on. Lake Butler Volunteer Fire Department Chief Mike Banks (kneeling) and students (seated on fire truck, I-r) Jake Osteen, Josie Godwin, Hunter Croft, Aaliyah Sellers, Laura Park, Eli Rimes, (standing) Caleb Holdridge, Hayley Burke, (front, I-r)Kaitlyn Grainger, Christain Simmons, Jeremiah Wintons and Carson Simmons. LEFT: After his presentation, Mike Banks passes out firefighter stickers to (I-r) Caleb Holdridge, Hayley Burke and Kaitlyn Grainger. ABOVE; "I pledge to never play with matches" is just one requirement for these firefighters-in-training. Banks had the children, including (front, I-r) Ayla Smith, Sydney Rae Spears, Kayla Bryant, Jayla Bryant, Cameron BFidgman, (back) Kelly Denson, and teacher Tonya Odom (holding Allyson Chapman) say a pledge in order to become junior firefighters. Genius and great abilities are often wanting; sometimes, only opportunities. Some deserve praise for what they have done; others for what they would have done. -Jean de la Bruyere THE MOST AND THE GREATEST The most destructive habit Worry The most dangerous pariah A gossiper The greatest joy Giving The world's most incredible computer The brain The greatest loss Loss of respect The worst thing to be without Hope The most satisfying work Helping others The deadliest weapon The tongue The ugliest personality trait ,...Selfishness The two most power-filled words "1 Can" The most endangered species Dedicated leaders The greatest asset Faith Our greatest natural resource Our youth The most worthless emotion Self-pity The greatest "shot in the arm" Encouragement The most beautiful attire SMILE! The greatest problem to overcome Fear The most prized possession Integrity The most effective sleeping pill Peace of mind The most powerful channel of communication..........Prayer The most crippling failure disease Excuses The most contagious spirit Enthusiasm The most powerful force in life Love Free George Foreman Grill with a Home Equity Loan Fixed Rate Fixed Payment No Closing Costs* MERCANTILE BANK 1 takhe your banigpersonafy. 606 West.Madison Street, Starke.......... 904-964-9696 300 West Main Street, Lake Butler....... 386-496-9607 branch for odduKona prdu Ilnlratrlo. Subject to normal apptaton and appeal poce. Pnoyam codrofs siiject to da ngewxtout noce. Me be FDC l ua Hous r Lende Offer available only at the locations listed below: MERCANTILE BANK W take your banking personal. 606 West Madison Street, Starke ......... 904-964-9696 300 West Main Street, Lake Butler....... 386-496-9607 *A nual Percentage Yield is accurate as of 10/16/06 and will be paid through 12/31/06. Rate subject to change after account is opened. Fees may reduce earnings. Minimum opening deposit is S 100. New money is required. Not available for funds currently on deposit at Mercantile Bank. To open a Premium Savings Account, a . Mercantile Bank personal checking account is required (Free Checking excluded). Transaction limiatons apply. Member FDIC Nov. 16, 2006 UNION COUNTY TIMES Page 5A .*i* .... .... *.Jir. ~ **'''r -w Union County Farm Bureau President Elery Griffis looks on as Lake Butler Mayor Jimmy Beasley signs the proclamation declaring it Farm-City Week. LETTER Continued from p. 1A. Union County has deep roots in agriculture. All of our best- known festivals have their basis in agriculture. From Worthington Springs' :vegetables to Raiford's beef .:cows, these events bring folks together to celebrate harvesting ,of our locally grown Commodities. LBMS Continued from p. 2A Davison, Andrea Devlin, Caleb Dukes, Quaneshia Edwards,,. Cochin Elis, on, Neither the farm nor the city can exist in isolation. Instead, the interdependence of the two creates jobs, products, markets and relationships that make our economy and nation strong. Join with us in recognizing Union. Elery Griffis, President Union County Farm Bureau Lake Butler Priscilla Guthrie, Ryan Hall, Austin Harden, Courtnee Hardin, Timothy Henson, Kailee Hooten, Christina Hunter, Edel Jardiness, Brandon Liston. Alexandra Morneau, Julie Nettles, Kaleb Nobles, Keanna Odom, Kayla Parsels, Grace Perez, Adam Roddenberry, Morgan Scott, Sierra Self, Alana Stevens, Rachel Summers, Bobbie-Jean Tatum. Hali Ward. Shelby Wooddell, Abbe) Worthington Lodge members passed to new degrees LBES adds security measures For added school safety, Lake Butler Elementary School has begun locking the back school entrance gates. Parents of first-, second-, third- and fourth-graders are asked not to line up before 2:10 p.m. because the gates will be locked until that time. Lining up before 2:10 p.m. would also cause major traffic concerns. FCCD Continued from p. 1A dry goods or monetary donations. Christmas baskets - Dec. 15 canned goods, dry goods or monetary donations. Adopt a Grandparent - Dec. 15 sugar free candy. Angel Tree program - Dec. 8 presents for children (for Guardian ad Litem). Warmth with Jackets - Dec. 15 collecting jackets of all sizes. School supply donations ongoing paper, pencil enspens, glue, crayons, notebooks, markers, backpacks, etc. Ronald McDonald House ongoing pop tops, travel size hygiene products (shampoo,4. us. FCCD is a nonprofit corporation. Brooker church holds Nov. 18 gospel sing Community Church of Brooker will hold a gospel sing on Saturday, Nov. 18, at 7 p.m. The featured group will be "The Yeoman Family" from Lake Park, Ga. Everyone is welcome. For more information, call Pastor George Dyal at (386) 496- 2805. Nov. 21 pool tournament to benefit Toys for Kids A pool tournament will be held Tuesday, Nov. 21, at the and Macee Worthington. Eighth-graders making A- B honor roll for the'first nine weeks at Lake Butler Middle School were. Colby Aadrews. :Cadilyn Bishop, Ha'den Double Deuce in Lake Butler. Sign-up will be from 5:30-6 p.m., and the tournament will start after that. There is a $10 entry fee to participate in the pool tournament, and a $5 fee. for both the dart and bowling tournaments. All proceeds will benefit the Lake Butler Toys for Kids program. For more information, contact Felicia Settles at (386) 496-9094. St. James AME Church to hold gospel sing Nov. 18 St. James AME Church will be hold a singing program on Saturday, Nov. 18, at 7 p.m. The guests will be "The Gospel Echos" of Ocala. Everyone is welcome. Brown, Amy Emery, Shelbie Finley, Chase Fry, James Herndon, Emily Holmes, Kayli Jenkins, Garrett McRee, Taylor McSpadden, Megan Mobley, Colby Odowski. Keaton Reynolds, Michaela The church is located at the corner of C.R. 238 (Providence road) and C.R. 231. County. Shannon, Kaitlyn Thomas, Marissa Washington and Miles Willis. Bradford County's Only OVernor Char tey C. Conference Center NOW BOOKING HOLIDAYS... THANKSGIVING CHRISTMAS NEW YEAR'S Plta adead... aetit ?7c/a ! IS OPEN FOR RENTALS... *Space for up to 500 people * Conference rooms * Audio / Video presentations capabilities... Call Pam at 904-964-5278 for information and tours. I i NOVEMBER pectias p.fhn^^ Bell 2.4 GHz . Cordless Phone Wanswerinq system 3 line LCD noise memory .l Electronic ... ....... ............ Typewriter GX-750, 9" typing width, 96 character keyboard, view mode, auto. carriage return, I paper support doubles as cover, automatic j correction system and rhore. $149.99 Bell Dual Handset Cordless Phone 2.4 GHZ. noise " reduction, redial '..m auto answer ano transfer : $89gOj - Electronic he. Typewriter ML-300, 16 character display, automatic correction, variable 10/12 pitch typing *m. selector, 12 cps typing speed, bold type, super/sub script and more. $199.99 Fellowes 7-outlet Advanced Strip , ULApproved $50000 ...' Connected .' - Equipment . Warranty 9 / $23. Panasonic KX-TG2355S SI Cordless wlAnswering KX TG2355S. 2 4 GHz. Cordless Wth Answering FHSS technology, talking caller ID. Light-UP Antenna $121.95 Panasonic RN-505, Micro Cassette Recorder _- Tape speed selector , Plus 60 min. cassene W Voice activated - $69.95 ' Panasonic 2-Line Telephone Hands-free speakerpnone 3-way calling, mute function, redial. 20 1 -touch dials. 10 speed dials, headset lack. desk/wall mountable $59.95 A1 Panasonic RN-202 Micro Cassette Recorder Fast playback, cue and review, Pause control. $39.95 Fellowes Confetti Cut Home/Office Shredder PS65C, Shreds 8 Sheet/Pass into 5/32"x2" Confetti Cuts, 9" Throat, Accepts letter and Legal, Credit Cards, Staples and Paper Clips Safety Lock, Black/Gray.. $179.95 FRE DEIVER]YI NI AL ORER O 'R$2 Bod apr2# on -we2xl THE OFFICE SHOP i ". MiN' TZ (904) 964-5764 FAX: (904) 964-6905 20-Vars ewerieme 110 W. Call St. ON ALL OFFICE MACHINE REPAIRS 'Art for illustration purposes only. Star ke II Keith Kirby (front, second from left), Kevin Kirby (third from left) and Tim Giebeig (front, on the right) were passed to the Degree of Fellowcraft in Lake Butler Lodge No. 52 F & AM on Nov. 8. I I I -I I ! I i I i L1 .,do4 n Page 6A UNION COUNTY TIMES Nov. 16, 2006 RETIRE .Continued from p. 1A and daughters, Janet Whitehead and Pam O'Steen, all shared their thoughts on the support their mother has received as she was ready to retire. "She is so happy, being able to share this with everyone," said Janet. "We appreciate it (all the people who showed up)." Janet said her mother is known to most people, in the community. "She's everybody's 'Meme,'" she said. Tim spoke of his mother's longevity. "Her own son retired before her," he said. "But she was still of-good work value." Pam, who used to work for the Union County school system, said she looked up to her mother. "She's, a wonderful person. She's been my mentor. She's been a friend and my mama." Pam said the two made it a rule early on in her career not to discuss the politics of the school system so *no one's feelings would get hurt. It is also important to note that Sue Whitehead had other jobs during her tenure on the school board, according to Pam. Whether it was a job at a .furniture store, the bank or other places around town, Pam said her mom was totally devoted to whatever she did. "If you look at those jobs, they're all dealing with people," Pam said. In one word: dedication School Board Member Alvin Griffis has served with Whitehead for 10 of her 14 years. "If I had to describe her in one word, that word would be dedication," he said. "She's one of the most dedicated public officials." Griffis said Whitehead / mentored fhim in leadership, guidance and dedication. Most people would not realize that Whitehead had been volunteering consistently ,at Lake Butler Elementary School, he. said. Beside this, he said she regularly attends school events, from, sports to band-adding that she had worked in the band boosters concession stand for approximately 40 years. Griffis said in time of crisis, Whitehead al ays, knew just the right response. "She always says the right things. I just tag along," he said. "I've certainly enjoyed working with her." Superintendent Faulk and other speakers echoed these sentiments. '"Everything she's' done for the students of Union County through the years," he said, "you just can't say enough about it." Faulk said disagreements happen among the school board at times, but Whitehead and the other board members were always good at keeping the students first in their decisions. "It's been a pleasure and an honor to work with you," he said as he presented Whitehead her plaque. Bobbie Morgan brought out old photos of Whitehead when she was in school-photos of her in the band, having the most school spirit, playing basketball and other activities. "Aunt Sue," as she became known to many, helped raise her, Morgan, said about the amount of time she spent at Whitehead's house. Morgan remembered Whitehead playing competitive softball in her 40s. This drive was something that made her a good school board member, and she said -she would look forward to seeing more of Whitehead in the classrooms now. MW.^|>~k ..l".>- ,1 <. Speech! Speech! When it was Whitehead's time to speak, she said all she had done throughout the years was strictly in her job description. "That's what I was elected for," she said. She may be allowing someone else to take over her seat at the school board meetings (George Green Jr. was elected earlier this year and will take over at the Nov. 21 meeting), but Whitehead said she would still be. around. "I'm going to miss it to a certain point..." she said, citing 11 p.m. phone calls as the part she wouldn't miss at all. Whitehead, with her children, grandchildren and one great-grand child in attendance, said she would still .volunteer at the schools and pay people visits. "They're not through with me yet." With memories, photos, food, family and friends, Whitehead thanked everyone and ended her speech as she said her mother always ended things-with a poem by Edgar A. Guest: Sue Whitehead gets together with the board members one last time before her final school board meeting. Pictured are (I-r) Sandra Floyd, Alvin Griffis, Whitehead, Marsan Carr, Allen Parrish and Superintendent Carlton Faulk. "It's, folks like you who keep the whole world smiling. It's folks like you who drive the cares away. It's folks like you when trouble's clouds are piling, Who always have some cheering word to say. Oh, what would folks like us, I wonder, do, "Without the love and help of folks like you? J.T. Parrish and Bill Whitehead catch up on a few stories, while enjoying iced tea. . Betsy Whitehead (left), director of food services, pins a corsage on Sue Whitehead during the party on Tuesday. Both getting a little teary-eyed, Sue Whitehead hugs' Carlton Faulk after he presents her with a plaque honoring her 14 years of service to the students of Union County schools. Lake Butler MiniStorage : MinmStcrage in Lake Butler "......... .. COMING SOON! MORE UNITS & FENCING Units Available:* *5x5 5x510 10x10 Coming Soon!10x201 Access 24 hours. Security. CALL NOW FOR RESERVATION!!! 386-496-2264 Hwy. 121 South and Southwest 3rd St., Lake Butlerirl wilh Floaming & Assoc. L.L. is licensed o picensed to prce in FL end has his principle office located in Houston, IX. Fleming &Associates,L.L.P 1330 Post Oak Blvd., Suite 3030 Houston, TX 77056-3019 ' The hiring of a lawyer is an important decision that should not be boaed solely upon advertisements. Before you decide, ask us. to send you free written information about our qualifications and experience. . I. .- Rei' gH Henry Whitehead takes a moment to talk with Sue Whitehead's son, Tim. Bobbie Morgan shows high school photos ofSue Whitehead, who she calls "Aunt Sue." The Campaigns Are Over.., The Votes Are Cast... Now, What Do We Do With All Of Those Political Signs? RECYCLE TIH SIGNS ., THAT WILL NOT BE Recycle it RE-USED AT THE FOLLOWING SOLID WASTE & RECYCLING COLLECTION CENTERS: i SR 121 in Lake Butler Providence Lake Butler by the Water Plant New River Regional Landfill near Raiford 4 - Let's all do our part, recycle... it's not a total waste. ASSOCIION ASSOCIATION RECYCLE* REUSE REDUCE .,2006 u ,., COUNTY .-.S Page 7A 2 more contestants eliminated, 10 remain in Tiger Idol 3 Elliott Willis breaks the bad news to Gracie Rambo that she has been eliminated. This meeting will take the EMS accepts place of the regularly scheduled meeting on toys, clothes Tuesday, Nov. 28. The Nov. 21 meeting will be for Christmas held in the board meeting room located at the corner of The Fifth Annual Big Red Lake Avenue and Southwest Christmas Drive is not too far Sixth Street in Lake Butler. away. To prepare.for the event, the lN EMS headquarters in Lake Thanksg giving Butler is accepting toys, clothes and other donations. in Lulu to be School board to re-organize on Nov. 21 Union County School Board will hold its re-organizational meeting on Tuesday, Nov. 21, at 6 p.m. held Nov. 19 Lulu Baptist Church and Lulu Advent Christian Church invite everyone to join them in giving thanks w-ith a Thanksgiving worship service on Sunday, Nov. 19, at 11 a.m. It will be held at the Lulu Advent Chfistian Church. Following worship services, Thanksgiving dinner will be. served. Everyone is invited. BY LINDSEY KIRKLAND Times Editor With one not being able to make the third show and one not earning enough votes to stay, two contestants were eliminated last Thursday night on Tiger Idol 3-James Wring and Gracie Rambo. The third show entertained the community with music from the 1980s, with Elliott Willis and Celeste .%Wilson again serving as hosts. BELOW: Anthony Wallace sings "Dead or Alive" with the help of Cody Tempest. Give thanks at the library Union County Public Library's storytime program for young children will be about Thanksgiving on Thursday, Nov. 16. It is entitled "A Marvelous Thanksgiving" and will start at 10 a.m. There will be no storytime program during the week of Thanksgiving on Wednesday and Thursday, Nov. 22-23. What do you give the book lover who has everything? At the Union County Public Library, the perfect gift is just a book dedication away. The librarN is raising funds for its new building by taking donations for books that will be used in the new facility. These books will have a book plate added as a dedication to a' loved one. For e\ery %wonderful gift for Nour loved one and your library. Fore more information, call (386) 496-3432. Tights, leg warmers, big hair and lots of makeup made the show a successful trip back to the '80s. Contestants sang the following songs: Tara Kirkpatrick "I Want You to Want Me," Kaleb Clyatt - "Candle in the Wind," Michelle Hunter "I Have Nothing," Gracie Rambo - "Hit Me with Your Best Shot," Ashley Crawford "The Rose," Tyler Gordon "You Give Love a Bad Name," Ashley Benton "I Love Rock 'n' Roll," Trish Berrier - "Black Velvet," Anthony Wallace "Dead or Alive" (accompanied on guitar and vocals by Cody Tempest), Camryn Wessner "What I Like About You" and Melissa Dukes "I Think We're Alone Now." Contestants took the liberty of dancing in the audience, having a backup singer/musician and a piano accompaniment. . When Celeste Wilson was ready to announce the results from the -Oct. 12 show, she said, "The tribe has spoken, and it's very sad," and then promptly handed over the chore to her co-host. Willis announced Rambo was going home, but she didn't seemed phased. Rambo said Trish Berrier sings "Black Velvet" for her aunt and uncle. she would keep singing throughout her high school career. The fourth show will feature Disney music in the Union County High School auditorium on Thursday, Dec. 14, at 7:30 p.m. Voting results? from the '80s show will be- announced at that time. Interviewed by Elliott Willis (left), Melissa Dukes (center) has got the '80s fashion trends covered, as does co-host Celeste Wilson (right). Dukes said she sang the song "I Think We're Alone Now" for her cousin, Amanda Futch, for when they crank up the music when no one's home. I-:ARN RIONLY OR, GIFT CARDS TEST CONSUMER PRODUCTS 0 AT HOME Waiting Log on to: on a seti Deal And sign up. It's free!!! Novationl Sardis Baptist Church Pastor Paul Osteen (left) held a prayer circle for approximately 200 people on Sunday. Members prayed for the completion of the church's new family life center. Helping Osteen set up the sound equipment were Charles Ball, minister of music, and (not pictured) Tim Rose, associate youth pastor. Sardis Baptist prays for new construction On Sunday morning, Nov. 12, Sardis Baptist Church of Worthington Springs held a prayer circle for the new family life center on the grounds being cleared for the building. Held during the church's normal Sunday school hour, 9:45-10:45 a.m., the physical size of the foundation was marked by stubs behind the existing .sanctuary to allow members to visualize how large the building would be upon completion. Pastor Paul Osteen conducted the service to approximately 200 in attendance. Individual prayers from 11 people were heard, but church members also prayed as a group. "As Sardis Baptist Church members, we were praying for the planned Family Life Center to be completed and paid for with all the praise and glory going to God," Ted Barber said. Following the prayers, donuts, coffee and orange were served in the church dining hall. Worship I tChe Mouse of t he lrd... Somewhere this week! The churches and businesses listed below urge you to attend the church of your choice! - I 1rm~ Page 8A UNION COu.... ..vl ., Community, students unite to honor veterans AT RIGHT: Veteran Lehman Alvarez introduces the speakers at the beginning of the cererhony Nov. 10. BELOW: Union County High School's Tigerettes perform a flag routine to 'God Bless America' during the Veterans Day parade, including (I-r) Shelbie Bishop, Nikole Anselowitz, Summer Depew and Tara Kirkpatrick. (L-R) JROTC Sgt. Walter Littles, CSM Andrew Framer, Cadet Lt. Col. Sarai Young and (in back) Mallory Wise conducted the Veterans Day ceremony at the Veterans Monument in Lake Butler. Wise said during her speech, "I would like to thank the many veterans for their participation in protecting our guaranteed rights as Americans. During a time of war, you stand ready to serve." ABOVE: Ted Barber salutes the flag during the playing of Taps. AT RIGHT: Bill McGill (left) and Jack Whitehead ride in the Veterans Day parade down Main Street in Lake Butler on Nov. 10. Happy5Oh",uel Nov. 17,1956 I.. 2. .--..*.-2~.. -~ r ..- ..,,.,,~ * ~ - .* ~ ......... I S Love, the Family STOP LEG CRAMPS m BEFORE THEY STOP YOU. Calcet .. .. . .. I Triple Calcium O - ' , ", on Daytona Beach 'L iJ and Get a Free Daytona Getaway Gift Bag! Studio from Direct Beachfront FREE On-Site Parking F oceanwalk.com 800-649-3566 ru' ..LuJr,',rido ". ni.ll'. m n :TaV 1 bdrm slaridardfrom 9rr 94, I t'dJrrT, r,:.3nl lr,, frorT i r 5 h0i Re'Ir 'Ihon; .ipply Bdied orn avarlabilir Sourie (ode 9022; key Code NEWSPAPER - Business & Service Directory- County Commissioner Ricky Jenkins (left) and his brother, Sam (VFW's Sr. Vice Commander Dist. 14), received plaques certifying the ceremony flags had flown at Camp Phoenix, Afghanistan, on March 11. Jenkins said the flags meant a lot because a family friend was serving overseas. VFW gives away shotgun L Harold Pittman (left), last year's commander of VFW Post #10082, presented Chris Rainey (right) with a Remington 12-gauge shotgun Model 870 Express. Rainey, of Lake Butler, won the post's shotgun drawing held recently. Automotive % Air Conditioning % and Quick Lube QUALITY PARTS AND SAME DAY SERVICE lI, _.:;i .il T i,.. 1 3 .I ,.. E ._ l- FREE ESTIMATES! 1 K ,,-I .hi FL .l N,. h ,-,I 'r4' i .1 352-473-6561 Housing Butler Townhomes LLC Lake Butler, FL ATTENTION! Local Residents 95 to 100% Financing for qualified buyers. In-house additional financing for deposit requirements. Call to schedule an appointment 386-496-2020 Building Supply s Jackson BUILDING SUPPLY "Where Quality & Service are a Family Tradition" US 301 S.* STARKE 964-6078 145 SW 6TH AVE LAKE BUTLER 496-3079 m_ U Mobile Home Services ROGERS MOBILE HOME SERVICES TR -\ IS R)(-OGERS In.|. l.l,.n ni.. r ,, 6 l , 10567 .U 301 Hampton. FL 32041 Travis Rogers 352-260-8005 Joni Rogers 352-468-2959 U t I Home Repair BRADFORD HOME REPAIR & PAINTING 904-966-2024 NORTHEAST AND CENTRAL FLORIDA BUILDERS INC. 904-769-9616 Additions Remodels * Custom Homes Residential / Commercial SL ,, C.,ttfl J CBC #1252824 ., CBC #1252824 Roofing t, ITY lve-,, ROOFING 4 BUY DIRECT FROM MANUFACTURER lowest Price in Northeast and Central Florida Painted Galvanized Galvalume All trim and accessories Rib Panel 3 toci coverage Installation Availanle Secondary Metal Available 904-368-8159 , ./ ii 0. Home Repair T'royer's #-ome 'Repair 40 years experience Everett Troyer S ciC-'Ret c c i reactor * Home Repairs ' * Roof Repairs (904) 964-6852 Cell: (941) 809-9111 Title Services -M w-asi" - I 1 Section B:-Thursday, Nov. 16, 2006 News from Bradford County, Union County and the Lake Region area UF musician to give piano recital tonight in Starke The Bradford Patrons will be presenting a. piano recital, performed by Kevin Sharpe, on Thursday, Nov. 16, at 6:30 p.m. at the United Methodist Church of Starke. This event-is free, but there will be a wine and cheese reception for those interested at the Woman's Club of Starke immediately following the recital. Tickets to the reception are $10 and may be obtained by calling Joan Rogers at (904) 964-7515. Sharpe holds the position of Associate Professor of Chamber Music at the University of Florida, -where he is an active chamber musician and soloist. He has received many awards, including the Oberlin Conservatory Rudolph Serkin Prize, and has also received awards in the National Association of Negro Musicians Competition and the National Young Artists Piano Competition. In 1991, Sharpe was the top prize winner in the Johann Sebastian Bach International Piano Competition in Washington, D.C. He also performs frequently as a guest soloist with orchestras throughout Florida, Washington and Indiana. He has also made appearances in Mexico, Iceland, Finland, Argentina, Hong Kong and the Czech Republic, where he was.. an American representative for the American Liszt Society. Starke Kiwanis poker tournament is Friday TheKiwanis Club of Starke will be posting a' Texas Hold'Em poker tournament on Friday, Nov. 17, at 6:30 p.m. at the Starke Golf and Country Club. Registration takes place at 6 p.m. and the entry fee is $50. Food and drinks will be available. For more information, or to secure a spot in the tournament, please call. Steve Deninark at (904) 964-5827. FCCD needs donations for community projects Chapter 5 of the Florida Council on Crime and Delinquency has a busy year planned in the area of community service. Several upcoming projects that FCCD has need community support, by way of, dry goods or monetary donations. ... Christmas baskets - Dec. 15 canned goods, dry goods or monetary donations. Adopt a Grandparent - Dec. ,15 sugar free candy. Angel Tree program - Dec. 8 presents for children (for Guardian ad Litem). ' Warmth with Jackets - Dec. 15 collecting James L. Crawford County Manager and June Neats jackets of all sizes. * School supply donations ongoing paper, pencils, pens, glue, crayons, notebooks, markers, backpacks, etc. * Ronald McDonald House ongoing pop tops, travel size hygiene products (shampoo,. FCCD is corporation. a nonprofit ,. ': I. '- '.t THE KEY TO AN PRE-OWNEDC/ "GL' CH' C, ,'R II'D ".:;, .0". GOLD CHECK CERTIFIED' .3 S ^'',^ ^..sT. op.Nl~ Register now for holiday basketball tourney The annual Charles Jackson Sr. Thanksgiving' basketball tournament is planned for Thursday, Friday and Saturday, Nov. 23-25. Registration is now under way. Registration deadline is Saturday, Nov. 18. For information, contact Alica McMillian at (904) 964- 6415 or (904) 966-1100. For the good job they did for the Michael and Anastasia Papaioannou family. Happy Thanksgiving and God bless you! usnr~v' Page 2B TELEGRAPH, TIMES & MONITOR--B-SECTION Nov. 16, 2006 Barbecue reserve champ is Starke Elementary student BY CLIFF SMELLEY Telegraph Staff Writer Could a future Food Network personality be found in Starke? That remains to be seen, but 8-year-old Starke Elementary School student Hailey McElhenny made her first appearance in a kjids'..barbecue competition memorable as she was named the Sting-Kill Kid's Q reserve grand champion on Nov. 4 in Douglas, Ga. Hailey had to compete in two categories: chicken and pork chops. She took first place in chicken and placed third in pork chops. She admitted she was "surprised, really, really surprised" when she heard her name called out as the winner of the chicken category. The accomplishment not only got Hailey featured on Starke Elementary's "Eagle Eye News," but prompted Principal Christy Reddish to make a comparison with a Food Network star. "Mrs. Reddish said she might be the next Paula Dean," Hailey's mother, Jessica, soid. At the barbecue event, Hailey received a large piggy- bank trophy for her first-place finish and a smaller piggy bank for her third-place finish. She received $100 for the first- place finish as well as $100 for being reserve grand champion. Her. third-place finish netted her $50. "I've already spent it," Hailey said of the money. "I've only got $30 left." Jessica McElhenny said she actually took $100 and placed it in a savings account for Hailey. Hailey was able to spend the rest of the money as she pleased. She paid for a haircut and a pedicure, as well as sharing the money with her little sister. Jessica and her husband, Justin, have an interest in barbecue. They have formed their own cook team, and Jessica is one of organizers of the December barbecue competition in Starke. The couple also has a friend in Clay Hill who competes in barbecue contests. As one of the top-10 cooks in Florida, he -- ; i'.; was invited to participate in the National BBQ Festival, held in Douglas, Ga., Nov. 3-4. The McElhenny family was planning to make the trip to help support him. That's when it was discovered the Kid's Q competition would also be held at the contest. "When my daddy told me (about it), I said, 'Sure, I'll do it. I'll give it a try.' I was really excited," Hailey said. Hailey said she often helps her dad when he's cooking on his grill at home. "Justin's always made it a point to always include her in doing stuff," Jessica said. Jessica estimates her daughter spent approximately six hours prepping the food and cooking it. "She had to pretty much do everything on her own," Jessica said. "She could have help, but they wanted the kids to do the majority of the work. She did." Jessica said the family's friend from Clay Hill allowed Hailey to use one of his smokers. He also helped her" with boxing the food since the contestants were judged on presentation as well as taste and tenderness. Hailey said she felt good ' about the chicken. She and her family were able to taste some that was left over and she said it was good. "I thought maybe I'd get second place in chicken," she said, "but when I heard I was first, I was like, 'Wow.'" , Jessica said there was not much time to reflect on the moment while the trophies were being awarded. However, when it was all over, it proved to be quite an emotional time. Jessica and her husband were crying, as were members of the Florida Barbecue Association, who were cheering Hailey on as the lone representative from the state of Florida. As you can imagine, Hailey, upon witnessing that scene, broke down as well. "I guess it was all just so overwhelming," Jessica said of her daughter. "I don't think she expected to do as well as she did. She just buried her face in her daddy's belly and cried." .Now that she's gotten her first competition under her belt, Hailey plans to compete in a kids' competition at the Starke contest. She said she doesn't anticipate doing anything differently this time around, adding that she definitely won't be doing anything differently with her first-place chicken. Next November, Hailey will return to Douglas, Ga. "She does plan on going back next year and defending her title as reserve grand champion and, hopefully, get grand champion," Jessica said. Watch out, Paula Dean. Hailey McElhenny preps her chicken the day before ..- - the. contest. ,i. .... -'% .'**! ** 's:, ,-., .... :-. ''- ..'".- I.,, 'I ..... , Best Sausage in the South! All Meats Now Available Including Seasoned Roast! 12876 SE 21st Ave (Old Forsyth Road) Starke 904-964-7019i OPEN: Nov. 22- 8am-6pm CLOSED: Thanksgiving Day OPEN: Nov. 24.&.25,,8am-6pm, Now accepting Owners USDA Food Roy.& Clifford Jackson Stamps Kare Gaskins-. S'S Tree Service and Timber Company I FREE ESTIMATES 24-Hr. Emergency Service | Removal *Topping Trimming 0 Stump Grinding Storm Damage lcsced iJnsured Seqrving M SurrauMjiegCotlies RED STARLING BRADFORD RESIDENT 3 2-485-219 '" 352-745 4503r VisF17151 F~E~eIIt'u'siontE1Webakt: Y .]mmaluunitfi Roi A:~1 *A K. I .~"- .~. Starke's own "BBQ Diva." Hailey McElhenny said her father, Justin, gave her a choice of two team names: BBQ Diva and BBQ Brat. You can see which one she chose. I I - - -': i. r! i 4C Nov. 16, 2006 TELEGRAPH, TIMES & MONITOR--B-SECTION Page 3B Understanding the voluntary pre-K program BY TERESA STONE-IRWIN Telegraph Staff Writer Florida's Voluntary Prekindergarten Education Program went into effect at the beginning of the 2005-2006 school year. Each child who resides in Florida and has reached the age of 4 on or before Sept. I of a given school year is eligible for the free voluntary pre-K program during that school year. Parents of an eligible child may enroll the child in one of the following programs: (a) A school-year voluntary pre-K program delivered by a private prekindergarten provider or eligible public school; or (b) A summer voluntary pre- K program delivered by an eligible public school or by a private prekindergarten provider. A child may not enroll in more than one of the above programs. Parents may choose the private provider or eligible public school in their area, however, the provider may determine whether or not to admit any child based upon staff-to-child ratio availability. Florida Statutes require-that each prekindergarten program delivered by private providers must be accredited just as those delivered through the public school system. Prekindergarten instructors must hold, either a child development associate credential which recognizes that the individual has completed the national requirements and has proven their competence to work with young children, or hold a teacher's certificate. In addition, prekindergarten instructors must be screened using the Level 2 screening standards and rescreened every five years. Linda Johns, the director of accountability and special programs for Union County schools said, "By law, each public or private voluntary pre- K provider must deliver at least 540 instructional hours to students during the traditional 180 day school year. This breaks down to three hours each school day. After that time, parents are able to pick up their child or they can make arrangements with the private provider for extended child care. The state provides the funding for only the three hours of classroom instruction a day," said Johns. Each school district in Florida is also required to administer a VPK summer program. Each district's school- board determines which public schools in the district are eligible to deliver the summer program. According to Steve Mountain, the executive director of Early Learning Coalition of Clay, Nassau, Baker and Bradford counties, the summer voluntary pre-K program differs from the traditional school year program. "The summer program consists of 300 hours of instruction within a 90 day period. Some may find this program to be more intense and faster paced," said Mountain. Parents enrolling a child in the voluntary pre-K program should also be aware that a child must comply with the attendance policy ,of the private kindergarten provider or district school board. As a general rule, the state allows for three unexcused absences per month, and seven absences with a parent note. After It accumulative absences in one month, documentation is required (such as a doctor's note) to avoid a child being withdrawn from the program. "All voluntary pre-K programs are state funded, so your chosen provider will not receive funds if your child is not meeting the attendance requirement. Parents should check with the individual provider to be sure of their attendance policy," said Mountain. Parents can enroll their child in the VPK program at any time, so long as their chosen provider is accepting new students. Registration requirements to any VPK program are as follows: * The child must be a Florida resident who has reached four years of age by Sept. 1 of the enrollment year. The child's original birth, certificate is required. * Proof of residency of the parent or guardian of an eligible child is required. Such proof can be in the form of a I TTRT TEEITOR: Reader supports universal care Dear Editor: Veterans' Day has come and gone and the veterans have been honored and recognized 'but I want to recognize the :wives and children of these :veterans. As they read this ;letter they 'will recognize themselves but I want to honor Those women who have had the :sorrow of a miscarriage or the. joy of a new child without ,their husband there to share the Pain or the joy. I want to send a hug to those women who :buried their mothers, fathers, ,sisters, or brothers and their husbands could not be there to hold them close while they cried their hearts out. I want to Let you kno%% that it took courage when your .child suffered a horrible accident or deadly illness and you were thousands of miles away from your supporting and loving family and you and your .spouse were the only ones there to care for the other children and to support each other. I want to salute the women who looked around their homes every 18 months to two years and decided what they would throw out or put into storage because they were only allowed to ship 2,000 pounds when they went overseas. Oh yes, my hat is off to those women who managed to live for six months or more when the shippers managed to "lose" their household goods en route to their new .station and they had to live with the bare necessities while they figured that the next day their stuff would arrive. Only a military . family) knows what a "white glove inspection" to clear their quarters entails before they can move to their next home but you cleaned your house to pass (with or without your husband). Some way you managed to stretch a private or a corporal's pay to last a month at a time and to never let that soldier husband or your kids know that the 30 different ways you prepared hamburger was out of necessity and not just because they liked hamburger. Every time you moved you had to give away or throw away groceries, mops, brooms, garbage cans, etc. and knew that .some way you would have to find money in the budget to replace them when you got to the next station. When your spouse was overseas and he got $18 overseas pay but needed $75 a month so he could have some money to ease the liardship he was going through. you cutback e\en further on what yo6u and the kids had'fid Personalized Gifts & Gourmet Foods Christmas Ornaments & Decor 322-A S. Walnut St. 964-9080 found ways to enjoy peanut butter and jelly sandwiches with Kool Aid picnics. You adjusted to taking your kids to new doctors every time you moved and learned to like it. You adjusted to 30 people being scheduled for a 9 a.m. appointment and took a good book to read. I salute that little boy or girl who didn't know that the man standing in the room is daddy, because daddy is supposed to be that man in the picture on the table. I want to tell those children whose dad, and now that women are in the military, their moms, are not there for the important times of their lives, that it's not because they don't care but because they care so much they are willing to be separated from you to protect you. I salute those military See READER p11B utility or phone bill. * Any custodial adult of an eligible child, such as a grandparent or foster parent, must also have documentation showing that they are the custodial parent of the child. The Early Learning Coalition of Bradford County has partnered with Episcopal Children's Services for the voluntary pre-K program in that area. For a registration packet or further information, Bradford County residents should call (904) 964-1543. Voluntary prekindergarten providers located in Bradford County are Brooker Elementary, Noah's Ark Childcare, Children's Farm, New Beginnings, Hampton. Elementary, Midway Learning Center, Lawtey Community, School, Bradford Preschool, Hope Christian Academy, Love'n & Learning, Southside. Elementary, Starke Elementary and Starke Head Start. In Union County, a OF WALDO, FLORIDA ... . * Lifetime Warranty * Pressure Treated Wood Serving All of North and North Central Florida Buildings Starring .... 80mo Come See Us U.S. Hwy 301 MeZiS'nsi.3elKauerIne Waldo Flea Markets OPEN ALL WEEK Saturday & Sunday 352485-2533 "PLUS TAKE AN EXTRA 0 OFF ! ONE DAY ONLY $299 9 ,^eg.$100 Round and Baguette Diamond Ring Hurry while supplies last! Saturday, November 18, 2006 I ........... m , FREEDMAN'S JEWFI RS W SINCE 1920* STARK, FL 904-964-9669 Asd until our Ap.,r.'. ,r1j U "..84Aw' .EWlw oswIR d j U,,mpla xqf u sml~ns AW INSTAWIAION, tomnu slomA,,r,,,,,l WI F M, ILRRIBLB AIF it 1 9VCOS[CUIR AM MONTHSCSTOMERDOIhS NOT CONTACItT 0 13CAtN If 'UMI jNA IIt PO R AM ''A ~ A 'IM A IIS 11SAP!BIN 6 11AUTOAV MATICAtllY O)1)I l DION TE I )INOIHN AT IHETHEMIIIPNI[AHNG TIMS.I TAICIIN~A~NNE;IN[ 144Alm (ESIF II RH NM~~lA~IHl1(1t ,RyI IRORAtAT.,,A(Rl[lyllDp,,A t +INTERFIST FIRE PROMOTIONAL PLANS WHEN Y01 S1 )OUR )PREFERRED CREDIT CARD ISSIEI)D BY WFNNII. FINANCE (HAROESARE DEFERRED FOR PROMOTIONAL ( RI-DII PI AN PIRIL HASS AMN THEN Aft RI E FROM THE DATE OF PURI I. ASE TIIROIT.I AND IN('LIDIN( TIlHE LA DAY Y OF THEi PROMOIONAI. PERIODIIFTHIE PURCHASE .\IONIr I I\sNOI ImAI IN 1' .1 BY TIlE PROMOTIONAL PERIOD :'ND DATF (12 MONTHS FROM DATE OF PURCHASE FOR TOTAL PI'RH(IASE ABOVE $500). PiYMENTS ARE l :) 'RID 111 RIM Ilil 'PROM11 TIONAI PERIOD. 11 Ill- PRIOM110OIINAI. CREDIT PLAN IS NOT PAID IN FULL BEFORE TIlE PRIOTIOXNAL PERIOD ENDS. THE REMAINING HAlAM I.. INIIl IDIN, IIIEi -ll! RIED FINANCE IARiES. WILL BE IM It'DEI) IN N LR REGUL AR RE\OILVINi BALANCE AND REGt.LAR CREDIT TERMS WILL APPLY. AS OF No\ iiI R I. 21)116 o i' IOVsl : SBIIrT TO iN AI'R OF 24.96'i%, ill. RATE \MAY VARY. MINIMI M FINANCE CHARGE OF SI .00 BASED ON AVERAGE DAILY l.(\\IAV Er. St II (JI TO CREDIT APPROVAL. *Discounts Range from 30%-50% and exclude diamond solitaire rings.**Additional Discounts exclude clearance. repairs, remounts, loose stones and special orders. No Layaways. No Holds. No Rainchecks. Some Restrictions may apply. See store for details. SALE VALID SATURDAY, NOVEMBER 18, 2006 ONLY. Back & Neck Pain Clinic "Modem methods with old-fashioned concern." * Auto Accidents * Work Injuries * Headaches * Neck and Back Pain CHIROPRACTIC Call r. Berry PHYSICIAN Serving the Area For 18 Years 601 E. Call St. 8 0 Hwy. 230, Starke 964O ... EVERYONE APPROVED! PORTABLE OK NO CREDIT CHECK PORTABLE WAREHOUSES ' 06A! t.f.,.. : L 3 .,. ..' $ Y .. . - - ~'SS~5~81Sia~E~jEi~~~Bt~$~iF~:~i~~;r~s;P 'IN representative from the coalition meets every Tuesday at Lake Butler Elementary for parents who wish to enroll their child. For further information, call Van Brown or Michelle Cobb at (386) 961- 0133. Voluntary prekindergarten providers in Union County are Lake Butler Elementary School,. Little Rainbows Learning Center and Tiger's Den Day Care. Clay County residents should call (904) 213-3939 to reach the coalition in their area. Voluntary prekindergarten providers in the Clay County- Keystone Heights area are The Talent Village, In Loving Hands, Inc. and In Loving Hands, Too. Parents can also register their child online by going to itionlnfo.aspx and entering the name of their county. -1 Editorial/Opinion Thursday, Nov. 16, 2006 Page 4B We can remember Germany was first brought to the table Nov. 11, 1918, to formally end World War I, with the date being .etched into memory as Armistice Day. When the job had to be done over again, Americans combined the two celebratory --days.--- the successful ending of two world wars, into Veterans Day. It has been 88 years since the armistice ,.was signed "in France, Send 4Jl the long, bloody World War I. . Unfortunately, and for reasons little -understood by the average person, the ext generation had to do the same job over. The European end of World ! War II came April 17, 1945, followed by the collapse of the Japanese in August. Very few WWI veterans have survived until today, and WWII veterans are dying off at a very high rate, since it has been 61 years since the war ended. While the two world wars were major conflicts enlisting millions of young people in uniform, the United States has been in a J number of smaller, but no less deadly, wars, generating veterans in every age group. Thanks to former Starke City Commissioner Charles Schaefer ,(deceased),-- the-- city established Veterans Memorial Park on East Call. Street, and memorials are held each year to honor all veterans. World War II Museum, is located in New Orleans and portrays the entire history of WWII from beginning to end, and local veteran Douglas Hardy is a charter member. Hardy-is being honored with a certificate certifying his charter I membership, and his name will be "entered in perpetuity" on a kiosk at the entrance. Hardy was a rifleman in the Battle of the Bulge, ahn epic battle, that broke , the back of the German Armyv in" December 1944. The battle coincided with a record blizzard in the mountains. Hardy was hospitalized briefly with. frozen feet, but he returned to his, unit to fight again. Some veterans, such as I, were , never in eminent danger, even though we may have spent four years or more in the military, and while we served in wartime, the military owes us nothing. We are just glad to return home, maybe.a little heavier, and hopefully a little wiser, than when we left. Some young men and women didn't live to return home, and some came home with broken bodies, never to live a normal life. Our nation can provide for them, but there is no way to compensate them and their families for the loss of life and/or limb. But we can remember those who perished 'and honor those who served. By Buster Rahn, Apriyate ,rgan iz~, te ati onaaL,, .Tetegraph.Editorialist.- a e. .,, q.. ,,,,a-n,,i-. 'tb r ,N .rapi ',., LB Woman's Club says 'thanks' Dear Editor: I would like to say a special "thank you," to Sheriff Jerry Whitehead and Henry Fowler. Sheriff Whitehead donated chicken and rice for the Lake Butler Woman's Club fund raiser dinners on Nov. 6. Henry Fowler cooked the chicken' and rice, which was delicious. I would also like 'to thank all the ladies of the club who cooked the side dishes, served, and delivered the dinners. I extend my appreciation to all those who bought the Smeas-T-hey-all-had a part in making the fund-raiser a great success. The money raised will be used for a high school scholarship. Verona DeLoach president Pax coordinator says 'thanks' Dear Editor: It's both gratifying and exciting to find a way one can make a difference in today's fast paced, crowded world. Those in this community who have welcomed foreign ,students into their homes and the school this year are making a real difference. It seems particularly appropriate to extend a public "thank you" during International Education Week, Nov. 13-17. On behalf of my PAX students, Aitzol from Spain and Nancy from Germany, I would like to thank their host families, Mike and Sharlene Spires and Shelly and Ricky Starling. I also would like to thank. the teachers and students at Union County' High School and the Union County School Board for being so' willing' to welcome exchange students into the community. By-the simple act of setting an extra place at the table, an extra desk in the classroom, and being open to making a new friend, these generous and, enlightened community membc rs ;are. fac, iliiairig,,i, unique opporsupi-. ,tqs,,q- cultural learning. International Education Week is a joint initiative of the US Department of State and the US Department of Education. In announcing this year's celebration, Secretary of Education Margaret Spellings observed that educational opportunities like those provided by the PAX program "Teach us to see beyond our borders and boundaries, to overcome stereotypes and appreciate cultures other than our own. in so doing, they give us hope for a brighter future by advancing freedom, opportunity and understanding." These arc, .-indeed, giant rewards Tor which I extend heartfelt thanks on behalf of my PAX students. Dawn Brown PAX Community Coordinator Lake Butler Thanks to the members of Fargis Lodge for donation Dear Editor: At the Nov. 6, 2005, stated communication of Lake Butler Lodge No. 52, Free and Accepted Masons, the Worshipful Master of J. Wendell Fargis Lodge No. 356 of Neptune Beach, Florida along with. two other members of the J. Wendell Fargis Lodge personally presented a donation of $1,000 to help Mary Murphy and her family recover from the devastation the tragic bus accident caused that family. The check was deposited into Lake Butler Lodge's account for a bank transfer Nov. 7, to the Mary Murpfly and her three children.. The members of Lake Butler Lodge expressed their appreciation to all the members of J. Wendell Fargis Lodge for their generous donation. We feel very proud to hane other lodges of Freemasons from all around the state of Florida that have made donations to assist the families adversely affected by the tragic, bus accident. P -. TDriTedffdeir' P, ast. District, Depuyr', . llll" \ I I ] /I i. I . Ttracker Isoatf 1i~rry (lantin & / ^\ A4AA4^ ,. -/ -.' '*. ^' are teaming up to bring you Chief . responds to critic Dear Editor: I am responding to a letter that was submitted last week about the Lawtey Police Department. I would like to clarify some things and answer some questions that a citizer had: - Q. How many cars does the police department need ' A. All Police Departmenti need one car per officer. It i s proven fact that vehicles last longer when they have only -one driver. In instances where company cars are a'ailabl . accountability ana responsibilities are placed.,'o one person, the assigned drive? Therefore, the Lawtey Policq Department needs twelve cars. Q. How many officers does LPD have? 1 A. The Lawtey Polidd Department employs 12 sworfn officers. I Q. Do we' supply all thk officers a "Take home/take tl your other job' car? . A. Who is we? The Lawtey, Police Department has twd officers who have assigned taked home cars. One is the chief oP police and the other is th major. Both of which were approved by the Lawtey ,Citi Council. Since the major is thd only person that has a take, home car and another job, no, a1 police car is hot driven to the "other job." .. ', . Q. With these take ,hom' cars, do we get 24/7 protection and availability? A. Here it is again, who is1 we? All citizens of Lawtey have 24-hour law enforcement, protection. ' Q. Will I see. my 'tax dollars (LPD new cars) patrolling in, my neighborhood?.. ". q A. Since the Lkwtey Police1 Department receives no taxV Dollars from tie citizenss o0f Lawtey, yoi will not see ybur "tax dollars at work" within, this department. The Lawteyg Police Department is a .sef,- supporting agency with Lic' assistance from tax revenue' that is paid by Lawiey citizens.= Officers. of this department patrol all neighborhoods within. the city limits.. Q. Were they purchased to) .....See ,LETTER,,p7B ILVIf U .. .,I.l .,t '.,, ill AI SATURDAY -"NOV. 18 from 8am to 6pm MERCURY Outboards OClde~i-aiIt xi TRACKER. --, TRACKER BOAT CENTER... Home of America's Favorite Boats! and 00JEH I I I I I177 take & Macclenny, call for details. Enter Our SPEND $20.00 OR MORE AND PUT YOUR NAME IN THE DRAWING FOR A $50 GIFT CARD! SIT'SALL HAPPENING IN STARKEAT TERRY'SHUNTING & FISHING* US 301 & SR-16 TrackerBoats Terry _ SUNDAY NOV. 19 from 8am to 4pm :1 Buy Your Boat This Weekend and Then Come Back For = Terry's Big After Thanksgiving Sale on Nov. 24TH 10 TO 30% OFF Select Items Such As GUNS CAMMO SNAKE BOOTS DEER FEEDERS AMMUNITION & MORE! CLEAANC SAE O REMINIGN~ 206 MDELS&-AL, gIoBoa i - I ~i~g~ I Nov. 16, 2006 TELEGRAPH, TIMES & MQNITOR--B-SECTION Page 5p i OBITUARIES 1 Art Saily Art Sally KEYSTONE HEIGHTS Art Saily, 93, of ,Keystone Heights died Friday, Oct. 27, 2006, in Gainesville. Born in 1913 in Daggett, Mich. to Otto and Mariana Saily, Mr. Saily lived in Marenisco, Mich., Oregon and Idaho before moving to Keystone Heights in 2002. He worked in the lumber and construction industries and built and operated a machine shop. Mr. Sally is survived by: his wife of 63 years, Della Steinback Saily of Gainesville; a son, David Saily of Ridgefield, Conn.; two daughters, Mary Saily of Reston, Va., and Janet Groesbeck of Melrose; four grandchildren and two great- grandchildren. Arrangements were under the care of Moring Funeral Home of Melrose. George Alcott : KEYSTONE HEIGHTS Ernest George Alcott, 86, of Keystone Heights died Tuesday, Sept. 12, 2006, at Bradford Terrace. Born in Arlington, Mass., on Sept. 16, 1919, Mr. Alcott moved to Park of the Palms from Baltimore and New England. He was a member of Park of the Palms Church. He served in: the U.S. Army Air Corps during World War II and was an engineer for General Electric. Mr. Alcott is survived by: his wife, Dorothy Traver Alcott of Keystone Heights; three sons, Stephen Alcott of Somerville, Mass.,' David Alcott of San Antonio, Texas, and Daniel Alcott of Millers, Md.; four grandchildren and seven great- grandchildren. Funeral services for Mr.. Alcott will be held at 10 a.m. on Saturday, Nov. 25, 2006, in Gately Funeral Home with Nancy Bowen, SND conducting the ser iicesi. i'ment .wil[ follow in Melrose, Mass. Jones Funeral Home of Keystone Heights was in charge of local arrangements. Christine Gillyard LAKE BUTLER Christine V. Gillyard, 68, of Lake Butler died Thursday, Nov. 9, 2006, at North Florida Regional Medical Center in Gainesville following a brief illness. Born in Fairbanks, Mrs. Gillyard had lived in Lake Butler for 40 years. She was the daughter of the late Milton and Viola Milton Fielder. She was a homemaker and seamstress and was of the Baptist faith. Mrs. Gillyard is survived by: a son, Joe Gillyard of Fort White; a daughter, Eva Coakley of Lake Butler; two sisters, Margaret Smith of Gainesville and Nancy Harris of Georgia; five grandchildren and five great- grandchildren. Graveside services for Mrs. Gillyard were Nov. 14, 2006, in Sparkmans Cemetery in Fairbanks with the Rev. Russell Woodard officiating. Interment followed under the care of Dees Family Funeral Home of Lake City. A guest book is available at home.corn. Cassie Pearce LAKE BUTLER Cassie Edenfield Pearce, 96, of Lake Butler died Wednesday, Nov. 8, 2006, at Lake Butler Hospital following an extended illness. A lifelong resident of Union County, Mrs. Pearce was a cook at Dr. Bolls Hospital in Lake Butler for many years. She was a member of First Christian Church of Lake Butler. Mrs. Pearce is survived by: a daughter, Ovedia Pearce; seven grandchildren and 24 great- grandchildren. She was preceded in death by her husband Clinton Pearce; and two children, James Pearce and Willow Mae Grantham. Funeral services for Mrs. Pearce were Nov. 10, 2006, in First Christian Church of Lake Butler with Brother Arthur Peterson, the Rev. David Thomas and the Rev. Ronnie Osteen officiating. Burial followed in Old Providence Cemetery under the care of Archer Funeral Home of Lake Butler. Wayne Wetzel KEYSTONE HEIGHTS Wayne Eugene Wetzel, age 60, of Keystone Heights passed away peacefully at home on Friday, Nov. 3, 2006. He was surrounded by family as be'ended his long courageous battle with cancer; Wayne was born in Macomb, IIl., on Jan. 12, 1946, and mo\ed to Ke. stone in 1984 from Gaines iIle a' "ahe was of'the Baptist Faith W\'ane also served in the United States Navy and had a long career in the computer industry, most recently serving as a business analyst for Keane Corp. in Jacksonville. Wayne was q lifelong collector of Allis: Chalmers tractors and an avid outdoorsman, enjoying boating, skiing, biking, and his all time favorite-golfing with his wife. Wayne is survived by his wife of 25 years, Claudia Story Wetzel of Keystone Heights; children, Susan M. Marble and Bradford W. Wetzel, both of Brunswick, Ga.; stepdaughter, Kelly J. Amburgey of Keystone Heights; mother, Helen Mohr of Carthage, Ill., sisters, Karel Carl, Brenda Wetzel Sage, Marjorie Campbell, all of Carthage, Ill., arfd Nancy Lionberger of LaHarpe, Ill.; brothers, James Wetzel of Stanley, Idaho, David Wetzel of Nauvoo, Ill., and Byron Wetzel of Bellevue, Idaho; five grandchildren and .two great- grandchildren. A celebration bf Wayne's life will be held at 2 p.m. on Monday, Nov. 20, 2006, in the DeWitt C. Jones Chapel in Keystone Heights with Tom Miller conducting the service. Interment will be at a later date. Memorial contributions may be made to Haven Hospice of the Lakes, 6400 St. Johns Ave., Palatka, FL 32177. leaad %4 7Ta"sI The family of Colton Shane Barnhart would like to thank everyone for all of your kindness in our time of great loss. It was greatly appreciated. We would like to give special thanks toArchie Tanner and his' staff, Norma Donn, Colton's doctors, teachers, bus drivers and friends. Linda and Sylvia, you are proof that angels do live amongst us. God bless you all and thank you. Tonya Barnhart and family In last week's paper,. Colton's obituary said that he would be cremated. This was submitted to the paper before some changes were made. Colton was laid to rest on Thursday, Nov. 9,2006, in Santa Fe Cemetery in Hampton, Where everyone who loved him will always be welcome, to visit him. V.,,,. MEET A NEW FRIEND OF THE FAMILY. U:~6 - Kathleen McNamara. ME Board certified in Family Practici S" e i. '" ' In Memory [ In Memory Grady Hart In Loving Memory of Catherine "Kat" Bryant Jan. 28, 1949 Nov. 14, 2005 If tears could build a stairway And memories a lane I would walk right up to Heaven And bring you back again No farewell words were spoken No time to say "goodbye" You were gone before I knew it Andonly God knows why MA heart still aches in sadness A.,l secret tears will flow What it meant to love you No one can ever know But now I know you want me To mourn for you no more To remember all the happy times Life still has much in store Since you 'll never be forgotten I pledgeto you today Ahallowed place within my heart Is where you 'll always stay. We miss you, Mama We miss you, Dear Sister Associate with those who help you believe in yourself. -Brooks Robinson "When You Say It With Flowers It's Beautifully gaid" . |gincelq731 6/a's7 (904) 964-7711 In Loving Memory of Our Daddy (;rady Hart June 4, '1932 Nov. 12, 2003 Not a day goes by that we don't think of you. We love and miss you. Love;' Your Daughters and Grandchildren in Memory Horace C. Odem Jn Loving Memory Horace C. Odem April 27, 1941 Nov. 16, 1998 It's been eight years since you left us. People said time heals all wounds, but nothing can replace your memory. We will always miss you. Love, Your Sister, Eunice Perry Clemons A Full-Service Repair Shop * Alignments. * Brakes- turn rotors * Shocks * Struts * Exhaust work/mufflers * Pipe bending * Duals * Tires-balance& rotate Oil changes * Tune-ups * Diagnostics' computers * Batteries * Alternators * Starters Got gasp Certified Mechanics Owner: Richard Barrick Manager: Gina Richard 138661431-1185 Head Mechanic: Kenny Richard (formerly at Mosley Tire) Mechanic: Robert Harvey 12670 NE SR-121, Raiford 1 mile S of Raiford P.O. AWA Aiknuln+-- 11 FARM ., iLACHUA LUMBER 1386-462-3003 1] SHOP EARLY for CHRISTMAS in our 1500 sq ft Store full of WESTERN & WORK WEAR! . We o c1MAKE ITA o o " a We also carry 'rt DO01! Dy Red Wing Double H and Ariat at prices that can't be beat! Come See Us... WeAre Huge! * Western Wear * Work Wear * Tack * Lumber * Saddles * Plumbing * Electrical * Fencing Supplies * Langdale Posts t- If.*. A t%..- IiuiIDf AAAA : Covering all your ,ome visa uur -vIw t ou( Horse Feed needs sq. ft. HARDWARE and with Purina & we RENTAL BUILDING... we .-carrv Exclusive Dog have everything from Hand Purina FeedbyvPurina. Tnnk t Ph P -T olsts oo Bobcats! A Feed, Farm & Lumber Stor LIKE ANOTHER!! on South Main Street in Alachua past the RR Tracks. 'I - I a O OWL au~ I ~ :i~hPlprp~F*~rr~-----i-~-_~rj_~_=-~ii~lj ~--~~l-C I , a Page 6B TELEGRAPH, TIMES & MONITOR--B-SECTION Nov. 16, 2006 !CRIME Man arrested for kicking officer A 47-year-old Sanderson man faces multiple charges from his arrest in Starke Nov. 8. Cecil R. Carter resisted Patrolman Shawn Brown by pulling away and kicking the officer. After being arrested and placed in the patrol car, Carter kicked out the back window, Patrolman Brown said. As the officers attempted to place Carter into another patrol car, Carter kicked Patrolman Brown several times. Carter was charged with resisting an officer with violence, battery on a law enforcement officer, criminal mischief and attempted escape, Patrolman Brown said. Bond on the charges was set at $35,000. Carter was also charged on warrants for possession of Oxycodone and resisting arrest with violence. Bond was set at $30,000. Stealing floor tiles gets man arrested A 32-year-old Mayo man was arrested Nov. 9 in Providence for stealing from a construction site. Sergio Correa was charged with burglary and grand theft by Deputy Ken Smith. Correa had six boxes of floor tile in the trunk of his car, Deputy Smith said. Correa works for the contractor who was pouring the concrete at an unfinished residence in Providence Plantation. Reportedly there have been other thefts from unfinished homes in the area, Deputy Smith said. Value of the tiles is approximately $400. Man charged in attack on victim ........A ,;-,'^t-ard6ld 'Aian was, arrested. ,N.ov 12 i, o ngT gs after he" allegedly pushed his way into a home where he beat the victim with an axe handle. Julian Wesley Raines was charged with battery," aggravated battery and burglary with assault, according to Deputy Kevin Dice. Raines is charged with pushing the first victim to the floor when she tried to block his entrance at 2:18 a.m., Deputy Dice said. Raines then went to the bedroom, where the other victim was sleeping, and began striking the victim approximately three times about the head with an axe handle, causing a large gash in his scalp. He also struck him on his arm and body, Deputy Dice said. The victim refused treatment for injuries, Deputy Dice said. Deputies advised Raines to stay away from the victim's home when they were called to a domestic controversy a few months ago, Deputy Dice said. Starke woman charged with stealing A 22-year-old Starke woman was arrested Nov. 12 in Clay County for petit theft. Adrienne Kelly was charged by Clay Deputy A.R. Hewitt with shoplifting at J.C. Penney in the Orange Park Mall. A fraud complaint was filed charging Kelly withh stealing a J.C. Penney credit card and a check from a relative's purse in Bradford County. The credit card fraudulent activity was approximately $150. The stolen check was uttered at Winn' Dixie in Middleburg for $95.22, Deputy Hewitt said. Kelly was also charged on a warrant for worthless checks, Deputy Hewitt said. Four arrested for fighting Four people were arrested Nov. 12 after deputies were called to investigate the report of a fight in progress outside the 301 Quick Stop on U. S. 301 south of Starke. A verbal altercation outside the store between Christopher D. Plemons and Blake W. Ford erupted into a fight with several others becoming involved, according to Deputy Thomas Sapp. Plemons, 18, of Starke was charge with aggravated battery and one count battery. He was released from custody after a $20,000 surety bond was posted. Ford, 20, of Starke was charged with battery and resisting arrest, Deputy Sapp said. A $2,000 surety bond was posted for his release from custody. Also arrested was Billie Jean Saxon, 22, of Starke. She was charged with battery and released after a ,$1,000 surety bond was posted. William D. Griffis, 30, of Hampton was charged with battery. A $1,000 surety bond was posted for his release, Deputy Sapp said. Recent arrests in Bradford, Clay or Union The following individuals were arrestedrecently by local law enforcement officers in Bradford, Clay (Keystone Heights area) or Union County: Tyesha Latwane Foster, 23, of Starke was arrested Nov. 7 by Starke Patrolman William Murray for aggravated battery. Foster is charged with striking the victim in the face with an air freshener can. During the altercation, Foster bit the victim on her arm, Patrolman Murray said. A $5,000 surety bond was posted for her release, from custody. Mark Alan Teears, 36, of Jacksonville was arrested Nov. 11 by Bradford Deputy Thomas Sapp for domestic battery. Teears is charged with striking and kicking the victim several times during a confrontation that started at the Red Dog Saloon. The argument continued as the couple was northbound on U.S. 301, Deputy Sapp said. The victim was treated at the emergency room for minor lacerations and contusions, Deputy Sapp. said. Teears was also charged with violation of probation k ith no bond. He remains in, custody .with bond set on the, battery charge at $1,000. Kristofer Allen Akridge, 26, of Starke was arrested No\. 9 by Starke Patrolman, J.W. Hooper for simple battery. Police were called to a disturbance where they found Akridge smelling strongly of alcohol, Akridge is charged with pushing the victim against the wall, where she hit her head, Patrolman H6opber -said. Akridge was released from custody afer a $1;000 :surety bond was posted. Shaunte Tracy Hyman, 18,. of Lake Butler was arrested Nov. 1 by Union Deput', James Goodwin for battery and trespassing. Hyman was ordered to leave a residence on Southwest 13th Street, where she had been issued a trespass warning, Deputy Goodwin said. Hyman is charged with being involved in a physical fight with the victim while at ;he residence, and hitting her, )epury Goodwin said. She yas., jepeatedl; told to leave, but vf4 ( Ranked One of The Best Restaurants in Florida by Florida Trend MAlw-inet 2003, 2004, 2005 & 2006 HE YEARLING J RESTAURANT EST. 1952... ,CROSS CREEK, FLORIDA SERVING THE FINEST IN CRACKER CUISINE... SEAFOOD AND USA PRIME BEEF. OPEN THURS-FRI 5-1OPM, SAT. NOON-1OPM SUN. NOON-8:30PM S PHONE (352) 466-3999 i~iFAjI~ 7H Ti JIH -~- -1-ZJ ii would not, Deputy Goodwin said. Matthew Boilan, 22, of Keystone Heights was arrested Nov. 9 by Clay Deputy L.C. Ricks for a possession of controlled substance without a valid prescription. and possession ofcannabis During an investigation of a disturbance, the deputy observed a bag containing marijuana in Boilan's jacket pocket. A cigarette box containing 3.5 pills that were determined to be Xanex was also found, Deputy Ricks said. Boilan admitted he does not have a valid prescription for the Xanex, Deputy Ricks said. James L. Sinders, 22, of Starke was arre..ted Nov, $ by Patrolman Hooper for possession of cocaine. Sanders was found to have 6.2 grams of cocaine in his possession while on Brownlee Street, Patrolman Hooper said. Bond was set at $15,000. Danielle Lawrence, 26, of' Starke was arrested Npv. 7 by Patrolman Murray for possession of. drug paraphernalia. Lawrence was stopped just after midnight as she.was walking .on-U.S. ,301. She '.was nervous when questioned. During a search, the officer found crack pipes in her possession. Patrolman Murra. said A $1,0)00 surety bond was posted for her release from custody. Johnnie Lee Alexander, 40, of Lake Butler %as arrested Nov. 7 by Union Deputy.Mac Johns for burglary. criminal mischief and petit theft. Following an investigation of a No\. 3 burglar) at Butler To'.nhouses, Ale\ander was charged with breaking into the office at Butler Town Homes and. stealing" approximately $150, Deputy Johns said. Alexander admitted to the burglary. He stated he needed the money to support his crack cocaine addiction.- Alton Lamar Moore, 46, of Jacksonville was arrested Nov. 8 by Patrolman Hooper for retail theft and resisting a merchant. Moore is charged with stealing merchandise valued at $30.60 from Food Lion. When store ,personnel attempted to stop him from leaving the store, Moore pushed them out of the way and left, Patrolman Hooper RIDE FREE UNTIL 200* ON SOO7 POL.RRIS RTTUV VISIT YOUR POLARIS DEALER FOR AlDDITIONL LIMITED-TIME INCENTIVES. said. A $2,000 surety bond was posted for his release from custody. It is evident that many great and useful objects can be obtained in this world only by cooperation. -Thomas B. Macaulay Polarisof Gainesville 12556 NW US Hwy 441 Alachua, GL 32615 1-386-418-4244 .-.. . AN 7- 1, LI,,rd,. I I'. 4 00 Shop Our-6 Acres of RVs * Airstream travel trailers y .. and motorized . * Allegro Motor Home by Tiffen * Prowler, Salem & Rockwood Travel Trailers ROCKWOOD CHALET FOLD DOWN CAMPERS SSales Service Parts Accessories Large Camper Store New and used units in stock ALLEGRO & AIRSTREAM MOTOR HOMES TOLL FREE 1-800-541-6439 12380 Hwy. 441 So. Alachua, FL 32615 386-462-3039 SBRASIN ION ::: .Cadillac Saab p A'O5 CHEVY I . EQUINOX 25k miles 13,900 '02 OLDS : '04 HONDA BRAVADA PILOT EX Leather, 33k miles 22k miles $10,900 I *19,999 I I'02 MONTE SCARLO SS 40k miles 7.711,450 Sales hours: Mon-Thurs 8:30-7.00 352-378-5301 800-5354608 Fri 8;30-6:00- Sat 9:00-4:00 GH 2001 NW 13th St.. Gainesville, FL Service hours: Mon-Fri 7:30-5:30 NOTICE OF PUBLIC HEARINGS CONCERNING THE ENACTMENT OF ORDINANCES" IMPOSING IMPACT FEES The Bradford County Board of County Commissioners will conduct two public hearings to consider the enactment of ordinances imposing impact fees. The first of the two public hearings will be held on: Date: November 27, 2006 Time: 7:00 p.m. Place: Charley E. Johns Conference Center 1610 North Temple Avenue, Starke The second and final public hearing will be held on:. Date: December 14, 2006 Time: 7:00 p.m. Place: Charley E. Johns Confereice Center 1610 North Temple Avenue, Starke All interested persons may appear and be heard with respect to the proposed ordinances. I. Nov. 16, 2006 TELEGRAPH, TIMES & MONITOR--B-SECTION Page 7B [CRIME Recent arrests in Bradford, Clay or Union The following individuals were arrested recently by local law enforcement officers in Bradford, Clay (Keystone Heights area) or Union County: Ted Edgar Manning Jr., 45, of Starke was arrested Nov. 11 I by Patrolman Murray for retail i. theft. Manning is charged with concealing a package of ribs and two T-bone steaks while in Winn Dixie. He attempted to leave the business without paying for the items. Patrolman Murray said. He was released from custody after a $1,000 surety bond was - posted. Donald Guy Prater, 42, of . Starke was arrested Nov. 7 by, Starke Patrolman Michelle . Davis for trespass. Prater was found at Winn Di\ie, where he had been given a no trespass warning, Patrolman Davis i: said. He was released from " custody after a $1,000 surety bond was posted. Joseph M. Kutta, 82, of Lawtey was arrested Nov. 8 by Starke Patrolman Shawn Brown for retail theft. Kutta is charged with removing merchandise from Winn Dixie without paying. Value of the meat was $27, Patrolman Brown said. A $1,000 surety bond was posted for his release from custody. Charles Robertson, 24, of Lake Butler was arrested Nov. 6 by Union Sgt. Raymond. Shuford for disorderly intoxication.. Deputies responded to a report of a vehicle in a ditch on Northwest Fourth Avenue, where Robertson was standing near the vehicle. Robertson first. stated a friend had parked it there, but later admitted to driving the truck into the ditch. He appeared to be under the influence' of drugs .and/or alcohol, Sgt. Shuford,said. admitted to drinking a few beers, Deputy Smith said. Buchanan refused testing, refused the breathalyzer and refused to give her name and address, Deputy Smith said. Valentin Acosta Monter, 36, and Juan Martinez, 21, both of Branford, were arrested Nov. 7 by Starke Patrolman Michelle Davis. Monter's vehicle was stopped for erratic driving on U.S. 301, travelling at speeds of eight to 10 mph, Patrolman Davis said. Monter was charged with reckless driving and Martinez, who smelled strongly of an alcoholic beverage, was charged with disorderly intoxication. Bond was set at $1,000 on each of the charges. Minor Klinton Catledge, 19, of Green Cove Springs was arrested Nov. 9 by Bradford Deputy Aaron Black for DWLS. Catledge's vehicle was stopped for speeding on C.R. 225. A computer check revealed that his license had multiple suspensions for failure to pay traffic fines. He was released from custodN after a $500 surety bond was posted. Eric Lamar Cue, 37, of Gainesville was arrested Nov. 10 by Lawtey Patrolman J.W. Padgett for DWLS. He was released after a $500 surety bond was posted. Cecil Seay, 36, of Worthington Springs was arrested Nov. 10 by Brooker Marshal Tommy Raulerson for DWLS. A $500 surety bond was posted for his release. Clarence A. Kelsey II, 63, of Keystone Heights. was arrested. Nov. 8 by Starke Patrolman Jason Crosby for violation of driver's license restriction. A $5,000 surety bond was posted for his release from custody. Adrian Gregory Bay, 35, of Lawtey was arrested Nov. 10 by Bradford Sgt. Ray White for violation of probation DUI. He was ordered to. serve 50 days in the county jail. Coy .Franklin, 47, of, Ke) stone Heights \\as arrested *n . Nov.-7 bN Cl'a depuire on' .oen iidK ee mJ.tmentr and violation of probation others; this is true morality. driving under the influence -Nicolas Chamfort SDanielle. Bertie, 23, of Keystone Heights was'arrested fNov. 9 by Clay deputies on a warrant for failure to appear worthless check. b Dustin Wade Jackson, 21, of HOME IS Starke was arrested Nov. 11 by Deputy Sapp for violation of probation with no bond. f Rico Demond Lee, 31, of ,_Lake Butler, was arrested Nov. 13 by Sgt. Shuford on w arrants for aggravated battery with total bond set at $15,000. . Tiffany Joy Diechman, 22, .was arrested Nov. 13 .by Sgt. tShuford on a warrant for fraud. Bond was set at $10,000. i Traffic Trent Robert Barton, 37, of , 5,arasota was.arrested Nov. 12 by Florida Highway Patrol i-.'' pl. James Starling for driving while license suspended or , revoked (DWLS) knowingly. ) '.. '\. Barton's vehicle was stopped on C.R. 230 travelling 75mph in a 55mph zone. His license " had been suspended for failure to pay. He was also wanted on a warrant for Tampa but Hillsborough County advised i he \ as wanted only if he was arrested locally. Cpl. Starling s daid. A $500 cash bond %\as j .-posted for his release from ikcustodN. Thomas Lloyd loore, 46,; b.of Raiford was arrested Not g0 b\ Cpl. Starling for DUI. loore was stopped on S.R. '31 driving a 2000 Ford pickup after radar indicated the truck was speeding. He smelled .strongly of" an alcoholic. beveragee. and his eyes were red If you live in Sta and watery,,Cpl. Starling said. Moore failed field sobriety Starke medical testing and refused to submit to the breath test. He was can diagnose an Further charged with DWLS right here. We a land on a warrant for failure to appear Moore was released heart disease to irom custody after surety bonds ' stalling $12,000 were posted. 922 E Cal Elizabeth Ann Buchanan, 1, of Fort White was arrested Starke. FL ov. 6 by Union Deputy Ken . mith for DUI, DWLS and I904.36 existing an officer. Buchanan's Shands issan was stopped on S.R. 00 when it was observed swerving back and forth across the lanes. She smelled strongly :. ..m, f ,an alcoholic beverage and LETTER Continued from p 4B chase speeders on U.S. 301 and drive to Raiford? A. Police vehicles are the preferred tool to apprehend traffic violators and respond to calls where a police officer is requested. Bicycles, Segways, skateboards and scooters are usually not as fast in catching someone that is going 60 mph in a 45 mph speed zone or responding to a call that requires police officer. Driving to Raiford? Police vehicles are not prohibited from leaving the city limits of Lawtey. They are subject to be driven anywhere on official police business. Q. Where was Lawtey PD at 2 a.m. after the Florida-Georgia game? A. An officer was monitoring the large amount of traffic that was going home after the game. Where were you? Q. There was an auto accident on east Lake Street (in the city) where BCSO responded and an injured man was taken to a trauma unit. Where was LPD? A. The officer assigned to work that night was patrolling the city of Lawtey since the, auto accident was not within the city limits of Lawtey. Where are you getting your information? Q. What is LPD's response time? A. Lawtey Police Department's response time is less then a minute depending, on the location of the officer at the time of an incident. Q. Why does LPD need tasers? A. All police officers need tasers as a tool to help protect life and property. Q. Who are they really going to use them on? A. Tasers may be used on anyone that show active physical, aggressive physical, or aggravated physical resistance to a law enforcement officer as outlined in the Use of Force Matrix Repcommended Response' LUdls set by the Florida Criminal Justice Standards and Training Commission and Florida Department of Law Enforcement. Tasers can and may be used in -lieu of a firearm with an extremely reduced amount of force and only used in accordance with departmental policies and procedures. Q. Will it be a student at Lawtey school? Will it be an 80-year-old who is a little confused and disoriented? A. Students at the Lawtey Community School are well behaved, thanks to the exceptional staff that is employedd there and the exceptional parents that raise 'their children with love and .respect'for other people. Let's Lbe real; how many confused .andri disoriented 80-year-olds have you seen causing a disturbance in Lawtey? Q. LPD does nothing about the drug dealing in town. So % ho will the taser be used on? The speeders in the school zone? A. Do you really know what we are doing about the drug dealing? Of course not. If you did then everyone would know and it would be, pointless to pursue drug dealers. We issue citations to speeders, not use a taser on them. The Law offices of Douglas E. Massey Auto Accidents* Dog Bites* Personal Injury* Felony and Misdemeanor Criminal Defense Divorce and Family Law Social Security Disability Claims -I- 964-6455 -.:: 9580.. NW SR. 6 6 STA tRKE FL 3209 ' ... nt :.. (90:4) d64-6455 ns w *lFrec initial consultation: No Fees excluding costs unless you win Q. Call your council person, city hall, or LPD and ask why tasers are needed. Ask why we need more new cars? A. I can't speak for members of the council or employees of city hall but the police department needs two new cars because we are replacing two older cars. Do you think we were buying new cars just to spend money? Do you really think that the council members would approve the purchase of new cars if they weren't needed? Q. Why didn't we have police protection on a Saturday night? A. Just because you don't see a police officer doesn't mean that they are not there. Maybe we should install all of our cars with real time GPS tracking so you know where we are 24- hours a day seven days a week. Q. If officers were on duty, why did BCSO respond first? A. If you are referring to the auto accident that you think happened inside the city limits, BSCO responded first because it did not happen within the jurisdiction of the Lawtey Police Department. I welcome any and all comments or questions that you may have concerning this department. We are here to serve and protect the citizens of Lawtey. We have worked hard, to get this department where it is today and will not supply the citizens with nothing less then the professional law enforcement that they deserve. How long. will people: continue to live in Lawtey without a police department? How many people will move to Lawtey, knowing that there will not be a police officer at their home when they need one? Lawtey is growing, whether we like it or not, and this department has to be ready and be able to conform to that growth. We cannot do this using old, outdated, or workout equipment. Everyone is entitled to their own opinion but if you want to start talking facts, make sure you know the facts -before you start talking. Thank you. Chief M.M. Jordan Lawtey Rural, urban residents are 'partners in progress' Dear Editor: This Thanksgiving Day, as we gather with family andc friends to count our blessings, let's give thanks for the bounty we enjoy not just on this holiday, but every day. The safe, plentiful food that is available to us, ahd the products used to produ' the clothing, housing, medidcines, fuel and other products we use on a daily basis, didn't just appear in a store. They got there thanks to a tremendous partnership of farm: and ranchers, processors,,.,.gokers, truckers, shippers, ad~'ettsers, wholesalers and retailers. A In appreciation of this farm- .city partnership, the president of the United States .annually proclaims the week leading up See MORE, p11B MERLE nORMRfT Page 8B TELEGRAPH, TIMES & MONITOR--B-SECTION Nov. 16, 2006 S* ARead our Classifieds on the Where one call CSS i f A ds World Wide Web <' does itall! i id 964-6305*473-2210*496-2261 Notice IFOUAL HOUSING OP- PORTUNITY All reales- il, cl dverlisingq in this nltwspaper is subIoct to llnh Federal Fair Housing Act o 19168 which makes il illegal to advertise "any pioleience, limitation or discrimination based on since. color, religion, sex oi national origin, or an intention to make any such preference. limita- lion or discrimination Familial status includes children under the age of i living with parents or l'(,al. the toll-free telephone number for the hearing impaired is 1-800-927- 9275. For further infor- mation call Florida Com- mission on Human Rela- lions. Lisa Sutherland 850-488-7082 ext #1005. I, KENNETH DONALD APARICIO, am not and Swill not be responsible for -,, -i-,:,, : ,,: .,ed as Sr .,,, _,06 by. CASH VEHICLES '92 BONNEVILLE, $1,750. "'88 Cadillac, $1,500. '94 Cougar, $1,500. . Chevy S-10, $4,600. All cars plus tax, tag and title 352-277-7759. CHURCH VAN 2001 DODGE 3500 15-pas- senger van. 47K miles. $12,800 OBO. 2 miles south of Lawley on 301 on the right in Starke. Call 305-321-6785. 1998 LINCOLN CONTI- NENTAL Everything works. great condition, $3,850. Call 352-377- 8882 and ask for David Hurse. '89 RANGER PICK-UP - Runs good, work truck. $850, call 904-364-3678, 1995 CAMARO V-6, AU- TOMATIC, COLD AIR. Runs and drives like new, $2.000. Call 386-659- 2173 or 386-916-6585. HANDICAP 10 PASSEN- GER VAN. 1994 Chevy, 17mpg, TV, VCR, like new inside. $3,900 firm. Call 352-473-2252. 1997 FORD F-350 XLT, 7.3 V-8, power stroke diesel. Dually supercab, 4WD, A/ C, power windows. $12,500 OBO. Call 352- 473-9913 or 904-521- 4747. Also, 1979 Jeep CJ-5, 304 V-8, 3sp, manual transmission, tilt wheel, new soft top 4WD, works. $2,750 OBO. Call 904-327-2324 or 904-521-4747. 43 RV's and Campers '32 PULL BEHIND CAMPER Must see to appreciate. $1,800, call 904-364-6690. MOTOR HOME CLASS "C". 1999 Shasta, 30ft. Model Cheyenne. 30,475 miles, excellent condition. Pay off bal- ance due to Bank of America and it's yours. Contact Andrew Cain at 386-496-1862 or Virginia Cain at 352-473-7797. Seeitat 1356SE81st St, Starke. ..1993 24C PROWLER Travel Trailer- New tires, battery, updated propane tanks, accessories, com- plete anti sway hitch sys- tem. Plus top of the line hitch. Issues with refrig- erator and electric water heater, $4,300. Call 352- 473-4974. 44 Boats 16' HOBICAT FOR SALE, $650 OBO. Tramp and sails in excellent condi- tion, pontoons need pol- ishing. Call 352-235- 4352. AMERICAN EAGLE 15FT FIBERGLASS GANOE. Suntop, seats, trolling motor, marine battery and ROOMS FOR RENT Economy Inn Lawtey, FL Low Daily & Weekly Rates Daily Rm Service Microwave, Cable/HBO Refrigerator Local Phone (904) 782-3332 For Sale N" ,/ STARKE 3/2 H.O.M. New construction, 1 yr. warranty, in downtown near schools. $ 10-1,999 Call 352-235-2972 3/2 Home on.1 acre lot. 1 block from Country Club. ' $210,000 with $5,000 Carpet allowance. 3/2 home built in 1999. Like new condition on over an acre. Bayless Hwy. $219,000 . Land 12.5 acres, .CR 229. Pecan trees,. beautiful home site. $195,000 septics, 2 untitled mobile homes. $95,000 I '^^^ 'l^^ I.^ trailer. $950 OBO Call 352-473-9913 or 904- 327-2324. 45 Land for Sale OCALA NATIONAL FOR- EST LOTS. $500 down. $199/mth. Owner, 352- 239-5520 or 352-236- 4579. land.com/2nd.. 1.65 ACRES ON CR125 IN LAWTEY. Convenient commute to Jacksonville. Property will allow for a mobile home or new con- struction. Asking $27,900. Call Jennifer Lourcey at Coldwell Banker/Smith & Smith Realty, 904-566-9068 or 904-964-9222. KEYSTONE HEIGHTS home only lot, 196' x 105'. County water. A schools. $39,000. Call 352-256-6701. 3.5 ACRES IN INDIAN TRAIL, $40,000. .5 acre building lot on Gatorbone Lake, $40,000. 1 acre next to Gold Head State Park, $30,000. Rock bot- tom prices. Call 352-475- 1832. 10 ACRES, 1998 HOMES OF MERIT DWMH, 4/2, 2000 sq ft. Asking $235K, make an offer. Call 352-475-1832. ONE ACRE LOT FOR SALE, BRADFORD COUNTY, off US301 be- low WalMart, north on SW 127th St, south of Starke, FL. Mobile home, partially fenced, previ- ously cleared, no knowl- edge of well or septic tank! $25,000. Call 352- 235-4352. Lic. R.E. Salesman. . WATERFRONT, HOMES ONLY, building lot for sale. Bradford County, est, .85 acre on Paradise Lake, Keystone Heights, FL. Only .2 of a mile off paved road to lot. Will need well and septic and some clearing. $65,000. Call 352-235-4352. Lic. R.E. Salesman. BEAUTIFUL .74 ACRE Announcements What .Destrovs Rel.ii.'s n.i,,i, Answ'er pgei Jp Bt .mrd ReadI RDi.iIll, h, L.. Ron Hubbard Sent S8-5342. Auctions ONLINE AUCTION MerryGro Farms Includes tractors. semis.: %an Irailerm thousands of .h-ppinn carts alnd nursery, wagons. warehouse equipment . tools. supplies and m,',e Det a i Is a t., 'LAND AUCTION' 230 Props Must be Sold! Low Down / E-Z Financine. Free Catalog (800)937- 1603. corn NRLL East. LLC:AB2509. Buleziuk:AU3448. Johnston:AU3449. Mauck:AU3447. Developers Closeout AUCTION- 12/2/06 14 Residential Condominiums, Pompanoa Beach. FL Financing and Online Bidding Available 2% Broker. Cooperation L. Fisher AU93: ABIO6 (800)331-6620 x 16. In Cooperation with Lauro Auctioneers Sale subject to all terms. Absolute Real Estate Auctions: Homes. Condos: Commercial. Land. Wailerfront. All will sell, ait. Auction. Brokers & Phone Biddi ng Welcome. Neal VanDeRee Re.ilt.r/ \- iunee i '4 4| i' .] ,114 1 ,, w.,w.vandcree.com: ABSOL.UT'. AUCTION. Historic. Walerfronit HIGH AND DRY LOT with lake access ready for your home or new mo- bile. In quiet Big Tree Lakes, Keystone. $27,200. Call Carol Ekenbarger, Realtor at Helen Hersey Really, 352-235-00 $376,500 for both. Call 904-964-4111. 48 Homes for Sale MORTGAGES TAILORED TO YOUR NEEDS. First time home buyer, no money down. refinanced. Slow credit, bankruptcy ok. Call for approval, 904-742-2942. 3/3 BRICK HOME ON BEDFORD LAKE 2500 sq ft, lots of amenities. $395,000, make offer. Call 352-473-7769 or 352-235-1294. 2892 SO FT HOME in- cludes 1080 sq ft guest addition with office and estate subdivided into 5 tracts. 3624 Topside Road. Knoxville. TN. Saturday. Nov. 18. 10:30 AM: ". 1-800-4-FURROW. TN Lie. #62. Liquidation Auction- 130+/- acres Divided 17+ acres. Leslie. GA.. Saturday December 2. 10am. Rowell Auctions. Inc. (800)323-8388. GAL AU-C002594 10% buyer's premium. Auction- 208+/- acres'- Divided. Excellent Row Crop Farm, Saturday. December 2:I10:00 a.m.. Irwin County. G-A. Rowell Aui.:.I. In, (800)323-." Q :, \L' AU-C002594 1.0% buyer's p re mi iuin. Auction- 74+/- acres - Divided. Excellent Colquitit County Farmland. Friday. November 24. 10:00 a.m.. Rowell Auctions. Inc. (800)323-8388. 10% buyer's premium. GAL Building Supplies METAL ROOFING SAVE $$$ Buy Direct From Manufacturer. 20 colors in stock with alli Accessories. Quick turn around! Delivery Available (352)498-0778 Toll Free (888)393-0335. Business Opportunities ALL CASHH CANDY ROUTE Do you earn' $800/day'? 30 Machines. Free Candy All for $9.995. (888)629-9968 B02000033. CALL US: We will not be undersold! Imagine vou are... Looking To'Buv Or Sell A Business '& Are Matched With The Ribht Opportunity Quiclvly NBCS Worlds Lar-esi Match Maker "Of Businesses: CALL. .(8(K)999-SAI.E Or Visit vwwwv.NBCSI.LC.com. Learn to bu v Foreclosures. tax lien,. and rcliabs foi' icnnie s on the .dollar. Mlentrii walks you through ciah deal \-/Z to 'ensure private entrance to addi- lion. 5/3, newly remod- eled, 2 acres on lake. near Slarke and Key- stone Heights See "BuyOwner.com". Prop- erty ID#8828 or call John at 352-473-6407. 49 Mobile Homes for Sale HILLIARD/ NEW Jacobsen 32x48:3BR/2BA. set up on 2 acres with well, sep- tic & power pole included, $734 per month.ft 4/2 on 1.5 acres in Baker County, $110,000. Call 904-259- 8028. NEW FLEETWOOD HOMES 2006 MODELS sold for thousands less. Call 904-259-1100. NEW 2006 24X56 3/2 FLEETWOOD, $44,900 delivered and setup. Yarborough Homes, drive a little, save a lot. Call 904-259-8028. SINGLEWIDE MOBILE HOME 1987 2/2 3-ton heat pump. Must move, $8,000. Call 386-496- 3504. SLWTEY LAND/HOME 3/ 2 2002 SINGLEWIDE. 1185 sq ft o0 2 acres with new carpet. ERA Moneyhan Realty, T J Nooney, 904-705-6248. KEYSTONE LAND/HOME 3/2 2002 doublewide mobile home. 1958 sq ft on 1 acre, paved road and new carpet. ERA Moneyhan Realty, T J Nooney, 904-705-6248. HIGHLAND ESTATES - 2002 DWMH, split plan, 3/2, fireplace, luxury -master bath. dining room. decks, partially fenced. '.? -f living space. Ap- .r:,-.ed at $68,500 in February, only $63.500 FHA, VA ok. 100% fi- nancing available. Call Mark Uram at 352-528- 2092. 50 For Rent FURNISHED ROOMS SUCCESS (800)433- 4556. Financial MONEY TO LEND Residential/Imnestors/Co mmercial Refinance'Your Adjustable SAVE S$$$$ Bankruptcy. Trurndowns. Stop Foreclosures I % Available Call Direct Lending Partners (866)459-2606 CASH NOW. FOR FUTURE PAYMENTS! We will buy your Annuity.. Stirictured .Settlement. Lottery or Owner Hell M .. ... Note. Call CI..l (' ..i .1 Resources Ii'. -: ' 5815. Low-rate .NO DOCUMENTATION Mortgages. Ideal if RETIRED. SELF- EMPLOYED. DIVORCED. PRIVACY- consciou s o r UNEMPLOYED. No Job Required. 0%4 Down. 100% Cash-Out Available. nk.com (888)ZE'RO- DOWN. Help Wanted $2.900 WEEKLY GUARANTEED! Address letters for holiday cash. No experience necessary. Free information. Stair immediately! Write: A&G Publications. 2370- G Hillcrest Rd. #147-H. Mobile, AL 36695. Driver-HIRING . QUALIFIED DRIVERS for Central Florida Local & National OTR positions. Food grade tanker. no haznmat. ino pumps. great benefits. competitive pay & new equipment. Need 2 years experience. Call viinumn Transport, for "our opportunly lo'da\y. (8()741-7950. DRIVER: YOU WANT IT. WE HAVE. IT! Solo, learns, owner operaloris. company dri\ ers. students, recenti eI'adl.. regional. dedicated. lonia htiul. Van. latlbed. MuLsl be 21. CRST Career Center. (800)(940-2778. \\\\ w.driveltormr'm .comii. We're raisiniii pa\ for F'loridai rcgimoilm driers' Home cvr\ \\Neckend! Home during the \\cek' FOR RENT I UIVIrCOMPLETE with CH/A, cable pro- vided, all utilities paid! Central location. 10%dis- count on first months rent for senior citizens Rooms with private bath. $110 $130 /wk Room without bath. $95. Laun- dry facilities available.Apts.. SPECIAL-RENT 2 & 3BR homes, newly renovated. Deposit required. No pets. First month free. Call 678-438-6828 or 678-438-2865, for more information. 2/2 HOME for rent, with laundry room & Direct TV, $550 per month, 904-966-2024 ROOMMATE WANTED - MELROSE AREA. Pri- vate bath and private TV room. $350/mth, must have references. Call 352-404-5308. FOR RENT large 1BR/1BA apartment. $400 per month, $400 deposit 6 month lease required. Call Mike at 904-364- 7026. COTTAGE FOR RENT OR LEASE- 1/1 Appliances, fenced-in yard, on Lake Geneva. $550/mth plus deposit. Call 352-473- 3518 LAKE GENEVA- 2BR MH. DIRECT LAKEFRONT $500/mth plus security. no pets. 7804 SR100, Keystone Heights. McDonald's Trailer Park. 352-235-0035. MOBILE HOME FOR RENT IN LAWTEY. 2/1 with AC, fenced in area. Call 386-562-3408. IN MELROSE- 107 TOPAZ TRAIL. 3/1 house. CH/ A, stove, refrigerator, w/ d hook-up, fenced back- yard. $595/mth, $500/ sec. Call 352-475-5533 or 352-745-0690. 1/1 APARTMENT WITH Jlnae Whittemiro Sales-Associate Jennifer Vaughan S Sales-Associate e;.^ s fSMK Solid weekly miles! 95% no touch! Preplanned freight! $.43 per mile. sometime. money & .more! Heartland Express (800)441-4953 Oi1. AWESOME FIRST JOB!! Kay's Nalurals. 12 new hires. Over 18. Travel USA! $500 sien- on! Cash Daily! No Experience Necessary. Call Kayv. oda.a (800)988-0650. (877)KAYCREW. (602)421-3015. HENDRY CORRECTIONAL INSTITUTION in IMMOKALEE. FL. is RECRUITING FOR CORRECTIONAL OFFICERS (GREAT PAY & S TATE BENEFITS) Con-'t, cm Barnhart @ ( ".' r. 2107/2108 or Apply on- lin e a t. CLASS-A C D 1. DRIVERS- Now Hiring OTR & Local Drivers- New Equipment: Great Benefits: 'rem iui P ., Package. Call (Ot m. Trans port. (877)882'- 6537. Drivers -Car haulin career. OREAT HOME TIME! Exceptional Pa' & Benefits! Pmaia Training! Min. 1 yr, Clai.s-A'CDL exp. req. TH E WAGGONERS TRUCKING (912)571- 9668 OR (866)413-3074. TEAMS NEEDED. Home weekly. Class A- CDI. w/HAZMAT. TOP PAY & BENEFITS. (800)428-0678.. Ivey Mechanical seeks plumbers. sheet i meal ourinevman & helperm . I)eFuiiiak Sprinms (850)892-2768. Gracesille (850)263- 0982. Florida Cilt (305)246-8411 & Monim' Haten (8631946-9166, Competiili\e pay/benefiis. ..\A/IO. DATA N'INTRY: Work FIr oi I imn\ where. FIlc\ible Honurs. Pcsei',onal C'omipiilel Required. S\,: el len t ( .i ecr (O)pp orlunill Serioii , InquiriesC (0 nl 1i(8000)( 44- 9636 Emxl. 700. S.... Up to $550 ". I i''Y Working tihrouilm the o\erin'meini PT No Expemience. Call Todav!! (800)488-2921 Ask for Department W21. . Homes For Sale $0O. DOWN HOMES Gov't & Bank Foreclosures! Low or no down! No credit OK! Call Nowe! (800)749- 2905. PALM HARBOR Factory Liquidation Sale. 2006 Models Must Go! Modular. Mobile & Stit Homes. 0% DOWN Whell. You Owni1 Your Own Land!! Call for FREE Color Brochure. (800)622-2832. Instruction HEAVY EQUIPMENT OPERATOR TRAINING FOR EMPLOYMENT: Bulldo,'ers. Backhoes. Loaders. Dump Trucks. Graders. Scrapers. Excavators: National Certification. Job Placement Assistance: Associated Trainine Services (800)251-3274 \t. corm. Heav)n fee! (866)889-02 10 iniflo@aiimericasdrivingeac adenmy.conm. Lots & Acreage :LAND AUCTION:' 230 Props Must be Sold! Lows Down / E-Z Financinme. Free C.iailog (800)937- 1603 Sww'w.I.ANDAUCTION. :coi NRI.I. East. II C.AB2509. Bulc/iuk:AU3448. J.ohlnton:\AU3449. Maiick:AU3447. N. lI l I1-350 Acres 301 ,\c+/- lo%\ as S651)0/.Icre KITCHEN. Includes elec- tricity and TV. Call 386- 659-1621 3/2 DOUBLEWIDE MO- BILE HOME KEY- STONE HEIGHTS. 3/2, has new carpet and paint. newer appliances. w/d hook-up. CH/A, double lot Very, very clean References needed. $625/mlh plus $600/sec. Call 904-571-4264. BOLT LAKE COTTAGE. 21 1 $475/mth. $475/sec Call 386-867-1948. 2/2 SPLIT DESIGN FUR- NISHED DWMH with porches and carport. nestled in the woods on Santa Fe River. $600/ ninth. Call 386-496-2030. WASHINGTON SQUARE Apts. Hawthorne. FL. 1 & 2 Bedrooms. Rental as- sistance available to qualified applicants. Equal opportunity pro- vider, Office hours are Tues & Fri. 8am to 12pm and 1pm to 5pm. Call ,352-481-9388. 52 Animals & Pets DANVILLE EXOTIC BIRDS Hand-raised cockatiels for sale, all colors. Call 386-867-0214. 53A Yard Sales ARCHERY BOWS PSE NOVA. Never shot. $180. Bear white-tail 2. has case. sites. detach- able quiver and arrows. $150. Call 904-966- 0631. BIG YARD SALE 417 Edwards Road in front of boutique. Sat only! 8am lit 2pm. Clothing, home interior, a little bit of ev- erything. BIG YARD SALE across from Wal-Mart. 13948 SE 48th Ave. Sat from 8am to 2pm. HOME INTERIORS & Tupperware scratch and dent sale. 1730 Raiford Road. Starke. 352-745- 1106 or 904-364-7790. Saturday, 8am-5pm. SATURDAY. NOVEMBER 18. 8AM-2PM. 1512 Patmarlin St.. Starke (Green Acres area). YARD SALE- THURSDAY. FRIDAY. SATURDAY. AND SUNDAY. 7 miles south ol Starke on Hwy 30.1 at CR221 South F R K Self Storage. YARD SALE CORNER OF CR229 AND CR225. Friday. Saturday and Sunday, 8am-5pm. Lots of everything, 904-964- 2453. UNION Tree Service "We Specialize in Dangerous Trees" NO JOB TOO BIG OR TOO SMALL Licensed & Insured Residential & Commercial For the Best Prices & Job for ALL your tree care needs contact Albert Andrews at 386-867-0214 or VE WANT JR LISTING mmercial & Residential ingrid Smith Real Estate Broker Ronnie Norman Shella Daugherty Sales-Associate Sales-Associale ' -",% Stacy Hendrix Sales-Associale Erica Norman ChamelleWhittemnr Sales-Associate Sales-Associate Irn~d. Lourcov Sales~suAclate Pre- Cdo'structioni Golf Community Large lots & condos Qs/ deepwater. marsh, oolf. nature views. Gated. Golf. Fitness Center. tennis. Trails. Docks. S70k's. $300k. (877)266-7376. 12 ACRES/LAKEFRONT/$. 99.900 239 feet of US Corp Frontage on beautiful. GA/FL'Pre-Construction Grand Opening. 20 AC $99.900. Pay tfo Closing Costs. Terrific opp'ty to own 20 acres in GA. Coastal region. New survey. subdivision potential, excel financing at the unbelievable price of $99.900. CALL NOW! (800)898-4409 XI002 CLP-GA Land Services LLC. Licensed Real Estate Broker. MAINE SPORTING PARADISE! 500 ACRES only $299.900. Hunters & fishing enthusiasts wanted Private 500 acre parcel of land ideal for hunting offers access to crystal -clear trout & salmon stream- unbelievable fishing. NEW TO MARKET! Great owner financing. Call L&S Rhy (207)78 r-3343. Steel Buildings STEEL BUILDINGS. Factory Deals. Save $$$. 40 x 60' to 100 x 200'. Ex: 50 x 100 x 12' = S3.60/sq fi. (800)658- 2885. ww t.rigidbi lding.coim. SPECIAL BUILDING SALE..."DON'T MISS IT!" December deli erv or deposit holds tiil spring' 25'x40" xl2' $4800. 40'x60 x16' S12.800. From end optional. Other sizes " I"'li 'i ," Pioneer. h h.- 422. ind. .\bundant wildlife. Recreational paradise. Low taxes. EZ terms. Call Utah R ,..., LLC. (888)54 " BEAUTIFUL N:' CAROLINA. ESCAPE THE HEAT IN THE BEAUTIFUL PEACEFUL MOUNTA INS OF WESTERN NC Homes. Cabins. Acreaae & INVESTMENTS. " CHEROKEE MOUNTA IN G M AC REAL E S T ATE. cherokeemoiuntai nrealtmy.co m Call for free brochure (800)841-5868. BEAUTIFUL BLUE RIDGE. NC Mountain Views. 8+ Acre Mountain Estate. Heavily Wooded with StreamI. EZ Financing- $49.900. (8X00)230-6380. ext. 120. View Western North Carolina. North Georgia. Eastern TN. Real Estate. Excellent retirement area. Very affordable homes. cabins. land. Low taxes. Good pa.vingt jobs available. F. MURPHY. NORTH CAROLINA AAH Affordable Homes in the Mountains. Affordable Homes. Mountain Cabins and Land. CALL FOR FREE BROCHURE (877)837-2288 EXIT .REALTY, MOUNTAIN VIEW PROPERTIES,. Norlh Carolina Cool Mountain Air. Views & Streams. Homes. Cabins & Acreaae./ FREE BROCHURE (800)642- 5333. Realty Of Murphy 317 Peachtree St. Murphy. N C. 28 90 6.. 1+ ACRETN HOMESITE 1.8 ACRES large lot with nice view. level building site on top. Stone, oiltcroppinas for natural landscaping. Pond on the east side. 'Close to larme state park Only $89.901)! Call (866)292-5769. NC MOUNTAIN 7 acres, on mountain top. view. trees. waterfall & large public lake nearby pa\ed pri\ale access." heated comIllun$iiv. $994.500 owner t866)789-8535. C'Oistal Georgia- Neot. Only 4 pIr el 0"u - Fin avail ;'4. I Ext 1285 A Bar Sales Inc. 7 days 7amr-7pm Medical Supplies FREE DIABETIC SUPPLIES! MEDICARE PATIENTS! Call Us Toll Free (866)294-3476 and receive a FREE METER! Atm-M-Ted Quality Diabetic Supplies'. Miscellaneous ATTEND COLLEGE ONLINE from Home. 'Medical. "Business. *Paralegal. "Computers "Criminal Justice. Job Ilacemient assistance. Computer provided: Financial Aid if qualified. Call (866)858- 2121 v ch.conm. DIVORCES275- $350*COVERS children,. etc. Only one signature required! "Excludes govt. fees! Call weekdays (800)462-2000. ext.600. ( 8 a m-6p m ) Alta Divorce. Ll.C. Established 1977. AIRLINES ARE HIRING Train for high paying Aviation Maintenance Career. FAA approved program. Job placementI assistance. CALL Aviation Institute of Maintenance (888).149- 5387. Real Estate Gulf front lots $595k. Homes starting mid $300k. New master planned ocean front community on beautiful Mustang Island. near Corpus Christi. TX. nm. (866)891-5163. NC Gated Lakefront Community. Pleasantly mild climate 1.5 acre.. 90 miles of shoreline. Ne\er offered before with 201 pre- develop memn discount's. 901. financing. Call (800)709-5253. WYOMING RANCH DISPERSAL 35 acres - 49.900: 50 .acres - S59.900. Snow-capped 1m rrun I a ided b e s. Surrounded by gov'l Rusty Eddy at 386-466-5987 We Se 'Property Fast Let us sell yours! .... BroKer . ny" sings ,; e - nances '; Sam iGbson Jennifer Lourcey .ns Sales-Associate Sales-Assoclate nsj ? "A Full Service Title Compai * Title insurance Real estate clo, * Title searches purchases, refi * Over 13 years .- cash transaction in the title industry ~ loan packages IS OAur Prihiity Catny SKenly Office Manager 107-F (904) 964-9222 TOLL FREE: 1-877-269-6577 415 E. Call St., Starke ~B~T~7iU6f~O~B~~'i~i~a~1;`2' h~Pli~L~ederJDb*?r~bPa=;;ra~'~aB~P~I~C~~ Nov. 16, 2006 TELEGRAPH, TIMES & MONITOR--B-SECTION Page 9B SiRead our Classifieds on the Where one call C classified A ds -L World Wide Web 0 does it al 1 a 984-6305.473-2210 496-2261 YARD SALE 101 SOUTH MYRTLE Saturday. Ram-? Toys. new Barbie dolls. Christmas decora- lions, beanie babies, Slulted animals. clothes - a little bit of everything. MULTI-FAMILY YARD SALE. 807 Parkwood PI. Starke Saturday. November 18. 7am-7 YARD SALE FRIDAY AND SATURDAY, 8am-lpm. One mile west of 301 on CR18. Wood-working tools, new gas range, small generator. sewing machine and household items. HUGE YARD SALE Fri- day, Saturday and Sun- day. Designer clothing, household items, lots of baby items, exercise bikes, furniture, curtains, brand new mattress. 1313 W Pratt St. 7am-? MULTI FAMILY YARD SALE Saturday. No- vember 18th, 7am-2pm. Golf clubs, tools. house- hold. etc. 1792 NE 154th St. MULTI FAMILY YARD SALE CR229. 5 miles past Starke Elementary School, Friday and Sat- urday, 8am-?, 904-368- 0129. Windows, table saw, dishes, comforters, household items, -name Randd women's, men's Lnd children's' clothing, infants up to' 12 years, Give yourself the perfect holiday gift! This beautiful three bedroom home plus bonus room and bonus garage is available in Green Acres. Under $300,000 Call for a viewing: (904) 364-8604 or (904) 964-7753 LEWIS WALKER ROOFING INC. "AFFORDABLE QUALITY" MI M w01 N l EN I N U H D lots with price tags still on. Good condition Graco playpen with built-in bas- sinet and changing table, toys and lots more All must go, come shop for Christmas! ATTENTION YARD SALE GOERS II you shopped al the yard sale at the Theressa Community Center off SR100 by Hope Baptist Church this past Saturday and bought a wooden crib or a playpen with built-in bassinet and changing table, please call me at 904-364-6463. I have some parts that you will need. I apologize lfor any ,inconvenience! NOVEMBER 17TH AND 18TH. 7AM-4PM. Last light north of Starke, take a right to the stop sign. take a left and first left at the pecan grove, first house on the left. Christ- mas stuff, motorcross tires, clothes, household, some furniture, just too much to list. Come and see us. The price is right. YARD SALE IN SUBDIVI- SION ACROSS FROM WALMART. Household items, baby items, toys, clothes, furniture. Satur- day, 8am-? 53B Keystone Yard Sales SAT 8AM TIL 2PM. 7692 Kaibab Ave, in Eg Tree Lakes. 2 FAMILIES Fri& Sat. Nov. 17 & 18. 6836 Deer Springs Road. 8:30am to 4:00pm. Lots of things. HUGE YARD SALE Post- masters retirement vil- lage clubhouse. Hutschinson Ave. off CR 214. Fri & Sat, Nov 17 & 18. 8am til 3pm. NOVEMBER 17 AND 18, 8AM-4PM. 5154 SE 7th Ave, look for signs. Freezer, some antiques, tools, household appli- ances, some old stamps. Christmas items, smoker. lots of stuff. SATURDAY, 8AM-12PM, 445 NIGHTINGALE ST. Computer desk, games. toys, puzzles, household items, books, old-time push mower. LARGE YARD SALE - men's table, clothing, fur- niture and misc. Beta Sigma Phi, 426 SE 28th Loop, Geneva Lake Es- tates. Saturday, Novem- ber 18, 8am-4pm. HIGHRIDGE ESTATES,- 6398 Cascade Dr (enter Highridge, turn left, first street on right). Saturday. November 18,8am-3pm. Boys/baby clothes, plus- size clothes, shoes. purses, baby items, jew- elry, Christmas items. material, floral arrange- QUALITY ff OMIE&, INC'. ments, lots ol misc Can- celled if raining. BIG YARD SALE FRIDAY AND SATURDAY. 6409 Beloit Ave, Highridge Es- tates, follow signs from SR100, 8am-? 53C Lake Butler Yard Sales HUGE MULTI-FAMILY AN- NUAL GARAGE SALE. Saturday, November 18th, 7am-? Whitehead/ Reiman homes- SW 11th St., Lake Butler. Starcraft Pop-up camper, furniture, couches, end tables, di- nette set with chairs, small refrigerator, bunk beds, mirrors, pictures, blankets, comforters, lamps, Showtime Rotis- serie, skillets, flatware, lots of kitchenware, tow- els, sheets, awesome clothing (Old Navy, American Eagle. Gap. Kenneth Cole, etc.), su- per nice shoes, sneakers, gorgeous infant/baby stuff and clothes, videos, DVDs, antique and col- lectible dolls, some an- tiques, sporting goods and clothes and much, - much more. All clean, super condition and nicely 55 Wanted LOOKING TO BUY PLANTED PINE TREES. Slash, loblolly, long leaf. 3-5 years old, 10-16 feet -tall. We pay top dollar. references available. Call 352-494-6653. USED CHRISTMAS DE- COR FOR THE NEEDY. Looking for Christmas trees, ornaments, lights, tree toppers. wreaths, anything Christmas. Call 904-964-2835. .,iii.i, Brand new still .:.. -,d Can deliver. Retail $5800. sacrifice $1100. 352-377-9846. ...' MATTRESS TWIN sets, $89,. full sets 1 :9., Queen sets $159, King sets $189. Mattress Fac-,, tory, 441 East Brownlee, St. Save a lot. Cash and FOR SALE Get ready for Hunting Season! I have several used Cobra 29 CB Radios for sale that are priced right. Have a few antennas, coax, other misc. items. 386-496-1215 before 9 pm please FOR SALE 2 Parcels 13+ Acres in all 500 ft frontage on 301 South-. Only 3/10 mile from Super Walmart. Office 2800 sq ft Building Mini-storage and Barn *Ideal Location* Call (904) 964.3827 S--CALL TODAY! 904-964-400 866-964-4207 1107 S. Walnut S Starke, Florida (Located Behind Bradfor Cmounry Eyes Center) KEYSTON Par o:th Plm Sae yOwe Sae Qit 2 B/ I + Bons Boo carry. Call Sonia at 352- 473-7173 or 904-964- 3888. BED-QUEEN orthopedic Pillowtop mattress and box. Name brand, new in plastic, with warranty. Can deliver. Sacrifice $100. Call 352-372-8588. TWO OLDER TRACTORS John Deere, David Brown. For information. call 386-431-9230 or cell, 352-745-8282. SPA/HOT TUB 20 JETS, 5HP, COVER, warranty. Retail, $4,800, sacrifice $2,695. Call 352-484- 0820. ADJUSTABLE BED - TWIN, extra long, elec- tric, multi-positional, memory foam mattress. $750, call 352-378-4977. BRAND NEW QUEEN SIZE MATTRESS still in plastic and box. Paid $900. will sell for $400. Exercise bike, all digital, $50. Cardiofit total work- out machine, $50. Call 904-964-2870. NEW GENERATOR - NEVER USED, electric start, $800 firm. Also, jazzy power chair, excel- lent condition, candy apple red, $5,000 firm. Call 904-964-5405. PA EQUIPMENT PRO- FESSIONAL SOUND EQUIPMENT. Too much to list, very good condi- tion. Call 904-964-8325.. KENMORE DISHWASHER 3/4 built in. Almost new. Call 352-284-7774 any- time. BACK HOE 1973 FORD 4500 TLB (tractor, loader, back hoe). Motor, alter- nator, starter, battery all fairly new. Runs good. $7.000 OBO. Call 352- 473-9913 or 904-327- 2324. KEYSTONE PACK RAT - Kinderdraft white chang- ing table and 4 drawers, all-in-one, excellent con- dition. $150 OBO. Elec- tric heaters, $10-$20. 59 Personal Services BRADFORD LIMEROCK SALES. Limerock, crush crete, asphalt millings. building sands. gravels. tractor work. We haul, we spread. Business 904- 782-3172. mobile 904- 509-9126. Monday through Saturday. CLARK FOUNDATION REPAIRS, INC. Correc- tion of termite & water- damaged wood & sills. Leveling & raising . Houses/Bldgs. Pier Re- placement & alignment. Free Estimates: Danny (Buddy) Clark, (904)-284-, 2333 or 1-800-288-0633. FLORIDA CREDIT UNION has morfey to lend forK Call Today 1 (904) 964-6312 ]". T.H.E. Apartments 922 E. Brownlee St. Starke, Florida Newly Remodelerd 2 & 3 Bedrooms Available Rrm is based on Income Water, Sewer On-Site Laundry Facility & Play Areas Office Open: Monday Friday 8:00 to 4:30 p.m. Call (904) 964-7133 t" i:,:. r : r ,. ; jI i&N :' .F.,.-0.. "Come sfrai (it [o Ifo 'so,~ IN VAN -F-1IOfN I() R1tA C R~efinance & )0 t rd ROOF FREE REPAIRS RE-ROOFS EXTENDED MOBILE HOMES METAL SINGLES WARRANTY NEW ROOFS FLAT ROOF LICENSED TILE WOOD SHINGLES LOW SLOPED & MAINTENANCE GRAVEL INSURED __ STORM DAMAGE **THE BEST POSSIBLE ROOF AT THE BEST POSSIBLE PRICE" PO Box 82 Office: 386-497-1419 $155,000 Toll Free 1-866-9LW-ROOF 3/1.5 on 10+ acres in Ot. White, FL 32038 Fax: 386-497-1452 Starke (fish pond)' REDUCED! $85,500 1 acre on Ashley Lake Cleared w/well & power pole $34,900 Crystal Lake homesite. .5 AC cleared. A' Aiiun ofCenIral Pacific Noitga Purchases lge : HA-VA: ; Conventional- -New Cnstruction - Home Equity Loans ~ No Income Verification Loans boemongagenuka com. $165,000 Access to Crystal Lake. 3/1.5 w/detached shop. "CIDCI MTIITM I $225,000 3/2 on 2+AC, 2-car garage and shop $39,900 $415,000 Cleared residential lot, 25 AC between paved road. Melrose & Hawthorne $49,900 $115,000 Residential lot.' 9 AC. Just Listed. Triest Ave. Keystone Heights 1 Cal/M sa G 'afayat.. 352-494-1829 rm 7396 SR-21 N., Keystone Heights 1 | See MeLissa's listings at: M ss n ar Producer ALTOmelissa@helenhersey.com Multi-MlIllhn Dollar Producer PEALTOS meljssa@helenhersey.com M H. & land packages. 1- 800-284-1144. CUSTOM CUTS Lawn & Landscape, customized lawn care. sod. trimming, landscape design. Rea- sonable rates, free esti- mates. Commercial & residential. Licensed and insured. Call 386-496- 2820. if no answer please leave message. SECRETARIAL SER- VICES Typesetting. re- sumes, etc. Call Melissa at 904-364-6463. CNA WITH 18 YEARS EX- PERIENCE. Will do pri- vate duty care for you or your loved one in your home. Please call Judith, 386-496-2019. TEENAGER LOOKING FOR BABYSITTING JOBS. Weekends mostly. 8 hour childcare course completed. Please call 904-964- 4924. Stump Grinding Tractor work Debris Removal ECONOMY STU James &.finda Daileys Owners & Operators Licensed & Insured REMODELING, ADDING AN ADDITION. need some help on a small project? Call Michael Byrne. State of Florida Licensed Building Con- tractor for a quote at 352- 473-0185. Monday Fri- day, 9am-4pm. If unavail- able please leave a mes- sage and our Office Man- ager will return your call. AFFORDABLE, DEPEND- ABLE house cleaning, weekly, biweekly. monthly or new construc- tion & dry loam carpet shampooing, windows. Call for free quote 904- 769-1541. CHILDCARE IN MY LAKE BUTLER HOME. 30+ years experience. All hours, great rate, bal- anded meals. Call 386- 496-1062. LANDSCAPE AND IRRI- GATION Clean-ups., mowing. irrigation, instal- MP GRINDING INC. (904) 769-9641 352) 284-1977 Cell ATTENTION "Yard Sale Goers" If you.went to the yard sale at the Teressa Community Center last Saturday and bought a wooden crib or the playpen with built-in bassinet and changing table, please call (904) 364-6463. I have some parts that go to these items that you will need! Keystone Hauling & Handyman Service, LLC *Carpenift *u sfahgMwng *omeRepair *TreeTnm=g& Rmnoal w*Pri Wadng *SiteOeancU *OddJobs *-1asxPunmial *Ya.d Work P-ie Baiuk & QpnskMuIh SGmardm RoNo-TIfng ie Forkale | II fe ha ... J. .* ., i* I T r , O ner. Kern' (thiford 'l352-473-710 IMoie35-460-,a .1 American SDream of Northeast Florida,Inc. R EA LTOl4R So 205 N. Temple Ave. Starke c(104] 964-5424 STARKE. 4BR/1.5BA ALL BRICK HOME IN TOWN. HOME IS IN A GREAT LOCATION AND SITS ON A LARGE LOT. $99,900. MNLS#331597. STARKE. 3BR/2BA. WeU kept home features new roof, water softener, screened porch, Ige. back yard w/storage shed. Sprinkler system. $194,000. MLS#321480. A W Business Has Been Good... And We Are Sharing Our Success With You! ALL HOMES ON THE LOT REDUCED! , JiaOy Modadsf!/ MORE HOME ~ MORE LAND SAll credit applications accepted! me ScotBilt TownHomes General en -ay Too | 0 Visit Us-Before You Buy! c Jerry's Quality Homes | S .,.(352) 473-9005 ...-,, 6969.SR21N SKeystone Height FL ,g ... - Jerry Ted JoAnn AW 'I 5' m "" """"" True 30-year fixed rate commercial loans (WITH GUARANTEED RATE REDUCTION EVERY 5 YEARS WITH GOOD PAYMENT HISTORY) S904-964-8111 TOLL FREE 866-964-8111 105 Edwards Rd., Starke I - --mp mmmmb Page 10B TELEGRAPH, TIMES & MONITOR--B-SECTION Nov. 16, 2006 Read our Classifieds on the ,, where one call /<! Classified A ds World Wide Web 9d oes5ita/# 964-6305'473-2210 496-2261 lahonr service and ie- p,aii h liqh qualtv land- scapo lightning Visa and Maslercard accepted Call 386-196-1017 HOUSE CLEANING HOLIDAY SPECIAL. Free estimates No job too big or too small. With references. Call 904- 368-0591 or 352-562- 9924 NEED SOMETHING cleaned? Call me! Rea- sonable rates Power washing, clean back yards, garages. etc. Call 904-964-3704. 65 Help Wanted EXPERIENCED BACK HOE OPERATOR with CDL Class A. F/T. M-F. Apply in person. Dampier Septic Tank. 7030 NW 23rd Way. Gainesville. 352-378-2659. DFWP. EOE. CARE GIVER 2 years ex- perience working with riderly or disabled cli- ents. 2 or 3 days per week. Su-EI's Retire- iment Home. Hampton. Phone 352-468-2619. COMPANY SPECIALIZING in Erosion control now hluring the following posi- lions' Crew leaders, equipment operators, la- borers. Class ACDLdriv- ers- valid Drivers license a Must! Fax resume to 904-275-3292 or call 904-275-4960. EOE. Drug Free Workplace. LOCAL CLEANING SER- VICE looking for part- lime help 20-30 hrs weekly. Must have refer- inces and a background check: Must be honest. reliable and motivated. Contact Elena at 904- 364-6455. COME JOIN THE FAMILY- L.IKE atmosphere and work at Windsor Manor. Open positions for CNA's ,ill skills), maintenance issislant. RN weekend supervisor and dietary ,ids Fill out applications alt 602 E Laura St.. Starke 32091 or tax resume to 904-964-6621. Call 904- 964-3383 for appoint- iment. EEOC/DFWP. CAREGIVER FOR .ELD- ERLY LADY weekend shifts. Call Lorene. 352- .173-7393. BUS DRIVERS NEEDED Ior Union County School. Sleady work. 40/hr CDL training available. Call 386-496-2182. Mike or BDenita. PRESCHOOL TEACHERS WANTED. Sunday Sat- urday. 6am-10pm. In- fants through 6th grade. Little Folks University Child Care Center in Gra- ham. FL. 352-485-1427. OPEN POSITION AT ROAD DEPT.!SOLID WASTE 'The Union County Solid Waste has ,in open position for a full lime employee. You must have a valid class B CDL and you must be able to pass a background check and be approved by the Department of Correc- lions to work with inmate laborers. The work schedule is Monday Through Friday from 7:30am-4:00pm with a thirty minute lunch break. Please apply at the Road Department or the Board of Commission Office from 8:00am-4:00pm. Monday through Friday. Applications will be taken until 141/23/06. HELPER NEEDED for home repair work. Call 352-475-1596. leave a message. , Driveways Sidewalks Slabs Footings *Decorative Concrete Coating in many colors Pumping & Finishing FREE ESTIMATES. Bus: (904) 964-3827 Mobile: (904) 364-7153 SEEKING PERSON with extensive Equine ,xperi- ence accu- rate and willing to do rou- tine and detailed work. DFWP. 352-473-4984. 2ND SHIFT WIL TRAIN. with great potential for advancement. Hours are Monday, 3pm-11:30pm. Starting salary will be $7.75/hr. American Ac- cess Technologies lo- cated in Keystone Heights. DFWP. good benefits, call 352-473- 4984. DELIVERY/WAREHOUSE career opportunity: We are looking for depend- able, self motivated people who enjoy work-. ing in a retail delivery/ warehouse position. It you have a valid drivers license, can meet the DOT driving require- ments for vehicles within GVWR greater than 10,000 lbs but less than 26.000 Ibs. are able to push, pull, lift and/or carry material up to 100 lbs. please consider joining our team. The position offers competitive com- pensation and benefits package. Apply in person at Farmers Furniture. 835 W Walnut St, Starke. Only candidates selected for an interview will be contacted. EOE. BARTENDER WANTED - . January 27th for the Steel Buildings Factory Direct Savings Delivered to your door step All sizes All applications 904-769-6305 'JSEPI Chamber Banquet. Call Kim at 904-964-5278. REFRIGERATION ME- CHANIC The University of Florida. Department of Housing and Residence Education is currently re- cruiting for a Refrigera- tion Mechanic. This po- sition requires the completion of an ap- proved program in air conditioning, refrigeration and heating: or a high school diploma and four years appropriate experi- ence. Universal Certifi- cation 1 and 2 is required. A qualified candidate will possess the knowledge of the procedures and methods for maintaining, repairing and replacing refrigeration units, com- ponents and their support structure. Ability to read blueprints and schematic drawings and knowledge in DDC controls is pre- ferred. A post-offer health assessment and criminal background check will be conducted. Expected starting salary is $12.50 hourly. To view applica- tion instructions and corn plite an online resume, please visit. edu/job. Reference num- ber for this vacancy is 0700657 and this position will close on 11/22/2006. If an accommodation due W 62 to a disability is needed to apply for this position, please call 352-392-4621 or the Florida Relay Sys- tem at 800-955-8771 (TDD). An Equal Oppor- tunity/Affirmative Action Institution. MASON THE UNIVER- SITY OF FLORIDA, De- partment of Housing & Residence Education is currently recruiting for a Mason. This position re- quires the completion of an apprenticeship pro- gram in Masonry, or a high school diploma and four years of appropriate experience. A qualified candidate will possess the skills to perform skilled masonry work at journeyman level with ceramic tile, brick, ce- ment blocks and plaster. General construction knowledge is preferred. A post-offer health as- sessment and criminal background check will be conducted. Expected starting salary is $10.50 per hour, To view appli- cation instructions and complete an online re- sume, please visit. Ref- erence number for this vacancy is 0700645 and this position will close on 11/22/2006. II an accom- modation due to a disabil- * Cabinets Doors * Windows Sinks e Buy & Sell New & Used Building Materials 352-379-4600 Z2 S.E. 2nd St. Gainesville, FL FIBERGLASS BOAT REPAIR All Makes All Models 30+ years experience ALL CRAFT MARINE 904-964-8228 BANANA BAY LANDSCAPE INC. ..... Spedaliz g in , PALMS and TROPICAL Residential ~ Commercial ndscape with Sophistication & Attitude dy owned & operated by Charlie Revay 352-214-1320 Small or Large Parcels. With or Without Homes. Call Glen Lourcey W 352-485:-1818 ity is needed to apply for this position, please call 352-392-4621 or the Piorida Relay System at 800-955-8771 (TDD) An Equal Opportunity/Affir- mative Action Institution TRAINER FOR DEVELOP- MENTAL DISABLED ADULTS. Responsible for setting up training ac- tivities in accessing com- rTiunity resources. Must have reliable transporta- tion. Have clean driving record, background and drug test. Reimburse- ment for usage of car is available. COME JOIN the family at Windsor Manor-a 120 bed long term care faciltiy located in Starke. We are close to Orange Park. Lake Butler. Gainesville or Lawtey. We need staff to assist in the dietary department and CNA's for evening and night shifts. Apply in person at 602 E. Laura St. Starke 32091. Call J. Richardson for more in- formation at 904-964- 3383 EOE/DFWP 120 BED SKILLED FACIL- ITY seeking a special RN to be an ADON of 60 bed uniL. We are close to Or- ange Park. Lake Butler. Gainesville or Lawtey We need staff to assist in the dietary department and CNA's for evening and night shifts. Apply in person at 602 E. Laura St. Starke 32091 Call Vicky Kelly for more infor- mation at 904-964-3383. EOE/DFWP. ACORN MEDICAL CLINIC is seeking an experienced Social Services case worker 1-2 days a week. Must have knowledge of Medicare & Medicade programs and community resources Bilingual a plus. Fax resume to Chris at the Acorn Clinic, Brooker, FL 352-485- 2927. LOOKING FOR. H& R Block is now interviewing for the upcoming TAX SEASON. We have TAX PREPARATION and CUSTOMER SERVICE MANAGER positions available in STARKE KEYSTONE HEIGHTS HAWTHORNE For more information please call Beverly Koon at 352-493-4394 or fax your resume to 352-528-4016 SANTA FE COMMUNITY COLLEGE Vice President For Development ,Application Deadline: January 15, 2007 For additional information visit: or call Human Resources at 352-395-5185 CHILDCAREafterschool and weekends. 3 days/ wk Interested candi- dates please call 352- 473-6581 for more infor- mation. HORSE TRAINING STABLE IN KEYSTONE HEIGHTS needs part- time help. .Cleaning. care. bleeding. Call 352- 473-2511. HIRING OTR DRIVER - minimum 2 years experi- ence. Call Charles. 904- 449-9043 or 904-368- 0725. SENIOR SERVICES CASE MANAGER Union County. Responsible for client case records, home visits, cent assess- ments. case plans, and case management De- sirable qualifications: 4- year college degree with course work in Social Work, Sociology. Psy- chology. Nursing. Geron- tology, and/or related fields. Two years experi- ence in Gerontology and/ or related fields. Experi- ence may be substituted for the college required. Submit resume to SREC, Inc.. PO Box 70, Live Oak. FL 32064,386-362- 4115. Deadline: Novem- ber 28, 2006. Voice/TDD Affirmative Action Em- ployer. Driver WE'RE BRINGING JOBS TO YOU! CRST Van Expedited is hiring Truck Drivers in YOUR area. No Experience? Need Training? We offer Company Sponsored Training, Day one Benefits and Guaranteed Hometime. Start Your New Career With Us Today! Call for more details. 800-913-2778 In Just 71 Days... you can have the skills you need to get a job as a Dental Assistant 10-week- course. Saturday only Tuition $2.450 Payment Plans Call -Christi @ .Iacksonville Dental Assistant School for info packet 904-398-3401 next class starts: March 3, 2007 Reg. by FL Commission for Independent Education Help Wanted: Dental Assistant 5 Yr. Experience Required Fax Resume to: 904-396-4924 Don't Have Experience Yet? See the ad for Jacksonville Dental Assistant School in the Education Section of the Classified Ads ofthis paper. It starts with the Headline: "IN JUST 71 DAYS You can Have The Skills You Need To Get A Job As A Dental Assistant." Driver HOME WEEKENDS! PGT Trucking Is Hiring Flatbed Drivers TOP PAY/BENEFITS! Students Welcome CDL-A License Required Company Drivers and 0/0's Call: 1-866-PGT-FLAT (1-866-748-3528) BIG LIVING ESTATE AUCTION SATURDAY, NOV. 18, 10 A.M, 3.5 miles west of Interlachen on State Road 20, turn left on Martha, then right on Cologne. Watch for s/gns. Antique & other furniture, load of antique smalls, lots of china, baking, cooking, & other kitchen items. Small appliances, linens, lift chair, washer & dryer, refrigerator, 2 large storage sheds, '98 Chevy Corsica Car, & lots more, Bring your chairs. Terms of auction: Cash, check w/lD, Visa, MasterCard & Debit Card. 12% Buyer's Premium plus tax. 2% B.P. discount w/cash/check. KEYSTONE AUCTION SERVICE AB#1648, Col. Ken Mitchell, AU #2225 5500 SE 3rd Ave., Keystone Heights, FL 32656. Call for information (352) 473-9008 We Cart it CONCRETE A OPEN 24/7" wOttner: Buddyl Browder 19563 NWSR 16 Starke, FL NOW HIRING CLASS A CDL DRIVERS WE OFFER A COMPETITIVE PAY ANi) Quality Assurance Position requires: repetitive heavy lifting of product cases, constant walking/standing, bending, twisting and stooping. Weekday (Tues -Fri) & Weekend (Sat Mon) Full-time & Part-time Positions * Wal-Mart's benefits include: Progressive wage Increases, discounts, 401(K), stock purchase plan, profit sharing, health benefits and career advancement opportunities. PerFcwrmance Food Group We Haul Redl-Mlxed Concrete in our 1-Yard Mixing Trailer from our plant to your rel-forms,. $149 oer yI + tax.. dollveredit youl SA I -yard = 80 sq. fIi. at 4" deep Short Wheel Base, Automatic, AC, 5.0L V8 302, Goose Neck Receiver in Bed, Draw-Tite Hitch, 2 New Tires. Has jumped timing... have all new parts to fix goes with truck. $1,500 Call 386-496-1215 before 9 pm please Driver Dedicated Regional Avg. $825 $1025/wk 65% preloaded/pretarped Jacksonville, FL Terminal CDL-A req'd 877-428--5627 Bobby Campbell Roofing, Inc. Licensed & Insured (904) 984-8304 FREE ESTIMATES! Lie. #CCC-132672 Employment opportunities available. Call for more information. WHITEHEAD BROS.,INC. LAKE CITY LOGISTICS Over-The-Road Drivers Needed! New trucks with ThermoKing APU's. 1800 watt inverters. top of the line leather seats, walk-in condo sleepers.,and new air- ride front suspension for a smoother ride than you have ever experienced. Home several nights most weeks as we have a good mixture of regional and over hlie nmd. Home most weekends. Personalized dispatching that comes froU only dispatching 25 trucks locally. Earn up to 310% of revenue immediately. NO WAITING!! New increased layover pay. Up to $100.00 per day. 2 weeks vacation. $1200.00 per year Safety Bonus. Driver ofl the Year bonus. Driver recruitment bon. . Medical and dental insurance. Need 2 years experience. CALL JIM OR DEBBIE LAWRENCE 904-368-0777 or 888-919-8898 oppol- --qmmm OOOPPPPPP- d Nc > TELEGRAPH, TIMES & MUN TOR--B-SECTION Page 11B Numbers continue to climb for Upward Soccer program BY CLIFF SMELLEY Telegraph Staff Writer Madison Street Baptist Church's Upward Soccer program has lived up to its name thus far as the number of participants has increased since the program's inception in 2004. This year, 190 children comprise more than 30 teams that take to the field behind Starke Elementary School every Saturday during the season. Jeff Summers, youth pastor at the Starke church, said there were 140 participants during the program's inaugural year, which was more than he anticipated. "Soccer's not real big in Bradford, but the numbers have grown each year, which is what we wanted it to do," Summers said. The Upward program is similar to any .other youth sports program in that it provides opportunities for both boys and girls who fall in a wide range of ages with four different leagues: instructional ,(4-5-year-olds), first-second ,grade, third-fourth grade and fifth-sixth grade. Where the program differs from others is that scores are not kept. The emphasis is not on winning, but on giving your best effort. Summers said winning is nice in athletics, but a team can put forth its very best effort and still not win. "That's just life, so the kids need to learn that winning and losing shouldn't define who you are," Summers said. Players are recognized for their efforts following every game. Every player receives star stickers, which are handed out in various categories. Also, coaches and/or family members talk to the players after the games about the difference Jesus Christ has made in their lives. After all, the program is considered a ministry, and Summers said he has been able to see it make a difference in some people's lives. He spoke of one man, whose children played last year, who came to know Christ. "Now he's coaching this year," Summers said. Madison Street Baptist Church plans to expand its Upward ministry with the addition of a basketball program upon completion of the church's family life center, which is currently under construction. Summers said the Upward programs are part of the church's way of reaching out into the community and trying to make it a better place.:' "I think we ought to give kids as many different opportunities in our community as we can," he said. That goes for any child, whether he or she attends the church or not. "We want as many kids to come as possible," Summers said. The Upward Soccer program will conclude its season with an awards program on Monday, Nov. 20. However, anyone interested in learning more about the program is encouraged to call the church office at (904) 964-7557. Maybe next year's number of kids playing will go even higher. "We're excited about what God has done through the soccer sports ministry," Summers said. The Madison Street Baptist Church Upward Soccer instructional league (4-5-year- olds) Meerkats are: (front, from left): Noah Preston, Ciarra Hopkins, Carson Johnson, Tyler Dunn, Taylor Jones, Whip Davis, (back, from left) coach Rachel Dunn and coach Ronni Spangler. Photo courtesy of Thornton Photography. .: m ^ The Madison Street Baptist Church Upward Soccer Instructional league (4-5-year-olds) Pandas are (from left): Alex Perez, Donnie Cannon, Jacob Cavin, coach James Cavin, Hunter Collins, Brooklyn Wiggins and Garfield Johns. Photo courtesy of Thornton Photography. The Madison Street Baptist Church Upward Soccer instructional league (4-5-year-olds) Squirrels are (from left): Emily O,Neal, David Kilgore, coach Speedy Wilkerson, Summer Fulgham and Jacob Wise. Photo courtesy of Thornton Photography. 41t : ~- -: ~ 4%4) ~ ~ I.. j - UK).. 1r .: 'Zr The Madison Street Baptist Church Upward Soccer Instructional league (4-5-year- olds) Rhinos are: (front, from left) Wyatt Everson, Cole Williams, Gage Jackson, Sarah Warren, Cheyenne Oschner, Stephanie Neesmith and (back) coach Jarrod Everson. Photo courtesy of Thornton Photography. The Madison Street Baptist Church Upward Soccer instructional league (4-5-year- olds) Chipmunks are (from left): Saige Whitaker, Zachary McRae, Ben Miller, coach Michael McRae, Wyatt Thomas, Justin Garrison and Jacob Garrison. Photo courtesy of Thornton Photography. The Madison Street Baptist Church Upward Soccer Instructional league (4-5-year- olds) Geckos are: (front, from left): Mason Griffis, Eli Hanson, Abbygayle Ames, Jace Oody, Brittney Hollingsworth, (back, from left) coach Hanna Johns, coach Tom Crawford and coach Gwen Crawford. Photo courtesy of Thornton Photography. Starke Kiwanians are accepting jacket donations The Kiwanis Club of Starke is sponsoring a "Jackets for Kids" drive to help families in need of jackets for the winter. Jackets are currently being collected at Town and Country Ford and Denmark Furniture. They may be dropped off any time during business hours. If you are in need of jackets, this is a no-questions-asked ' drive. Call Carol Still at (904) 964-7200 or (352) 235-6150. (local in the Starke area). READER Continued from p 3B brats who were told if you get in trouble your dad could lose his stripes and we wouldn't have as much money so you better keep your nose clean, and mom and dad meant that. I know you cried all the way from one place to the other when you had to move every two or three years but believe it or not, when you grow up, people will know the difference because you will be more mature, better educated and able to deal with almost any situation in your life. We salute you and thank you for him, or in a gas chamber testing a gas mask so that others would be safe, or walking the DMZ in Korea where shots were fired every day, or guarding the Berlin Wall or a thousand other duties that no one but military wives know about and worry about- during "peace" time. The wives and children of those who are wounded, whether it is a physical wound that we can easily see or a mental wound that only the wife and children can see, must tend to those they love for years and after a short while, the world forgets how their service to this country changed the lives not only of the veteran but of their family. The spouse of those who served in active combat deserve a special medal for their courage in keeping the homes going for their soldiers to return to and for sharing their courage with their spouses so they can concentrate on staying alive. And, of course, the wives and children of those who are presently serving where there is active combat going on need our daily encouragement and prayer. We need to remember that not only are the husbands and fathers aind sons serving in places like Iraq, sharing your parent with us Afghanistan, Korea and other so we can be safe and know hot-spots, but-their.wives.and you feel a great deal of pride im .hildren'Vhearts are there with your father or mother. Walk them and they are serving here tall and make them proud of them and they are serving here. on the home front. you. I want everyone to give any Will the wives and children wife of a veteran or an active of the men and women who duty GI a hug and say thank have served, or are serving in you for the times you didn't cry the Army, Air Force, Coast when your guy left because Guard, Marines, Navy, you wanted him to see a smile Merchant Marines, please stand on your face, for the letters you up. I salute you, for you too didn't write when things got have served. I am sure you feel tough and you didn't have the same sense of pride your GI anyone to turn to but you feels and have the right to stand didn't want him to worry, for right beside him. the times you worried and (I understand that women are prayed for his safety knowing now serving and men are that even if he wasn't in a "war having to stay at home and zone" he was on a missile keep the home fires burning so launcher, or riding across snow please don't take offense if I where crevasses existed that used wives in most places; if could open up and swallow you are a stay-at-home dad while your wife serves, I honor you too). Betty Warren Starke Knowledge-full, unfettered knowledge of its own heritage, of freedom's enemies, of the whole world of men'and ideas-this knowledge is a free people's surest strength. -Dwight D. Eisenhower MORE Continued from p 7B to and including Thanksgiving Day as National Farm-City Week. .n the seven days "leading. to and including. Thanksgiving Day, Farm-City Week is celebrated nationwide.' What are we celebrating? The American economy is strong, thanks to the interdependence of farms and cities. ' As the. president of the Bradford. Courage is what it takes to stand up and speak; courage is also what it takes to sit down and listen. -Winston Churchill Cats seem to go on the principle that it never does any harm to ask for what you want. -Joseph Wood Krutch Bradford County has deep roots in agriculture. All of our best-known festivals have their basis in agriculture. From beef cows, squash, and strawberries, to pine trees, these events bring folks together to celebrate harvesting of our locally grown commodities. Here in Bradford County there-are nearly 900'farms with about 180,314 acres in agricultural production. Bradford ranks thirty-fifth in the state in value of livestock items produced. Neither the farm nor the city can exist in isolation. Instead, the interdependence of the two creates jobs, products, markets and relationships that make our economy and nation strong. Join with us- in recognizing Bradford. James Gaskins, President Bradford County Farm Bureau fr~~ bi ... -- I . - i ". Page 12B TELEGRAPH, TIMES o iviONITOR-B-6-tu iiON Nov. 16, 2006 CHEVROLET OF STARKE 0( a4- In Stock ak Now 4 door sedan Automatic, Cruise Control, Rear Spoiler, Stk #C61004 . ... 7 ~'~iIO W~l ~~WL MWTIMH - aiy I Stk #T62015 if- lj[rli ~ IMMMEA~J HI 1 1 il;'u AT, Trailer Package, Power Windows, XM Radio, Stk #T64002 Y7~iL~7 Th LJ _2u J I NLe JLyV _.F A Stk #S71001 '00 FORD F-150 a '03 GMC SIERRA X-CAB OPM ;, : I 1' '149. or 7, li Sk #31 6,990" *03 CHEVY '03 FORD MUSTANG GT CONVERTIBLE '06 CHEVY COBALT tes. w ,d : .0, :;-i a '01 CHEVY 90 4X4 u*~di~t i I .-- Stk #9726 '00 GMC -IIMMY SI T 0-*AR^WMWWiBSISS^ Leather, Stk #C61010A ** I SPECIAL Stk #T72021A LA 0 0 Stk #9712 $11.98a' Stk#S72019A Dually, Stk #T62068A $16,990* '05 CHEVY _.OUINOX LT Stk #9717 $177988 CALL TODAY! (904) 964.7500 1-888.-4-1-CHEVY US Hwy 301 North Starke, FL "You're Never Too Far From A Great Deal!" Baldwin7 lJacksonvllle Lake City t Orange Park Lake T Sn-le Green Cove Spg Lake uer --Kingsly Lake S G n aido STARKE Key"tone Heights Oca la If Ii jiMf~ .CHEVRO LET 4JfiSrA __ ~~4,VA-qP ;CV "s"_~_~""~f~;~M~-r'; ;,7ppwwwk,4 2,m 1 i'll Te',-Tl -01111112~ ~k~pe' ......... .. ,,' the Neww 'rm~I[C am" ~-- ~'-~.3 Section C: Thursday, Nov. 16, 2006 Telegraph Times Monitor Bradford Army JROTC members Rachael Snyder and Tim Baxley speak with. residents of Bradford Terrace following a flag lowering ceremony in honor of Veterans Day. Area ceremonies salute heroes Starke ceremony honors those who served. BY TERESA STONE-IRWIN Telegraph Staff Writer At Charles J. Schaefer Veterans Memorial Park, members of the community came out to honor our nation's veterans on Nov. 11. In attendance were Starke Mayor Carolyn Spooner and. City Commissioner Danny Nugent. Commander Hank Williams opened the ceremony by saying that the.e origin of Veterans Day as we know it goes back to the end of World War I. "On the 11th hour of the 11th day of the 11th month, an armistice was signed that, ended World War I, Williams said. "The day was called 'Armistice Day' and was widely celebrated annually each Nov. 11 until the year 1954. "Near the end of the Korean conflict, then President Dwight Eisenhower changed the designation of Armistice Da) See HONOR p2C Blanding pays tribute to veterans. BY CLIFF SMELLEY Telegraph Staff Writer What's the definition of a hero? As far as Brig. Gen. John Perryman is concerned, it is one who has served this country as a member of its armedforces. With that it mind, Perryman and a small crowd at Campn BLinding paid tribute to those See TRIBUTE p2C i | V8 Engine, Super-Nice ".pg [Truck! Stk #7027A S ..Endurance, Leather, Off Road -[,: 4:. Pkg, Low Miles, All the toys!, GET YOUR BEST Let Jessica Whittemore,4 answer your Internet - uestions. lessica wbhlttemsre TOW 8,& COUNTRY FORD CREDkT RE-ESTABLISHING SUPER STORE:': NO HASSLE NO MARRASSME Employees of Mercantile Bank of Lake Butler include (1-r) Tammy Granger, Zack Smith, Joyce Tomlinson, Jill Raber, Billie Yon and Jennifer Jones. Mercantile Bank earns 'Best Place to Work' BY MARCIA MILLER Telegraph Staff Writer Mercantile Bank of Starker and Lake Butler was chosen as one of four Best Places to Work in the area, served by the North Florida Regional Chamber of Commerce and was presented with its award at' the banquet held Oct. 26. Mercantile's special employee benefit package was the main reason it was chosen as one of the Best Places to Work, but the competition included a variety of factors that can make a business a good place to work. Keystone Building Center in Keystone Heights, Touchstone Heating and Air of Lake Butler and the YMCA of Bradford and Union counties were the other three award winners. (Touchstone was featured last week and stories on the other two Dynamics Consulting is compiling the scores from all the businesses in all the categories and will release a report that details the average for the' entire area in each category-but not what each business scored in that category. That general report .will be ready in about one week. TheI only details about individual companies from the reports' that will be released to the public are those top few categories that earned the winners their plaques at the awards banquet. One of the programs that earned! Mercantile Bank its awards was its child care reimbursement program. Joe Flynn, senior vice president at Mercantile Bank, said the company spends $1 million each year reimbursing its employees for funds they spent on child care-a necessary expense for parents who work.- Of course, that $1 million is for all Mercantile Bank locations, not just the ones in Starke .and Lake Butler, the locations that earned the award. "That amount of money may \not be a lot to one of the larger banking firms, but to us, it is a big amount. But we want to See BANK p3C II IN THE COMFORT OF YOUR OWN HOME TOLL FREE II TOLL FREE 1 -800.224.2413 OPEN 24 HOURS .... own .U.ta n o l. .. ... ^^ .n new ior . US HWY 3S H T 01 *OUTH o STKE, -FL o 9,04-964-7F=200 TOWN&COUNTRY IL- i I Page 2C TELEGRAPH, TIMES & MONITOR--C-SECTION Nov. 16, 2006 TRIBUTE Continued from p 1C heroes with a Veterans Day ceremony on Nov. I1. Perryman, the featured speaker at the event, said the men and women who have served, and who currently serve, this country are "ordinary people placed in extraordinary circumstances." "(They are) men and women who know the meaning of selfless service, courage, duty, honor and country. They are the American heroes who sit to your left and right this morning. "History often records the valor of American veterans in terms of our units and armies, but the real history of the American armed forces is the story of each individual veteran who accepted his call to duty. "This gathering to honor'the American veterans- is a tribute to their glory and to their devotion to duty." Those veterans have been people from all walks of life, but Perryman said they all shared common bonds-they HONOR Continued from p 1C to Veterans Day and dedicated the name to the sacrifices made by all servicemen and servicewomen of all American wars. It specifically falls on the 11th day of November each year, rather than becoming just another holiday or three-day weekend, in order to ensure that veterans would be recognized appropriately- throughout our great country," said Williams, Boy Scouts Troop 70 was there to perform the placing of the wreaths, followed by the the Bradford Army JROTC with a flag-folding ceremony. Rachel Scott delivered the "U.S. Air Force Academy's Flag-Folding Ceremony" speech as fellow JROTC members folded an American flag for the demonstration. "The flag-folding ceremony represents the same religious principles on which our country was originally founded" coq j , "The portion of tie," said Scott. The first fold of our flag is a symbol of life. The .second fold is a symbol of our0 flagofthe UnitedStates lights for f. --fhlier, for he, too, hg.s,.given' his sons and difiufers for the defense of our country since they were first born. The 11th fold, in the eyes of a Hebrew citizen, represents the lower portion of the seal of King David and King stood firm and answered their nation's call to duty. "We gather today to honor the men and women of our armed forces who through the centuries have fought for a common cause," Perryman said. "They defended America when our borders, our people and our way of life have been threatened." Perryman did not want to just recognize those who served in the past, but those who also serve today in more than 100 nations around the world. They, too, have that common bond. "They follow the same oath of allegiance to our constitution that those who went before them swore to," Perryman said. "They go where they are sent, and they do what they are asked and much, much more. These common men and women have always done, and continue to do, uncommon things." It would be remiss to honor veterans and those serving today without also honoring military families, Perryman said. Their service is marked by their unwavering support for those servicemen while Brig. Gen. John . Perryman of the Solomon, and glorifies, in their 53rd Infantry t eyes, the God of Abraham, Brigade was . Isaac and Jacob. the featured - The 12th fold, in the eyes of speaker at the - a Christian citizen, represents Veterans Day, an emblem of eternity and, ceremony at glorifies, in their eyes, God the Camp Blanding. Father, the Son and the Holy Ghost. Scott continued by saying, "When the flag is completely folded, the stars are uppermost, reminding us of our national motto, 'In God We Trust.' After the flag is completely. folded and tucked in, it takes on the appearance of a cocked D f hat, ever reminding us of the badge and a Department of soldiers who served under Defense Staff badge. General George Washington Dampier began by saying he and the sailors and marines was sincerely honored for the who served under Captain opportunity to make a few John Paul Jones who were brief remarks concerning followed by their comrades America's veterans, including and shipmates in the Armed the men and women currently Forces of the United States, servicing in thealmed forces preserving for us the rights, "On behalf of the untold privileges and freedoms we number of people throughout enjoy today," said Scott. the history of this great nation The park's flag was then who have worn a uniform, I lowered to half-staff, being offer my thanks for their honored by a salute from the service. members of the JROTC and On this day, we the playingof "Taps." commemorate the service of thei ep veterans of all wars, speaker was retire nerin i ind William E.r(Bil) Dampsie. -, \.omen set aside theirci ili.an Dampier graduated from pursuits to serve their nation's Bradford High School and cause, defending the freedoms went on to serve over 37 years we often take for .granted, in the military. Dampier's preserving our. precious impressive list of credentials American heritage," said includes two Legion of Merit Dampier. medals, a Defense Meritorious lHe continued by saying that Service medal, Defense the service and commitments commendation medal, four of men and women-whether Army Meritorious Service '-voluntary or as sometimes medals, two Army required by law-has allowed Commendation medals, a the United States to attain and Special Forces tab, Master to sustain its reputation Parachutist badge, Airborne throughout the world as an Pathfinder badge, Army Staff honorable role model for truth and democracy. r Florida Twin Theatre All Seats $5.00 Before 6 p.m. 964-5451 iOPEN EVERY NIGHT* (Visit us on-line at)H -mni=a-I1=-- Starts Fri., Nov. 17 Robin Williams in Fri. 7:00, 9:00 'Sat. 4:55, 7:00, 9:00 Sun. 5:00, 7:05 Mon: Thurs. 7:30 Starts Fri., Nov. 17 Jesse Bradford in I FLAGS OF OUR FATHERS Fri. 8:00 Sat. 5:30, 8:00 Sun; 5:30 Mon. 7:15 Starts Wed., Nov. 22 Denzel Washington in DEJA Thurs., 7:15 Wed. -Thurs., 7:15 PARTRIDGE CARPET CLEANING We Use A Powerful Truck Mount Unit 3 Rooms for $59.95 (352) 475-3413 I CALL TODAY TO SCHEDULE YOUR APPOINTMENT Starke - Goff Coun"ry Club Banquet Facilities Clubhouse Driving Range VISIT OUR PRO SHOP GR 3BAT ORTAv MEMBERSHIPS AVAILABLE NO INITIATION FEE. r Al\ FAMILY-SENIORSEASONALOR 904-964-544 II STUDENT AVAILABLE. SR 230 E (2 miles'east of'US1) Strke '. : :. ", p Brooker resident Frank Towers (left) talks to fellow veteran Frank Heppner of Orange Park following the conclusion of the Camp Blanding Veterans Day ceremony. ceremony. Infant Sun Men they are away from home. "They may not carry a rifle," Perryman said, "but they carry many burdens until their loved ones return home. Sadly, some never do. Whenever a serviceman falls in service to our nation, it is the family that suffers the most. "When we honor our veterans, it is only right that we thank their family members and honor them for their sacrifices." Perryman is commander of the Florida Army National Guard's 53"' Infantry Brigade. Now Open! Little Folks University Child Care Center nts 6th grade day-Saturday 6AM-10PM tion this ad and pay No Enrollment Fee Parents' Night Out! Need to start your holiday shopping? Drop in spaces available! S.. Before/After School Care Located in Graham, just minutes from Starke (352) 485-1427 GET FREE NOW. 12M by Molorla "Their service has also provided and guaranteed citizens of the United,States with freedoms that are largely not available to people of many other countries,". Dampier said. "There is nothing more fundamental for the people of our country to know than the fact that freedom is not free:.It has been purchased and repurchased time and time again by men and women of our country who have given their lives that we may remain free. They were willing and ready to stand firm for those beliefs,: ad principles that we, as Americans, holddear.- ,- .., \' *'^"- .. '-,: % ', A ,, N.ti 1, 9 ,,I IdI ,e $4999 _ $49 99 aler t, all .'i leb.tal. Free Incoming Plan : ' sling at All incoming calls _ $4999/. FREE from anyone, from anywhere. 0 Day Rhik- hn Gwaltw. NEXTnL ownSprfdnt Stop bytodayl H3-appy 966-CELL Sta urte (Next to Grannies Restaurant) ~3,9,,.n&,~,baIota',3,n'anm93,$ba,.$M, ,S.,w.w.bd.3kO~rm$2i3$%6$4vsbttS.katan3~.a,.d.2ty.tAt~ 9'W',O6& .dk4~b, t, lll~IO$ 3,n.t 0,1 mOd din3s Lam 9.,1M~ OOc**GajtAIWIlmbI,9h. / baIo$Mbt.t& ~b,$3n&LW.tM ~ lZI anAk&.3$M1Mb*n.9t,,/.,/.tIsPflt&,0fltal~ 212 East Call St., Starke ,,, (904) 964-3100 R T res.-Frl, 10-6 Sat. 10-5 The Bradford County Telegraph, Union County Times and Lake Region Monitor will have early deadline the week of Thanksgiving, Nov. 23. Classified and retail advertising, must be received no later than Monday, Nov. 20, at 3 p.m., I to accommodation the holiday printing schedule. Thanks and have a great holiday! ".9 Yfrmal'Wear Sale $75$100 S Prom --Black & White Affair - Snowball Chamber Banquet TWO WEEKS ONLY! 11/16-11/30 A 4 m He recently completed a one- year deployment to Afghanistan as commander of Joint Task Force Phoenix. He said he is proud to carry on in veterans' footsteps and he thanked them for what they had done. "Speaking on behalf of all those in uniform today, we're proud to stand in the ranks among you and carry on the legacy you've left us,",1 Perry.man said. "Every morning, when we wake up in a free'land, it's because of men and women like yourselves." ` - Ho (i days.1 unrurhlym~ulslMnawlla;mne~rr~anaa~h 11~1. Nov. 16, 2006 TELEGRAPH, TIMES & MONITOR--C-SECTION Page 3C ~. -I I.. ii Mercantile Bank of Starke has nine employees. They are (1-r) Scott Schiller, Nancy Blackall, Suzanne Lewis, Jaclyn Drew, Haley Letcher, Tracy Reichert, Loretta Edwards, Patty Morris and Ryan Grady. BANK Continued from p 1C assist our employees in any way we can," said Flynn. Another program that earned Mercantile Bank the award is called the Elevate program. "Basically, employees are provided with an incentive to do the right thing for the customer," said Flynn. "Employees get a cash award for doing the right thing. We expect employees to talk to customers about their true financial needs and help them meet those needs." Flynn said the incentive for the employee is not to sign customers up for additional services they don't need, but to make sure the services provided fit the needs of the customer. Mercantile Bank employees are also given paid .insurance policies for both life insurance and accidental death and dismemberment that equal two times his or her annual salary. Another benefit Mercantile provides which helped earn the company this award is a 401k where the company match totals six percent of the employee's total salary. Flynn said Mercantile Bank recognizes the investment it has already made in its employees and provides programs like these to protect that investment. "In reality, in the banking industry, the biggest thing that sets one bank apart from the others is its people," said Flynn. "All banks offer checking accounts, certificates of deposit, loans, etc. The biggest difference from one bank to the next is the people. If you have well trained people who work well for you, it is critically important to retain them as your employees." Mercantile Bank also offers employees the opportunity to participate in additional training programs so they can have the opportunity to move up the career ladder within the company. Benefits packages, incentive programs, offering special training so employees can advance their careers and providing additional services like Mercantile Bank's child care reimbursement are all examples of factors that help companies retain the people who are so critical to their success. Those are also the factors that are measured by the Best Places to Work program. The program is designed to recognize both large and small companies for efforts made in retaining their workforce. Factors measured by the program include employee turnover, the growth rate of the company, the amount spent on employee training, the percentage of employees who achieve promotion, employee insurance packages and retirement plans, and many more. =wIn w'i 1. Anyone, except Telegraph employees and their immediate family members,. agio Uin RULES OF THE GAME tie breaker blank. (For instance, if the score of the GATORS game was GATORS 19, opponent. Rob Eberle of Worthington Springs missed 5 yJRNNNGSSPORTIN4 ANJeING S US IOgN Your Dodge Truck e dquarter. S PORTNC J w Itle S NNIN S INS U T. . F4VC h icago a+ ALk ...CA-...%P and PAINTERS, Inc. Sjet' sHANCE 1 1 207 Orange St. -964-3300e yer d, eal a,/h t pyr bme bi. hter' CHRYSLERN e Mnst t M a Atlanta at Baltimore (8 f7)229180 (352)3734744 -- '...e-- Minnesota at Miami * Minnesota 5tM $ 00 LARGE PEPPERONI PIZZA Cincinnati at New Orleans 1-800-78896-3 100100 U.S. 301Starke 211 S. ORANGE ST., STARKE 964-7434 1 All Day Every Day Locally Owned 8 Operated Washington at Tampa Bay 2 miles south of Starke on US-301 904-964-7200 Web address: SAWYER GAS Wendell Davis, District Manager Western Carolina at Florida (352) 468-1500 1-800-683-1005 SpiresS "Hometown 386-496-3361 Indianapolis at Dallas 610 SW 1st St., Lake Butler Visit and contact us at: spiresiga.com _ Capital City Bank Miami at Virginia 350 N. Temple Ave. Starke, FL 32091 (904) 964-7050 WI:13:, ICMI "[thO] {a'lf I 44 MR.AutoAXPRESSTAX 0 INSURANCE D Sabrina L. Roberts AGENT ' Auburn at Alabama 737 S. Walnut St. Starke (904) 964-3375. UM Ifi 01 V khM 913 u [1:111A i! nir l vu Wo (114 500 Green Way S.R. 100E Keystone Heights, FL 32656 (352) 473-4952 You're a VM Winner with Sonny's Arkansas at Mississippi St. 230 N. Temple Ave. CtS l k FIn 964-8840 Cathy Skdly OFFICE MANAGER Jan Jackson OFFICE ASSISTANT ^nSbji' lite Escrow San Diego at Denver 107.F Edwards Rd., Starke, FL 6ur row priority 904-964-2363 KIRBY LASER AND NEEDLE EMBROIDERY* ENGRAVING SCREEN PRINTING Tennessee at Vanderbilt .K (41t ,.Jii-by OWNER and OPERATOR 50 E. Main St., Suite A Lake Butler. FL 32054 Phone: 386-496-3792 Fax: 386-496-3796 Cs Community Established in B 957 State Bank No cut-off time on deposits Michigan at Ohio St. STARKE 1 LAKE BUTLER 811 S. Walnut St. 255 SE Sixth St. [904-964-7830 MEMBEC [386-496-3333) murm rI.rIrn- r i .-I-.n-A-..-. ... -r.s.ameM. r w . GREAT STEAKS California Southern Professional . at USC GREAT TPARICE! Title Services, Inc. spor -H EVROLET o" /or the Zr" Brad ViniWake Fort SOFTARE Ole Miss at LSU Tow 84A 8061 4 Lake Butler Starke Resu US30S E FLI ,o(904) 964-7500 235 SW 4th Ave., Ste. 5 704 N. Lake St. Com US 301 S. STARKE, FL J6 8VV I LUS301 nNorth 1-888-4-1-CHEVY 386-496-0089 904-964-6872 b'IK Ballet*Tap*Jazz* Lyrical-* Hip-Hop* Modem Ages 2'/7 and older rgh at Cleveland 417-E West Edwards Rd. Starke Jones Funeral Home HOSPITAL EQUIPMENT MONUMENTS PRE-NEED PLANS Dedicated Service For Over 88 years S TAf RKE KE YgSTOINE HEIGHTS 964-6200 473-3176 Steve & Cindly utchi St. Louis at Carolina OWNERS Serving. ffFaithis Jackson S Building Supply Proudly smig our em mum 1 for arr 45 years! cattle at San ^^ff Francisco FranciscLake Butler S 145 SW 6th Ave. dQf4..n3l7Q Se Starke US 301 South QSA.-fn71 Bradford C oaml k lNesTiI akh(lab Bradford Pre-School Owner: Linda Bryant 76w, wa S&e 19S97 Child core for ages I & up New England at Green Bay Open MONDAY-FRIDAY 407 W. Washington St., Starke* 6:30 am.- 6 p.m. (next to Bradford High School) u,.-,,) 964-4361 Move in for Whispering aks "BRAND NEW" COMMUNITY APARTMENTS Western Michigan at FSU 900 S. Water St. Starke 904-368-0007 Jackson Building Supply Hayes Electric Jo Funeral Home Capital City Bank Sawyer Gas Sonshine Title 6'r-n-e Inwith"m Auto lCaesars ting Chance iur_. rr -L__ut dtro Pre-bciuul n and Country Ford Its Fitness Center mrifty State Bank 3v Laser 6 Needle s Grocery rmil Starl Spire Experience The Difference! Bk of Starke 7 South Florida at Louisville Bring in this ad for a free week membership! 418 West Call 904-368-8101 Sonny's Restaurant Chevrolet of Starke Western Steer IWA aks^I- J- ,-. .* -3LarKC Z90l'nn ina Handi-House Portable Buildings Over 65 buildings in stock! FINANCING AVAILABLE 904-964-3330 I I Oakland at Kansas City US-301 S in Starke HAYES ELECTRIC AND AIR CONDITIONING Corner of S.R. 16 & 301 N (904) 964-8744 S Buffalo at RESIDENTIAL 4 .' Houston Master Li nrd k L #ER-0003575 i RA-0033644 -Insured Southern Profesmsional Tide Sermce Hai-House TIEBREAKER SCORE: Name: Address: Phone: aI I- I .UA US-301 S, Hampton Just 1/2 Mile South of the Gate Station At 301 & 18 STARKE ACADEMY OF / " -/ Pittsbu (904) 964-5277 Campaign signs can be recycled at area centers The New River Solid Waste Association is participating in a Department of Environmental Protection pilotiltey and in Keystone Heights. The Union County centers in Lake Butler (at the water plant and by the horse arena on S.R. 121) and Providence will also be accepting signs. Containers at each of these centers will be clearly marked. For more information, please call the New River Solid Waste Association at (386) 431-1000. --~"- jenrings insumumn "'"''""'" -=i,, iiiii~ Oaks A , I Page 4C TELEGRAPH, TIMES & MONITOR-C-SECTION Nov. 16, 2006 Indians' season ends against South Sumter again BY CLIFF SMELLEY Telegraph Staff Writer Keystone Heights had no answer for South Sumter running back Richard Kelly, who scored four touchdowns to help lead the host Raiders to a 52-12 win over the Indians in T-ha ass 2A Region 2 semifinal game in B'ishnell on Nov. 10. South' Sumter rushed for 310 yards, with Kelly gaining 169 of those on 19 carries. He, scored three touchdowns in the first half as the Raiders built a 31-6 lead. "They're a better football team than we are," Keystone head coach Chuck Dickinson said. "I can't make any excuses. The best football team won tonight." It was the second straight - year South Sumter (10-1) began its playoff run with a win over Keystone (9-2). The Raiders will travel to Jacksonville to play Bolles for the Region 2 championship on Friday, Nov. 17, at 7:30 p.m. Kelly, who is listed at 6-0, 240, punished the Indians on many of his .runs. Several Keystone defenders tried to tackle Kelly one-on-one once he made his way into the secondary on his first touchdown run, but he just ran them over on his way to the 59-yard score. "If you don't stop him at the line of scrimmage, it's hard to you better put it in the end zone, or you better get points out of it," Dickinson said. "You're not going to get that many chances against them." Keystone took advantage of such a chance toward the end of the second quarter. A drive that began at the Indians' own 20 appeared destined to end with a punt, but Cameron Yarbrough's 29-yard reception on third-and-13 kept the drive alive. Greg Taylor then proved his worth in the passing game, catching three passes for 39 yards, the third of which was a 9-yard touchdown with 2:07 remaining in the first half. However, instead of going into the half down 24-6, the Indians wound up trailing by 25 when South Sumter's Pat, Mobley returned the ensuing kickoff 100 yards for a score. Kelly found his way into the end zone for the last time at See KHHS, p.8C Artistic Hair Designs "For The Ultimate Look" by Christine Bedford 904-509-5032 Greg Taylor fights for yardage in the loss to South Sumter. Taylor led Keystone in rushing and receiving. stop him once he gets past the linebackers," Dickinson said. "He outweighs all our kids. He's bigger than any guy we've got on the football field. He's a load once he gets going and we've got guys who are 150, 160 trying to hit him. It's like hitting a tree." Kelly also had scoring runs of 3 and 2 yards in the second quarter which, with a 47-yard field goal by Kody Stump, put the Raiders up 24-0. Keystone had a chance to get on the board when the score was 10-0. Two 15-yard penalties on South Sumter helped move the Indians downfield, but Michael McLeod's 40-yard field goal attempt with 1:13 remaining in the first quarter was no good. "You get an opportunity, KHHS plays to scoreless tie in soccer A win opened the season, but since then the Keystone Heights boys soccer team has tied two straight opponents, including- a-scoreless match against Fort White on Nov. 13 in Fort White., The Indians (1-0-2 prior to Nov. 14) played St. Francis on the road to open the season, earning a 3-0 win on Nov. 7. Keystone's defense held St. Francis to three shots on goal, but the host Wolves' goalie made many great, saves as Keystone took 23 shots on goal. Austin Bennett put the Indians up 1-0 when heheaded- -- n. a-corner-kick by- Brad Gober in the 18th minute. The constant rain that fell during the first half stopped, and Keystone responded with a fast start to the second half. Justin Hannah beat his defender and sent a cross to Hayden Rodel, who tapped the. ball into a wide-open goal one minute into the half. From that point on, Keystone dominated play. The Indians added their third goal in the 50th minute when Ryan Miller, off of an assist by Branden Waters, easily beat a defender and the goalie on a breakaway. - Keystone goalie Juan Arenas had seven saves. The Indians then played their first district match, jumping out to a 2-0 lead on host Crescent City before the Raiders rallied to salvage a tie on Nov. 10. Keystone scored the first half's lone goal when Hannah worked the ball in close to Rodel, who jammed the ball off the post into the goal in the 23d minute. The Indians increased their lead on a fast-break opportunity in the first minute of the second half. Miller delivered a pass to Rodel, who once again beat Crescent City goalie Nahum Sotelo for a 2-0 lead. The Raiders finally scored in the 55th minute when Leo Villegas scored on a free kick from 40 yards out. They then tied the score in the 60h minute on a penalty kick by Ivan Nobles. Keystone played P.K. Yonge on Nov. 14 and will travel to play district opponent Matanzas on Friday,.Nov. 17, at 7 p.m. On Monday, Nov. 20, the Indians travel to Orange Park to play St. Johns Country Day at 5 p.m. They then travel to play Palatka on Tuesday, Nov. 21, at 7 p.m. Keystone girls soccer team wins second straight BY CLIFF SMELLEY Telegraph Staff Writer Tory Beasley scored one goal and had three assists as the Keystone Heights girls .soccer team improved to 2-1, with a 4-0 win over host Fort White on Nov. 13. Beasley scored the Indians' first goal off of an assist by Emily Jones. She then assisted on a goal by Tysee Williams as Keystone took a 2-0 lead into the half. Williams and Julie Campbell, each with an assist from Beasley, scored the Indians' two second-half goals. The match came on the heels of a 7-1 win over host Crescent City in the district opener for both teams on Nov. 10. Williams scored three goals, Beasley had two and Campbell and Noel Crane each had one. Emily Jones had two assists, while Beasley, Campbell and Williams each had one. Keystone travels to play district opponent Matanzas on Friday, Nov. 17, at 5 p.m. On Monday, Nov. 20, the Indians travel to Orange Park to play St. Johns Country Day at 7 p.m. They then travel to play Palatka on Tuesday, Nov. 21, at 5 p.m. REGISTER NOWI ! B SPRING 2007 CLASSES LAKCE CITY A COMMUNITY COLLEGE [[ q C]al 9Cainetao tiT e,,! Open Registration I Nov. 7-Dec.14 3) 8 a.m.-6:30 p.m. Mon.-Thu. .. h 8 a.m.-4:30 p.m. Fri. Dec. 15 (all fees due by 3 p.m.) I Jan. 2-5 8 a.m.-3 p.m. (Fees are due by 3 p.m. each day) I- For more information: ' (386) 754-4287 .r t, BILL BAILEY'S o,, GOSPEL MUSIC" thursday, 3riday & Saturday, .or 16, 17, and 18 at Dixieland Music Park US Hwy 301 S, Waldo (US-301 S behind the Classic Cafe Resttaurant) featuring Pif:0 ,* Down East Boys Debbie Domer Sime! .* The Browns Held under The Freemans Held under Wilma Smith c .vered Crystal River pavilion The Hemphills BRING YOUR LAWN CHAIRS! WEDNESDAY, Nov 15 6:30 Dm "Potluck Supper & Informal Sing" with DEBBIE S DOMER, WILMA SMITH, and more! Thursday, November 16, 7:30PM BRIAN FREE & ASSURANCE, SINGING ECHOES Friday, November 17, 10am SJ Chapel Service" with PASTOR CHUCK & WILMA SMITH Friday, November 17, 7:30pm TALLEY TRIO, DOWN EAST BOYS, BROWNS Qk Saturday, November 18, 10am "Chapel Service" with JOEL & LABREESKA HEMPHILL I Saturday, November 18, 6pm . .- Qp The PFEIFERS, The FREEMANS, CRYSTAL RIVER o Adults-$10 Adults 3-day pass1$25 0 Children 3-11 perlgtattihegtnl $5 No admission charge for Wednesday ) night or morning chapel services- offerings received. Over 300 camp sites w/water electric of tthe grouds at mIdelandAMusic Park! Jor reservations or more information call, classic Cafe 352-468-3988 Nov. 16, 2006 TELEGRAPH, TIMES & MONITOR--C-SECTION Page 5C Verna and Oscar in 1946. Verna and Oscar now. Davises to celebrate 60th anniversary Oscar and Verna Davis were married Nov. 2, 1946. They have six children, Wesley Davis, Wayne Davis, Curtis Davis, Charline Meres, Diane Johns and Loraine Rule. They also have 14 grandchildren and 22 great- grandchildren. The couple's children will host an anniversary reception at Sampson City .Church of God in the fellowship hall on Saturday, Dec. 2, beginning at 4 p.m. Family and friends are invited. No gifts please. Lake Region Community Theater hosts recital New cosmetology class begins soon Are you interested in a career that can include entrepreneur, fashion, art and sales representation? Then cosmetology may be the career for you. A new cosmetology program will begin Wednesday, Jan. 3, at Bradford-Union Area Career Technical Center. Registration for the program will begin Monday, Dec. 4. The cosmetology class includes hair coloring, cutting and styling, manicure and pedicure training, plus opportunities for ownership in salons and beauty shops and sales for supply companies. If you are interested, call (904) 966-6769 for more information or to schedule a *TABE test. Financial aid is available for those who qualify. SiAt F4TQ-00QQ -Wrsh.0r 4$Ile'sL ruid Ruth and Paul Meng Mengs celebrate 60th wedding Nov. 18 anniversary Paul and Ruth Meng of Doug and Anita Wilkinson Hampton Lake recently of Lawtey announce the celebrated their 60th wedding upcoming marriage of their anniversary with a weekend daughter, Beverly Anne gathering at Camp Wilkinson, to Danny Lee Montgomery. Haley Jr., son of Danny and All of the couple's 11 Lynn Halsey Sr. of Hampton. children, Carltop, Bill, The bride-elect is employed Carolyn, Phyllis, Marty, Joyce, at Bradford Terrace Nursing Sallve. Beverlv. Jne. Mike and and Rehabililation Cenier in J,-hn. th. children's .,p.uses Siafke'....." .. ... "Ir23 cf h -Ncngs' 2t The groom-elect is grandchildren attended. employed at Lonestar Artistic Paul's brother and sistcrs. as Concrete in Hampton. well as in laws, cousins and The wedding will take place friends came from as far a3% a\ on Saturday, Nov. 18, 2006, at as California and Ohio to the home of Danny and Lynn spend the weekend '~ith ihe Halsey Sr. in Hampton. couple. A reception will follow. -The weekend was filled with All family and friends are a video of memories, a hat invited., contest, a swap shop, food, sitting around the campfire and lots of laughs. Consolidated The Mengs were married on C n.'ol-da e Nov. 9, 1946, at Holy Rosary High School Cathedral in Toledo, Ohio. High SchooI Paul and Ruth have lived'in plan reunion theHampton area since that The Consolidated High School Reunion second annual fund-raising event, "Christmas STARKE Banquet Celebration," is LUTHERAN ! scheduled for Friday, Dec. 15, at 7 p.m., at the Lake Butler MISSION Lakeside Community Center. (LC-MS) . The event is semi-formal and dinner will be served. Sunday Worship at 10:00 A.M. For more information, in the Banquet Hall of the contact Eddie or Cora Jackson KOA Campground, at (352) 496-1670, or Alicia U.S. 301 - Maxwell at (352) 372-8668. U.S. 301 S. (904) 964-8855 We Speak Christ Crucified o SITEPREP ,. Land Clearing Ponds Grading S 1-800-871-7525 office/Fax 386-496-4740 Licensed Insured 386-32 miles S of bridge in Palatka 480 S. U.S. HWY. 17, SAN MATEO inykat'1areYoiFukvWITcI0Gfo? SANTA FE COMMUNITY COLLEGE 352.395.5000 Over 97 percent of SFCC's career fast track graduates find jobs in the fields of their choice. Over 60 percent of SFCC's A.A. degree graduates go on to the University of Florida. Transform your life through education. Get started today. Spring semester starts January 8, 2007. Anthropology Astronomy Biology Chemistry Dance History Humanities Journalism Mathematics Music Philosophy Physics Political Science Psychology Religion Sociology Spanish Avialion Biolechnology Building Construclion Business Cardiovascular Technology Early Childhood Education Graphic Design Networking Nursing Sonography Welding Zoo Animal Technology and many more... Beverly Anne Wilkinson and Danny Lee Halsey Jr. Wilkinson and Halsey to wed On Nov. 5, piano and vocal recital was held at the Lake Region Community Theatre's new home at 218 S. Walnut St. in Starke. Included were students from the Starke, Keystone Heights and Lake Butler area. Front row (I-r): Brianna McWaters, Lauren Hovsepian, Victoria Denmark, Rachel Ricker; second row, piano instructor Jack Stella, Tessa Ricker, Dynna Been, Madison Colaw, Jenna Coleman, vocal instructor Karyn Merritt; third row, Rachel Wells, Ashley Crawford, Hanna Ricker, Pam Brunt, Billy Gnann; fourth row, Chuck Goldstrom, LaDonna Hart, Faye Ricker and Rachel Rothwell. Page 6C TELEGRAPH, TIMES & MONITOR--C-SECTION Nov. 16, 2006 BIRTHS Taylor Hayden Cason Pilcher Brett Hayden and Ann Jeremy and Tosha Pilcher of Kersh of Keystone Heights Starke announce the birth of announce the birth of their their son, Cason Tyler Pilcher, daughter, Taylor Brooke on Oct. 11, 2006, at North Hayden. on Oct. 25, 2006, in Florida ,Regional Medical Gainesville. Center in Gainesville. Taylor weighed 7 pounds, 12 Cason joins a sister, Carley ounces and measured 19/2 Pilcher. inches in length. Maternal grandparents are Maternal grandparents are Larry and Sharon Hinds of Jack and Gloria Kersh of Starke. Keystone Heights. Maternal great-grandparents Maternal great-grandparents are Shirley Andrews of are William C. Kersh of Keystone Heights and Kenneth Keystone Heights and Shirley and Carolyn Hinds of Hopper of Keystone Heights. Keystone Heights. Paternal grandparents are Paternal grandparents are Kevin and Cheryl Craven of Jerry and Betty Kay Pilcher of Middleburg and Brett M. Starke and the late Gloria Hayden of Huntington Beach, Pilcher. Calif. Paternal great-grandparents Paternal great-grandmother are Edith Tyler of Sylacauga, is Linda Lavenbarg of Ala. and the late Clarence Jacksonville. Tyler. Wood and Thornton engaged Anna and Frankie Wood of Starke announce the engagement of their daughter, Amanda Wood, to Nelson Thornton, son of Alton and Michelle Thornton of Raiford and Roy and Evelyn Weiland of Lawtey. The bride-elect is a 2005 graduate of Bradford High School. She is, employed by Aloha Tan. The groom-elect is a graduate of Union County High School. He is employed by Mates, Camp Blanding and the Florida National Guard. The wedding is planned for 4 p.m. on Saturday,, July 21, 2007, at 4 p.m., at Camp Blanding Chapel. Nelson Thornton and Amanda Wood A reception, will follow in Cooper Hall. Invitations will be mailed. BIRTHS Shyla Morgan Crowe Shyla Crowe Jimmy and Jessy proudly announce the birth of their daughter, Shyla Morgan Crowe, on Nov. 8, 2006, at Alachua General in Gainesville. Shyla weighed 6 pounds, 11 ounces and measured 19 inches in length. She joins a brother, 3-year-old Hayden Rollins. Maternal grandparents are Julia and Mitchell Stewart of Raiford. Parental grandparents are Phillip and Sheila Lyons of Starke. Great grandmother is the late Violet Griffis of Starke. We love you, Grammi Sheila, Papa Phillip and all the family! PAID Happy 12'" Birthday Balton! /0" YOMpa.e 4e, Justin William Crawford and RuthAnne Harris Harris and Crawford are engaged RuthAnne Harris and Justin William Crawford, both of Lawtey, announce their engagement. A private wedding ceremony will be held on Saturday, Jan. 13, 2007. psi WORTH NOTING I Veterans of Foreign Wars (VFW) Post 1016 and its Ladies Auxiliary are accepting entries for the Patriot's Pen Essay Contest and the Voice of Democracy Scholarship Competition. Patriot's Pen is for sixth-, seventh- and eighth-grade students. The theme is, "Citizenship in America." Post 1016 will award a $50 U.S. Savings Bond to the local winner. The Voice of Democracy Competition provides ninth- through 12-grade students the opportunity to write and record a broadcast script. The theme is, "Freedom's Challenge." Post 1016 will award its winner a $100 U.S. Savings bond. Entries are due to the Post chairperson, Christine Peace, by Wednesday, Nov. 1. For rules and applications, call Peace at (904) 368-0447, or visit the VFW Web site,. Hospice is in need of volunteers. There will be a volunteer training program soon, and if interested in this important volunteer opportunity, call Carolyn Long, 386-328-7100. Congatulations Kaayla C0emons 5o0uthero Qri7j Hours: Sun. & Mon. ~ 7 a.m.-4 p.m. Tues.-Sat. ~ 7 a.m. 9 p.m. Closed Sun. & Mon. Nights Tuesday Steaks Burgers Friday Tuesida Sandwiches Buffet Satuiday NightS 9 Fried Chicken Saturday ALL-You-AN-cuE Truck & Bus Parking Nighs Drive Thru WINSSFOOD 110 1 11 ,111 BUFFET MUST PRESENT COUPON l Hat' hr_ $ Q14 (352) 481-5577 LAKE AREA PROFESSIONALS ~ Betsy Jo Minor hk-I i,1-r Becy -Wils- Becky Williams George Leath Rea .4 .s r 9 Cindy Teske R ,.lh .r .... 124 Hotel, Melrose PRICE REDUCED---Beautiful 2 story home on Little Swan Lake with sandy beach. Two decks plus screened room. Large master bedroom & bath with walk-in closet. Two utility buildings, vinyl siding, covered to match home. Property is gated & fenced. $349,000 1299 Coral Farms Rd, Florahome Beautiful 9.5 acre tract with rolling landscape and lots of oaks and wildlife. Paved road on 2 sides and would be perfect for mobile home or your dream home. KealtrArsoc. - rF t Jack Ganstlne RealtorA.ss'o. SLL Jim Brady R) sdior As..... r I Jeanne Goodson John Wick John Wick Realtor Assm, Rtllnr Awm.r. Robin Jones Liz Dunn Rosario Orozco Reillor Amsw.. Reallor Ass.w. Realtor Assoc. Visit our Web page Se Habla Espan61l 5605 S.E. US Hwy. 301, Hawthorne ~'CENTURY'21 SHOWCASE PROPERTIES, INC. - I Nf khhI m 1 4- ~.-~ti~ l~s~.i~e~:Stif iet~, , ELEGRAPH, TIMES & MONI fOR--C-SECTION Page 7C Lady Tigers finish as runners-up in preseason classic BY CLIFF SMELLEY Telegraph Staff Writer The host Tigers rallied a having trailed for most of game, but Baker Cot eventually came out on defeating the Union Col -girls basketball team 54-5 *overtime to win the U( :Tip-Off Cl.ssic on Nov. 9. Union struggled with *outside shooting, but Mira 'Kent knocked down a pointer to tie the score at 4 with 1:17 left in regulation. The two teams t :exchanged baskets tw ;Bianca Clemons scored- :of an assist by Kent- drew a foul, putting the Ti up by two with 23 second play. She could not make ensuing free throw, howe leaving the door open Baker County to f( overtime, which the Wild did after Ruise made two throws with 16 seconds left Kent made a 3-pointer tc the game at 49-all in overt then made a free throw wit seconds remaining to put team up 50-49. Those would be the points for the Tigers. Bak Brittany Hinson made a 1 shot from just inside the -before de la Pena sc( following her own steal. -. Kent tried to drain ano -7rey to tie the game, but ' 4hot was off the mark. Baker's Deanna McKe "4niade a free throw with e -Seconds left to cap the scori The Wildcats, who clun a one-point lead at the half ;by as many as nine point the third quarter, but two throws by Am 4ranzluebbers late in quarter sparked a 9-0 A-sh'li Watkins had a li .follov. ing her own steal du :--hat stretch, while As] UC ope season BY CLIFF SMELLE Telegraph Staff Write Amber Franzluebbers 13-of- 15 free throws an her team in scoring rebounding as the U County girls basketball opened the regular season defeating host Middleburl .28 on Nov. 13. Miranda Kent opened .game with a couple c !pointers for the Tigers ( which brought Middleb 'defense out to the perir iand opened things up ir |for Franzluebbers. She fin 'with 19 points, while grabbing 11 rebounds blocking three shots. Kent was the second-le; *scorer with 12 points. Bianca Clemons and As Clemons (up from ju varsity) had seven and Rebounds, respectively, ored Clemons' 3-pointer tied the game at 34-all. other Clemons finished with 10 the points, as did Kent. Franzluebbers led the team nzie with 18 points. eight Franzluebbers also had 13 ng. rebounds and seven steals, g to while Ashley Clemons and , led Watkins had 10 rebounds each. ts in Kent and Bianca Clemons free had nine rebounds each. ber Franzluebbers and Kent the were named to the all- run. tournament team. ayup [ring In the tournament's rhley consolation game, Fort White ns regular with win Y Ashley Clemons also leading r the team with four steals. Union head coach Perry made Davis said Bianca Clemons d led and Kelly Bennett played and "great low-post defense." Jnion The Tigers return home team tonight, Nov. 16, to play in by Hamilton County at 7:30 p.m. g .41- Union then hosts Branford on Friday, Nov.' 17, at 7 p.m. 1 the before opening their'District 6- of 3- 3A schedule on the road 1-0), against Crescent City on urg's Monday, Nov. 20, at 6 p.m. meter Union travels to play Fort inside White on Tuesday, Nov. 21, at ished 7 p.m. also and Score by Quarter UCHS: 16 5 11 9-41 fading MHS: 2 8 3 15-28 shley Union County Scoring (41): inior Bennett 4, A. Clemons 4, B. six Clemohs 2, Franzluebbers 19, with Kent 12. Free throws: 17-24. defeated Trenton 41-39. Score by Quarter BC: 12 10 12 11 9-54 UC: 9 12 6 18 5-50 Union County Scoring (50): Ashley Clemons 10, Bianca Clemons 4, Franzluebbers 18, Shaniece Huggins 1, Kent 10, Watkins 7. 3-pointers: Ashley Clemons 2, Kent 3. Free throws: 11-19. Tigers open tourney with 8-point win Union trailed by eight points early, but wound up winning by eight, defeating Trenton 55- 49 in the first round of the Tip- Off Classic on Nov. 7. Franzluebbers had 15 points and 21 rebounds, while Kent had 14 points and 12 rebounds. Lindsey Brannen scored 10 points before turning her ankle. She did not play in the championship game because of the injury. Watkins finished with nine points and seven rebounds, while Bianca Clemons had eight rebounds. Watkins also had three blocks. In the other first-round game, Baker County defeated Fort White 44-36. ra - r -. 7 17-49 13 9-55 Union County Scoring (55): Brannen 10, Bianca Clemons 5, Franzluebbers 15, Kent 14, Watkins 9, Allant'e Webb 4. 3- pointers: Kent 3. Free throws: 14-28. The basic test of freedom is perhaps less in what we are free to do than in what we are free not to do. -Eric Hoffer . Miranda Kent '- prepares to put up a shot for Union County . in the Tigers' preseason Tip- ) Off Classic. If , FROZEN SEAFOOD at Paradise Nursery in Starke * Red Snapper 4 Ibs.....$25 Jumbo Raw Shrimp 3 Ib.....$25 * Grouper. 5 Ibs.............$25 Cooked Shrimp- 3 Ibs..........$20 * King Fish. 5 lbs..........$25 * Tilapia 5 lbs............... $25 * Ocean Scallops. -2 lb...$20 * Fla. Lobster Tail 2 lbs.........$35 * Stone Crab Claws 2 Ibs......$20 * Boneless/Skinless Chicken Breast 5 lbs..........$25 West of Starke on Hwy 16 904-964-8055 [cIRE BEANS i~zr to BUE JE~ANS] FIND THE CA$H IN YOUR HOME K Florida Credit Union The "Ultimate" in Car Paint Lg-/ has arrived! MATRIX CUSTOM PAINT... ;high gloss, deep color & a wetter look. This Special Offer Starts with 1 set Lambo Door Custom Paint of your choice. Reg. $4,295 .............CALL TQDAY...$1,995 w/minor body work Plus for The Domestic Auto Minor Body Work Reg. $995 .CALL TODAY... $595 (cars only) Pickup's with Spray-on Bedliner... Add any style paint, custom or domestic Reg. $1,295 NOW $795 Located in Ellisville -1386) 697-1696 Ask for Tony G. 21= Annual Antique Engine Show 2"1Annual Beefcemberfest BBQ Competition December 8 & 9 at the Bradford County Fairgrounds For more information call [9041964-5252 or (9041364-6683 84.-Monta Home equity Special! Ratos as eow as 6.740 By refinancing your current home equityto Florida Credit Union, you can do anything from building your dream kitchen to taking that long awaited vacation. Take advantage of low rates*-, now's the right time to refinance your home equity. Lock in at a fixed rate I One Low Payment U 125% Loans Available I Debt Consolidation I Automatic Payment Options Starke 1371 S. Walnut (904) 964-1427 Florida Credit Union *S~ta p~l, numc mkmumdt oin mp mrP~rqlnAwM WI bei a udi~ nripebased mpraah yitaflpa~Is~nccts hlsaidcaig~ts~r~ais1~a~ $511 ai $181atbeie:$31 al 151 8% 1~ 11~iI8LENDER'iDE Score by Quarter THS: 11 14 UCHS: 14 19 I ' .- ( & Union County's Amber Franzluebbers dribbles between Baker County defenders. Waldo Far ers & Flea- Market Nov. i rr*wlwiar Page 8C TELEGRAPH, TIMES & MONITOR--C-SECTION Nov. 16, 2006 KHHS Continued from p. 4C the start of the second half. Defensive lineman Ismael Rodriguez recovered a fumble for the Raiders at the Keystone 37. Tarren Freeman broke loose on a 33-yard run, setting Kelly up for a 4-yard touchdown run that made the score 38-6. Keysto'n's Taylor, who had seven receptions for 141 yards, was a pivotal part of the Indians' second touchdown, drive. He took a short pass from Lott and turned it into a 55-yard gain to the South Sumter 11-yard line. Taylor would eventually score on a 15-yard reception on a' fourth- down play at the 9:12 mark of the third quarter. That was all for the Indians, as the Raiders scored on two of their next three drives. A 6- yard touchdown run 'by quarterback Denzel Smith capped a 50-yard drive and a 2-yard touchdown run by Freeman capped a 44-yard drive. The Raiders were looking at another potential score in between those two scoring drives, but Keystone's Clayton Mosley intercepted Smith., Keystone's best chance at another score came when Matt Story had a 53-yard kickoff return to the South Sumter 38 in the fourth quarter. An 8- yard run by Story later gave the Indians a first down at the 22, but Keystone would eventually turn the ball over on downs at the 18. It may have been a disappointing end to the season, but Dickinson said he Keystone's Matt Story (right) carries .. the ball with * South Sumter's Marty Everett in pursuit. Cameron Yarbrough couldn't come down with this catch for the Indians. was proud of the effort of his players, who never gave up during the game. Now, Dickinson would like to see the ;younger players coming up build upon what this year's senior class accomplished-two straight postseason appearances and a 9-1 regular season record this year. "I wish the season could've continued, but I appreciate the seniors and their hard work over the last three years," Dickinson said. "Hopefully, the younger guys will take this experience and be ready to play next year." Score by Quarter KHHS: 0 6 6 SSHS: 7 24 14 0-12 7-52 Scoring Summary S: Kelly 59 run (Stump kick) S: Stump 47 FG S: Kelly 3 run (Stump kick) S: Kelly 2 run (Stump kick) K: Taylor 9 pass from Lott (kick blocked) . -S-Mobley 100 kickoff return (Stump kick) S: Kelly 4 run (Stump kick) K: Taylor 15 pass from Lott (pass failed) S: Smith 6 run (Stump kick) S: Freeman 2 run (Stump kick) Team Statistics First Downs Rushes/Yds. Passing Yds. Passes Punts Fumbles Penalties K 12 29-119 -176 9-33-1 4-28 1-1 4-35 S 22. 40-310 57 5-13-1 2-30 1-0 7-75 Thermal Image are (I-r): David Kuykendall on lead vocals, Clint McFarland on guitar, guest artist and fiddle player Matthew Menard of Ocala, bass guitarist Don Crookston, drummer David Feagle and keyboardist Barry Passetti. Thermal Image: A band some would say is 'hot' BY TERESA STONE-IRWIN Telegraph Staff Writer Thermal imaging allows the ability to see in dark, dense smoke-filled environments. Firefighters like Lt. David Kuyendall of Clay County Fire and Rescue use thermal imaging inside a structure fire to locate victims and find the fire's "hot spots." Another hot spot to be in was at the Starke Fall Jam when the band Thermal Image took the stage at 6 p.m. Saturday evening. Kuyendall, the band's lead singer, describes Thermal Image as being "sort of a hard rockin' country band with 'a really high energy show. We build our shows on a little Garth Brooks, a little Johnny Cash, and a whole lot of Jacksonville," said Kuyendall. The condensed water vapor in the sky behind a high-flying jet is a contrail. LEGALS NOTICE OF PUBLIC HEARINGS FOR ENACTMENT OF ORDINANCES BY THE BOARD OF COUNTY COMMISSIONERS BRADFORD COUNTY, FLORIDA NOTICE IS HEREBY GIVEN that proposed ordinances, which titles hereirnafter appear, are being considered for enactment by the Board of County Commissioners of Bradford County, Florida. The first of two public hearings concerning the ordinances will be held on November 27, 2006 at 7:00 p.m., or as soon thereafter as the matter can be heard, at the Governor Charley E. Johns Conference Center, located at 1610 North Temple Avenue, Starke, Florida. At the date, time and place first above mentioned, all interested persons may appear and be heard with respect to the proposed ordinances. A copy of said ordinances may be inspected by any member of the public at the Office of the County Clerk, 945 North Temple Avenue, Starke, Florida. AN ORDINANCE OF THE BOARD OF COUNTY COMMISSIONERS OF BRADFORD COUNTY, FLORIDA, RELATING TO THE REGULATION OF THE USE AND DEVELOPMENT OF LAND IN BRADFORD COUNTY, FLORIDA; CREATING CHAPTER 75 OF THE BRADFORD COUNTY CODE; IMPOSING IMPACT FEES ON LAND DEVELOPMENT IN BRADFORD COUNTY TO PROVIDE FOR ROAD IMPROVEMENTS, FIRE. PROTECTION, EMERGENCY MEDICAL SERVICES, PARKS AND' RECREATION, LAW ENFORCEMENT, LIBRARIES AND PUBLIC BUILDINGS NECESSITATED BY SUCH NEW DEVELOPMENT; PROVIDING AUTHORITY FOR ADOPTION OF THE ORDINANCE; PROVIDING FINDINGS AND DECLARATIONS OF THE BOARD OF COUNTY COMMISSIONERS; PROVIDING DEFINITIONS; PROVIDING FOR THE' PAYMENT AND TIME OF PAYMENT OF IMPACT FEES; PROVIDING FOR IMPACT FEE BENEFIT DISTRICTS; PROVIDING FOR IMPACT FEE TRUST FUNDS; PROVIDING FOR THE PLACEMENT OF REVENUE COLLECTED FROM IMPACT- FEES INTO IMPACT FEE TRUST FUNDS ESTABLISHED FOR THAT PURPOSE; PROVIDING FOR THE USE OF IMPACT FEE RECEIPTS; PROVIDING FOR REFUND OF IMPACT -FEIS; PROVIDING FOR EXEMPTIONS AND CREDITS; PROVIDING FOR REVIEW OF IMPACT FEES AND THE FEE SCHEDULES; PROVIDING FOR THE AUTOMATIC ADJUSTMENT OF IMPACT FEES SCHEDULES; PROVIDING FOR PENALTIES FOR VIOLATION OF THIS ORDINANCE; PROVIDING FOR SEVERABILITY; PROVIDING FOR REPEAL OF ORDINANCES INCONSISTENT WITH THIS ARTICLE; PROVIDING DIRECTIONS TO THE CQDIFIER; AND PROVIDING AN EFFECTIVE DATE. AN ORDINANCE OF THE BOARD OF COUNTY COMMISSIONERS OF BRADFORD COUNTY, FLORIDA, RELATING TO THE REGULATION OF THE USE AND DEVELOPMENT OF LAND IN BRADFORD COUNTY, FLORIDA; CREATING CHAPTER 76 OF THE BRADFORD COUNTY CODE; IMPOSING IMPACT FEES ON LAND DEVELOPMENT IN BRADFORD COUNTY TO PROVIDE FOR ADDITIONAL PUBLIC EDUCATION CAPACITY AND RELATED FACILITIES NECESSITATED BY SUCH NEW DEVELOPMENT; PROVIDING AUTHORITY FOR ADOPTION OF THE ORDINANCE; PROVIDING FINDINGS AND DECLARATIONS OF THE BOARD OF COUNTY COMMISSIONERS; PROVIDING DEFINITIONS; PROVIDING FOR THE PAYMENT AND TIME OF PAYMENT OF IMPACT FEES; PROVIDING FOR IMPACT FEE BENEFIT DISTRICTS; PROVIDING FOR AN IMPACT FEE TRUST FUND; PROVIDING FOR THE USE OF IMPACT FEE RECEIPTS; PROVIDING FOR REFUND OF IMPACT FEES; PROVIDING FOR EXEMPTIONS AND CREDITS; PROVIDING FOR REVIEW OF IMPACT -FEES AND THE FEE SCHEDULES; PROVIDING FOR THE AUTOMATIC ADJUSTMENT OF IMPACT FEES SCHEDULES; PROVIDING FOR PENALTIES FOR VIOLATION OF THIS ORDINANCE; PROVIDING FOR SEVERABILITY; PROVIDING FOR REPEAL OF ORDINANCES INCONSISTENT WITHTHIS. 11/16 ltchg. Grand Opening Sat, Nov. 18 Terri's Scrapbooking & Papercraft 150-B S. Lawrence Blvd Keystone Heights, FL Hours: Mon-Fri 11am 9pm Sat. 9am 9pm Classes Available 7-9 pm Monday-Friday "Windows by ListDc." Lisa Tatum, Design Consultant Shutters,Binds, Shades, Custom Window and Home Treatments COMMERCIAL&RESIDBUTIAL SCe0 tody for yw Te he 8-stith1es E 904-782-1230 or 888-782-1237j -Sf5L---'- -- V Inspect 'n' Check Special $14.95 1 Any Make or Model (Save Today $20). Has your water treatment system been checked lately? A professionally trained Culligan Water Expert will come to your home and inspect, adjust and check your water system. $300 OFF $9.95 Per Month I a W hole I for the 1st3 months RentalSpecial I ...HOUSe-System Isn't itftime you tried a CulliganWater L(Insiallation included) Conditioning System in your home? Limitd time der Not vaihd with o fter ofl Ote s and parichipaihon may vaye 2006 CoNlgan intetoional Co The band members are from areas either in or surrounding Jacksonville, where they perform regularly at Cheers in Mandarin. "We are the first and the only live band that has ever played at the Crazy Horse Saloon in Orange Park and we've even been invited to come back again. We've also played at the Pepsi 400 and are tentively set to play at the Daytona 500 as well," said Kuyendall. Although Thermal Image has been a band for roughly five years now, the current members are the result of years of auditioning and trying out many different musical talents until finally getting the right mix. "The current band members have been playing together for almost two years now and the chemistry of the band shows in the performance," said Kuyendall. The band's demo includes the songs "Hickory Dickory Dock," "Mile by Mile," "Somewhere," "Little Town" and "Love ain't a Heartache." Both WEAG in Starke and WQLC in Lake City currently getsrequests for and plays their songs. To check out Thermal Image on the Web, go to.,. Kids to adult 50cc to 400cc Variety of Colors, Patterns, including Pink S Reg. Camouflage. STARKE WALDO (904) 904-8885 (3521468-2307 U.S.Hwy.301 S Waldo Flea Market (Across From Wal-Mart (NearBtrance) Beside Mosley Tire) Sa. & Sun Mon.-Fri 8-6 8-6 [g 9094-86581 Christmas Sale * SCOOTERS ATVS MOPEDS DIRT BIKES J & R Overhead METAL SALE 36 inch wide metal in various colors. CUT TO LENGTH. 352-473-7417 IEn~ srnrn Ipn Contact Us | Permissions | Preferences | Technical Aspects | Statistics | Internal | Privacy Policy © 2004 - 2011 University of Florida George A. Smathers Libraries.All rights reserved. Acceptable Use, Copyright, and Disclaimer Statement Powered by SobekCM
http://ufdc.ufl.edu/UF00028314/00093
CC-MAIN-2016-44
refinedweb
36,328
75.71
An interpreter in Haskell I haven’t touched Haskell for a couple of years. To get back into it, I made an interpreter for a small imperative language. Haskell is great for making interpreters! First I define the syntactic structure. My language has integers (its only native datatype), pure operators on integers, a set of global variables, some control flow constructs, and two I/O primitives. Below the syntax is encoded as the type E (for “expression”). data E = -- literals EInt Int -- pure operators | EBinOp Op E E | ENot E -- global variables | EGet String | ESet String E -- control flow | EIf E E E | ESeq E E | EWhile E E | EDoWhile E E | ESkip -- I/O | EWriteByte E | EReadByte data Op = Add | Sub | Eq | Lt | Lte | And -- and many more Here’s an example of a program written in this language, called writeXsForever. writeXsForever :: E writeXsForever = EWhile (EInt 1) (EWriteByte (EInt 120)) You might be able to eyeball this expression and guess its intended behavior. My intended behavior for this program is that it writes the byte x to stdout repeatedly forever! But to give this program meaning, I must define the interpreter. In Haskell, the interpreter could be a function with the type: eval :: E -> IO () My interpreter is more complex for two reasons. First, since the interpreter is evaluating an expression, it needs to return the value that expression evaluated to; in my language this is always an Int. Second, my language has mutable global variables ( Map String Int) which must be “threaded” through each evaluation. eval :: Map.Map String Int -> E -> IO (Int, Map.Map String Int) The Haskell main function begins the interpreter by calling eval on the root expression of the program: main :: IO () main = do eval Map.empty writeXsForever return () $ ./jimscript xxxxxxxxxxxxxxxx^C $ Now I define eval case-by-case on each syntactic form in E. I start with perhaps the simplest, EInt, a literal which evaluates to itself and does not modify any variables: eval vars (EInt i) = return (i, vars) Next, I interpret BinOp, the syntax form for all binary operators on integers. Notice how we evaluate the left-hand side expression before the right-hand side, and that this matters because of to the side-effects that expressions can have on global variables and on input/output. Notice the “threading” of vars through each evaluation gets quite verbose (I’ve chosen not to abstract this, because I plan to implement more sophisticated variable “scoping” in future). Also notice that evalOp is rather tedious, translating between Op values and Haskell functions which implement them. Much of the work in writing an interpreter is handed off to the host language! eval vars (EBinOp op e1 e2) = do (val1, vars') <- eval vars e1 (val2, vars'') <- eval vars' e2 return (evalOp op val1 val2, vars'') evalOp :: Op -> Int -> Int -> Int evalOp Add a b = a + b evalOp Sub a b = a - b evalOp Eq a b = if a == b then 1 else 0 evalOp Lt a b = if a < b then 1 else 0 evalOp Lte a b = if a <= b then 1 else 0 evalOp And a b = if a == 0 || b == 0 then 0 else 1 The global variable map has primitive “get” and “set” expressions, which are evaluated as follows. Notice the call to error if the variable isn’t set (I’m not a Haskell purist). eval vars (EGet var) = case Map.lookup var vars of Nothing -> error $ "no such variable: " ++ var Just x -> return (x, vars) eval vars (ESet var e) = do (val, vars') <- eval vars e return (val, Map.insert var val vars) On to control flow, an interesting one is EWhile. Its “looping” behavior is implemented using Haskell recursion; notice the subcall evaluating a new EWhile with the new global variable set: eval vars (EWhile c e) = do (cond, vars') <- eval vars c case cond of 0 -> return (0, vars') _ -> do (_, vars'') <- eval vars' e eval vars'' (EWhile c e) On to I/O, here’s the interpreter for IWriteByte. My language can only write to stdout, but it could be extended to write to files, sockets and so on (but this would want a native string datatype, not just integers). eval vars (EWriteByte byteE) = do (byte, vars') <- eval vars byteE if byte < 0 then error $ "Tried to print byte < 0: " ++ show byte else if 255 < byte then error $ "Tried to print byte > 255: " ++ show byte else PosixIO.fdWrite PosixIO.stdOutput [Char.chr byte] return (byte, vars') Now here are some more interesting JimScript programs: writeTheAlphabet :: E writeTheAlphabet = ESeq (ESet "x" (EInt 1)) (EWhile (ENot (EBinOp Eq (EGet "x") (EInt 27))) (ESeq (EWriteByte (EBinOp Add (EInt 64) (EGet "x"))) (ESet "x" (EBinOp Add (EGet "x") (EInt 1))))) $ ./jimscript ABCDEFGHIJKLMNOPQRSTUVWXYZ uppercase :: E uppercase = (EDoWhile (ESeq (ESet "c" EReadByte) (EIf (EBinOp Eq (EGet "c") (EInt (-1))) ESkip (EIf (EBinOp And (EBinOp Lte (EInt 97) (EGet "c")) (EBinOp Lte (EGet "c") (EInt 122))) (EWriteByte (EBinOp Sub (EGet "c") (EInt 32))) (EWriteByte (EGet "c"))))) (ENot (EBinOp Eq (EGet "c") (EInt (-1))))) $ ./jimscript hello HELLO Programs in this language are Haskell expressions of type E; there is no defined syntax. I might define a syntax and write a parser next. Addendum: some of the eval definitions were long-winded so I omitted them. Here’s are the rest. eval vars (ENot e) = do (v, vars') <- eval vars e case v of 0 -> return (1, vars) _ -> return (0, vars) eval vars (EIf c t e) = do (cond, vars') <- eval vars c case cond of 0 -> eval vars' e _ -> eval vars' t eval vars (EDoWhile e c) = do (_, vars') <- eval vars e (cond, vars'') <- eval vars' c case cond of 0 -> return (0, vars'') _ -> eval vars'' (EDoWhile e c) eval vars (ESeq e1 e2) = do (_, vars') <- eval vars e1 eval vars' e2 eval vars ESkip = return (0, vars) eval vars EReadByte = do exp :: Either Exception.SomeException (String,Foreign.C.Types.CSize) <- Exception.try (PosixIO.fdRead PosixIO.stdInput 1) case exp of Left _ -> return (-1, vars) Right (str,count) -> do if count == 0 then return (-1, vars) else do let [c] = str return (Char.ord c, v.
https://jameshfisher.com/2018/03/06/an-interpreter-in-haskell
CC-MAIN-2019-09
refinedweb
1,028
62.61
I posted a while back on a job opening for a BCL PM position. We got a lot of great candidates in response to that post, and it was quite exciting to see the range of experience and backgrounds in the people who responded. Now if you ever show interest in a job at Microsoft, and if you get past the first couple of hurdles, inevitably you’ll do a 30 minute informational with a member of the team you’re going to be joining. When we had the PM position available, I did a lot of those informationals, and I would always start by describing the position to candidates. I thought I would share my rundown of the position with you for two reasons: a) so you know what a BCL PM does, and b) so you can tell me what sounds cool, and what sounds pretty uncool. A Base Class Library Program Manager, is fundamentally, a ‘Feature’ PM. That is, their primary role is the ownership of specific features within the BCL. For every feature in the framework, there’s a PM who owns the feature. System.Windows.Form? Someone owns that. System.Web.UI.Page? Someone owns that too. For BCL, the PM ownership of features is broken up amongst 5 people: 3 whom own a small chunk, and two who own a larger chunk (really just coming down to team logistics: the lead for the area believes that it’s goodness for everyone to own some feature area, since it keeps you in touch with the core technology, and the most fundamental PM role). What features you own is generally a reflection of a couple of things: a) what desire/interest you have in a particular area (the fantasy check), and b) what simply needs to be owned (the reality check). Ownership is normally broken up at the namespace level (although every so often, a singe class or two can be called out, because their ownership can simply be handled separately). For example, I own System (the majority of: base types, Console, Math, Environment, a lot of exceptions, etc., but not things like AppDomain), System.IO (and S.IO.Ports, S.IO.Compression), System.Text.RegularExpressions, System.ServiceProcess, System.Resources, System.Timers (a huge burden), and two classes outside that scope: System.Text.StringBuilder, and System.Diagnostics.Process. Another PM simply owns System.Collections, and another owns System.Threading. This gives you an idea of the difference between a PM focused primarily on feature ownership, vs. owning a smaller amount of features, and doing other stuff too. Now the inevitable question is: what does ‘ownership’ mean? Well, for each feature, there’s a dev, PM, and test owner. I’ll assert (probably because I’m a PM) that ultimate responsibility for a feature lies with a PM. At the end of the day, the PM for a feature needs to be the Subject Matter Expert for that feature (along with the dev and tester). Responsibilities include: – The design of the feature (the API set) – Defining how you’re expected to use the feature – Triaging what bugs should, and shouldn’t be fixed for the feature – Scoping, and identifying what work should be done on the feature in VNext – Writing the specs, and threat models for the feature – Writing presentations/whitepapers about the feature – Ensuring the feature is in a shippable state – Giving presentations about the feature area (or related areas) – Reviewing documentation for the feature – Answering customer questions about the feature Timeline: For someone new to an area, I would expect that learning a feature area would be anything from 3, to 12 months. That is, if you were new to a PM role, then if you were lucky, you could be the expert in 3 months, but depending on the difficulty, it could take a year. For that period, I would expect that 100% of your job is simply coming up to speed on the role. At some point, you’ll find that you’re starting to get the area, and suddenly (ok, it’s because you have people on your *** all the time, asking you to do other things) you’ll notice you have some free time to be doing other stuff. This is where things can get really fun, since what ‘other stuff’ you do can be largely defined by you. It should be something that at least your manager agrees is beneficial. But once you’ve agreed, you can go for it. Writing whitepapers, giving presentations, driving team wide processes, defining guidelines, creating tools, working with external teams to ensure their needs are met, it’s all good. Visibility is a big thing at Microsoft, so your manager will typically encourage things which get some good visibility. But the other focus here should be ‘pick something you think you’ll enjoy’. Believe me, you’ll be more successful at it if that’s the case. Lowlights of the job: There’s points in the cycle, where there’s a lot of pressure, and the job can be pretty thankless. Your key job at these points is basically protecting the rest of the team from a lot of the sundry stuff that goes on, and if you do it right and they don’t see that stuff, then of course, they don’t know about it, so they don’t can’t appreciate it. At these points, stress can be high because you’re driving to dates, and you do NOT want to be the sub-team that seems to be lagging behind. At these points, you can often come across like the bad cop: but someone has to ensure you’re keeping on target and while that responsibility is certainly a team thing, at the end of the day, the PM should be the person metering that and making sure it happens. A lot of the job for a feature PM can also be about triaging bugs and other process oriented stuff. It’s my experience that a LOT of people don’t like that part of the job. The reality is that if someone doesn’t do that, it tends to not happen, and then things can begin to fray, or even fall to bits. It’s an important part of the role, but not the most glamorous. Highlights of the job: you get to decide (read: be part of the decision for) what happens within a feature area: and this is SO fun. From the decision on what features to do, to how they should be designed. If you like presenting (like I do) then that’s available to you. You get to write code, something which is always neat fun. And I would say above all else, you get to work with awesome people. Tips Tips Why so little comments ? You used fixed font – unreadale on my 1600×1000 screen. PingBack from
https://blogs.msdn.microsoft.com/bclteam/2005/03/15/the-base-class-library-program-manager-pm-a-job-description-kit-george/
CC-MAIN-2016-44
refinedweb
1,153
66.98
How to install WiringPi2 for Python on the Raspberry Pi WiringPi2 for Python – installation instructions for Raspbian use RPi.GPIO because that’s what I first got started with. But, aside from hardware PWM, one thing I love about WiringPi2 is that it also has some extra built-in drivers for various chips – e.g. the MCP23x17 & x8 port expanders. This makes handling expanded ports as easy as… - defining a pin - setting it as input or output - reading or writing to the pin All the low level heavy lifting is done for us. :) You’ve still got to hook up your own wires though. I think Gordon’s working on that for V3 :p Installing WiringPi2 for Python Installing WiringPi2 for Python is very simple, but there are a couple of required packages, so we’ll install those first. Before we install anything, though, let’s update the package lists… sudo apt-get update This is what should happen… Now we need the following. If they’re already installed, no harm will be done… sudo apt-get install python-dev python-pip If asked, confirm that you want to go ahead with the installation with y This will take several minutes. When it’s finished, you should see this… Now we’re ready to install WiringPi2 for Python itself sudo pip install wiringpi2 You will see lots of messages. pip, the python package installer that you just installed, is compiling WiringPi2 and installing it all for you. After lots of messages starting with “gcc – pthread”, you should see this… Let’s check it Now you should be good to go. Let’s check that it works with a live Python environment sudo python import wiringpi2 wiringpi2.piBoardRev() We just imported wiringpi2 and used one of its new functions piBoardRev() which is the built-in Raspberry Pi revision checker. Notice it returned a 2, which is good because I’m using a Rev 2 board. ;) If that all works as it should… ctrl+d to exit python You are installed and ready for action with WiringPi2’s GPIO features. I will be creating a page for simple WiringPi2 usage instructions in the near future. All loaded, tests complete inc C and Bash, but the following does not work:- wiringpi2.wiringPiSetup and SYS and Gpio (or any mix of the three) wiringpi2.pinMode(1,1) wiringpi2.digitalWrite(1,1) wiringpi2.delay/PiBoard etc does work. GPIO write 1 1 works but not the above. I’m going slightly mad over this! Can you help? Travelling back to UK today. Will have a look when I get back. Sorry for the delay. I’m having a bit of a problem. I have successfully installed wiringpi2. After importing wiringpi2 in python, the wiringPiSetup( ) function, regardless of the scheme I choose to initialize, causes the python shell to restart. Any insight into a possible cause/solution would be great. Thank you! Using wiringpi2.piBoardRev() to verify the installation is not complete in that wiringpi2.wiringPiSetup() can still cause a RESTART if the permissions are not correct. A permissions issue can be checked by using the LXTerminal and at the command line start IDLE3 with the command ‘sudo IDLE3’. If the module containing wiringpi2.wiringpi2.wiringPiSetup() runs without RESTART then permissions is the issue. I just wanted to say THANK YOU FOR YOUR SUPPORT IN HELPING ME RESOLVE A MAJOR PROBLEMO. I WISH YOU WELL AND THE BEST THAT THIS WORLD HAS TO OFFER. YOUR FRIEND MICHAEL BONG FROM MILWAUKEE, WI. Thats a very nice comment u left in here sir Is there an update to make this work with A+ additional gpio? Things attached to my gpio ports on the physical pins between 27-40 are not responding when using python version of wiringpi2, however if I use “gpio write” and “gpio mode” work fine on the command line. I think the C version is updated, but not sure about Python. this works: getting some errors which end with ImportError: No module named pygments.lexer Any ideas on what I am actually missing or how to start debugging?I get similar errors when I try from easy_install or pip or trying to install from git version Traceback (most recent call last): File “/usr/bin/pip”, line 5, in from pkg_resources import load_entry_point File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2727, in add_activation_listener(lambda dist: dist.activate()) File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 700, in subscribe callback(dist) File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2727, in add_activation_listener(lambda dist: dist.activate()) File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2230, in activate map(declare_namespace, self._get_metadata(‘namespace_packages.txt’)) File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 1827, in declare_namespace _handle_ns(packageName, path_item) File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 1797, in _handle_ns loader.load_module(packageName); module.__path__ = path File “/usr/lib/python2.7/pkgutil.py”, line 246, in load_module mod = imp.load_module(fullname, self.file, self.filename, self.etc) File “/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py”, line 3, in except ImportError: File “/usr/lib/pymodules/python2.7/mpl_toolkits/axes_grid1/__init__.py”, line 2, in from axes_divider import Divider, SubplotDivider, LocatableAxes, \ File “/usr/lib/pymodules/python2.7/mpl_toolkits/axes_grid1/axes_divider.py”, line 14, in import matplotlib.transforms as mtransforms File “/usr/lib/pymodules/python2.7/matplotlib/__init__.py”, line 134, in from matplotlib.rcsetup import (defaultParams, File “/usr/lib/pymodules/python2.7/matplotlib/rcsetup.py”, line 15, in Partially fixed once I realised that the missing package was called python-pygments and not just pygments. also needed python-sphinx. Now issue is import matplotlib.transforms as mtransforms File “/usr/lib/pymodules/python2.7/matplotlib/__init__.py”, line 134, in from matplotlib.rcsetup import (defaultParams, ImportError: cannot import name defaultParams removed matplotlib with purge, then installed it again and everything now seems to work (sudo apt-get –purge remove python-matplotlib) […] For wiringpi, see — and beginners install guide, see .. This is an example of it’s general use in […] Thanks for this page. After so many googling and researches I found this site which helped me to install wringpi2. I want to use this wiringpi2 to get GPIO_GCLK working. Hi all works until: Sudo pip install wiringpi2 I get: Cannot fetch index base URL Cannot find any downloads that satisfy the requirement wiringpi2 No distributions at all found for wiringpi2 Is something down somewhere? Thanks I typed in a simple Python example to test the pins. It works fine from cli, but when I open in Python Gui I get an error saying ImportError: no module named wiringPi2 No idea, sorry. I don’t use a Python GUI at all. Was it IDLE? Most GPIO libraries require root priviliges. I wonder if it’s something to do with that? need to import wiringpi2 (note the p is lowercase). yep that’d be it. Good catch. I missed it. Doesn’t work with python3. Import error, wiringpi2 not found :( OK with python2 The “sudo pip install wiringpi2” gives a lot of errors on the new Raspian-Jessie. It does not work (the check at the end) Forget my message. Retried it with a fresh image and IT WORKS, thanks Every thing seemed to load OK, but when I try to import wiringpi2 I get no module named wiringpi2 I am using a PiZero It does not work on my Pi2 either, I get the same message. I rebooted and that did not help I think there were some changes recently. What happens if you just remove the 2? Does it work now? If so, I’ll update the instructions. It worked great, Thanks for your help and fast response. My wiringpi2 doesn’t work. Is wiringpi2 compatible with python 3?? The issue: Python 3.4.2 (default, Oct 19 2014, 13:31:11) [GCC 4.9.1] on linux Type “help”, “copyright”, “credits” or “license” for more information. >>> import wiringpi2 Traceback (most recent call last): File “”, line 1, in File “/usr/local/lib/python3.4/dist-packages/wiringpi2-1.1.1-py3.4-linux-armv7l.egg/wiringpi2.py”, line 28, in _wiringpi2 = swig_import_helper() File “/usr/local/lib/python3.4/dist-packages/wiringpi2-1.1.1-py3.4-linux-armv7l.egg/wiringpi2.py”, line 24, in swig_import_helper _mod = imp.load_module(‘_wiringpi2’, fp, pathname, description) File “/usr/lib/python3.4/imp.py”, line 243, in load_module return load_dynamic(name, filename, file) ImportError: /usr/local/lib/python3.4/dist-packages/wiringpi2-1.1.1-py3.4-linux-armv7l.egg/_wiringpi2.cpython-34m.so: undefined symbol: PyString_FromStringAndSize Can someone help,please…… Yep – wiringpi python changed recently. Change all references from wiringpi2 to wiringpi and it should work. This was discovered yesterday and a solution is in the works so as not to break backward compatibility. The instructions will be updated to reflect this. Any update on using Python3 with wiringPi? I have been struggling for a couple of days with getting a simple I/O program running under Python3. Just ran it under Python2.7 and it successfully ran first time. By thew way – on RPi3B, fully updated. The installation seemed to go OK. I can run the board rev test above ok, but had found that when running under Python3 Idle, I had to import wiringPi (no ‘2’). Did the same in my I/O program. Under Python3 it seems to restart a couple of times, as if it locks up when a wiringPi call is made. As I said, runs perfectly under Python2.7. I don’t use wiringPi myself, but does help? If not, is the best place to report problems, rather than the raspi.tv blog ;-) I followed the instructions and it installed correctly. When I run python from the command prompt using the ‘sudo python’ command, I can import the wiringpi package (importing wringpi2 apparently doesn’t work anymore, you have to import ‘wiringpi’ with python 3). However, when I run Python (3) IDLE from the start menu and try to import wiringpi, it can’t locate any package called wiringpi or wiringpi2. It is as if the installation never happened. Did anyone find a solution to this. Even i am facing what ChrisG is facing. Thank you. Was sure banging my head as to why this was not working. Thank you for this tutorial. But I have a question At the beginninig I got an error when I’ve tried to install wiringpi, so I’ve tried this command sudo pip install wiringpi2 –upgrade an this is normally fixed the problem. Then I’ve checked that the package was sucessfully installed in the python environment and I got the same result as u. But when I wanted to import wiringpi in the python script. I got this error” No module named wiringpi” What could be the problem? As I mentioned earlier, you’ll be much better off asking for help at than you are by posting comments on a 6-year-old blog article on RasPi.tv ;-) I already found a solution. Thanks for ur help
http://raspi.tv/how-to-install-wiringpi2-for-python-on-the-raspberry-pi
CC-MAIN-2019-39
refinedweb
1,849
67.55
----- Original Message ----- From: Jon Lancelle <lancelle@pacbell.net> To: <cocoon-dev@xml.apache.org> Sent: Saturday, December 09, 2000 2:34 PM Subject: Re: Strange errors saying Sitemap is unavailable > I had a problem building the latest CVS version, and after upgrading my > jaxp.jar to 1.1, it built fine. Do we even need jaxp? I put the three > files, jaxp.jar, crimson.jar, and xalan.jar under JAVA_HOME/jre/lib/ext. > > I am also getting the sitemap not available message, and am running > tomcat 3.2 when trying to bring up cocoon2. I think I will upgrade to > the latest build of tomcat 4, and see what's up. > > Jon Lancelle You do not need jaxp.jar and Crimson --esp. in the /jre/lib/ext folder. You should put your XML parsers in the classpath at the same level as everything else--cocoon needs a SAX2 parser (namespace support). The other jars simply get in the way. > Berin Loritsch wrote: > > > In one of the commits last night, Cocoon became broken on > > WebSphere. Hopefully someone can help me with it. I don't > > seem to have any exceptions thrown (at least that are logged). > > The Stylesheet is generated AND compiles. I don't know if there > > is an error in loading it or not. > > > > I am going to look into it today, but if someone fixes it > > before then let me know. I *did* test my stuff before committing > > it. I found that the reason for this is that the ResourceClassLoader is not loading the compiled sitemap class. I have not been able to track down the specific error--but I am running J-Test on it now. We have three uncaught SecurityExceptions that can be generated.
http://mail-archives.apache.org/mod_mbox/cocoon-dev/200012.mbox/%3C007f01c062b3$11023800$3200a8c0@calvary.org%3E
CC-MAIN-2017-04
refinedweb
288
78.55
Sunday, May 31, 2009 Renaming the wheel: a parable "Your majesty," they said, "we have this innovation we call the axle; since last year we have improved efficiency with the wheel, but this combination of wheel and axle will bring glory to the kingdom and wealth to the royal treasury, and also be more environmentally friendly." Rehoboam told them to come back in a few days. According to 1 Kings 12:5-7, he got some good advice from his father's former senior officials: "If you want them to serve and obey you, then you should do what they ask today. Tell them you will make their work easier." About the cart-makers guild, the advisors said: "That 'wheel and axle' thing looks way cool. If you offer them additional supplies from the royal machine shop, our wheeled-vehicle technology will be the envy of the region. About the terminology -- that's beneath your majesty's notice; let them call it what they want. Should not decisions be made at the lowest reasonable level in the organization?" Tragically, Rehoboam rejected this good advice (1 Kings 12:8) and turned to some young hot-heads who told him to answer the people harshly. Even worse, one architecture astronaut said, "Rather than 'wheel' and 'axle', your highness, I suggest that 'rod' and 'reel' would be more appropriate and bring more glory to your majesty, and they all begin with your majesty's initial. And besides, you're the king; you get to decide." Three days later, the people returned, and Rehoboam answered them harshly (1 Kings 12:12-14). In an unrecorded further comment, Rehoboam also told the GM reps, uh, the cart-makers' guild, "You have to use the words 'rod and reel', not 'wheel and axle', or no more access to the royal machine shop." "But your majesty!" they replied, "All our papyri use the words 'wheel' and 'axle'!" Rehoboam was unmoved. "Forget all the innovation crap until you rework your documentation to use the new approved words, 'rod' and 'reel'. I'm king; I get to decide." The results were unfortunate, as recorded in 1 Kings 12:15-19. The ten northern tribes separated from the tribes of Benjamin and Judah. They were never reunited. And after being beaten down, the cart-makers' guild gave up their wheeled-vehicle technology and went into the manufacture of cast idols instead. They never recovered either. Saturday, May 30, 2009 Three perfect days in Yosemite! pydoc for friendly up-to-date documentation $ ./plext1.py -hor they just type the script name without parameters, and the script tells them they have to provide this or that parameter. Here's a screen-scrape: $ ./plext1.py -helpIf you type plext1.py --help or similar, you'll get the same thing. ./plext1.py:. $ Now suppose you want to provide a website (a wiki, say) with the "help" messages for a bunch of these scripts. You could run each script, snarf'n'barf the help message, and put that onto your wiki. This might be OK if you just have a couple of scripts and you never (well, hardly ever) change them. But even with just a few scripts, you've got denormalized (redundant) data -- data that can easily get out of date. That is, whenever you change one of the scripts, you have to snarf'n'barf the help message again, if you want the website to stay up to date. This is a waste of time, if not easily forgotten.... How about having a CGI that runs the script and displays the help message? This is such a bad idea that I don't even know where to begin.... But what if you had a CGI that would run pydoc(1) on the script? It might be able to print something like this: $ pydoc /home/collin/plext1.pyEven better, the CGI could run pydoc -w and then spit the result onto your page, something like what you see at plext1.html. Now how cool is that? Help on module plext1: NAME plext1 FILE /home/collin/plext1.py DESCRIPTION. FUNCTIONS find_longest_match(an_arg, legal_words) main(args) The parameter is a list; we expect sys.argv[1:] -- i.e. just the words, not the script name. printwords(a_list) show_answer(an_arg, legal_words) an_arg is a long string like "ivngmarlbkstvl" (MUST BE all lowercase); legal_words is a list of words from the dictionary. usage() DATA verbose = False words = '/usr/share/dict/words' Anyway, if you want to see the source of the program, here it is. Note that the entire content is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. #!/usr/bin/python -ttDid that sound too much like a commercial? Too bad :) # vim:sw=4:et "".""" import re import sys words = "/usr/share/dict/words" verbose = False def main(args): """The parameter is a list; we expect sys.argv[1:] -- i.e. just the words, not the script name.""" global verbose legal_words = [] all_lower = re.compile('[a-z]*$') w = open(words, 'r') for a_word in w: if all_lower.match(a_word): legal_words.append(a_word.rstrip()) w.close() got_a_word = False for an_arg in args: if an_arg == "-v": verbose = True continue # Not a flag; it's a plext puzzle if all_lower.match(an_arg): show_answer(an_arg.lower(), legal_words) got_a_word = True else: usage() if not got_a_word: print "Didn't get any words." usage() sys.exit(0) def usage(): print sys.argv[0] + ":", __doc__ sys.exit(1) def show_answer(an_arg, legal_words): """an_arg is a long string like "ivngmarlbkstvl" (MUST BE all lowercase); legal_words is a list of words from the dictionary.""" num_words = 0 # none so far while len(an_arg) > 0: (match_len, some_words) = find_longest_match(an_arg, legal_words) num_words = num_words + 1 print `num_words` + ": matched '" + an_arg[:match_len] + "':", printwords(some_words) an_arg = an_arg[match_len:] print "my best answer is:", num_words, "words" def find_longest_match(an_arg, legal_words): len_matched = 0 pat = "" the_list = legal_words # loop entry: # the_list -> words matching len_matched bytes of an_arg # pat -> pattern showing len_matched bytes while len(the_list) and len_matched < len(an_arg): if verbose: print "trying to match:", an_arg[:len_matched+1] old_list = the_list pat = pat + '.*' + an_arg[len_matched] pat_re = re.compile(pat) the_list = filter(lambda aword: pat_re.match(aword), old_list) len_matched = len_matched + 1 # At this point: Either we matched all of an_arg, or... if len(the_list): # Matched the whole thing if verbose: print "matched all of '" + an_arg + "': e.g.", printwords(the_list) return (len_matched, the_list) else: # Here, the_list is empty. So we matched len_matched-1 bytes. if verbose: print "matched", len_matched-1, "bytes of", print "'" + an_arg + "': e.g.", printwords(old_list) return (len_matched-1, old_list) def printwords(a_list): if len(a_list) == 1: print a_list[0] return # else print a_list[0], "or", a_list[len(a_list)-1] if __name__ == '__main__': main(sys.argv[1:]) High school prank... She... AddendumIf you look closely at the link above, you'll note that the author is with the Daily News Group -- i.e., the Redwood City Daily News and its siblings. The San Mateo Daily Journal has this story. Wednesday, May 20, 2009 Exploratorium! I. Sunday, May 17, 2009 A flight from God... and from each other? The whole mechanism of modern life is geared for a flight from God and from the spirit into the wilderness of neurosis.That was written over a half-century ago, before 80+ channels of cable TV, before email, before cheap cellphones and pagers, before Facebook and Twitter. Flight from God indeed! There's a flight from ourselves and from each other too.Thomas Merton, No Man Is an Island, p. 109 If you're unsure about my extrapolated conclusion, consider how many times in the past week you sent an email -- whereas a few years ago you would have picked up the phone and heard the sound of their voice in your ears? And a few years ago, you might have heard some hesitation, or a catch in your friend's voice, and asked what was happening, and maybe your friend would describe some major or minor catastrophe. Maybe you couldn't "do anything" to help, concretely, but you would have connected in a way you didn't with last week's email. And why email? Well, why not? You (or I) can be a lot more productive with email. You could probably contact a half-dozen different “communities” during the time it took for that hypothetical conversation, and experienced a lot less drama doing it. This rationale has two gaping holes in it, of course -- first, as not-so-subtly hinted at by the quoted “blue type,” these communities may be diluted by the lack of face-to-face communication. If the words we exchange are mediated by keyboard and screen, our communication is thin indeed. And if our chosen medium makes it easy to avoid drama, well, it also makes it easy to avoid heart-to-heart contact. Sometimes another's catastrophe elicits feelings within ourselves -- feelings that aren't always comfortable; as Judd Hirsch tells Timothy Hutton in Ordinary People, "it doesn't always tickle." And so it's easier to send the email or text than to call on the phone. Or avoid communication altogether and play a video game or watch a DVD. As DeGrandpre wrote, [W]e are in flight from reality ... to escape the unpleasantness of our immediate inner and outer lives, which ranges from boredom and restlessness to anxiety and despair.Immediate life is painful, so we go for experiences mediated by keyboard (or joystick) and screen; we flee ourselves, each other, and God.Digitopia: The Look of the New Digital You by Richard DeGrandpre, p. 74 The other problem with my somewhat tongue-in-cheek rationale is simply this: even if the "communities" we're contacting aren't dilute, why is it better to contact more of them in a shorter time? Why is it always preferable to use an easier method and "accomplish more" than to follow a time-consuming process and "accomplish less"? That is the (largely) unquestioned modern assumption: that more is better. This is probably closer to what Merton originally had in mind. The thing about this modern perspective is that it is far from false. Modern methods led to the development of dwarf wheat, by which over a billion human lives were saved. This is undeniably pleasing to our Creator. With modern mass-produced vaccines, we have eradicated smallpox. But technology enabled Ponzi schemes, pump-and-dump fraud, the abuse of credit default swaps, and other specifically modern felonies. In addition, we have a new set of uniquely modern psychological disorders, though I don't know of the APA has identified them as such. I recently heard about a person who is exhausted by being with a small group of people, terrified of unmediated interpersonal interactions. Over the phone or on email, though -- no problem! My heart goes out to this person, who could never have developed this affliction back when all interactions were immediate. So what?I'm not advocating, in this electronic medium, that we burn our cellphones and unplug our internet connections. But I do hope that you and I remember to use the phone sometimes, instead of email or text messages. And that we sometimes get on the road and meet face to face, instead of "meeting" electronically. Saturday, May 16, 2009 Do CEOs matter? Alas, sometimes they do.. Thursday, May 14, 2009 Bike to Work day, May 14 - Why are there headwinds both ways? - The sound of cheering and applause... from volunteers at a table on Middlefield near Ellis! They had some giveaways I think. At the Nasa/Bayshore light rail stop, I spied my friend Kerry, part of the sponsoring organization. She was packing up their stuff (it was after 9:30); I grabbed a banana segment and got back on the road. - Food! There was free food at the office: registered cyclists received a bag containing - a sports drink (something like Gatorade® but generic?); - a Clif® bar -- mine was "carrot cake"; - an apple; and - a bottle of water (crystal geyser® i think) - In the morning I took Middlefield Road all the way to Ellis, going over Highway 85 (a mild incline is involved). A friend told me that he avoids that overpass, so I skipped it on the return trip, passing under 85 on Moffett. It was a little easier, but either way Google Maps® reports 14.4 miles. - On the way home, I caught up to two other cyclists. Both of them wore unisex cycling tights (I was wearing loose athletic shorts of a kind the lovely Carol detests). One of them looked back, then pulled ahead -- a competitive fellow, or maybe he just decided he'd had enough of a break. I continued behind the other one, who I realized after a while was a woman. Though I enjoyed the slightly slower pace, I didn't want this lady to think I was looking at her backside (which I was). So I went around her when the traffic permitted. I passed the competitive(?) fellow when he detoured into a supermarket. - I guess I was in a hurry (I certainly was on the way home) because I realized I hadn't stopped for water the whole way. - My bike don't get no respect. One of my colleagues (he of the multi-thousand$ road bike) came over the next day to taunt me about locking up my 35-year-old machine (I bought it when I was a college freshman in 1974). Why would anyone bother locking that thing up, he wondered. "That bicycle carried me to the beach and back many times, and to Big Basin!" I retorted. "Well, you don't weigh very much," he said. Hurmpf. Monday, May 11, 2009 Jury duty! Around 11:40, we were told to take an early lunch and be back by 1pm. A few minutes after 1:00, we were told to go to a certain courtroom and await instructions. The presiding judge arrived. He started us off with some good news: this morning's waiting around was going to count as our jury service for this year. Whew! He explained a change in the court system made about a decade ago, and he also explained what happened in the case we were called in for. Sometimes, he said, having a bunch of prospective jurors waiting around downstairs is what it takes to get these guys to settle a case. They know what they'd like to say and do at trial, but when the 75-80 people are milling around downstairs... it's only then that they say, "Gee, do I really want a jury to hear all this about my client?" I had this scenario in my mind's eye: The lawyers are posturing back and forth. The judge is trying to get them to settle. The defendant is clearly guilty, and this reality is finally hitting the defense attorney. It's getting close to lunch time, and the judge says, "Counselor, there are about 75 rather impatient jurors downstairs, ready to roast your client's anatomy. I suggest you settle." Of course that isn't what actually happens, but it was amusing to imagine it. my opinion on the 5/19 propositions - 1. Sunday, May 10, 2009 A perfect day We were back at headquarters around 3:20pm. I took my boots off and had a little drink. We visited the restroom (running water and flush toilets at headquarters! Yay!), then Carol drove us down the hill and back to Redwood City. We parked the car, and I bought our tickets: 6pm showing, which gave us time for a quick dinner at the Chipotle Grill on Theatre Way. I inhaled a burrito, and probably too many chips. The burrito was great; the chips... well, let's just say we pitched the leftovers. Great burrito though, and very quick. The lovely Carol had a salad, which was also great (I had a bite). The film, Star Trek (2009), was fabulous. It deviates in many places from the history of starfleet as we know it, but that's OK. It's got great FX, a reasonable (well, not utterly stooopid) plot, and some terrific lines. "Careful with the ship, Spock; she's brand new." We got home about 8:30 and chatted with our teen-ager. I helped her with some computer stuff. We took showers and got to bed early. A perfect end to a perfect Saturday. Today, Mother's Day (Mothers' Day?), we started off with homemade blueberry waffles; the teenager set the table and created a fruit plate. Dinner was Swiss steak (a childhood favorite of the lovely Carol); I also sauteed carrots and zucchini in olive oil with some Italian seasoning. The teenager whipped up the potatoes, and made up some Jell-O for dessert. And now it's time to work on the dishes. Thursday, May 07, 2009 Papa Haydn's Surprise This was some years ago, and our copy was on cassette tape. It was a delightful story. The reader, Ann Rachlin, is masterful. If your kids are at all interested in music, you should consider putting this on your MP3 player (iPod® or similar), or burning it onto a CD... and playing it over and over again for them. Click here and listen to a few 30-second clips and see what I mean! Monday, May 04, 2009 Fear or Faith.! In these cases, one could imagine responding from fear, or from faith. Here's what I mean. We could decide to go I could decide to ask her out (You've got the idea.) It's obvious that you decline sex with the stranger, you turn in the cash, you report your winnings on your tax returns. Other decisions are not quite so clear-cut. - really exciting... job in another state - based on faith that God will help us take care of the kids, and that he will use the work I do at my job to bless the world; --or-- - based on fear that if I pass this up, I'll never have another chance! - based on faith that God will provide future opportunities, --or-- - based on fear about the kids. - just [got] dumped... start something with that woman who started coming to our church -. - based on faith that when the right person comes around, it'll be more evident to me; --or-- - based on fear that this one will end in disaster too. - boyfriend ... aren't meant for each other! Mental health day People.
http://collinpark.blogspot.com/2009/05/
CC-MAIN-2018-30
refinedweb
3,079
73.58
Learn to Use ITensor Case Study: TRG Algorithm The handful of techniques we have covered so far (ITensor contraction and SVD) are already enough to implement a powerful algorithm: the tensor renormalization group (TRG). First proposed by Levin and Nave (cond-mat/0611687), TRG is a strategy for contracting a network of tensors connected in a two-dimensional lattice pattern by decimating the network in a heirarchical fashion. The term "renormalization group" refers to processes where less important information at small distance scales is repeatedly discarded until only the most important information remains. The Problem. One dimension In one dimension, spins only have two neighbors since they are arranged along a chain. For a finite-size system of N Ising spins, the usual convention is to use periodic boundary conditions meaning that the Nth spin connects back to the first around a circle: The classic "transfer matrix" trick for computing @@Z@@ goes as follows: where @@\text{Tr}@@ means "trace" and the transfer matrix @@M@@ is a 2x2 matrix with elements. Two dimensions Now let us consider the main problem of interest. For two dimensions, the energy function can be written. The TRG Algorithm@@ : Implementing TRG in ITensor Finally we are ready to implement the algorithm above using ITensor. At the end of this section we will arrive at a complete working code, but let's look at each piece step by step. To get started, start with the following empty application: #include "itensor/all_basic.h" using namespace itensor; int main() { //Our code will go here return 0; } First define some basic parameters of the calculation, such as the temperature "T"; the maximum number of singular values "maxm"; and the top-most scale we want to reach with TRG: Real T = 3.0; int maxm = 20; int topscale = 6; Next define the indices which will go on the initial "A" tensor: auto m0 = 2; auto x = Index("x0",m0,Xtype); auto y = Index("y0",m0,Ytype); auto x2 = prime(x,2); auto y2 = prime(y,2); Here it is good practice to save the index dimension @@m_0=2@@ into its own variable to prevent "magic numbers" from appearing later in the code. The constants XType and YType are "IndexType" tags which let us conveniently manipulate only horizontal or only vertical indices later on. It is also convenient to save copies of x and y with prime level raised to 2 as the variables x2 and y2. Now let's create the "A" tensor defining the partition function and set its values as discussed in the previous section: auto A = ITensor(x,y2,x2,y); auto Sig = [](int s) { return 1.-2.*(s-1); }; auto E0 = -4 P = exp(-(E-E0)/T); A.set(x(s1),y2(s2),x2(s3),y(s4),P); } The first line creates the "A" tensor with indices x,y2,x2,y and all elements set to zero. The next line defines a "lambda" function bound to the variable name Sig which converts integers 1 and 2 into Ising spin values +1.0 and -1.0. To set the elements of A, we loop over integers s1,s2,s3,s4. The function range1(d) returns an object that can be used in a for loop to iterate over the integers 1,2,3,...,d. One slight difference with the convention of the previous section is that here the Boltzmann probability weight P has an energy shift of E0 = -4.0 in the exponent. This will keep the norm of the rescaled A tensors from growing too quickly later. Though it changes @@Z@@ , it does so in a way that is easy to account for. Finally we are ready to dive into the main TRG algorithm loop. To reach scale @@N@@ we need to do @@N-1@@ steps, so we will write a loop that does this number of steps: for(auto scale : range(topscale)) { printfln("\n---------- Scale %d -> %d ----------",scale,1+scale); //...TRG algorithm code will go here... } In contrast to the earlier range1 function which starts at 1, range(topscale) makes the for loop run over 0,1,...,topscale-1. In the body of this loop let us first "grab" the x and y indices of the A tensor at the current scale. auto y = noprime(findtype(A,Ytype)); auto y2 = prime(y,2); auto x = noprime(findtype(A,Xtype)); auto x2 = prime(x,2); Although on the first pass these are just the same indices we defined before, new indices will arise as A refers to tensors at higher scales. The function findtype(T,IndexType) searches through the indices of a tensor and returns the first index whose type matches the specified IndexType. Since we want the version of this index with prime level 0, we call noprime to reset the prime level to zero. We also create versions of these indices with prime level 2 for convenience. Now it's time to decompose the current A tensor as discussed in the previous section. First the A=F1*F3 factorization: auto F1 = ITensor(x2,y); auto F3 = ITensor(x,y2); auto xname = format("x%d",scale+1); factor(A,F1,F3,{"Maxm",maxm,"ShowEigs",true, "IndexType",Xtype,"IndexName",xname}); We create the ITensors F1 and F3 with the indices of A we want them to have after the factorization. This tells the factor routine how to group the indices of A. Along with the tensors, we pass some named arguments. The argument "Maxm" puts a limit on how many singular values are kept in the SVD. Setting "ShowEigs" to true shows helpful information about the truncation of singular values (actually the squares of the singular values which are called "density matrix eigenvalues"). Also we pass an IndexType and name for the new index which will be created to connect F1 and F3. The line auto xname = format("x%d",scale+1); is a string formatting operation; if for example scale == 2 then xname will be "x3". We can write very similar code to do the A=F2*F4 factorization, the main difference being which indices of A we request to end up on F2 versus F4: auto F2 = ITensor(x,y); auto F4 = ITensor(y2,x2); auto yname = format("y%d",scale+1); factor(A,F2,F4,{"Maxm=",maxm,"ShowEigs=",true, "IndexType=",Ytype,"IndexName=",yname}); For the last step of the TRG algorithm we combine the factors of the A tensor at the current scale to create a "renormalized" A tensor at the next scale: auto l13 = commonIndex(F1,F3); A = F1 * noprime(F4) * prime(F2,2) * prime(F3,l13,2); The first line grabs a copy of the index common to F1 and F3, which is convenient to have for the next line. The second line first contracts F1 with F4, then the result of this contraction with F2, and finally with F3 to produce the new A tensor. The functions wrapping the F tensors adjust the prime levels of various indices so that the indices we want contracted with match while the indices we don't want contracted will have unique prime levels. In more detail, noprime(F4) returns a copy of F4 (without copying F4's data) such that all indices have prime level 0. Calling prime(F2,2) increases the prime level of all of F2's indices by 2. And prime(F3,l13,2) raises the prime level of just the index l13 by 2. Try drawing the tensor diagram showing the contraction of the F tensors to convince yourself that the prime levels work out correctly. Last but not least, after we have proceeded through each scale we want to take the last A tensor at the "top scale" specified and compute observables from it. Though this tensor contains a wealth of information, we will look at the simplest case of computing the partition function @@Z@@ . To obtain @@Z@@ from the top tensor, all we have to do is trace both the x indices with each other and trace the y indices with each other, which results in a scalar tensor whose value is @@Z@@ : In ITensor, you can compute a trace by creating a special type of sparse ITensor called a delta. A delta tensor has only diagonal elements, all equal to 1.0. Pictorially, you can view the delta tensors as the dashed lines in the above diagram. Let us grab the x and y indices of the top tensor: auto xt = noprime(findtype(A,Xtype)); auto yt = noprime(findtype(A,Ytype)); auto xt2 = prime(xt,2); auto yt2 = prime(yt,2); Then use these indices to create delta tensors: auto Trx = delta(xt,xt2); auto Try = delta(yt,yt2); Finally we contract these tensors with "A" and convert the result to a real number to obtain @@Z@@ : auto Z = (Trx*A*Try).real(); An interesting quantity to print out is @@\ln(Z)/N_s@@ where @@N_s = 2^{1+N}@@ is the number of sites "contained" in the top tensor at scale @@N@@ : Real Ns = pow(2,1+topscale); printfln("log(Z)/Ns = %.12f",log(Z)/Ns); With the conventions for the probability weights we have chosen, we can check @@\ln(Z)/N_s@@ against the following exact result (for an infinite-sized system): where the constant @@k=1/\sinh(2\beta)^2@@ and recall @@\beta=1/T@@ . Click the link just below to view a complete, working sample code you can compile yourself. Compare the value of @@\ln(Z)/N_s@@ you get to the exact result. How does adjusting maxm and topscale affect your result? #include "itensor/all_basic.h" using namespace itensor; int main() { Real T = 3.; int maxm = 20; int topscale = 6; auto m0 = 2; auto x = Index("x0",m0,Xtype); auto y = Index("y0",m0,Ytype); auto x2 = prime(x,2); auto y2 = prime(y,2); auto A = ITensor(x,y2,x2,y); auto Sig = [](int s) { return 1.-2.*(s-1); }; auto E0 = val = exp(-(E-E0)/T); A.set(x(s1),y2(s2),x2(s3),y(s4),val); } for(auto scale : range(topscale)) { printfln("\n---------- Scale %d -> %d ----------",scale,1+scale); auto y = noprime(findtype(A,Ytype)); auto y2 = prime(y,2); auto x = noprime(findtype(A,Xtype)); auto x2 = prime(x,2); auto F1 = ITensor(x2,y); auto F3 = ITensor(x,y2); auto xname = format("x%d",scale+1); factor(A,F1,F3,{"Maxm=",maxm,"ShowEigs=",true, "IndexType=",Xtype,"IndexName=",xname}); auto F2 = ITensor(x,y); auto F4 = ITensor(y2,x2); auto yname = format("y%d",scale+1); factor(A,F2,F4,{"Maxm=",maxm,"ShowEigs=",true, "IndexType=",Ytype,"IndexName=",yname}); auto l13 = commonIndex(F1,F3); A = F1 * noprime(F4) * prime(F2,2) * prime(F3,l13,2); } println("\n---------- Calculating at Scale ",topscale," ----------"); auto xt = noprime(findtype(A,Xtype)); auto yt = noprime(findtype(A,Ytype)); auto xt2 = prime(xt,2); auto yt2 = prime(yt,2); auto Trx = delta(xt,xt2); auto Try = delta(yt,yt2); auto Z = (Trx*A*Try).real(); Real Ns = pow(2,1+topscale); printfln("log(Z)/Ns = %.12f",log(Z)/Ns); return 0; } Download the full example code Next Steps for You to Try Modify the sample application to read in parameters from a file, using the ITensor input parameter system. Following the details in the appendix of the "Tensor Network Renormalization" paper arxiv:1412.0732, for the critical temperature @@T_c=2/\ln(1+\sqrt{2})@@ trace the top-scale "A" tensor in the x direction, then diagonalize the resulting matrix to obtain the leading scaling dimensions of the critical 2 dimensional Ising model. Following the paper arxiv:0903.1069, include an "impurity tensor" which measures the magnetization of a single Ising spin, and compare your results at various temperatures to the exact solution. Pro Tip: for tasks 2 and 3 above, it is a good idea to modify the TRG code such that A gets normalized after each step, for example by adding a line A /= norm(A);. The exact normalization is not so important (trace norm versus Frobenius norm); the idea is to prevent A from getting too big, which will definitely occur after too many iterations. When computing observables such as the magnetization, it is sufficient to use the "effective" partition function @@Z_\text{eff}@@ obtained by double-tracing the top-scale A, regardless of how it is normalized. References The original paper on TRG: Levin and Nave, "Tensor Renormalization Group Approach to Two-Dimensional Classical Lattice Models", PRL 99, 120601 (2007) cond-mat Factorizing ITensors IQTensor Overview
http://itensor.org/docs.cgi?page=book/trg
CC-MAIN-2019-18
refinedweb
2,070
55.88
On Thu, Feb 04, 2010 at 05:34:36PM +0000, Matthew Booth wrote: > > + int prompt = isatty (0) ? 2 : 0; > > You've already got this in a global. In fact, I can't see it used > anywhere. Doesn't this generate a warning? Yup, this is a bug -- removed -- thanks. > > + buf = rl_gets (" key> "); > > + buf = rl_gets ("value> "); > > Why no indentation on this prompt, as for key? So they line up ^^^ > > + if (!buf) { > > + fprintf (stderr, _("hivexsh: setval: unexpected end of input\n")); > > + quit = 1; > > + goto error; > > + } > > + > > + if (STREQ (buf, "none")) { > > + values[i].t = hive_t_none; > > + values[i].len = 0; > > + } > > + else if (STRPREFIX (buf, "string:")) { > > + buf += 7; > > + values[i].t = hive_t_string; > > + int nr_chars = strlen (buf); > > + values[i].len = 2 * (nr_chars + 1); > > + values[i].value = malloc (values[i].len); > > + if (!values[i].value) { > > + perror ("malloc"); > > + exit (EXIT_FAILURE); > > + } > > + for (j = 0; j <= /* sic */ nr_chars; ++j) { > > + if (buf[j] & 0x80) { > > + fprintf (stderr, _("hivexsh: string(utf16le): only 7 bit ASCII strings are supported for input\n")); > > + goto error; > > + } > > + values[i].value[2*j] = buf[j]; > > + values[i].value[2*j+1] = '\0'; > > There must be a library function to do the above. Where does the 7 bit > ASCII restriction come from? There's iconv, but that's even crazier than doing it by hand. This is fine for 7 bit ASCII, but would break if you pass in UTF-8 (hence the check that no high bits are set). > This doesn't look like regedit's expandstring format. What's the purpose > of it? > > > + else if (STRPREFIX (buf, "expandstring:")) { Not sure what you mean -- expandstring is a separate type in the hive. We don't care about what regedit may or may not do. > > + xerr = xstrtol (buf, NULL, 0, &n, ""); > > Does xstrtol support 0x notation? Yes. > > +#if 0 > > + if (n < 0 || n > UINT64_MAX) { > > + fprintf (stderr, _("%s: %s: integer out of range\n"), > > + "setval", "dword"); > > + goto error; > > + } > > +#endif > > Why have you commented this out? You can't test a 64 bit int against UINT64_MAX. In any case it's just documentation of what the limits are. > > + for (j = 0; *buf && j < 2; buf++) { > > + if (c_isxdigit (*buf)) { /* NB: ignore non-hex digits. */ > > The documentation defines the limiter to be a comma. I'd stick to this > strictly, making it more likely to catch typos. The documentation just says that non-hex digits are ignored, and I can't be bothered to code more complex parsing here. Rich. -- Richard Jones, Virtualization Group, Red Hat New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd
https://www.redhat.com/archives/libguestfs/2010-February/msg00059.html
CC-MAIN-2015-11
refinedweb
426
77.23
In previous installments on part-of-speech tagging, we saw that a Brill Tagger provides significant accuracy improvements over the Ngram Taggers combined with Regex and Affix Tagging. With the latest 2.0 beta releases (2.0b8 as of this writing), NLTK has included a ClassifierBasedTagger as well as a pre-trained tagger used by the nltk.tag.pos_tag method. Based on the name, then pre-trained tagger appears to be a ClassifierBasedTagger trained on the treebank corpus using a MaxentClassifier. So let’s see how a classifier tagger compares to the brill tagger. NLTK Training Sets For the brown corpus, I trained on 2/3 of the reviews, lore, and romance categories, and tested against the remaining 1/3. For conll2000, I used the standard train.txt vs test.txt. And for treebank, I again used a 2/3 vs 1/3 split. import itertools from nltk.corpus import brown, conll2000, treebank brown_reviews = brown.tagged_sents(categories=['reviews']) brown_reviews_cutoff = len(brown_reviews) * 2 / 3 brown_lore = brown.tagged_sents(categories=['lore']) brown_lore_cutoff = len(brown_lore) * 2 / 3 brown_romance = brown.tagged_sents(categories=['romance']) brown_romance_cutoff = len(brown_romance) * 2 / 3 brown_train = list(itertools.chain(brown_reviews[:brown_reviews_cutoff], brown_lore[:brown_lore_cutoff], brown_romance[:brown_romance_cutoff])) brown_test = list(itertools.chain(brown_reviews[brown_reviews_cutoff:], brown_lore[brown_lore_cutoff:], brown_romance[brown_romance_cutoff:])) conll_train = conll2000.tagged_sents('train.txt') conll_test = conll2000.tagged_sents('test.txt') treebank_cutoff = len(treebank.tagged_sents()) * 2 / 3 treebank_train = treebank.tagged_sents()[:treebank_cutoff] treebank_test = treebank.tagged_sents()[treebank_cutoff:] Naive Bayes Classifier Taggers There are 3 new taggers referenced below: cposis an instance of ClassifierBasedPOSTagger using the default NaiveBayesClassifier. It was trained by doing ClassifierBasedPOSTagger(train=train_sents) craubtis like cpos, but has the raubttagger from part 2 as a backoff tagger by doing ClassifierBasedPOSTagger(train=train_sents, backoff=raubt) bcposis a BrillTagger using cposas its initial tagger instead of raubt. The raubt tagger is the same as from part 2, and braubt is from part 3. postag is NLTK’s pre-trained tagger used by the pos_tag function. It can be loaded using nltk.data.load(nltk.tag._POS_TAGGER). Accuracy Evaluation Tagger accuracy was determined by calling the evaluate method with the test set on each trained tagger. Here are the results: Conclusions The above results are quite interesting, and lead to a few conclusions: - Training data is hugely significant when it comes to accuracy. This is why brown, while at the same time can get near 100% accuracy on treebank. - A ClassifierBasedPOSTagger does not need a backoff tagger, since cposaccuracy is exactly the same as for craubtacross all corpora. - The ClassifierBasedPOSTagger is not necessarily more accurate than the bcraubttagger from part 3 (at least with the default feature detector). It also takes much longer to train and tag (more details below) and so may not be worth the tradeoff in efficiency. - Using brill tagger will nearly always increase the accuracy of your initial tagger, but not by much. I was also surprised at how much more accurate cpos. Thinking that postag was probably trained on the full treebank corpus, I did the same, and re-evaluated: cpos = ClassifierBasedPOSTagger(train=treebank.tagged_sents()) cpos.evaluate(treebank_test) The result was 98.08% accuracy. So the remaining 2% difference must be due to the MaxentClassifier being more accurate than the naive bayes classifier, and/or the use of a different feature detector. I tried again with classifier_builder=MaxentClassifier.train and only got to 98.4% accuracy. So I can only conclude that a different feature detector is used. Hopefully the NLTK leaders will publish the training method so we can all know for sure. Classification Efficiency On the nltk-users list, there was a question about which tagger is the most computationaly economic. I can’t tell you the right answer, but I can definitely say that ClassifierBasedPOSTagger is the wrong answer. During accuracy evaluation, I noticed that the cpos tagger took a lot longer than raubt or braubt. So I ran timeit on the tag method of each tagger, and got the following results: This was run with python 2.6.4 on an Athlon 64 Dual Core 4600+ with 3G RAM, but the important thing is the relative times. braubt is over 246 times faster than cpos! To put it another way, braubt can process over 66666 words/sec, where cpos can only do 270 words/sec and postag only 483 words/sec. So the lesson is: do not use a classifier based tagger if speed is an issue. Here’s the code for timing postag. You can do the same thing for any other pickled tagger by replacing nltk.tag._POS_TAGGER with a nltk.data accessible path with a .pickle suffix for the load method. import nltk, timeit text = nltk.word_tokenize('And now for something completely different') setup = 'import nltk.data, nltk.tag; tagger = nltk.data.load(nltk.tag._POS_TAGGER)' t = timeit.Timer('tagger.tag(%s)' % text, setup) print 'timing postag 1000 times' spent = t.timeit(number=1000) print 'took %.5f secs/pass' % (spent / 1000) File Size There’s also a significant difference in the file size of the pickled taggers (trained on treebank): Fin I think there’s a lot of room for experimentation with classifier based taggers and their feature detectors. But if speed is an issue for you, don’t even bother. In that case, stick with a simpler tagger that’s nearly as accurate and orders of magnitude faster. Pingback: Accurate and Fastest NLTK tagger. | Anu B Nair() Pingback: Au Naturale - An introduction to NLTK for NLP in Python()
http://streamhacker.com/2010/04/12/pos-tag-nltk-brill-classifier/
CC-MAIN-2016-07
refinedweb
900
50.63
We are about to switch to a new forum software. Until then we have removed the registration on this forum. Hi, I tried to load a series of gif files using the gifAnimation library and encountered "OutOfMemoryError". I have tried increasing the memory settings but encountered the same error. The problem occurs at Line 15. This is how the code looks like: import gifAnimation.*; Gif scene0, scene1A, scene1B, scene2; int cplay = 0; //Current gif playing. void setup() { size(1920, 1080); background(0); imageMode(CENTER); scene0 = new Gif(this, "Scene 0.gif"); scene1A = new Gif(this, "Scene 1 - A.gif"); scene1B = new Gif(this, "Scene 1 - B.gif"); scene2 = new Gif(this, "Scene 2.gif"); scene0.play() cplay = 0; } void draw() { if(cplay == 0){ image(scene0, width/2, height/2 - 150); } else if (cplay == 1){ image(scene1A, width/2, height/2); image(scene1B, width/2, height/2); } else { image(scene2, width/2, height/2); } } void mouseReleased(){ cplay = cplay + 1; scene0.stop(); scene1A.stop(); scene1B.stop(); if(cplay == 0){ scene0.play(); } else if (cplay == 1){ scene1A.play(); scene1B.play(); } else { scene2.play(); } } Regards. Answers Quick test you can do on your side and report. If you run one file at the time, do you get any error? Can you share your gif files? Kf If I run one file at the time, the error does not occur. When I load multiple file with increased memory, the startup took a while before it fully loads and it consumes quite a lot of memory. Just wondering if Processing is not a suitable environment for animation? These are my GIF files: Open source ===> Who knows ? It really depends on your expectations and your resources as in computer and in resources as what you are trying to load. Is the Gif library the most suitable tool for you? As it is right now, it seems it is not working for you. If you check the source code of the library, a gif object is treated as an array of PImages. How big are those gifs? I do not work with gifs so I can't tell how it would perform. If you share them, people could run (likely) your code and provide some feedback. On a side note, notice that 1A and 1B are overlapping. Is that intended or you forgot to introduce an offset when displaying that pair of gif objects? You can also discuss more about your animation's details and forum goers could provide relevant feedback. By the way, you might be interested in checking the exhibition section to see what people has done before. Kf I have provided the links to my GIFs in the previous comments. I intend to make the 1B to run after the 1A. Maybe I code wrongly on that part? "You need permission Want in? Ask for access, or switch to an account with permission." good job. Sorry. Try this link: scene2 is 72 frames, all 1920x1080. 19MB compressed... that's why you're out of memory. Is there any other way to efficiently play a long animation? I wonder if instead of the gif file, you play a movie type of object. You should be able to convert the gif into a movie by retrieving the PImage array and using VideoExport by hamoid. This should be done in a separate sketch. However I am not sure if it is going to work. I am assuming playing a movie would be more efficient and you are not been limited by the computing power of your machine. Plus I usually handle movies with smaller image dimensions. A quick test would be to get a few movies with that image size and play them together. If it works, then Movie would be the way to go. Please take my comment with a grain of salt as I am not an expert in this topic. And I didn't test your code... I can't atm. Related to this comment: Based on your code scene 1A and 1B are shown together. Not sure what you mean 1B run after 1A then. Kf I will try that out. Thanks a lot.
https://forum.processing.org/two/discussion/26760/outofmemoryerror-when-loading-animated-gif
CC-MAIN-2019-13
refinedweb
690
85.08
Eric Worrall writes: Flamboyant British Billionaire Richard Branson, the man behind Virgin Galactic, the commercial space tourism venture, has been accused by greens of not fulfilling $3 billion of his green funding pledges. According to The Guardian, a prominent Green UK daily newspaper; .” Branson responded that he has lost a lot of money on green investments; “There is no question that Virgin is involved in a number of businesses that emit a lot of carbon, and that is one of the reasons why I have to work particularly hard … but, more importantly, to try to help other people balance their books as well. We have invested hundreds of millions in clean technology projects. We haven’t made hundreds of millions profit,” I guess even green billionaires have to make a choice, eventually, between pursuing green investments, and being a billionaire. To be fair to Branson, he tried – the £300 million he spent and presumably lost is a significant sum. Branson’s experience demonstrates that at the end of the day, only governments have the luxury of being able to sink vast sums into green money pits, without any serious possibility of a return on investment. Good for R.B. this is why the govt needs out of the green business so all that nonviable crap can wither and die a natural death. Or if the market wants it and is willing to support it, fine. Other than that uncle sugar can stop stealing from the taxpayer. So their issue with Branson is that he hasn’t put enough feed in the trough. I bet though what he’s done to date has been tax deductible. Mmm. If it is money lost by investment, then it is deductible (and should be). evanmjones: Mmm. If it is money lost by investment, then it is deductible (and should be). — I could not disagree with you more. Anyone can make irresponsible or criminal choices spending other people’s money with no risk of losses. Covering the losses of fools is completely unacceptable, it rewards failure and encourages a spiral into systemic failure, corruption and criminality. When you risk your own money you do actually try to plan and build real investments which so pay you back, and a whole lot more, and which are then generating a proportion of taxable income. People who want the rewards must always shoulder the risk and remain accountable for their losses. Expecting others to pay for foolish gambling habits is naked public fleecing and theft by a corrupt actor who should be bankrupted then asset stripped to their underwear. That’s how you keep the riff-raff’s hands out of the public cookie jar so you can create and maintain a viable civilization. What you suggest, namely, that tax payers “should” always pay for others gambling losses, is about as wrong-headed as you could possibly be and approximates the mindset of a criminal who’s accustomed to getting away with feeling completely entitled to steal other people’s money. But maybe it’s a winning formula for ‘investment’ success if you’re the Mafia, or else you’re a banker … but I repeat myself. Anyone can make irresponsible or criminal choices spending other people’s money with no risk of losses. Not him. He just lost it. Therefore is is universal practice that he be permitted to deduct it. This is not a Solyndra-type example where he takes no loss. So you believe that if someone makes a poor investment and loses his money that other taxpayers be liable to fund his loses. That’s crap. If he loses it, he should pay all of it. @Unmentionable: You are losing track of the fact that the only way he can write off these losses is to have other income to write it off against. This is long established, and economically sound, tax policy. In general, we do not tax people on gross income, we tax them on net income – however foolish the source of their investment losses appear. unmentionable: “Anyone can make irresponsible or criminal choices spending other people’s money with no risk of losses. Covering the losses of fools is completely unacceptable, it rewards failure and encourages a spiral into systemic failure, corruption and criminality.” So how do you feel about people on welfare, food stamps, unemployment insurance, etc.? You don’t think that in a lot of those cases bad or criminal choices got them into the position they are in? In those cases, is “covering the losses of fools completely unacceptable?” You are describing the concept of “moral hazard” and it is a big challenge for society. We have too much of it today, and that’s largely why just about every country on earth is buried under debt. Unmentionable: if drug companies and innovative companies were not able to write off their losses against the profits of their successful products, there would be no more new medications or innovations, particularly with the high corporate tax rates of the US. Unmentionable, I think you are mistaking a tax write off for a bailout. Nobody is covering his loses, they are simply saying the amount of taxable income he has is less. @Unmentionable Sometimes I read a comment on this site and just shake my head in disbelief. Yours has been one of them. Richard has enough losses to set against tax without needing to lose $300 million trying to make diesel from palm oil, clearly you haven’t noticed that Virgin Atlantic lost £200 million over the last two years and having to pay the excessive cost of using green fuel would just have made that loss even worse. Unlike his Virgin airplanes, Richard Branson will only be seen to go with whatever direction the wind is blowing ……. Virgin Hot Air We have invested hundreds of millions in clean technology projects. We haven’t made hundreds of millions profit, The ‘green’ activists don’t give a damn if businesses go bankrupt trying to finance their pipe dreams. Branson, fortunately, is a a pragmatic businessman first and a mush mouthed ‘environmentalist’ second. Perhaps the Greens failed to notice that “investment” implies future positive returns. Perhaps they should Google “Cut your losses.” I imagine that Branson’s commit and the money that he did spend got him access to some very powerful people that he might not otherwise have had access to, and during their conversations is strikes me as plausible that other subjects of interest to Branson’s corporate entities may have come up…. I expect that Branson considers the 300 mil as being better spent than he may publicly admit. David, Branson is the person everyone else wants access to! Especially in the UK all doors open for him. He doesn’t spend money to impress anyone. Regards, Ed As long a $200M went to Obama and the democrat party or else Holder will have to investigate RB. He probably reckons that the three hundred he has spent is the price of experience, and he is not going to throw any more down the drain. There is no such thing as a low carbon fuel that is economically and financially sound. If he has got wisdom, and has met interesting and/or useful people, that is all to the good. The UN/governments of the world claim that AGW is a threat….the $300 million is perhaps the price of doing business in such a ;’climate’…npi… “npi” What is “npi”? ..no pun intended.. Got it. T.y. As of mid-August, Tom Steyer had only raised $7mil of the $50mil he had pledged to match, for a potential $100mil to “green” candidates in this election cycle. Looks like Steyer’s performance will come up laughingly short. All that stuff is based on the premise that the technology actually works. Then they go in bigtime. But not only has the investment seriously underperformed, but there is no easy fix on the horizon to turn the equation around. The investori must be more than a little miffed at those who presented the prospecti. But if their ain’t no gold in them thar hills, they catch on pretty quick. If they could somehow come up with a tremendous leap in battery tech, then they would have a shot. But that turns out to be very damn difficult. And this isn’t the first time it has been tried, either. Reliable Legend tells us that Ford hired Edison (not cheap) to come up with a battery that would work for a car. Edison reported great success: “I came up with 50 ingenious ways not to make a battery.” I am led to believe that the first motor vehicle death ever recorded in the USA involved an electric car. What is your problem? Get with the program! Sometimes they got stuck on “on”. Anthony, small correction, you stated English Pounds (£) for the 2.7 unfunded amount, when it’s good ole American $$$. A small currency conversion. The article states he pledged $3 Billion, which works out to be £1.8b. I’m not being nit picky, but I’ve seen people go ballistic (mostly elsewhere) over simple grammatical errors, etc.. I don’t want your “competitors” to have any ammunition to try and discredit you. Some people will latch onto anything and make accusations on the accuracy or your postings.. Just some feedback. [author was Eric Worrall, fixed -mod] MikeH, good spot – thanks for the correction. I’ll have to work on my reading comprehension skills. Welcome to the club! Steven Goddard wrote a post on mine! I just knew that green was only about the money! I don’t object to doing well by doing good. (But you need to go better than 0 for 2.) The naivety of someone expecting Branson to fulfil his pledges is touching. His method of working is to let someone else run a service and bear the risk while he allows them to use the “Virgin” brand and concentrates on being the loveable businessman with a beard who doesn’t care about money (but somehow seems to have lots of it in his personal account. He got good publicity from making the promises but he was never going to go any further than that. I would have thought that green activists knew all about hollow promises, they use them all the time themselves. Of course our Dick has a track record. Search on Branson sues and you find items like ‘virgin’.” try to register the Virgin Olive Oil Shop and you will hear from his lawyers. The man is ruthless. BTW, he also manages to hide the finances of his empire which is why you have such widely differing estimates. Back in my paintball days, I used to carry a bottle of extra virgin olive oil in my kit. Useful stuff. (Besides, you never know when you may require one.) Currently it sounds like Expression Engine is the preferred blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog? Of course it was all a lie. But a few million to the right people will bury that fact faster than modern science. Branson was stupid to promise that he would invest so much. He should have figured out that the economics of green investments don’t justify much investment, BEFORE he made the promise. It seems as if he’s figured it out now. I think he owes no apologies. He made his promise (and lost his money) based on information received that was hopelessly incorrect. If anything, he is the one who is owed an apology. Richard Branson is a money driven & totally ruthless businessman who tried & failed to suppress the Tom Bower biography of him. He’s a wolf in green sheepskin. Greens are supremely well funded : The public images of both Branson & the Greenies, sold to us by the corporate lamestream media, is so far from reality that those media are now beyond a joke. Have to laugh that this article appears in The Guardian – a paper so focused on being successful and profitable that even its own CEO thought last year that it will not survive! Perhaps it took heart from Greenpeace Reality is perhaps dawning on CEO’s of businesses and they realise that as governments wind back their support for the Alarmists (the UK Government calling them the “Green Taliban” is pretty indicative of a shift in opinion) – then why should they throw good money at people who refuse to see reality? It has long been said that if the Financial Services Industry used data to predict fund performance the deeply flawed way that climate models abuse the underlying actual performance/temp data then those individuals would end up in jail – and quite rightly so. Perhaps the likes of Branson et al are getting hard info from advisers as to the accuracy of the Alarmists position. good money Productive effort that the world never gets back. Perhaps Mr Branson could consider investing in nuclear power. I am sure Kirk Sorenson could do with some of that promised funding to move along the development of the Liquid Fluoride Thorium Reactor, the only sensible long term solution to providing significant amounts of electricity without using fossil fuel or wasting large areas of land with next to useless windmills or part time solar farms. You often hear of Greens whining that sceptics are in the pay of Big Oil, is Branson now the equivalent of the so called Koch brothers. OTOH, I never objected to the “bros.” in the first place. Richard didn’t get to where he is today wasting cash, he’s seen through the scam so the money tap is off. Good on him. Anyway his answer is simple: “you’ll get your money when I get my global warming” This pretty well covers it. Branson is not going to chuck good cash into a money pit when he can see no return. When he pledged the cash he clearly saw a PR win and the possibility that he was buying into a money making venture. The whole biofuel/corn ethanol thing has since gone a bit toxic. There is still plenty of PR mileage in looking green though so don’t expect a U-turn any time soon. Naomi is probably doing the green coffers no favours by alienating him but her red pulp has burst out of her green skin. Branson’s buddy Burt Rutan got to him, I imagine. Had a talk. And by the way, Burt Rutan has a massive grassroots enthusiast audience each year at the annual Experimental Aircraft Show in Oshkosh, Wisconsin, where he is quite outspoken, that 100K American garage builders of private planes gather after they fly in carried by their own garage built aircraft, many designed by someone named Burt Rutan. “Branson’s buddy Burt Rutan got to him, I imagine. Had a talk. ” You nailed it. I never understood how Branson can be that naive warmist posterboy while he’s working with Rutan, who completely destroyed Global Warming theory in his slides and lectures. Probably Rutan just laughed at him long enough until he understood he’s on the wrong side of a trade. Thanks to the above comments ……. I fully agree, how can he be involved alongside Burt Rutan and not be influenced. Mr Rutan has many talks out there which make his thinking very plane ( pun !!! ) …… they must have sat down and talked about this stuff at some point ……. If Branson did not absorb something during his time with Burt, then I have no hope for the man ??? Naomi Klein is an anti-capitalist except when it serves her. “The Economist, in 2002, accused her of writing “page after page of engaging blather, totally devoid of substance”, with “all the incoherence and self-righteous disgust of an alienated adolescent”, whilst giving capitalism “no credit for the extraordinary progress seen in recent decades in reducing poverty and other measures of deprivation – notably child mortality – in the world’s poorest countries”. “Her new book, This Changes Everything she lists specific points that need addressing – the reversal of privatization, more taxation, stricter regulation of business, higher government spending – and prioritizes wealth distribution to win “the war our economic model is waging against life on earth”. Branson’s reply is easy: “You give me my global warming and I’ll give you your money” In fact if he comes back from this hurtful sleight with a fighting reply like that maybe others will cut back the waste too, including government Branson’s reply is easy: “You give me my global warming and I’ll give you your money” In fact if he comes back from this hurtful sleight with a fighting reply like that maybe others will cut back the waste too, including government then we all win Reneging on a promise ? That’s no way for an ‘Ocean Elder’ to behave Two of the most hypocritical egos on earth come into such close proximity and still no all consuming sucking singularity forms in the space between them? Is that weird or what? In the UK, Dulux has heard that green billionaires like to “p1ss money up against the wall”, so they’ve introduced an exclusive new color: it costs £1,000,000 a tin and it’s called “Pee Green”. /joke Branson may have billions in assets but are they totally unencumbered? If he has lost $300 million then that could prove problematic, it’s just enough to trip up any company that may be overextended here or there. I can’t make up who I despise more. Branson or the Greens. Either way I am laughing. Branson’s experience demonstrates that at the end of the day, only governments have the luxury of being able to sink vast sums into green money pits, without any serious possibility of a return on investment. WHAT!!!! Governments have no money, they spend our money sometimes very badly on schemes that have no base in reality, like CAGW. Get Real Anthony. I think Anthony understood that. I liked his slam on government waste. If governments have so much of your money to afford mad cap schemes then you are being overtaxed. Richar Branson is not stupid. Virgin Records, Coke, Atlantic and Galactic. If he’s not putting his money into the green machine then it’s clear he sees he cannot make money out of the “industry”. The gig is certainly up for the CAGW crowd. Is it “not stupid” to tell his workforce that those who are sceptical should find jobs elsewhere? I bet the day after the number of fault reports sky-rocketed and the clear up rate plummeted as all his engineers updated their CV. Remember he is on the “EMPLOYER” side of the employer/employee equasion. Branson in a pickle ???? Possibly – hell hath no fury like a green fanatic scorned 🙂 Eric Worrall For the benefit of you and others who may not know, saveenergy was making a joke (and revealing he is British). A British sandwich delicacy is Branston Pickle. Partial puns with more than one meaning are very British humour as displayed, for example, in Carry On films. Richard Infamy! @evanmjones September 14, 2014 at 11:39 pm “Mmm. If it is money lost by investment, then it is deductible (and should be).” Surely he could only claim back what he ‘PAIDED’ in taxes from a business. If the business went bust before making a return, then no tax, therefore all the money is LOST. Yes, the money is lost. Therefore he can (and should be able to) deduct those losses, as applicable. If you had to pay tax on investment money that yields no return (that is, in fact, lost entirely), there would be a lot less investment. I don’t understand why Naomi Klein is a star. I’ve read some of her writing, it lacks depth and shows her inexperience. She writes like a high school kid. Why do so many people insist on referencing and quoting this person? She’s kind of the gift which keeps on giving, IMO… Because they think (and I use the term loosely) like high school kids? I’m sad to say I once liked RIchard Branson. However, whether I have grown older or wiser or he has grown older and more pathetic, he now looks like some pensioner trying to be “in” with the kids a fraction of his age. The final straw was when he more or less said he didn’t want anyone working for him who had looked at the scientific evidence and agreed it hadn’t warmed in the last 17 years. Which, as most engineers are sceptical at least to a degree, is more or less saying “my engineers can go f** themselves”. I saw an interview of Branson on TV yesterday, not sure when it was taken. He said that all of the profits of his airline are being spent to develop an alternative to jet fuel and he expected to switch over his fleet within 5 years. For someone so obviously capable as a businessman, it’s an incredibly stupid commitment to make. I’ve lost a fortune in the last week. I asked me how much for a green thing and I told me a green thing would cost me a fortune. So I paid me a fortune. Luckily, the expense is tax-deductible – because the thing I bought from me is green. I’m so happy to do have done business with me. Naomi Klein, cannot answer any questions right now has they are busy on a around the world book flogging tour , to tell people how they are evil if they fly. Expect if you of the left and the have books to flog that is. But its to her credit that rather than go to live a ‘socialists paradise ‘, such has Cube, she has the courage to remain in the land of the ‘evil capitalists’ . Living the type of privileged life not only those that get to experience first-hand a ‘socialists paradise ‘would kill for and but plenty of others actual living in the same ‘evil capitalists’ land can only dream about. Even Branson knows its a scam. Gives the greens just enough money so he can go to the parties and be socially acceptable. Jack September 15, 2014 at 12:11 am Yep, Branson is a koch. He is to Green business what ‘dad-dancing’ is to disco. We have invested hundreds of millions in clean technology projects. We haven’t made hundreds of millions profit,” ============== Branson doesn’t say he lost money, only that he didn’t double his money. However, there certainly is an implication he doesn’t see a future in increased investment. The downside of corporate taxes for the public is that when companies make money, the public makes money through increased tax revenues. However, when companies lose money, they are able to use this loss to avoid paying taxes on money they did make. As a taxpayer, we should be very concerned when misguided activists such as Naomi Klein suggest that increased taxes and income redistribution will solve the worlds problems. The only solution that has actually been shown to work over the centuries is the economic model where people are allowed by governments to keep the fruits of their labors. Most of the worlds problems can be traced directly to the other economic model, where the powerful of the earth take the fruits of the labors of the rest of us, typically under force of law set by the same powerful.. There is plenty to go around on this earth, if people were allowed to keep what they earn, to spend as they see fit. Without the powerful trying to dictate how the money we earn would be better spent, if only they were allowed to spend it. Thus, they should have the right to take from the poor, to give to the rich. .” That 1 in 7 was probably not on profits or surplus; but on the entire harvest – of which the peasant had to put back half or so as seed for the next season. So it was likely existentially threatening; and in reality more like 1 in 3 of the surplus. At least that is approximately what the system was in Germany ca. 1000 years ago. Where the Naomi Klein’s of the world go wrong is in the assumption that governments are somehow able to take money from the rich and redistribute this to help the poor. Nothing could be further from the truth. Governments are powerless to take money from the rich. The rich use their money to protect themselves from governments. Entire industries exist solely for the purpose of helping rich people avoid taxes. Entire countries exist just for this purpose. Governments that do try and take this money find that it quickly leaves the country for safe havens, and the local economy collapses, often bringing down the government in it wake. It is the poor that pay the taxes that support governments, because it is the poor that lack the resources to avoid taxes. Redistribution schemes at best take money from the poor to give to the poor, allowing the rich to skim the cream off the top. Thus, when the rich get into trouble, there are wall street and bank bailouts, all paid for by the poor. When the poor get into trouble, they truly are in trouble. No one comes to their aid, except the likewise poor. Government has a very hard time taking money from Sir Richard. That’s why he can’t spend longer than 90 days a year in Old Blighty. This blessed plot, this earth, this realm…this Necker Island. gee, who do the poor work for then ? I used to work for one of his premier companies. Absolutely shocking once you draw back the curtain. How he and his companies get away with the favourable press they get in the UK I just don’t understand. Its all rubbish. As for the Green stuff…trust me, they believe it & it comes from the top. Or at least RB makes his people repeat the mantra. As an insider I can tell you the money they waste on this is shocking…I guess mouthing platitudes to greens is what its about perhaps. This is the Emperor’s New Clothes played out with an emperor who was bright enough to detect the scam, but is too compromised to do much about it. In the picture I see Gore. He too has dumped green investments. Branson should realise that it’s all for the sake of the planet and the grandchildren. Surely balancing the books and saving the Earth should not be compared. Follow the money. He didn’t say he lost 300 million, only that he didn’t make as much in profit. It could be that he profited 100 million out of hi 300 million. Hard to tell. There are plenty of green businesses which have gone completely bust in the recent past, such as Solyndra. And Branson has form (at least he claims form) for reimbursing investors out of his own pocket when possible, when investments go bad – at least, that is what he claimed in his book “Losing my Virginity”. Eric, he may have reimbursed the “correct” people (joe average no name guy surely ate his own losses), but the act was entirely strategic to either protect himself from being an clique outcast or to use as leverage in promotion of his brand (or book). It was not an act of humility or kindness – neither trait exists in him. His every act is to curate brand branson “It could be that he profited 100 million out of his 300 million” can be interpreted many ways: That would mean that he got back his 300 million investment plus 100 million. Or that he continues to leave the original 300 million in the business and gets a return of 100 million annually. If that were the case, he’d stay in. And, oh yes, is the 100 million pre or after tax? Was the investment his or shareholders’ money? One can communicate business issues very clearly – but only by using precise language consistent with ‘generally accepted accounting principles.’ Perhaps the most misunderstood concept in these blogs is ‘write offs’ followed by confusing revenue with profit. Sounds like extortion. or bulling. Give me your lunch money or I will talk trash about you. “We have invested hundreds of millions in green technology…” I will simply note the “We” could mean anyone. “We” does not mean “I”. Notwithstanding that equivocation, his statement is still useful as an accurate comment on the results of investing in “green” technologies. As a recovering consultant, I can attest that word-smithing is an art form with these folks. The definition of green technology is anything that causes even a slight reduction in “harmful” acts or products. For example, using an new app that incidentally and indirectly helps them layoff people is an example of using green technology to reduce company related carbon usage (e.g., commuting). It’s not a war, it’s an expanded terrorism prevention operation outsourced to the military who already happened to be in or near the the required country of interest. Let’s hear how much the Guardian has spent (wasted) on green efforts. No fulfilling his pledges? Does that mean he won’t get his “Simon and Garfunkel: The Concert in Central Park” CD and Greenpeace umbrella?
https://wattsupwiththat.com/2014/09/14/wheres-our-money-greens-accuse-billionaire-richard-branson-of-not-fulfilling-pledges/
CC-MAIN-2018-30
refinedweb
4,958
70.94
It was few years back on my first year of studies, when my friend told me about Python. Then it was great for me. One-liners could read ftp folders, web pages, interact with operation system, list comprehension, injecting code into life programs, nested functions, procedural as object oriented programming styles etc. etc. All of this in bultin libraries with simple but yet quite functional editor, supported with great documentation. I wrote my first studies project in Python and I was proud with it a little . During next years I was using Python for writing simple scripts to automate my proffesional work as PHP programmer. Python was and I still think is better language then PHP. After that I started to work as .NET/C# developer. It has diffrent syntax but C similarities let me to learn it quite quick. Framework .NET is powerfull tool also so I didn't touch Python for 2 or 3 years at least for anything longer then few lines. But a week or so ago I decided to write a simple script to automate reading whole RSS channel. I wanted it to filter it for only those news that I was interested in. I decided to use Python for it. I was considering also PowerShell since it is bultin into Windows and it an benefit from .NET. But I don't like it's weird syntax, and since I wanted to just write this script and not struggle with syntax errors I chose Python. I don't want to say that I made an mistake. I still powerfull language and I manage to write this script quickly, but... there was some misunderstanding. Maybe I am more experienced. Or spoiled with C#, or used to it. Or just picky. Nonetheless I decided to share this with the world. One of this things was global versus local scope clash. I probablye would get over it if not other things. Let us consider little program like this: global_var= 1 def func_with_local_scope(): print(global_var) func_with_local_scope() print(global_var) I does really simple thing: prints value '1' two times. Despite the fact that func has it's own local scope aside from global scope, it will work cause interpreter will think about as 'global_var' variable as global. It is correct behavior. Now let is change a bit: global_var= 1 def inc(): print(global_var) global_var+=1 inc() print(global_var) And... it will fail. Why? File "test.py", line 4, in inc print(global_var)UnboundLocalError: local variable 'global_var' referenced before assignment My first reaction was: "Huh?" How it is not assigned? It is done right before this function. Let's inspect scopes inside 'inc' function: GLOBALS: {'__name__': '__main__', 'global_var': 1, '__package__': None, '__doc__': None, 'inc': <function inc at 0x00000000031EC488>, '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__file__': 'F:\\skrypty\\music_rss\\test.py', '__builtins__': <module 'builtins'>} LOCALS: {} It is perfectly fine! Our variable is defined in global scope and it has value! And local scope is empty since I did not declared any local variables. Why system that is resolving variables names do not check for global scope when it is trying to find value? Because doing any assignment in function tells interpreter that this variable WILL be assigned in function and without declaring it with 'global' keyword it WILL be local variable. I know that. I understand that. And I think that is inconsistent and it should be done better. I would agreed to use always 'global' keyword or always not using and just letting interpreter do the job. Either way would be fine since it is consistent and desinger of the laguage decided to this that way. I his call. I could not be ideal but it would be intuitive. Let's do one test: global_var = 1 class Incrementer: print(global_var) global_var+=1 print(global_var) def inc(self): print(global_var) print(self.global_var) i = Incrementer() i.inc() print(global_var) When I was writing this I was expecting it to fail with my knowledge of scopes in functions. But I also was suspecting that this actually might work and I will find more scope inconsistencies. And there it is. I work just fine. I mean it run but it certainly do that like Spanish Inquisition. Result will be: 1 2121 First '1' is print(global_var) inside class declaration. Despite the fact that variable with this name is defined later in class and since this would cause an error in function I would expect it to fail here also. Here comes another 'Huh?'. Instead it is resolved to global variable. Second print is done after incrementing variable with the same name. Which is it? It is global variable? Or it is new local class variable? If code would be end here it would be good, tricky question for interview for Python job (maybe it is I don't know). Simple programmer like me would expect (if you reference variable with the same name in the same way it SHOULD be the same variable). No. It is not. Third print show that to us. It is global variable with the same name and it is still simple '1'. Doing incrementation in class scope of global variable (as I would expect) creates new local class variable and assign to it value of global variable PLUS one. How in hell this is incrementation? Forth print shows us value of two and actual place of incremented value. It is know in class variable with same name as global variable. I will call this inrementation with displacement. Python-like. Last print shows us global unchanged variable. It still there, not touched. Uhm... I don't know. Maybe this is explained somethere in documentation. Maybe it is logical somewhere in bowels of interpreter. Or whatever magic thing make this work. I don't know. I don't have time and will to dig in few hundres pages of documentation for specifics of inner workings of something so basic like arithmetical operators. And frankly I don't care. Throw and error, when you trying to increment value that is not there - like C. Resolve it to global variable like in JS. Prevent to name the variable just like another variable in scope level above - like C#. Just pick one please. And be consistent. Another one exist only in Python 3, contrary to previous. It begins with decision that all strings should be unicode. That is great. Resolving encodings is pain in the ass. But... console have it's encoding too. I don't know how this work in other systems then Windows but I suspect it's problem too since when googling for answer I found that in happened not only to me. So what happens when you get some unicode char that can't be encoded in console specific encoding? It suppose to show some not readable characters like │┐čŠč╣˝ˇ│ or just ? sings, don't you think? No. It throws exception. Program crash. End of story. It is command line. It is tool to interacting with users. If user will have to make something from information that 10% of it is giberish that is bad not it is not critical. When application is throwing an error when encoding string to some specific encoding when saving data to for example to DB, it probably be desired to throw error. But not in output! It is even more horrible because writing an app in Python you cannot know for sure what will be user interface encoding so you cannot be prepared on anything with tool like this. So script below will work fine in Python Shell fine and will fail in cmd.exe: string = 'показано' print(sys.stdout.encoding) print(string) With exception like that: File "C:\Python33\lib\encodings\cp852.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0]UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-7: character maps to <undefined> I added line print(sys.stdout.encoding) so I know that Python internally know what encoding is in output. This can be used to do something like this BEFORE print: string.encode('cp852','replace') so every char that can't be encoded will be replaced with something else. But why this cannot be done inside print? Why print at least cannot have another param to silently pass encoding errors? Another one that is connected with 3 version. In previous releases I used Python to debug http response of websites. It was really nice tool for it with set_http_debuglevel method of HTTPHandler class. send: 'GET / HTTP/1.1\r\nAccept-Encoding: identity\r\nHost:\r\nConnection: close\r\nUser-Agent: Python-urllib/2.7\r\n\r\n'reply: 'HTTP/1.0 200 OK\r\n'header: Server: arisheader: Expires: Thu, 07 Feb 2013 21:21:24 GMTheader: Last-Modified: Thu, 07 Feb 2013 21:21:24 GMTheader: Pragma: no-cacheheader: Cache-Control: no-cacheheader: Content-type: text/html; charset=UTF-8header: Set-Cookie: reksticket=1360272084; expires=Sat, 09-Feb-2013 21:21:24 GMT; path=/; domain=.: Set-Cookie: rekticket=1360272084; expires=Sat, 09-Feb-2013 21:21:24 GMT; path=/; domain=.wp.plheader: Set-Cookie: statid=89.71.103.226.25161:1360272084:324990297:v1; path=/; expires=Sun, 07-Feb-16 21:21:24 GMTheader: Set-Cookie: statid=89.71.103.226.25161:1360272084:324990297:v1; domain=.wp.pl; path=/; expires=Sun, 07-Feb-16 21:21:24 GMTheader: Content-Length: 94719header: Connection: close It not working in Python 3: import urllib.request h=urllib.request.HTTPHandler() h.set_http_debuglevel(1) b=urllib .request.build_opener(h) a=b.open('').readall() This feature was not documented as far as I know. I have found this in 'Dive in Python' book (). I suspect this was to non important to keep maintaint it in new versions. So much that it was not even removed. I could go on with lack of nice function for handling dates and time. Or 'self' (non)keyword inside class declarations. But this rant is long enough as it is. Maybe I will write another script in PowerShell, after fighting with syntax it will be more usable for simple scripts. About Me
https://internetexception.com/category/Python
CC-MAIN-2019-26
refinedweb
1,687
68.06
Java Program: How to Parse a String into Integer in Java Programming Java Program: Parse String into Integer in Java Programming with a Sample Java Source Code Parsing in Java is also a known practice by the Java Programmers. There are many reasons why a programmer parse a string into integer and for the sake of knowledge let us know how parsing takes place. Parsing usually use when extracting integers inside a string entered by the user. I first used it in a basic calculator program using joptionpane and jframe. The series of numbers and operators is entered by the user and the challenge is to solve it, identify the numbers and the operators inside the string and output the correct answer. However, in the following Java Source Code, we will just cover on how to use the parseInt() in Java. The program will compute the string entered by the user. So, to compute it, we will parse the string into integer. See the Java Source Code below. Related Hub for String Java Source Code on How to Parse a String into Integer package parsing_in_java; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a number: "); String string_num1 = input.nextLine(); // string is use instead of int System.out.print("Enter another number: "); String string_num2 = input.nextLine(); int integer_num1 = Integer.parseInt(string_num1);//this is how to parse string int integer_num2 = Integer.parseInt(string_num2);//another example on parsing System.out.println("The sum is: " + (integer_num1 + integer_num2)); } } Sample Output: Do you find this hub useful to you? Then, please rate it or leave a comment. Source Code Samples - Java Program: How to Use If Statement in Java Programming - Java Program: Using Multi If and Else Statement in Java Programming - Java Program: How to Use If Statement
https://hubpages.com/technology/-Java-Program-How-to-Parse-a-String-into-Integer-in-Java-Programming
CC-MAIN-2017-30
refinedweb
307
56.96
I don't see require there, but nevermind. I'll just "blindly" use require. )) Thank you! Type: Posts; User: karpatyx@ya.ru I don't see require there, but nevermind. I'll just "blindly" use require. )) Thank you! But how is it loaded in Sencha's MVC example (extjs\examples\app\simple\)? Thank you, it works. Just one detail I still don't understand: Ext.require('ikhtml.model.User'); // it works only if I add this line to module. var usersStore =... Hello guys, For some reason I'd like to control CRUD actions for my objects by myself using, for example manual Ext.data.JsonP.requests. So, let's assume I have User model and some method that... I tried using namespace but without success: ikhtml.on({ ... }); How I decided to move on: App.js: I see. Thank you very much. Let's imagine that I have deep namespaces. I don't like using them all throughout the application. Currently the only nice way to workaround it I found is alternateClassName. But you don't recommend... Let's imagine the following case: Ext.define('app.longNamespace1.longNamespace2.longNamespace3.utils.log.consoleLogger', { singleton: true, alternateClassName: 'consoleLogger', ... But is it recommended by "standards"? It's ok for me, but what if I work in a team - is it "usually" used? And what is the difference between alias and alternateClassName? Thank you. Sorry, but I'll disagree. Controllers have clearly defined role in MVC. My window manager is not a controller, it's class. I wouldn't like adding mess to application just to get single reference. Yes. The problem is not in loading viewport itself but in loading additional xtypes - layouts and tabpanels. Please work on your references. See console to check real reasons! I used chrome's... Hello guys, Sorry for kind of a stupid question, but I believe that anybody of you can answer in 10 seconds while I haven't figured answer yet in 25 minutes :). I have singleton class and I... Hello gyus, Are there any commonly used recommendations on using alternateClassName? Is it good practice? And what is the difference between "alternateClassName" and "alias"? Thank you. Hi, Nice way of communication between controllers is firing/listening application-level events. E.g. I have controller 1 and controller 2. I want controller 2 to do something if something... Much thanks! Now I have what to choose from :) Thank you, it's what I was thinking but you made it clear. And what is "right" way to check whether window is really closed if my reference is still alive? E.g.: var win =... Hi guys Still playing with this. Got the second similar issue with another form. When I close form, reference to it is still defined and contains info that "was actual". However, I'd expect it to... Cool, thanks. I've looked through layout managers but missed to check window itself... Did you put your viewport file to js_app/view/Viewport.js? This is the folder/file where ExtJS will look for it. what exactly would you like to get? Hi guys, One more question please: THere's a window with vbox layout. When I set its size to 120, it's created with much bigger size (about 200-250). I can set 120 only if I set minWidth: 120.... Hi guys, Issue: I'm closing form (I didn't define closeAction, hence it's default - 'destroy') but it's not destroyed. Code for creating/destroying on clicking login/logout buttons: ... Hi all, Within the last few days I've read number of ExtJS MVC discussions. Looks like this topic is fresh and hot. I believe Sencha will come up with really strong MVC improvements in next... Got a workaround. However, I'm not happy with it - it's ugly. On Controller Init: init: function () { this.control({ 'desktop': { beforerender:... Your example works for me. However, the same one using MVC - doesn't. Here are all parts: 1. Index.htm <html> <head> <script src="extjs/ext-debug.js"></script> <script...
https://www.sencha.com/forum/search.php?s=1ecd945aea7f9d9e5eff77a40446a3b5&searchid=18401108
CC-MAIN-2016-50
refinedweb
672
70.7
Aastra 53I Ip Phone LCD display - monochrome. [ Report abuse or wrong photo | Share your Aastra 53I Ip Phone photo ] Manual Preview of first few manual pages (at low quality). Check before download. Click to enlarge. Aastra 53I Ip Phone User reviews and opinions Comments posted on are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us. Documents 53i IP Phone Installation Guide 41-001157-00 Rev 01. Model 53i IP Phone Installation Guide iii Table of Contents Software License Agreement... iii Introduction....1 Phone Features... 1 Requirements.. 1 About This Guide.. 2 Phone Parts... 3 Key Panel....4 Key Description....5 Installation and Setup...7 Direct or Shared Network Connection.. 7 Connecting to the Network and to Power.. 9 Power Adapter... 9 Connecting a Handset or Headset.. 11 Desk or Wall Installation... 12 Inserting the Key Card on your Phone.. 14 Customizing your phone...15 Accessing Your Options via the Phone UI. 15 Accessing Your Options via the Aastra Web UI.. 16 Other Phone Features... 21 Adjusting the Volume... 21 Status Lights (LEDs)... 21 Call Timer... 22 Programmable keys.. 22 Line/Call Appearance Keys.. 23 Using a Headset with your Telephone.. 23 Troubleshooting Solutions...24 Limited Warranty.... 27 Introduction Congratulations on your purchase of the Model 53i IP Phone! The 53i communicates over an IP Network, allowing you to receive and place calls in the same manner as a regular business telephone. The 53i is capable of supporting the SIP protocol. Phone Features 3-line LCD screen 6 top keys: programmable hard keys (up to 6 programmable functions) 3 call appearance lines with LEDs Supports up to 9 call lines Full-duplex speakerphone for handsfree calls Headset support (modular connector) Built-in two-port, 10/100 Ethernet ports - lets you share a connection with your computer Inline power support (based on 802.3af standard) which eliminates power adapters. AC power adapter (included) Enhanced busy lamp fields* Set paging* Telephone Base Desk Legs Power Adapter Ethernet Cable 53i Installation Guide Screws and Anchors for Wall Mounting Optional Accessories (Not Included) PoE (Power over Ethernet) Inline Power Injector Additional Ethernet Cable (category 5/5e straight through cable) A PoE (Power over Ethernet) inline power injector supplies 48v power to the 53i through the Ethernet Cable on pins 4 & 5 and 7 & 8. Warning: Do not use this PoE inline power injector to power other devices. Key Panel 6 programmable keys with LEDs High quality speakerphone HAC handset Goodbye key Options key Hold key Redial Key Volume control Navigational keys 3-line LCD screen Message waiting lamp Keypad Speakerphone/headset toggle key Mute key 3 call appearance lines Key Description* Keys Key Description Goodbye key - Ends an active call. The Goodbye key also exits an open list, such as the Options List, without saving changes. Options key - Accesses options to customize your phone. Your System Administrator may have already customized some of your settings. Check with your System Administrator before changing the administrator-only options. Hold key - Places an active call on hold. To retrieve a held call, press the call appearance button beside the light that is flashing. Redial key - Redials up to 100 previously dialed numbers. Pressing the Redial key twice simultaneously redials the last dialed number. Volume control key - Adjusts the volume for the handset, headset, ringer, and handsfree speaker. See "Adjusting the Volume" on page 21 for more information. Line/Call Appearance key - Connects you to a line or call. The Aastra 53i IP phone supports up to 3 line keys. Handsfree key - Activates Handsfree for making and receiving calls without lifting the handset. When the audio mode option is set, this key is used to switch between a headset and the handsfree speakerphone. See "Customizing your phone" on page 15 for more information. Mute key - Mutes the microphone so that your caller cannot hear you (the light indicator flashes when the microphone is on mute). Key Description. Programmable keys - 6 Top Keys: programmable hard keys (up to 6 programmable functions). The following are the default functions for the programmable keys on the 53i IP phone: 1 - SAVE. 2 - DELETE 3 - DIRECTORY 4 - CALLERS LIST 5 - TRANSFER 6 - CONFERENCE Note: For more information about programming keys 3, 4, and 5 to perform specific functions, see the Aastra Model 53i User Guide. *See the Aastra 53i User Guide for more information about each of these keys. Installation and Setup The 53i can be setup to share a network connection with another network device. Power can be provided by the supplied power adapter or by an 802.3af compliant network power source or with a PoE inline power injector (optional accessory). If your System Administrator has already setup your phone, please refer to the 53 Mbps Ethernet cable ports. The port marked with LAN is used to connect the phone to the network, as well as provide power to your phone (if required). See "Connecting to the Network and to Power" on page 9 for more information. Power Adapter Connection Network Jack (if Inline power provided, do not install the power adapter) Separate Network Jack To Network Other Network Devices. To Other Network Device Network Jack (if Inline power provided, do not install the power adapter) Ethernet Cables Note: The PC jack on the 53i does not supply inline power onto other network devices. All Ethernet cables used must be minimum category 5/5e straightthrough cables, such as the cable provided with your phone. Connecting to the Network and to Power Power Adapter Use the power adapter . Ethernet Cable Network Jack (if Inline power provided, do not install the power adapter) Inline Power Not Provided If your network does not provide 802.3af compliant in-line power, you have to install the power adapter. Model 53i IP Phone Installation Guide 9 PoE Power injector (if Inline power or the power adapter are not provided) Ethernet Cables To PoE Network Jack Power Outlet To Phone To Network Jack Note: You should connect the power supply to a surge protector or power bar. All Ethernet cables used must be minimum category 5/5e straight-through cables, such as the cable provided with your phone. 10 Model 53i IP Phone Installation Guide Connecting a Handset or Headset Headset To Handset Turn the phone over and locate the headset jack marked f. Insert the headset cord into the jack until it clicks into place. Then route the headset cord through the groove as shown in the above illustration. Headset (Optional) Desk or Wall Installation Install on the Desk The desk installation for the 53i IP phone consists of two legs that attach to the back of the phone near the top corners. A total of four different viewing angles allows users to personalize their phone viewing preference.. For a higher viewing angle, use the second and third slots from the top. For a lower viewing angle, use the first and second slots from the top. Then push the stand towards the phone until it snaps into place. Three leg slot locations for customizing the height of the desk phone. 20.7 deg. Incline Angle 23.3 deg. Incline Angle 26.6 deg. Incline Angle 30.9 deg. Incline Angle Total 4 Viewing Angles 12 Model 53i IP Phone Installation Guide Install on the Wall The 53i IP phone has two pre-drilled wall mounting holes on the back of the phone. Using the provided wall mount drilling template, locate and mark the position for the mounting screws on the wall. Depending on the wall type, you may need to use wall anchors. Both the screws and wall anchors are included with your phone. Place the wall mount holes on the phone over the screw heads on the wall and pull down to lock the phone in. Wall Mount Holes Note: You may wish to purchase a short Ethernet cable from a local supplier for a wall installation. Also, if 802.3af compliant in-line power is not provided on your network, and you are installing the 53i on a wall using a PoE in-line power injector, you may also wish to use an equivalent flat Ethernet cable rather than the one provided. Inserting the Key Card on your Phone This card contains the label identification spaces for 6 programmable keys. 1. Remove the clear plastic lens from the top front panel of the telephone by gently pressing down on the lens and sliding upward. 2. Place the card into the programmable key card slot on the top front panel of the telephone using the indentation of the plastic for alignment. 3. With one hand holding the label card in place, gently slide the clear plastic lens into the slots at the top of the programmable key panel. 14 Model 53i IP Phone Installation Guide. Phone Option Access from Phone UI Access from Aastra Web UI. Model 53i IP Phone Installation Guide 15 Accessing Your Options via the Aastra Web UI You can use the following procedure to access the phone options using the Aastra Web UI. Aastra Web UI 1. Open your web browser and enter the phones IP address or host name into the address field. If the browser is using HTTP, the following redirect screen displays, followed by the Security Alert window. This process redirects HTTP to use HTTPS for a more secure connection. 2. Click YES to accept the certificate 3. At the prompt, enter your username and password and click. The Network Status window displays for the IP phone you are accessing. Note: For a user, the default user name is user and the password field is left blank. 16 Model 53i IP Phone Installation Guide 53. Time Format Select a time format for how time displays on your phone (12h or 24h clock).. Date Format Choose from a list of formats for how the date displays on your phone. Time Zone Choose your current time zone. Select your country by scrolling through a list, or by entering the country code (i.e., CA, US), then pick from the time zone list for that country. Daylight Savings This option allows you to specify daylight savings.. Clear Message Waiting To clear the Message Waiting Light, select the Clear softkey. The light will flash again when there are new messages waiting. Contrast Level Use these options to set the preference of contrast level and backlight for your phone. Contrast Level Use the Change softkey to cycle through eight contrast settings, which brighten or darken the display. 18 Model 53i IP Phone Installation Guide Backlight Use the Change softkey to cycle through different backlighting options of OFF, ON, or Auto. Auto backlighting sets the phone to turn off the backlighting after a period of inactivity; the idle period is user definable under the Advanced softkey when you select the Auto option. The backlight is turned on with a key press or state change on the phone. Live Dialpad* This option turns the Live Dial Pad mode ON or OFF. With live dial pad ON, the 53i IP phone automatically dials out and turns ON Handsfree mode as soon as a dial pad key or softkey is pressed. With live dial pad OFF, if you dial a number while the phone is on-hook, lifting the receiver or pressing the initiates a call to that number. Press the Change softkey to turn ON or OFF the dial pad mode. Set Audio The 53i allows you to use a handset, a headset, or handsfree to handle incoming and outgoing calls. The audio mode option provides different combinations of these three methods to provide maximum flexibility in handling calls. There are four audio mode options to choose from: Audio Mode Option Description Speaker This is the default setting. Calls can be made or received using the handset or handsfree speakerphone. In handset audio mode, pressing the button on the phone switches to handsfree speakerphone. In Speaker audio mode, lift the handset to switch to the handset. Choose this setting if you want to make or receive all calls using a handset or headset. Calls can be switched from the handset to headset by pressing the button on the phone. To switch from the headset to the handset, lift the handset. Incoming calls are sent to the handsfree speakerphone first when the button is pressed. By pressing the button again, you can switch back and forth between the handsfree speakerphone and the headset. At anytime, lifting the handset switches back to the handset from either the handsfree speakerphone or the headset. Incoming calls are sent to the headset first when the button is pressed. By pressing the button again, you can switch back and forth between the headset and the handsfree speakerphone. At anytime, lifting the handset switches back to the handset from either the headset or the handsfree speakerphone. Headset Speaker/Headset Headset/Speaker Headset Mic Volume To adjust the headset microphone volume, press Advanced after selecting the audio option, and then select the Low, Medium, or High volume level. Call Forward Use this option to call forward your phone. Use the and buttons to move between the fields to set the call forward Number, Mode, and No. Rings. The selectable call forward mode includes: All, Busy, NoAns (No Answer), BusyNoAns (Busy No Answer), or Off; this is selected via the and buttons. Network This is a system administrator level-only option, and requires a password to access. See the SIP IP Phone Aastra 53i, 55i, 57i, 57i CT Administrator Guide for details. SIP Settings Phone Status This option allows you to: View your network status including your phones IP and MAC address View your firmware version Restart your phone There is also a system administrator level-only option to reset the phone to factory default settings. See your system administrator for details. User Password Use this option to change your user password. Valid values for entering a password are 0 to 4294967295 (integers only; symbols and alpha characters are not allowed). Default password is an empty string "" (field is blank). numbers are 911, 999, 112, and 110; this is configurable via the WebUI or configuration file. Hint: To quickly lock your phone, press the key. button followed by the 20 Model 53i IP Phone Installation Guide. To adjust the speaker volume, press the volume button while the speaker is activated (activate the speaker by pressing ;. Programmable keys There are 6 programmable hard keys on the 53i phone, located at the top, left of the front panel display. These keys are programmable up to 6 functions. The following are the default functions for the programmable keys on the 53i IP phone. Default Function SAVE Description. DELETE DIRECTORY CALLERS LIST TRANSFER CONFERENCE These keys can also be set up to quickly access features such as Call return (*69) or Voicemail. Note: Quick access features like Call return and Voicemail must first be configured on your PBX in order to work on your phone. See your system administrator for more information. You must use the Aastra Web UI to configure the programmable key. For more information about programming keys on the 53i IP phone, see the Aastra Model 53i User Guide. 22 Model 53i IP Phone Installation Guide Line/Call Appearance Keys The 53i has 3 hard/line call appearance keys each with a corresponding status light. Additional line call appearances may also be set up on your phone as programmable keys. These line call appearance buttons and lights represent physical lines or calls for your extension. By pressing a line call appearance button, you connect to the line or a call it represents. The line call appearance light indicates the status of that line or call. When the phone is taken off-hook, the phone will automatically select a line for you. Line Call Appearance LED Status OFF Rapid Flash Slow Flash Description Indicates idle line or no call activity Indicates ringing on the line. Indicates a call is on hold. For more information about the Line Call Appearance keys, see the Aastra Model 53i User Guide. Using a Headset with your Telephone The 53i accepts headsets through the modular jack on the back of the phone. Contact your telephone equipment retailer or distributor to purchase a compatible headset. A non-amplified headset is required. Customers should read and observe all safety recommendations contained in headset operating guides when using any headset. Note: For best headset performance, Aastra recommends non-amplified headset equipped with modular connector. Making and Receiving Calls using a Headset 1. Ensure that you have selected a headset audio mode by accessing the Options menu. See the section "Customizing your phone" on page 15 for detailed information. 2. Plug the headset into jack. 3. Press the key to obtain dial tone or answer an incoming call. Depending on the audio mode selected from the Options menu, dial tone or an incoming call will be received on either the headset or the handsfree speakerphone. 4. Press the Nkey to end the call. 11 for information. Why is my speakerphone not working? If you press and the speaker light flashes and you do not hear dial tone, the Set Audio option has been used to set up the phone for headset use; press a second time. If the light goes out, the phone is set up to be used only with a headset or handset. If the light stays on steady and you hear dial tone, you can alternate between the speakerphone and the headset by pressing. See the section, "Set Audio" on page 19 for instructions on how to change the Set Audio feature. Why is my display blank? Ensure that power is being provided to your phone. If your Network does not provide Inline power over Ethernet, you can obtain an additional accessory, the a PoE inline power injector, to provide power over Ethernet locally to your phone. See the section "Connecting to the Network and to Power" on page 9 for details. call forward 20 call timer 22 Connecting Direct Network 7 Handset or Headset 11 Shared Network 8 To Power 9 To the Network 9 contrast level, setting 18 Customizing your phone 15 message waiting, clearing 18 microphone volume, headset 20 MWI (message waiting indicator) 21 network configuration settings for 20 network connection, direct 7 network connection, shared 8 date setting date 18 setting format 18 daylight savings 18 delete key 6, 22 dialpad, live 19 Optional Accessories 3 phone features 1 phone parts 3 phone status 20 PoE 3 power adapter 9 programmable keys 22 Ethernet Cable 8, 9 Ethernet wall jack 7 Handset, connecting 11 headset mode 19 Headset, connecting 11 headset, making and receiving calls with 23 headset/speaker mode 19 Requirements 1 ring tone, setting 18 save key 6, 22 SIP settings 20 speaker mode 19 speaker/headset mode 19 Stand Installation 12 indicator light 21 inline power 9 Installation 5 installation desk 12 Installation and Setup 7 Introduction 1, 27 time setting format 18 setting time 18 setting time server 17 setting time zone 18 tone set, setting 18 Index-1 user password 20 volume, adjusting 21 wall installation 13 warranty, limited 27 Web UI, using 16 Index-2 If youve read this owners manual and consulted the Troubleshooting section and still have problems, please visit our Web site at, or call 1-800-574-1611 for technical assistance. Aastra Telecom Inc. 2007 41-001157-00 Rev 01 Technical specifications WFA1447F 5100DTN DMC-FH120 GV-HIA5 RS-M63 RS2533SW 74630 L200-pink YZ250-2005 1401HD Tivoli 63 21FU1RK GT5000 SGH-T819 DS-150 HT-BD2t XAA Magna III EYE 312 IP2700 NW-E016 SP1654N-SRL Dopod D600 14GR1221 LN22B450c8 IP6220D RXV 550 PN50B850y1F FH40010 MID 2030 GP800 MC8088HLC DVP3142K 55 Review XL-3030 Slayer Scaleo PC DMC-FZ38 WM2010CW Deskjet 340 Voicestation 300 TXL32C10E M30-S350 ML-6060 HQ6090 LE32C650l1W Eufg29800X MCX 1900 DES-3828P DWS684 190CW7CS M-530V ICD-P30 MSK 25 EN6200 Roland AX-1 WJ-NT104 MP0804H SU-V7 E-105 TDM-7554R Zoom HD8 Ducati 748R DSC-TX1 QT-6000 DT125R-2002 TU-80 Tourer Brighton MP34 Trabant 601 CDR870-00 MAX 240 FF788 9400 GT TH-42PV600E BDP-S363 Mixer 01 Wintv-PVR-350 MB-600 Nokia N76 Tecra S10 System TDA-7566R YO-270 DD400 TL-C11 ZWW9570W CE2777N Type 1 Amplifier PT-07910 HX-740 Onis 300 HK654070FB Boardwalk Antispyware Mf4660 Easyshare C913 Siemens SX56 Aspire S DCR-DVD505E Bizhub C353
http://www.ps2netdrivers.net/manual/aastra.53i.ip.phone/
crawl-003
refinedweb
3,413
62.98
Recently I’ve become interested in optical character recognition (OCR) – I’ve discussed this with some peers and their default reaction is that the software necessary to do this is very expensive. Certainly, there are commercial packages available to carry out this function, but I wanted to investigate if there were any lower cost options available which I could use in a .NET project. After some investigation, I found three options: - Tesseract – a library with a .NET wrapper; - Windows.Media.Ocr – a library available for Windows Store Apps; - Project Oxford – OCR as a Service, a commercial product supplied by Microsoft which allows 5,000 transactions per month for free. In this post, I’ll demonstrate how to use Tesseract – in two future posts, I’ll use the Windows.Media.Ocr library, and Project Oxford to carry out OCR. Tesseract – an OCR library with a .NET wrapper Tesseract is an OCR library available for various different operating systems, licenced under Apache 2. I’ll look at getting this working in C# under Windows. In order to compare these three options, I needed a single baseline – an image with some text. I decided to take a screenshot of my previous blog post. This image seemed useful because: - The font face isn’t particularly unusual, so should be a reasonable test for automated character recognition. - There are a few different font sizes, so I’ll be interested to see how the software copes with this. - There are different font colours – the introduction at the top of the page is in a light grey font, so should be quite challenging for the software to read. As usual, I’m providing simple code which just gets text from an image – this isn’t meant to be an example of SOLID code, or best practices. Tesseract is quite simple to set up and use – these instructions were heavily influenced by content from Charles Weld’s GitHub site. I’ve tried not to copy things verbatim – this is a description of what I needed to do to get things working. 1. First open Visual Studio and create a new C# Console application named “TesseractSampleApplication”. 2. Next, open the Package Manager Console and install the Tesseract nuget package using the command below: Install-Package Tesseract This will add the necessary binary library to the project – Tesseract.dll. Also, there’ll be two folders added to the project, named “x86” and “x64”, containing other binaries. 3. You now need to add the English language files – these need to be in a project folder named “tessdata”. You can get these English language files from this location. The folder name can’t be changed or you’ll get an error. 4. As an optional step you can add configuration to the App.config file, which enables verbose logging. This helps a lot when things go wrong, and I got this code from this location. <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> </startup> <system.diagnostics> <sources> <source name="Tesseract" switchValue="Verbose"> <listeners> <clear /> <add name="console" /> <!-- Uncomment to log to file <add name="file" /> --> </listeners> </source> </sources> <sharedListeners> <add name="console" type="System.Diagnostics.ConsoleTraceListener" /> <!-- Uncomment to log to file <add name="file" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\log\tesseract.log" /> --> </sharedListeners> </system.diagnostics> </configuration> 5. Finally, the C# code – this very simple application just looks at the image I show above, and interprets text from it. namespace TesseractSampleApplication { using System; using Tesseract; class Program { static void Main(string[] args) { var ENGLISH_LANGUAGE = @"eng"; var blogPostImage = @"C:\Users\jeremy\Desktop\sample_for_reading.png"; using (var ocrEngine = new TesseractEngine(@".\tessdata", ENGLISH_LANGUAGE, EngineMode.Default)) { using (var imageWithText = Pix.LoadFromFile(blogPostImage)) { using (var page = ocrEngine.Process(imageWithText)) { var text = page.GetText(); Console.WriteLine(text); Console.ReadLine(); } } } } } } Compile and run the above code – if you added the configuration code in step 4, you’ll see a large amount of logging text, and finally the text that Tesseract reads from the image. I found that the text interpreted from the image was: JEREMY LINDSAY Building a 3d printer – Taz-5, Part 8: Building the X-axis Last time I attached the threaded rod and guide rails for the Zraxis. With these in place, I’m now able to start building the Xraxis. Afew notes on this post before I begin: 1.| ran outcfblackfilamentwhile buildingthis part,sol had to usethe yellow filament l’ve been using for my other project. 2. This was one ofthe trickiest parts ofthe project so far. The Xraxis involves a few pieces being bolted together, and I had issues with ABS parts shrinking slightly , which meant that holes corresponding to each other on different parts sometimes didn’t line up perfectly. So a few comments are: - Generally this was very good. There were a few small things that went wrong: - “Z-axis” was interpreted as “Zraxis“, so the hypen wasn’t seen correctly. - “I ran out of black filament while” was interpreted as “| ran outcfblackfilamentwhile” – the capital letter “I” was seen as a pipe character, and there were issues with spacing. - The black text was recognised – however the light grey text beside my name, the brown category words, and the date of the blog post were not interpreted at all. Conclusion Tesseract is a good open source option for optical character recognition in C# applications. It’s simple to get started with Tesseract, and interpreted text well from the sample tested. However, there were some small issues around spacing and occasionally problems with character recognition. Next time in this series, I’ll use the Windows.Media.Ocr library to interpret text from the same image.
https://jeremylindsayni.wordpress.com/2016/03/19/optical-character-recognition-with-c-in-classic-desktop-and-universal-windows-applications-part-1-using-tesseract/
CC-MAIN-2017-26
refinedweb
942
56.15
Vowles 0 Posted December 1, 2005 Basicly I have a text file, Heres a preview of the start. [X1]Ben[X] [X2]Ted[X] [X3]Fred[X] Basicily I wanted to make a loop that Gets the "Ben","Ted" and "Fred". I came up with this. $x = _InetGetSource("") $A = 100 $e = 0 While $A >= 0 $e = $e + 1 $C = _StringBetween($x,"[X"& $e &"]","["& $e &"]") MsgBox(0,"we",$WE) MsgBox(0,"",$C) if $C = "" Then MsgBox(0,"Xfire 5punk Adder","No more people") $A = 1 exit endif Func _StringBetween($s,$from,$to) $x=StringInStr($s,$from)+StringLen($from) $y=StringInStr(StringTrimLeft($s,$x),$to) Return StringMid($s,$x,$y) EndFunc Share this post Link to post Share on other sites
https://www.autoitscript.com/forum/topic/18618-quick-help/
CC-MAIN-2018-43
refinedweb
119
58.11
**************************** What's New in Python 2.0 **************************** :Author: A.M. Kuchling and Moshe Zadka .. |release| replace:: 1.02 .. $Id: whatsnew20.tex 50964 2006-07-30 03:03:43Z fred.drake $": .. epigraph:: :func:`sys.setdefaultencoding(encoding)` function in a customised version of :file: :keyword:, :mod:`unicodedata`, provides an interface to Unicode character properties. For example, ``unicodedata.category(u'A')`` returns the 2-character string 'Lu', the 'L' denoting it's a letter, and 'u' meaning that it's uppercase. ``unicodedata.bidirectional(u'\u0660')`` returns 'AN', meaning that U+0660 is an Arabic number. The :mod:`codecs` module contains functions to look up existing encodings and register new ones. Unless you want to implement a new encoding, you'll most often use the :func: :meth:`read`, :meth:`readline`, and :meth:`readlines` methods. These methods will all translate from the given encoding and return Unicode strings. * *stream_writer*, similarly, is a class that supports encoding output to a stream. *stream_writer(file_obj)* returns an object that supports the :meth:`write` and :meth: :mod: :func:`map` and :func: :keyword: :keyword:`for`...\ :keyword: :keyword: :keyword:`for`...\ :keyword: :meth:`__iadd__`, :meth:`__isub__`, etc. For example, the following :class:`Number` class stores a number and supports using += to create a new instance with an incremented value. .. The empty groups below prevent conversion to guillemets. :: class Number: def __init__(self, value): self.value = value def __iadd__(self, increment): return Number( self.value + increment) n = Number(5) n += 3 print n.value The :meth:`_ :program:`awk`, C++, Java, Perl, and PHP also support them. The augmented assignment patch was implemented by Thomas Wouters. .. ====================================================================== String Methods ============== Until now string-manipulation functionality was in the :mod:`string` module, which was usually a front-end for the :mod:`strop` module written in C. The addition of Unicode posed a difficulty for the :mod:`strop` module, because the functions would all need to be rewritten in order to accept either 8-bit or Unicode strings. For functions such as :func: :mod:`string` module is still around for backwards compatibility, but it mostly acts as a front-end to the new string methods. Two methods which have no parallel in pre-2.0 versions, although they did exist in JPython for quite some time, are :meth:`startswith` and :meth:`endswith`. ``s.startswith(t)`` is equivalent to ``s[:len(t)] == t``, while ``s.endswith(t)`` is equivalent to ``s[-len(t):] == t``. One other method which deserves special mention is :meth:`join`. The :meth:`join` method of a string receives one parameter, a sequence of strings, and is equivalent to the :func:`string.join` function from the old :mod: :mod: :option:`--without-cycle-gc` switch when running the :program: :func:`apply` built-in function: ``apply(f, args, kw)`` calls the function :func:`f` with the argument tuple *args* and the keyword arguments in the dictionary *kw*. :func: :keyword:`print` statement can now have its output directed to a file-like object by following the :keyword:`print` with ``>> file``, similar to the redirection operator in Unix shells. Previously you'd either have to use the :meth:`write` method of the file-like object, which lacks the convenience and simplicity of :keyword:; '%r' will insert the :func:`repr` of its argument. This was also added from symmetry considerations, this time for symmetry with the existing '%s' format style, which inserts the :func:`str` of its argument. For example, ``'%r %s' % ('abc', 'abc')`` returns a string containing ``'abc' abc``. Previously there was no way to implement a class that overrode Python's built-in :keyword:`in` operator and implemented a custom version. ``obj in seq`` returns true if *obj* is present in the sequence *seq*; Python computes this by simply trying every index of the sequence until either *obj* is found or an :exc:`IndexError` is encountered. Moshe Zadka contributed a patch which adds a :meth:`__contains__` magic method for providing a custom implementation for :keyword:`in`. Additionally, new built-in objects written in C can define what :keyword: :meth:`__cmp__` method encountered an error, since the resulting exception would simply be silently swallowed. .. Starting URL: .. :exc:`NameError` exception when code refers to a local variable before the variable has been assigned a value. For example, the following code raises an exception on the :keyword:`print` statement in both 1.5.2 and 2.0; in 1.5.2 a :exc:`NameError` exception is raised, while 2.0 raises a new :exc:`UnboundLocalError` exception. :exc:`UnboundLocalError` is a subclass of :exc:`NameError`, so any existing code that expects :exc:`NameError` to be raised should still work. :: def f(): print "i=",i i = i + 1 f() Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been introduced. They're both subclasses of :exc:`SyntaxError`, and are raised when Python code is found to be improperly indented. Changes to Built-in Functions ----------------------------- A new built-in, :func:`zip(seq1, seq2, ...)`, has been added. :func:`zip` returns a list of tuples where each tuple contains the i-th element from each of the argument sequences. The difference between :func:`zip` and ``map(None, seq1, seq2)`` is that :func:`map` pads the sequences with ``None`` if the sequences aren't all of the same length, while :func:`zip` truncates the returned list to the length of the shortest argument sequence. The :func:`int` and :func:`long` functions now accept an optional "base" parameter when the first argument is a string. ``int('123', 10)`` returns 123, while ``int('123', 16)`` returns 291. ``int(123, 16)`` raises a :exc:`TypeError` exception with the message "can't convert non-string with explicit base". A new variable holding more detailed version information has been added to the :mod:, :meth:`setdefault(key, default)`, which behaves similarly to the existing :meth:`get` method. However, if the key is missing, :meth:`setdefault` both returns the value of *default* as :meth: :func:`sys.getrecursionlimit` and :func:`sys.setrecursionlimit`. The default value is 1000, and a rough maximum value for a given platform can be found by running a new script, :file: :meth:`.append` and :meth:`.insert`. In earlier versions of Python, if ``L`` is a list, ``L.append( 1,2 )`` appends the tuple ``(1,2)`` to the list. In Python 2.0 this causes a :exc:`TypeError` exception to be raised, with the message: 'append :func:`PyArg_ParseTuple`, the current argument parsing function, which provides more helpful error messages and treats multi-argument calls as errors. If you absolutely must use 2.0 but can't fix your code, you can edit :file:`Objects/listobject.c` and define the preprocessor symbol ``NO_STRICT_LIST_APPEND`` to preserve the old behaviour; this isn't recommended. Some of the functions in the :mod:`socket` module are still forgiving in this way. For example, :func:`socket.connect( ('hostname', 25) )` is the correct form, passing a tuple representing an IP address, but :func:`socket.connect( 'hostname', 25 )` also works. :func:`socket.connect_ex` and :func: :mod: 'x' and take the lowest 8 bits of the result, so ``\x123456`` was equivalent to ``\x56``. The :exc:`AttributeError` and :exc: :meth:`tell` method of file objects return a long integer instead of a regular integer. Some code would subtract two file offsets and attempt to use the result to multiply a sequence or slice a string, but this raised a :exc:`TypeError`. In 2.0, long integers can be used to multiply or slice a sequence, and it'll behave as you'd intuitively expect it to; ``3L * 'abc'`` produces 'abcabcabc', and ``(0,1,2,3)[2L:4L]`` produces (2,3). Long integers can also be used in various contexts where previously only integers were accepted, such as in the :meth:`seek` method of file objects, and in the formats supported by the ``%`` operator (``%d``, ``%i``, ``%x``, etc.). For example, ``"%d" % 2L**64`` will produce the string ``18446744073709551616``. The subtlest long integer change of all is that the :func:`str` of a long integer no longer has a trailing 'L' character, though :func:`repr` still includes it. The 'L' annoyed many people who wanted to print long integers that looked just like regular integers, since they had to go out of their way to chop off the character. This is no longer a problem in 2.0, but code which does ``str(longval)[:-1]`` and assumes the 'L' is there, will now lose the final digit. Taking the :func:`repr` of a float now uses a different formatting precision than :func:`str`. :func:`repr` uses ``%.17g`` format string for C's :func:`sprintf`, while :func:`str` uses ``%.12g`` as before. The effect is that :func:`repr` may occasionally show more decimal places than :func: :mod:`exceptions` module containing the standard exceptions was translated from Python to a built-in C module, written by Barry Warsaw and Fredrik Lundh. .. Commented out for now -- I don't think anyone will care. The pattern and match objects provided by SRE are C types, not Python class instances as in 1.5. This means you can no longer inherit from \class{RegexObject} or \class{MatchObject}, but that shouldn't be much of a problem since no one should have been doing that in the first place. .. ====================================================================== :func:`isinstance` and :func:`issubclass`. This means you no longer have to remember to write code such as ``if type(obj) == myExtensionClass``, but can use the more natural ``if isinstance(obj, myExtensionClass)``. The :file:`Python/importdl.c` file, which was a mass of #ifdefs to support dynamic loading on many different platforms, was cleaned up and reorganised by Greg Stein. :file:`importdl.c` is now quite small, and platform-specific code has been moved into a bunch of :file:`Python/dynload_\*.c` files. Another cleanup: there were also a number of :file:`my\*.h` files in the Include/ directory that held various portability hacks; they've been merged into a single file, :file:`Include/pyport.h`. Vladimir Marangozov's long-awaited malloc restructuring was completed, to make it easy to have the Python interpreter use a custom allocator instead of C's standard :func:`malloc`. For documentation, read the comments in :file:`Include/pymem.h` and :file:`Include/objimpl.h`. For the lengthy discussions during which the interface was hammered out, see the Web archives of the 'patches' and 'python: :func:`PyModule_AddObject`, :func:`PyModule_AddIntConstant`, and :func:. :func:`PyOS_getsig` gets a signal handler and :func: :mod: :file:`setup.py` script. For the simple case, when the software contains only .py files, a minimal :file:`setup.py` can be just a few lines long:: from distutils.core import setup setup (name = "foo", version = "1.0", py_modules = ["module1", "module2"]) The :file:``', builds a source distribution such as :file: :file:`.pkg` files are in various stages of development. All this is documented in a new manual, *Distributing Python Modules*, that joins the basic set of Python documentation. .. ====================================================================== XML Modules =========== Python 1.5.2 included a simple XML parser in the form of the :mod:`xmllib` module, contributed by Sjoerd Mullender. Since 1.5.2's release, two different interfaces for processing XML have become common: SAX2 (version 2 of the Simple API for XML) provides an event-driven interface with some similarities to :mod:`xmllib`, and the DOM (Document Object Model) provides a tree-based interface, transforming an XML document into a tree of nodes that can be traversed and modified. Python 2.0 includes a SAX2 interface and a stripped- down DOM interface as part of the :mod: :meth:`startElement` and :meth:`endElement` methods are called for every starting and end tag encountered by the parser, the :meth: :class:`Document` instance is the root of the tree, and has a single child which is the top-level :class:`Element` instance. This :class: ``
http://docs.python.org/release/2.6.3/_sources/whatsnew/2.0.txt
CC-MAIN-2013-48
refinedweb
1,938
56.15
Flask For Wiki Engine Want to learn Flask, so using it to build little WikiEngine, which might end up hosting my WikiLog. I'll call the engine WikiFlux. 2014 - start Nov03'2014 - start, using Flask - work from - make VirtualEnv djcode/wikiweb, install - SqlAlchemy, WTF - next make sure it runs hello.pyper - yes! Nov04 - find Explore Flask ebook, note it recommends first reading official Quick Start and Tutorial pip install flask-debugtoolbar - going to plan on using blueprintsfor organizing - grr very confused how to organize things the "right way" up-front. - will probably take "divisional" approach, smells closer to MicroService separation - so wikiwebis the virtualenv, will contain just this one big app, so not adding an extra layer of directory. Treating first blueprint as spaceso have wikiweb/space/which contains templates, static, etc. - rough Data Base schema - spaces: id (int primary_key), path, title, owner_id, privacy_type (wikilog, privatewiki, ...) - nodes (pages): wiki_name_lower (unique primary_key), space_id, wiki_name (unique), body, created, modified - clarifying - id/name issue - goal is to have certain level of Case Insensitivity for url/name - wiki_name_lower is unique, has associated definitive Smashed Together Words/Camel Case wiki_name - if ask for Camel Case url, it first looks for that exact match - if fails, looks for lower(url) against wiki_name_url, if finds that match then does redirect to wiki_name - users - want to support IndieAuth if that makes sense, but what if this is the user's primary site/domain? - hrm trying to run things break stuff all over the place, smells like really need a directory level for the app. So move all the app bits into wikiweb/wikiweb/ - have wikiweb/run.py, wikiweb/wikiweb/__init__.pyand wikiweb/wikiweb/instance/config.py - try python run.pyand get Traceback (most recent call last): File "run.py", line 2, in <module> from wikiweb import app, db File "/Users/billseitz/Documents/djcode/wikiweb/wikiweb/__init__.py", line 8, in <module> app.config.from_pyfile('config.py') File "/Users/billseitz/Documents/djcode/wikiweb/lib/python2.7/site-packages/flask/config.py", line 128, in from_pyfile with open(filename) as config_file: I O Error: [Errno 2] Unable to load configuration file (No such file or directory): '/Users/billseitz/Documents/djcode/wikiweb/var/wikiweb-instance/config.py' * use pdb to find that within `from_pyfile()`, `self.root_path = '.../wikiweb/var/wikiweb-instance'` Nov06 - set instance_relative_config=False, move the config file - starts to run, but then ImportError: No module named psycopg2. Try to do pip install psycopg2but something fails there, too. Nov12: let's start again with baby steps hello.pystill runs - let's step all the way through the Tutorial - now try to get it working with PostgreSQL using the Mac postgres.app and SqlAlchemy - so let's take a step back and get it working with SqlAlchemy talking to SQLite. - able to get init_db()working - now have app working - should put this on GitHub before trying to get it working with PostgreSQL - GitHub repo [created]( Seitz/flaskr.py) Nov13: get flaskr.py working with PostgreSQL - change 1 line: engine = create_engine('postgresql://localhost/flaskr', convert_unicode=True) - run -> ImportError: No module named psycopg2... so {{{ pip install psycopg2.py Downloading/unpacking psycopg2.py Could not find any downloads that satisfy the requirement psycopg2.py Cleaning up... No distributions at all found for psycopg2.py Storing debug log for failure in /Users/billseitz/.pip/pip.log }}} - ok not just me - oh wait didn't need that .py - just pip install psycopg2{{{ Please add the directory containing pg_config to the PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. }}} - note recommendation here to install while not having the VirtualEnv be active - use bin/pip... - find /[virtualenv]/build/psycopg2/setup.cfg - uncomment/edit line per this: pg_config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config - try bin/pipagain, different fail {{{ Installation Error: Command /Users/billseitz/Documents/djcode/st/bin/python -c "import setuptools;file='/Users/billseitz/Documents/djcode/st/build/psycopg2/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/g5/d_mhycbn075d7yptvn9skd440000gn/T/pip-ZSGUoq-record/install-record.txt --install-headers /Users/billseitz/Documents/djcode/st/bin/../include/site/python2.7 failed with error code 1 in /Users/billseitz/Documents/djcode/st/build/psycopg2 }}} - (later) duh, realize this is in the wrong VirtualEnv! It's the one for WebPy not Flask. - try this: PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin/ sudo easy_install psycopg2 - at least 1 "warning" generated, but maybe ok? - re-activate VirtualEnv, launch flaskr.py- still fail - note Using /Library/Python/2.7/site-packages/psycopg2-2.5.4-py2.7-macosx-10.9-intel.egg- so install happened in the main python, not the VirtualEnv - realize (comment inserted above) that was working in the wrong VirtualEnv - don't have setup.pyor setup.cfgin the Flask VirtualEnv - go into the correct VirtualEnv's /bin/, try again PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin/ sudo easy_install psycopg2 - get warnings - do python flaskr.py- no errors! - hit root page - get Operational Error: (Operational Error) FATAL: database "flaskr" does not exist - quit flaskr, launch python, try {{{ from database import init_db init_db() }}} - same error - go into PostgreSQL's command-line window, do create database flaskr; - do python... init_db()- no error! python flaskr.py- hit root page - works! - enter records - works! - push tweak to GitHub Nov14: back to starting on WikiWeb.... - rip up most of the blueprints stuff, copy/tweak bits from flaskr.py - run CREATE DATABASE wikiweb - run init_db()- create tables - do some tweaking - have enough working that it gives you form like Flaskr to enter wiki_name and body, and saves it, and lists them all. No WikiWord catching, no Mark Down rendering, nothing. - save to Git. Not worth putting in GitHub yet. - so, to launch - make sure Postgre Sql is running - go into djcode/wikiweband do source bin/activatefor VirtualEnv cd wikiweband then python wikiweb.py 5000to run on port 5000 for now - < Oriented Unschooling> Nov16: can view single-node Page (but just raw content still), with not-found/edit/create link if fail (but link is wrong). Commit (Nov17). - note that tried using node = Node.query.filter_by(wiki_name=wiki_name).first_or_404()but got AttributeError: 'Query' object has no attribute 'first_or_404'- so just used first()which seems fine anyway, since I check for returned object in the page template. Nov17: Common Mark rendering: Looks like Roland Shoemaker's version is best choice for now. Though his hasn't been updated in a month, while the spec has had a number of changes since then (but I'm not sure how significant they are). Will give it a try. Update: working! Nov18-20: Correct Edit-page link URL. Correct handling for view-page of non-existing page. Commit Nov21: submitting page-change. - Currently getting "sent a request that this server could not understand". - fixed that, now have to distinguish creating from editing. Update: done. (Also now update node.modified on update.) - Get pagename in title tag! Update: done - Get spacename/link in title/header (just static for now, can make db look up in future version). Update: time to move config items to file. (Also want to include IndieAuth tag.) - actually didn't move to config file, just realized that config items needed all-caps names. Nov22: Some Web Design work - want something as clean/lite as possible - almost like a Card (CardDeck) (but infinite length) - and not literally, since Card design for desktop is mostly about displaying multiple cards (though that's semi-relevant for the Front Page maybe) - very little at top beyond a ribbon of identity - maybe collapsed menu - because there's so little to mess with, probably don't want to bother with BootStrap. - hmm what does Google Glass HTML/CSS look like? No, that's definitely oriented toward small fixed chunks. - Bah, just went looking for super-clean blog site, very happy with Ben Werdmuller's, so stole it! It uses BootStrap, so back in that game. Re-arranged some items, ripped out some bits, pretty happy with how it's looking. But still using lots of Ben's link tags inside, plus not even sure it validates after having mucked with it.... - Swapped in my photo, made favicon.ico, removed many tiny-icon image links. - Suppress certain meta tags in master layout when not in single-node page... done. - Bring any remaining Ben W assets/links local. Done - Search form in menu: make cheesy hack to redirect to Google. Next: Automatic Linking - look at MoinMoin code - text_moin_wiki.py- does SmartAscii and WikiWord handling all at one time (which probably eases isolation of WikiWord-s from tags) - Mark Wiki - doesn't do Smashed Together Words - this one in Flask - doesn't do Smashed Together Words - WebPy example - doesn't do Smashed Together Words - PikiPiki: like MoinMoin, processes SmartAscii at same time as Smashed Together Words, more easily because fewer markup features supported... - Tiddly Wiki code? - in /lib/python2.6/site-packages/tiddlywebplugins.links-1.2.0-py2.6.egg/tiddlywebplugins/links/parser.py - key regex rules are defined - WIKIWORDis one rule combined in CONTENT - in process_data(data)links get identified and passed through record_link(), etc. - it uses pyparser - going to try this - install pyparser; take copy of parser.pyand change "tiddler" references to "node" Got distracted by Auto-Complete, plus busy with life. #2015 Aug20'2015 Back to pondering Automatic Linking - 3 places/times it could be done - before calling Mark Down - generate Mark Down-format links around names - inside Mark Down/Common Mark library - nasty - after Mark Down conversion - seems like potential for weird issues, like tag ids/parameters that are Camel Case or AllCaps - so leaning toward first method! - also remember to handle other-wiki case like WikiWikiWeb:PageName - and to separate words in tag-text Duh, realize I have something that works pretty well already in WikiGraph scraping code! - grr feel like there's some bug trapping/stripping a space when finding/replacing a WikiWord, so I'm just using a hack to add it back. - Made "mistake" and output HTML link instead of Mark Down link. Then, because it worked fine, realized/remembered that Mark Down will just pass through HTML bits fine. Which means I can do the check-if-page-exists part in this first pass, and generate the appropriate link type up front. So that's nice. Aug25: last code edits (hrm last Git commit Aug20). Note had never dealt with issue where Smashed Together Words are inside a URL, or in linked text. And RegExp seems very nasty way to be catching those conditions. Then revisit Automatic Linking, conclude that it's time to drop Smashed Together Words and embrace the Free Link. Last notes were Sept27. So design plan is (Oct13): - double-brackets instead of Smashed Together Words - should canonical name be case-insensitive? - What's the Mattervs What's The Matter - keep Smashed Together Words for Page Name As URL - where store expanded name? (Note can't expand from Smashed Together Words because of punctuation, so have to keep real value handy.) - opt1: in db - currently have fields wiki_name and wiki_name_lower (which ease case-insensitive matching and uniqueness-enforcing) - opt2: no-where, just make it first line of page content, with H1 (when saving, if there is no H1, then insert it) - opt3: as YAML header at top of page for Structured Wiki - decision: opt2 (once need for other fields, shift to opt3) - '''hmm rethink given pretty name has to go both as H1 and Title tag''' Start coding changes (Oct13) - ack Git is broken! Some of recent stuff has whacked it. Moving Stencyl stuff around, or what? Well, will move along without it (because offline on train) - unlike plan when using Smashed Together Words, going to do WikiWord catching after running Mark Down. - get basic code working for simplest case - get tests.py set up to import/call/test functions from within wikiweb.py - rip out strange function at top of tests.py? Done - handle making URL for Free Link - currently just stripping spaces, have to (a) strip other punctuation; (b) capitalize words(?). Done - check for whether page actually exists (and tweak styles). Done - but need redirect when fails exact-match but hits case-insensitive-match - Done Oct16 - handle BlogBit pages - how write WikiWord, how render a URL. Done - fix above for weird cases: Schlep Work vs Schlep-Work vs SchlepWork; also McString and ACRONYM: Done Oct17 - check regular outside links, incl style. Done Oct17 but ugh [label](url)(Converting Moinmoin Text To Markdown]] - make bigger Text Area!!!! - handle InterWiki links WikiWikiWeb:WikiStandards- ugh requires db of spaces (update: hack) - then fix Git! Done Oct20 - then WikiGraph widgets Oct20 fix Git, do commit. 2015-10-18-LaptopDevProblems Bigger Text Area: Oct21 - hmm not as wide as it should be. Can't find CSS driving it. Ah, it's in bootstrap.css and set to 206px wide. Change to 606px. But the height in rows is driven by node_edit.html template. InterWiki: realize I can just do a hack for now: hash in code, not db. Front Page: correct order; limit number; render bits; sidebars - already was showing just first line from every node - now render Common Mark and WikiWord-s. Done Oct21 - order by date. Done Oct21 - show "more" link. Done but needs fixing (only show if needed, and put inline). Done Oct22 - next: show 20 at a time - use slice? no, use age-of-oldest-on-page to jump to next - need to handle starting point, plus case when run out of pages - Done Oct29 - next: style Front Page - first tweak style to regular page - too bland since I don't have background image like Ben W. Color bar at top? Look at kottke, plus my Tumblr accounts. - also need to revisit storage of "pretty" page name, because need to start rendering that instead of just wiki_name! (I'm back to feeling like I should just put it in the nodes table, because going to need it so often with the node it seems silly to have to go query for it, esp for lists like Front Page) - never mind - this isn't important enough for now Nov10: set space-delimited node.title - db structure - forms, h1, etc. Nov11: sidebar bits on the Front Page - define list of nodes for sidebar as per-space list; render list: done - next: style Front Page: done (BootStrap rows/spans, plus panels) - actually going to use Atom Standards since this is available - appears to be valid per Valindome. Nov11: JavaScript widgets: WikiGraph, Sister Sites, DisQus. Done. - get Google Analytics tracker, put into layout.htmltemplate. Done Nov12'2015: starting Converting Moinmoin Text To Markdown (plus scraping old, plus posting new) Plus couple misc things to tweak soon Nov26'2016: flip DNS to make this my new live WikiLog. Dec'2016-Mar'2017: start scraping InstaPaper. Mar14'2017: validate rel-me and h-card and h-entry and h-feed for IndieWeb. Edited: | Tweet this!
http://webseitz.fluxent.com/wiki/FlaskForWikiEngine
CC-MAIN-2017-13
refinedweb
2,503
56.96
#include <CaenIO.h> class CaenIO { CCaenIO(UInt_t base, int nCrate = 0); UShort_t ReadInput(UInt_t input); UShort_t ReadInputs(); void PulseOutput(UInt_t output); void SetLevel(UInt_t output); void ClearLevel(UInt_t output); void ClearAll(); void SetECL(UShort_t value); void ClearECL();} This class provides low level support for the CAEN V262 I/O register. This module is used by NSCL standard VME trigger and busy classes, but can also be used to provide application specific functionality. CCaenIO(UInt_t base, int nCrate = 0); Creates a CCaenIO object. The object is connected to a real hardware module and can control that module via its member functions. The base parameter must correspond to the module base address set in the hardware's rotary switches. If nCrate is specified, it represents the number of the VME crate in which the module has been installed. If not, the module is assumed to be installed in VME crate 0, which is suitable for systems with a single VME crate. UShort_t ReadInput(UInt_t input); Reads one of the module's inputs (numbered 0-3). If the input is NIM true, the function reaturns 1 otherwise it returns 1. UShort_t ReadInputs(); Reads all of the module inputs and returns a mask with bits set to 1 for inputs that have NIM true levels and 0 otherwise. Input 0 corresponds to the least significant bit of the mask returned. void PulseOutput(UInt_t output); Pulses the selected SHP output. void SetLevel(UInt_t output); Sets the value of one of the OUT outputs to a NIM true value. void ClearLevel(UInt_t output); Sets the value of one of the OUT outputs to a NIM false value. void ClearAll(); Clears all OUT and ECL outputs, by setting them to false logic levels. void SetECL(UShort_t value); Sets the the ECL outputs to the mask value void ClearECL(); Sets all of the ECL outputs to false.
http://docs.nscl.msu.edu/daq/newsite/nscldaq-11.2/r34059.html
CC-MAIN-2017-39
refinedweb
309
61.36
Interface and Abstract Classes November 22, 2017 Interfaces and Abstract Classes Let us take a moment to first realize what the purpose of interfaces and abstract classes are for. You are probably reading this because you have some sort of idea what these two types of classes are, but aren't really sure what specific purpose, or application they actually serve that would make it beneficial. To make this realization happen, first we need to be firm on the fact that interfaces and abstract classes are part of the object-oriented programming paradigm. That means that if you are working with some object oriented language, then the concepts of interfaces and abstract classes both exist. Interfaces Explained (Almost) Simply You might have read that interfaces are "contracts". What does that even mean? Let's take an example. When we create an interface, we are saying that any sort of class that chooses to implement the interface must override, or provide an implementation of all the methods defined by the interface. Now, why would we even be interested in doing this? Well, implementation of an interface allows us to do one thing: we need to take advantage of the fact that if an object implements an interface, then we are guaranteed that any object instantiated using the interface type have this method be callable. The above mentioned is called polymorphism. The running program does not care about how something is implemented, just as long as it is implemented and the signature exists. If we adhere to the signature defined by the interface contract, then we can generically invoked the object of the class which implements this contract. In summary, the specific implementation tied to the object which implements the interface will be executed as long as the method to callable through interface implementation during program execution. This is especially useful when it comes to working with generics. For example, suppose we have an interface called Drinkable. Our Drinkable interface has two methods, refill() and drink(). It is important to note that these two methods are merely signatures and have no implementation. It is up to the class which implements the interface to provide the implementation. You will see why now. Any classes then which implements Drinkable must override refill() and drink() as that is guaranteed by contract through implementation of the interface. If I had a Coffee class that implements Drinkable, then there is expectation that refill() and drink() should exist in the Coffee class. If I had a Tea class that implements Drinkable, then I should also expect to have both refill() and drink(). The compiler enforces that if we declare an implementation of a particular interface, we must provide the implementation to the interface methods. I have been very careful about the use of my terminology here. Interfaces are not classes. When a class declares that it will implement a particular interface, it has entered in agreement that the class will provide a set of declarations and definitions of the methods which the interface requires. The compiler will throw an error if this contractual obligation is not met. Therefore, it is important to note that implementing an interface does not solve a problem per say. It merely helps construct patterns to aid in solving the problem. To think of it in a naive fashion, we can say interfaces help organize code to make things more modular. Going back to generics, and containers. Now, suppose we have a LinkedList of Drinkable objects. We can define and initialize a generic container to hold various types of objects which implement this particular interface. public interface Drinkable { void drink(); void refill(); } Defining and initializing our list: List<Drinkable> drinks = new LinkedList<Drinkable>(); Taking this a step further, let’s initialize various objects which implement the Drinkable interface: Coffee, Tea, Soda and Water. public class Coffee implements Drinkable { public void drink() { System.out.println("Sip, sip, sip... You're drinking coffee!"); } public void refill() { System.out.println("Careful, don't drink too much caffeine!"); } } public class Tea implements Drinkable { public void drink() { System.out.println("Sip, sip, sip... You're drinking tea! It's very hot!"); } public void refill() { System.out.println("Careful, don't drink too much caffeine!"); } } public class Soda implements Drinkable { public void drink() { System.out.println("Gulp, gulp. *burp* Excuse you!"); } public void refill() { System.out.println("Too much sugar for you!"); } } public class Water implements Drinkable { public void drink() { System.out.println("GULP! GULP! GULP!... You're drinking water!"); } public void refill() { System.out.println("Drink up! Water is great for you!"); } } Coffee c = new Coffee(); Tea t = new Coffee(); Soda s = new Soda(); Water w = new Water(); Since all the above types of object classes implement the Drinkable interface, they are all common types and can be added to our list. drinks.add(c); drinks.add(t); drinks.add(s); drinks.add(w); Now, suppose we want to drink all these drinks. We can do so easily by just accessing each object in our list. We know that everything in this list has a drink() method due to contractual obligation in that each of these objects belonging to the classes which implement Drinkable, have the drink() method. for(Drinkable d : drinks) { d.drink(); } The output: Sip, sip, sip... You're drinking coffee! Sip, sip, sip... You're drinking tea! It's very hot! Gulp, gulp. *burp* Excuse you! GULP! GULP! GULP!... You're drinking water! How about refilling? It is the same approach. for(Drinkable d : q) { d.refill(); } All this was easy in that we had a guarantee that by having classes which implement the contract Drinkable, we had a guaranteed precondition that the methods drink() and refill() would exist. If we had not decided to implement Drinkable, then each one of our object classes: Coffee, Tea, Soda and Water would not have any reinforcement for which what should be called a "drink" method and a "refill" method. For example, Coffee would have drinkMe() while Tea could have drinkTea() and Soda and Water could coincidentally have drink(). If the aforementioned was the case, then we would have something like this: c.drinkMe(); t.drinkTea(); s.drink(); w.drink(); It would be really hard to write modular code that would process these types of drinks in a predictable fashion. Various applications would be file input and output where we have a File processor which takes in some sort of FileReader object. We can implement an abstraction of the file to be read called Readable. A FileReader object doesn't have to be concerned with what type of source the file is coming from -- albeit a database, file system on disk, network, etc. The only concern is if there is some sort of read() and write() method through an interface contract by implementing the Readable interface. From there, any FileReader can just call read() and write() and process the file accordingly. This allows lots of modularity within software packages. Abstract Classes Abstract classes can be confused with interfaces because they also leverage the concept of polymorphism, and they include methods which are implemented and some which are not implemented. These methods which are not implemented are declared abstract. Again, keep in mind that abstract classes do have implemented methods too. This is the distinction between an interface and abstract class. Any class declared abstract will not be able to be instantiated. This means you cannot create an instance of an abstract class. The purpose of an abstract class is to derive a new class-type from it. That means to use the abstract class, we must create another class that extends, or inherits the abstract class. The formal word for this is inheritance. When we inherit the abstract class, we can override the methods the abstract methods. We also gain the properties of the abstract class with our new class in which we have inherited from the parent class. If we think of interfaces as contracts, where we must implement all the methods defined in the contract, we can think of abstract classes as templates: where we actually have some implementation and properties that a class can acquire along with signatures of methods in which the acquiring class must implement. Abstract classes usually define the type and properties of the class, while interfaces define the actions in which a class can do. This is why you sometimes see the combination of the two being used when classes get defined. For example: class Coffee extends Drink implements Drinkable {} We say that the Coffee class extends a class called Drink. This means that Coffee now acquires all properties of the Drink class and will include additional properties that will make it be distinguishable as a Coffee, rather than a drink. Additionally, the Coffee will implement the Drinkable interface, which means that it will be able to let a client perform actions which are valid for a drink. Declaring a class as abstract and then having a class inherit from the abstract class is advantageous in the sense that child classes can be simple. If done properly, it is assumed that calling a method in the parent class in which is overridden by the child class is completely valid and required to be callable. This is the Liskov Substitution Principle. Going back to our Drink example, suppose Drink is our parent class and Coffee inherits from the Drink class. public abstract class Drink { public void sayHi() { System.out.println("Hello, there! I'm a drink and my type is... "); printType(); } abstract void printType(); } public class Coffee extends Drink implements Drinkable { public void doSomething() { super.sayHi(); } public void printType() { System.out.print("Coffee"); } public void drink() { System.out.println("Sip, sip, sip... You're drinking coffee!"); } public void refill() { System.out.println("Careful, don't drink too much caffeine!"); } } The method within the Drink class which exercises the Liskov Substitution Principle is sayHi(). Notice how the abstract method printType() is made available and the sayHi() method within the calls it? What actually happens is that when sayHi() is invoked within the child class, the child class’s overridden version of printType() is executed. This is possible due to the requirement in that child classes must always override parent methods which are declared abstract. The main differentiation between interface contracts and abstract classes is fuzzy, but we just need to restate and remember what makes them unique: - Interfaces serve as implementation contracts for predictable usage of code. - Abstract classes provide a way to inherit properties and methods from their parent along with overriding any parent methods which are declared abstract. Both take advantage of polymorphism to aid for method calls, and because of that, both must be used appropriately for certain situations. That's purely a design choice and because there is no clear cut, binary answer on when to use an interface or an abstract class in many teams I've been in, is in my opinion, probably the reason why there is much confusion between the two.
http://rogerngo.com/article/20171122_interface_and_abstract_classes/
CC-MAIN-2020-24
refinedweb
1,835
64.81
@nteract/commutable Examples Create an in-memory model of a notebook To create an in-memory model of a notebook, pass a string containing the serialized contents of the notebook to the fromJS function. import { fromJS } from "@nteract/commutable"; const notebookString = "{ cells: [...], metadata: {...} }"; const immutableNotebook = fromJS(notebookString); In the example above, notebookString can be loaded from a Jupyter server via the Jupyter Contents API, retrieved from disk using a filesystem API, loaded from a cloud storage provider with their API, or anywhere else. As long as it is a string that follows the nbformat, it will be converted to the in-memory model. Create a code cell To create a code cell, you can use the makeCodeCell function in the commutable API. import { makeCodeCell } from "@nteract/commutable"; const codeCell = makeCodeCell({ source: "print(1)" }); Note that you don't need to provide all the properties for a cell in the parameter passed to the makeCodeCell method. The package will use sensible defaults where appropriate. There are analogous functions to create other types of cells, such as makeMarkdownCell and makeRawCell.
https://docs.nteract.io/nteract/commutable/examples/
CC-MAIN-2020-10
refinedweb
178
50.06
Long time no see. :-) At 09:32 AM 7/22/99 -0500, Dan Connolly wrote: >I see the abiword format is based on XML. nifty! Thanks. We're quite happy with how it's been working out for us. We've even tried to stay fairly CSS-like in the properties we use, at least wherever the formatting models have been consistent enough. Add to that the fact that we're using base64-encoded PNG as our native raster graphics format, and we're pretty darn W3C-friendly. Guess all that time Eric, Jeff, and I spent in WG meetings didn't go to waste, huh? :-) >A suggestion: how about a namespace identifier to >document your tag vocabulary? If I understand you correctly, you could be making as many as four distinct suggestions here: 1. Document the !@#$!$#@ file format. ------------------------------------- As you suggest, the most authoritative reference for this is the source, and the file you found is a great starting place. In addition, Jeff has been trying to keep the following document up-to-date: abi/docs/AbiWord_DocumentFormat.abw Discrepancies between the two are bugs, and should be logged as such in Bugzilla. 2. Document it as a schema instead (or in addition). ---------------------------------------------------- If you or someone else would like to provide a first pass at this, we'd happily: - get it checked in - try to keep it maintained - post it at a URL on our website - etc. Again, once this exists and has a maintainer, discrepancies are bugs. 3. Explicitly reference that schema in the file format. ------------------------------------------------------- Once #2 happens, this is a no-brainer as well. If #2 doesn't happen and we posted the .abw document on the website as our namespace reference, how obnoxious would it be if we referred to *that* instead? After all, the product required to read that documentation is GPL, widely available, and eminently portable. ;-) 4. Actually *use* namespaces in the file format. ------------------------------------------------ At the moment, this is of no value to us, and as Eric suggests, I have no interest in breaking compatibility to require explicit qualifications of our default namespace. Fortunately, if I read the spec correctly, this isn't necessary, right? However, one of the developers on this list (Matt Kimball) has been investigating SVG for use as our native vector graphics format, so I expect that when he's ready to add it, making the SVG namespace explicit would be a Good Thing. Do you know whether James has added namespace support to expat any time in the last year? It's been the better part of a year since we last grabbed a copy of his code. Paul PS: For completeness' sake, I should also mention that we currently use XML for our XP preferences file format (instead of platform-specific INI or registry stuff), but I highly doubt that a schema or namespace for that would ever be worth bothering with.
http://www.abisource.com/mailinglists/abiword-dev/99/July/0269.html
crawl-002
refinedweb
485
61.97
# eoverflow.m4 serial 2 dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # The EOVERFLOW errno value ought to be defined in <errno.h>, according to # POSIX. But some systems (like AIX 3) don't define it, and some systems # (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. # Define EOVERFLOW as a C macro and as a substituted macro in such a way that # 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable, # 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric # value. AC_DEFUN([gl_EOVERFLOW], [ AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [ AC_EGREP_CPP(yes,[ #include <errno.h> #ifdef EOVERFLOW yes #endif ], have_eoverflow=1) if test -n "$have_eoverflow"; then dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves. ac_cv_decl_EOVERFLOW=yes else AC_EGREP_CPP(yes,[ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> #ifdef EOVERFLOW yes #endif ], have_eoverflow=1) if test -n "$have_eoverflow"; then dnl EOVERFLOW exists but is hidden. dnl Define it to the same value. AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include <stdio.h> #include <stdlib.h> ]) else dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but dnl don't define it as EINVAL, because snprintf() callers want to dnl distinguish EINVAL and EOVERFLOW. ac_cv_decl_EOVERFLOW=E2BIG fi fi ]) if test "$ac_cv_decl_EOVERFLOW" != yes; then AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW], [Define as good substitute value for EOVERFLOW.]) EOVERFLOW="$ac_cv_decl_EOVERFLOW" AC_SUBST(EOVERFLOW) fi ]) dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. dnl Remove this when we can assume autoconf >= 2.61. m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ])
http://opensource.apple.com//source/gnutar/gnutar-451/gnutar/m4/eoverflow.m4
CC-MAIN-2016-44
refinedweb
309
52.87
Results 1 to 3 of 3 - Join Date - Jul 2005 - 3 using fetchmail to fetch messages for Citadel system The situation is actually like this: - I have an email server from which I would like to deliver all messages to the Citadel () system. It is actually one "master" POP3 account (Citadel should connect to it somehow), which is used to retrieve all the messages for all accounts, so Citadel should be acting as a "middle" point between "real" mail server and users, some kind of intermediate message store. I think this is possible with fetchmail, but how... Also I have postfix and lmtp in mind, but I'm really not sure how to make it work... Please help with just a few advices, I can do much of the work by myself, I just need a little knowledge injection Thanks a lot!! - Join Date - Jul 2005 - 3 if understood correctly fetchmail forwards mails it receives to port 25 on the localhost (there is citaserver listening), and then i need some settings in citadel itself to accept those emails sent by fetchmail. how I should setup citadel and it's accounts to achieve this? here is my .fetchmailrc created with fetchmailconf, please help me to set it up, I just want to receive mail for marko@promoplan.co.yu with fetchmail and forward it to appropriate citadel account # Configuration created Sat Jul 23 04:05:45 2005 by fetchmailconf set postmaster "postmaster" set bouncemail set no spambounce set properties "" poll mail.promoplan.co.yu with proto POP3 user 'marko@promoplan.co.yu' there with password 'blablabla' is marko@promoplan.co.yu here options keep YES, i know, I'm pain in the ass but this stuff is really urgent to me, besides, there is definitely a complete lack of the web documents describing what i want, i searched a lot, no one talks about fetchmail + citadel... and the current documentation about citadel should be more comprehensive may I notice... Please help me hard thanks.... - Join Date - Jul 2005 - 3 I'm loosing my nerves these days like most people here ... Trying to make this combination work: fetchmail + postfix + dbmail-lmtpd + mysql... I want all message from POP3 account to be fetched by fetchmail (those are the messages from special account, which serves all messages for all users on some domain), and then import them by postfix and dbmail-lmtp transport into mysql database... Don't know where to start now, i used install and install.postfix, looked into fetchmail man, etc etc, tried different configurations, but I think the problem is that postfix can't deliver messages to dbmail-lmtpd Here are the important lines in the main.cf file: mailbox_transport = dbmail-lmtp:127.0.0.1:24 local_recipient_maps = master.cf: dbmail-lmtp unix - - n - - lmtp -v #tried this also.... but not so hard... #dbmail unix - n n - - pipe flags= user=dbmail:dbmail argv=/usr/local/sbin/dbmail-smtp -d ${recipient} I think the problems is that postfix smtp daemon never contacts dbmail-lmtpd, here is the exception from /var/log/mail: Jul 24 05:04:02 mailserver postfix/smtpd[8143]: connect from localhost[127.0.0.1] Jul 24 05:04:02 mailserver postfix/smtpd[8143]: 1E94820B03: client=localhost[127.0.0.1] Jul 24 05:04:02 mailserver postfix/cleanup[8145]: 1E94820B03: message-id=<20050724084406.6642.qmail@web52204.mail.yahoo. com> Jul 24 05:04:02 mailserver postfix/qmgr[8110]: 1E94820B03: from=<domanovic@yahoo.com>, size=2865, nrcpt=1 (queue active) Jul 24 05:04:02 mailserver postfix/smtpd[8143]: 52ABC20B04: client=localhost[127.0.0.1] Jul 24 05:04:02 mailserver postfix/cleanup[8145]: 52ABC20B04: message-id=<20050724090346.57759.qmail@web52207.mail.yahoo .com> Jul 24 05:04:02 mailserver postfix/qmgr[8110]: 52ABC20B04: from=<domanovic@yahoo.com>, size=2115, nrcpt=1 (queue active) Jul 24 05:04:02 mailserver postfix/smtpd[8143]: disconnect from localhost[127.0.0.1] Jul 24 05:04:03 mailserver postfix/smtp[8147]: 52ABC20B04: to=<marko@promoplan.co.yu>, relay=svrca.absolutok.com[80.93.224.10], delay=1, status=sent (250 Ok, message saved <Message-ID: <20050724090346.57759.qmail@web52207.mail.yahoo.co m>>) Jul 24 05:04:03 mailserver postfix/qmgr[8110]: 52ABC20B04: removed Jul 24 05:04:03 mailserver postfix/smtp[8146]: 1E94820B03: to=<marko@promoplan.co.yu>, relay=svrca.absolutok.com[80.93.224.10], delay=1, status=sent (250 Ok, message saved <Message-ID: <20050724084406.6642.qmail@web52204.mail.yahoo.com >>) Jul 24 05:04:03 mailserver postfix/qmgr[8110]: 1E94820B03: removed fetchmail -v output seems like okay... here is .fetchmailrc: set postmaster "postmaster" set bouncemail set no spambounce set properties "" poll mail.promoplan.co.yu localdomains promoplan.co.yu no envelope protocol pop3: username marko@promoplan.co.yu password blahblablah to * here What about dbmail-smtp, can i transfer messages with it? I never thought this will be this hard to setup... btw, i tried fetchmail + citadel/ux combination, and i succeded, but I've given up because I concluded Citadel's web interface is pretty buggy, maybe the Citadel itself too... Thanks a lot for your attention...
http://www.linuxforums.org/forum/servers/38945-using-fetchmail-fetch-messages-citadel-system.html
CC-MAIN-2016-30
refinedweb
853
56.05
From: Richard Stallman <address@hidden> Reply-To: address@hidden To: "Herbert Euler" <address@hidden> CC: address@hidden Subject: Re: Emacs crashes accidentally Date: Thu, 10 Aug 2006 12:27:42 -0400 I'm so sorry I was required to have some training these days and I could not read mails. Please forgive me. Before crashing, I wanted to undo some deletion so I typed C-x u C-x z z z ... When some `z' was pressed, Emacs suddenly crashed. The term "to crash" is often synonymous with "getting some z's" ;-).#3 0x010c10b3 in strout (ptr=0x2469648 <Address 0x2469648 out of bounds>,size=27, size_byte=27, printcharfun=19413041, multibyte=0) at print.c:417#4 0x010c1385 in print_string (string=37526819, printcharfun=19413041) atprint.c:506 It looks like STRING is invalid Lisp data. Please look inside it and see precisely what is wrong with it. (gdb) up#4 0x010c1385 in print_string (string=37526819, printcharfun=19413041) at print.c:506 506 strout (SDATA (string), (gdb) p string $1 = 37526819 (gdb) xpr Lisp_String $2 = (struct Lisp_String *) 0x23c9d20 "No further undo information" (gdb) p *$ $3 = { size = 27, size_byte = -1, intervals = 0x0, data = 0x243d8ac "No further undo information" } (gdb) I don't know whether it's wrong with STRING. #5 0x010c552d in print_object (obj=37526819, printcharfun=19413041, escapeflag=0) at print.c:2050#6 0x010c3c4a in print (obj=37526819, printcharfun=19413041, escapeflag=0)at print.c:1301 #7 0x010c3059 in Fprinc (object=37526819, printcharfun=19413041) at print.c:847 #8 0x010c3870 in print_error_message (data=36753309, stream=19413041, context=0x9fbff70c "", caller=19764345) at print.c:1090 Where did print_error_message get the string? Where did it come from? If it came from DATA, then please try to trace it back. What are the elements of DATA? #10 0x0105bc80 in cmd_error (data=36753309) at keyboard.c:1205#11 0x010b3dfb in internal_condition_case (bfun=0x105bfe0 <command_loop_1>, handlers=19471817, hfun=0x105bbd8 <cmd_error>) at eval.c:1465 Having seen this, I traced into INTERNAL_CONDITION_CASE. It's version 1.210.4.35 of EVAL.C, line 1465. Lines near that are: if (_setjmp (c.jmp)) { return (*hfun) (c.val); } I don't know how INTERNAL_CONDITION_CASE is invoked here, is it invoked by jumping? Now please take a look at what DATA is inside CMD_ERROR, which is the same as those in CMD_ERROR_INTERNAL and PRINT_ERROR_MESSAGE: (gdb) up #10 0x0105bc80 in cmd_error (data=36753309) at keyboard.c:1205 1205 cmd_error_internal (data, macroerror); (gdb) p data $25 = 36753309 (gdb) xpr Lisp_Cons $26 = (struct Lisp_Cons *) 0x230cf98 { car = 0x1291dc9, u = { cdr = 0x230cfad, chain = 0x230cfad } } (gdb) p $26->car $27 = 19471817 (gdb) xpr Lisp_Symbol $28 = (struct Lisp_Symbol *) 0x1291dc8 "error" (gdb) p $26->u->cdr $29 = 36753325 (gdb) xpr Lisp_Cons $30 = (struct Lisp_Cons *) 0x230cfa8 { car = 0x23c9d23, u = { cdr = 0x1283801, chain = 0x1283801 } } (gdb) p $30->car $31 = 37526819 (gdb) xpr Lisp_String $32 = (struct Lisp_String *) 0x23c9d20 "No further undo information" (gdb) p $30->u->cdr $33 = 19412993 (gdb) xpr Lisp_Symbol $34 = (struct Lisp_Symbol *) 0x1283800 "nil" (gdb) Hope the information can help. Beg your pardon for my late reply again. I'm so sorry. Regards, Guanpeng Xu _________________________________________________________________FREE pop-up blocking with the new MSN Toolbar - get it now!
http://lists.gnu.org/archive/html/emacs-devel/2006-09/msg00240.html
CC-MAIN-2016-50
refinedweb
518
75
Overview Atlassian Sourcetree is a free Git and Mercurial client for Windows. Atlassian Sourcetree is a free Git and Mercurial client for Mac. Introduction to sage-mode Installation and setup There are three possibilities for installing sage-mode: Option 1. Use the sage-mode bundled with Sage This is the easiest. Since the spkg is already installed, you only need to activate it in Sage and in Emacs. For the former, run sage -f sage_mode For the latter, then somewhere in your .emacs add the following (add-to-list 'load-path "$INSTALL_DIR") (require 'sage "sage") (setq sage-command "$SAGE_ROOT/sage") where $INSTALL_DIR and $SAGE_ROOT have been replaced with the respective paths on you machine. $INSTALL_DIR refers to the directory of the sage-mode Emacs files: these are usually located in $SAGE_ROOT/local/share/emacs Furthermore, if you would like typesetting of Sage results, consider customizing sage-view-default-commands and adding the following lines to your .emacs (after requiring sage): (add-hook 'sage-startup-after-prompt-hook 'sage-view) Also consider running (customize-group 'sage) in Emacs to see more options. Option 2. Download a pre-compiled spkg at the sage-mode Bitbucket repository Once you have downloaded the spkg for the version you want, you install the spkg in Sage by running sage -f sage_mode_<version>.spkg where sage_mode_<version>.spkg refers to the file you have downloaded. You can then follow the remaining steps of Option 1 to install sage-mode in Emacs. Option 3. Download the newest code from the Bitbucket repository. The most cutting edge solution is to clone the Bitbucket repository: first, make sure you have an installation of Mercurial. Then in an appropriate directory, run hg clone Then you can either create and install an spkg, or simply point Emacs at the directory, by adding something like the following to your .emacs: (add-to-list 'load-path "/path/to/sage-mode/emacs/") (require 'sage "sage") To create an spkg, go to the sage-mode folder that you checked out, and run ./make-spkg.sh $VERSION where instead of $VERSION, you write a version number. The version "number" can be anything. It might be useful for later reference to use as $VERSION something which can identify the exaxt version you built, such as the hash of the latest commit (found with hg id -i -r .). In any case, this creates a file sage_mode_<version>.spkg. You can then follow the steps in Option 2 as if you had downloaded this spkg from the repository. The inferior sage shell The primary element of sage-mode is interaction with a Sage shell in a buffer. Run the function sage in Emacs to start it. The new buffer communicates directly with a Sage shell in the background and behaves very much like it. You just type and send the command with <Enter>: sage: 2+2 4 sage: x^2 + 1 x^2 + 1 If you activated sage-view in the setup, the last output line should be properly typeset with LaTeX. This already then beats running the Sage shell in a usual terminal; however, we are just getting started. The shell also behaves like an Emacs shell: - Pressing M-por C-upgoes through earlier input. - The history of the shell is earlier in the buffer, and you can move around just as in any Emacs buffer. When you're not at the bottom command line, the text you enter won't send anything to the shell. - Pressing <Enter>on some line earlier in the buffer runs that line at the command line and returns the pointer there. - Pressing C-q C-jinserts a literal newline. Of course, you also have access to tab-completion and the usual Sage help: <Tab>at the command line attempts completion of current word. It understands all Sage and Python functions currently in scope, and it also completes attributes of objects. As usual in Emacs, with multiple suggestions they are presented in another window. - Adding ?after a name or attribute and then <Tab>shows the documentation for it in another window. Pressing <Enter>instead of <Tab>prints the documentation in the shell. - Adding ??and then <Enter>prints the preceding object's source in the shell. TODO: /jsrn: This behaves as above when I do it, but when iandrus does it, it opens the source file. Why? You can type quit to kill the Sage shell, or you can kill the entire buffer. Editing your Sage code Most of your code you will want to structure properly and keep, and so will naturally be edited in separate files and not typed directly into the Sage shell. When opening a .sage-file, sage-mode will be activated, providing you with syntax highlighting and various interaction with the Sage shell. If you already have an open Sage shell, the newly opened file should be aware of it. If not, you can open a new shell with the sage function. Now you have various functions for sending code to the shell: sage-send-bufferor C-c C-csends the entire buffer's contents to the shell. sage-send-defunor C-c C-dsends the defthat the pointer is currently standing in. sage-send-regionor C-c C-rsends the currently marked region. sage-attach-this-filewill attach this file to the Sage shell, so that every time you execute something in the shell, that file will be reloaded if it has changed. There are a few more such functions; type C-h m for a summary. Note that these functions are not exactly the same as typing in the shell: in particular, the result of the last line of code is not printed. Of course, many .sage-files can be attached to the same shell, allowing for quick editing and reloading of your various sources. There is a pitfall here, though: after modifying a function or class, it is necessary to reload all functions, classes and objects referring to it, so that the Sage shell is not using the old definition. Sometimes it is easier or even necessary to restart the Sage shell in order to achieve this. If you later restart the Sage shell, you might need to make buffers with .sage-files aware of the new shell. This is most easily done by revisiting the file: C-x C-v <Enter>. Custom initialisation of Sage Perhaps you would like to have Sage initialise with custom code when run from inside Emacs. As usual, you can use $HOME/.sage/sage.init for code which should run immediately after Sage starts. To run code only when Sage is run from inside Emacs is then done simply by guarding the code based on the environment variable $EMACS: import os if 'EMACS' in os.environ and os.environ['EMACS']: <Custom initialisation code goes here>
https://bitbucket.org/ddrake/sage-mode
CC-MAIN-2018-09
refinedweb
1,135
63.39
Details Description JRX does not handles multiple top level classes (this bug is not about inner classes) defined in one source file : - a link is set on the first class defined in the file that point to $(className).html which doesn't exist if the class is not public (so the source file is not $(className).java). - other classes of the file are not linked. In particular, the public class may not be linked. - in the class list, some links point ton non-existent files. Quickfix: ignore all non-public classes. Long term fix: link all classes. However, this requires to analyse all sources to build the map class->source-file before generating any HTML file. Activity - All - Work Log - History - Activity - Transitions
https://issues.apache.org/jira/browse/JXR-11?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
CC-MAIN-2015-32
refinedweb
123
66.84
At some point in your dealings with data, you will have to deal with missing values. Depending on the situation, you might need to fill these gaps, or delete rows/columns entirely. Luckily Pandas makes this easy for us. Let’s get our modules and dataset prepared, before we look to delete series or fill gaps. import numpy as np import pandas as pd #DataFrame is the contract details for our transfer targets, where known. #'np.nan' is a numpy value that shows that there is not a number. # In this case, it demonstrates missing data. df = pd.DataFrame({'Wage':[150000,123000,np.nan], 'GoalBonus':[4000,np.nan,np.nan], 'ImageRights':[50000,70000,100000]}, index=['Konda','Makho','Grey'], columns=['Wage','GoalBonus','ImageRights']) df So we know everything about Konda, 2/3 values for Makho and just Grey’s image rights. Let’s look at how we can tidy this up. Removing rows & columns with missing data If you decide to bin the players with missing data, it is simple with the ‘.dropna()’ method: df.dropna() So we are only left with the player with all values. What if you want to do the same for columns? df.dropna(axis=1) And now we have only the column with complete data – ImageRights. You’ll see that we pass the argument ‘axis=1’ to do look at columns, not rows. ‘.dropna()’ can also take the argument ‘thresh’ to change the amount of missing values you’re happy to deal with. Makho has only 1 missing value, whereas Grey has 2. Below, we’ll allow Makho into our dataset, but continue to exclude Grey: df.dropna(thresh=2) Fill data Sometimes, deleting rows and columns is a bit drastic. You may instead want to simply fill in the gaps instead. Rather than ‘.dropna()’, we can instead ‘.fillna()’, passing the desired value as the argument. df.fillna(value=0) That’s a lot cleaner if we want to perform other opearations, great work! You might want to be a bit smarter than filling with 0s. As an example, you might want to take a column and use the average to fill the rest of the gaps: df['Wage'].fillna(value=df['Wage'].mean()) Konda 150000.0 Makho 123000.0 Grey 136500.0 Name: Wage, dtype: float64 Summary Dealing with datasets can often be unwieldy and messy. Quite commonly, this is caused by missing values. Pandas helps us greatly with ‘.fillna()’ and ‘.dropna()’ and their ability to remove or change missing values with ease. If you are having issues with mismatching or datasets split across different files, you might want to check out the joining & merging data article.
http://fcpython.com/data-analysis/dealing-with-missing-data
CC-MAIN-2018-51
refinedweb
443
76.32
The release candidate of Silverlight 5 is available for download but with no go-live license and currently incompatible with Expression Blend. Silverlight 5 is in the somewhat unusual position of being a good product that most analysts believe has lost out to HTML 5 and Internet Explorer 9 which in theory provides an easier alternative for developers wanting apps to work cross platform. Microsoft’s official position is that Silverlight is a product with a future, and that version 5’s improvements add to the media support and ability to create apps with rich UIs. Examples of the better media support include GPU support so you can display high-definition videos on less powerful devices, and ‘TrickPlay’, which you can use in your apps to play videos at different speeds with buttons for fast-forward and rewind. The release candidate (RC) is intended for use by developers, and there’s no go-live license. The idea is that you’ll be ready for the release later in the year with your Silverlight 5 apps ready to go. There are some improvements to the new release over and above what was present in the last beta, including 64 bit support, and support for the Task Parallel Library (TPL). Other improvements include P/Invoke support for calling native functions; the option to use Postscript printing; support for in-browser trusted applications; and an updated PivotViewer control. You also get remote control and media command support, and power awareness for media apps so machines don’t display the screen saver when your app is playing a video, for example. According to a blog post by Pete Brown, the lead of the Developer Guidance Community Team at Microsoft, the team has also made several changes to the locations of some of the XNA namespaces and files. Brown says that you'll find that much of the 3D stuff has moved to a different DLL. One point to note if you’ve been using earlier the beta version of Silverlight 5 and in particular the preview version of Expression Blend, this won’t work with the release candidate, so if you have apps that need Blend for Silverlight 5 you’ll need to wait until an updated version of Blend comes out before moving to the release candidate. You can download the release candidate here: Silverlight better than HTML5? Silverlight 5 beta download Silverlight 5 beta announced If you would like to be informed about new articles on I Programmer you can either follow us on Twitter or Facebook or you can subscribe to our weekly newsletter. Apache has announced the release of CouchDB 1.2.0. It brings lots of improvements, some of which mean apps written for older versions of CouchDB will no longer work. Tickets for this year's developer conference were all snapped up within 2 hours of going on sale. If, however, you are a student you can still win a free ticket.
http://www.i-programmer.info/news/89-net/2989-silverlight-5-arrives-for-developers.html
crawl-003
refinedweb
494
53.14
Received exception while creating connection for pool "PIPPODataSourceJP": ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","DATABASESYS","trigger inform","kglhin: temp") osbpr1do.log00253:ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select obj#,type#,ctime,mtim...","sql area","tmp" I am interested in all the strings like PIPPODataSourceJP, to extract from the logs a unique list of Datasources failing. Let's first grep all the lines: grep ORA-04031 * > /tmp/allora04031.txt this doesn't work, it prints all the line: sed -n '/for pool /,/: ORA-04031/p' /tmp/allora04031.txt All this sed and awk is bullshit. /opt/oracle/fmw11_1_1_5/wlserver_10.3/common/bin/wlst.sh import fileinput start = 'for pool "' end = '": ORA-04031' for line in fileinput.input(['/tmp/allora04031.txt']): indstart = line.find(start, 0) if indstart > 0: indend = line.find(end, indstart) print line[indstart + len(start):indend] Here is the doc 2 comments: Or you could try this: perl -nle 'print $1 if /\s+pool\s+"(.*?)":\s+ORA-04031/' /path/to/logfile IMHO the FIRST quality of code is READABILITY. Perl, awk, sed, are all very powerful but totally unreadable unless you know them very well.
http://www.javamonamour.org/2012/10/print-text-between-2-strings.html
CC-MAIN-2018-47
refinedweb
199
58.79
please chk my code. it works well but is its logic correct?. #include <iostream> using namespace std; class train { private: int ms; public: train() { ms=250; cout <<"the speed of the train is 250km/h"; } train(int) { cout<<"please enter the speed of the train:"; cin >>ms; cout << "so the speed of the given train is "<<getMaxSpeed(); } void setMaxSpeed(); int getMaxSpeed(); void displaySpeed(); }; void train::setMaxSpeed() { cout<<"please enter the speed of the train:"; cin >>ms; } int train::getMaxSpeed() { return ms; } void train::displaySpeed() { cout <<"so the speed is :"<<getMaxSpeed(); } main() { int choice; train t1; cout<<"please select 1 if u want to display the speed through default constructor"; cout<<"please selext 2 if u want to display the speed through overloaded constructor"; cin>>choice; switch (choice) { case 1: t1=train(); break; case 2: t1=train(250); break; } t1.displaySpeed(); }
https://www.daniweb.com/programming/software-development/threads/255444/class
CC-MAIN-2016-44
refinedweb
140
54.53
LoPy4 LoRaWAN Nano Gateway and Node - ABP and OTAA issues Hi there, I've been trying to implement a LoRaWAN Nano-gateway and node, both using LoPy4 units. The gateway seems to be working fine for me as it can be seen to be connected on the TTN console, connecting to router.au.thethings.network. However, I can't seem to get the node to connect to the Nano-gateway. I've tried connecting using both ABP and OTAA but have encountered problems with both of these. I'm in New Zealand, using the AU915 plan with a gateway frequency of 916.8 MHz. I'm using the LoPy4 units connected to a Pytrack and a Pysense and I'm using the most recent firmware updates for all devices. I'm using the following code (only using one of the lora.join()authentication types at a time): from network import LoRa import socket import binascii import struct import time import config #.AU915) # create an OTA authentication params dev_eui = binascii.unhexlify('XXXX') app_eui = binascii.unhexlify('XXXX') app_key = binascii.unhexlify('XXXX') # create an ABP authentication params dev_addr = struct.unpack(">l", binascii.unhexlify('XXXX'))[0] nwk_swkey = binascii.unhexlify('XXXX') app_swkey = binascii.unhexlify('XXXX') for channel in range(0, 72): lora.remove_channel(channel) lora.add_channel(0, frequency=916800000, dr_min=0, dr_max=4) # join a network using ABP (Activation By Personalization) lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey)) # join a network using OTAA #lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0) # wait until the module has joined the network join_wait = 0 while True: time.sleep(2.5) if not lora.has_joined(): print('Not joined yet...') join_wait += 1 if join_wait == 5: print("Trying again...") lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey)) join_wait = 0 else: print("Joined!") break # create a LoRa socket s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) # set the LoRaWAN data rate s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3) # make the socket non-blocking s.setblocking(False) time.sleep(5.0) print(lora.stats()) input() for i in range (200): pkt = b'PKT #' + bytes([i]) print('Sending:', pkt) s.send(pkt) print("Sent") time.sleep(4) Using OTAA, the program seems to become stuck in the lora.join()function as I never see the 'Not joined yet'message. Using ABP, the node says that it has joined a LoRaWAN network ( lora.has_joined()returns True) but cannot send anything. I see 'Sending: b'PKT #\x00'and 'Sent'but nothing else in the loop. The gateway shows no indication that it has received anything other than 'Push ack'and 'Pull ack'and nothing is seen on the TTN Gateway Traffic entries or the Application Data. I've tried looking at other forum posts that encounter similar problems but the solutions presented in those, such as changing the channels created/removed or the data rate, haven't worked for me. Does anyone know what I may be able to try to fix these problems? @bed Yes, approach it step by step. First check the RF connection witrh the simple examples, which are tricky too. Then try ABP join, since that does not need downlink messages. After that go for OTAA join. There is indeed a problem with DRl 0 in the official 1.17.3.b1 revision, see, but that should not affect here. @rg_elect Glad that the OTAA is progressing. As the nano-gateway is listening on Channel 0, I would remove 1 and 2 as well. That will force the sends to be on exactly 915.2. With the GW using SF7BW125, that looks like it's DR 5 not 3. So I would try LORA_NODE_DR = 5. I don't know much about the mechanism of the OTAA or the nano gateway so I could be off base here. But it would be neat if the nano-gateway received a message -- does it print out to the console when it does? Anyway, I would suggest removing 1 and 2, and using DR 5 instead of 3. @bed Hi. I am getting the “not connected yet” in terminal from the lopy4node. I have removed all channels except 0,1,2 and all on 915200000 freq and data rate 3. I am not sure how to check the freq the nanogateway is listening on? I have setup the gateway config.py file for LORA_FREQUENCY = 915200000 LORA_GW_DR = "SF7BW125" LORA_NODE_DR = 3 This should setup the freq it is listening on but I need to query the process on what it is actually on? There are a couple of problems with the 0.17.3b1 release around AU915 -- if there are no channels to transmit on, the code will keep looping looking for a channel. Like forever! If you aren't seeing 'Not joined yet....' then I suspect the sends for the OTAA join are stuck in that loop. In 0.17.3b1, the add_channel() command has a problem (fixed on github) which will make your add_channels silently fail. I don't know if the add_channel() when it fails removes the channel. If so then there would be no channels, so the OTAA join sends would loop forever. If you comment out the section of code which removes channels and add channels, then if I'm right, the 'Not joined yet...' messages should start coming out, as the standard channels are setup when in the LoRa() call. I would try that first. I haven't used a nano-gateway, but as has been said, it will only listen on a single frequency, so you need to make sure that your LoPy4 is using the same frequency. If it is on a standard frequency, then I would just use lora.remove_channel() to get rid if all other channels (until a new release is created). Then all LoPy4 transmissions should be transmitted on the channel that the nano gateway is listening on. Good luck! @dillang Yes that's as far as it gets. I have a feeling it is in the RF connection between the node and the gateway. The gateway doesn't seem to hear it. I have tried all sorts of node codes but it think theres and issue in the gateway RF settings? My gateway shows push and pull ACK from TTN but nothing from the node. - robert-hh Global Moderator last edited by robert-hh @dillang The gateway should print a message when it received a packet from the node, even when the TTN parameters do not match. If not, the may work at different frequencies. The nanogateway listens only at a single frequency. So better sort that out first, and then carry on. You may also use the simple examples (e.g. or) to verify, that the RF set-up works. And yes, if you use revision 1.17.3.b1 of the firmware, you have to use also the most recent copy of the nano-gateway code from the library. @rg_elect Do you ever see the "Not joined yet..." message? I semi-solved this by downgrading the firmware version on the node to 1.13.0.b1, before they implemented the ability to select the LoRa region when the LoRa object is initialised. This solved the issues I had with joining and sending messages. Hi, I am also having the same issues with my lopy4 node not joining. Issue is the same as @DillanG was there any resolution to this? my gateway is a lopy and is connected to TTN my node is a lopy4 and have the OTAA copied into the main.py file. from network import LoRa import socket import binascii import struct import time import config lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AU915, adr=False, tx_retries=0, device_class=LoRa.CLASS_A) dev_eui = binascii.unhexlify('AABBCCDDEEFF7778') app_eui = binascii.unhexlify('****D57ED000C4EF') app_key = binascii.unhexlify('*****6CAC02F5742C41EE594460FDF87') for i in range(16, 65): lora.remove_channel(i) for i in range(66, 72): lora.remove_channel(i) print("ADD CHANNELS") for i in range(8, 15): lora.add_channel(i, frequency=915200000 + i * 200000, dr_min=0, dr_max=3) lora.add_channel(65, frequency=917500000, dr_min=4, dr_max=4) for i in range(0, 7): lora.add_channel(i, frequency=923300000 + i * 600000, dr_min=0, dr_max=3) print("JOINING") lora.join(activation=LoRa.OTAA, auth=(dev_eui, app_eui, app_key), timeout=0) while not lora.has_joined(): time.sleep(2.5) print('Not joined yet...') s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) s.setsockopt(socket.SOL_LORA, socket.SO_DR, config.LORA_NODE_DR) s.setblocking(False) time.sleep(5.0) for i in range (200): pkt = b'PKT #' + bytes([i]) print('Sending:', pkt) s.send(pkt) time.sleep(4) rx, port = s.recvfrom(256) if rx: print('Received: {}, on port: {}'.format(rx, port)) time.sleep(6) I'm also using the AU915 plan and have had a similar problem. Looking at another issue in this forum: fipy_lorawan-otaa-join-freezing-after-subband-selection I think that it's the same issue. @jmarcelino has put in a patch which may fix this, though it isn't in a release yet. Good luck, Brian - robert-hh Global Moderator last edited by robert-hh @dillang It depends on the combinations of versions. With 1.17.3.b1, you have to use the most recent copy of the nanogateway example from the github repository of the library. The difference: it must use ticks_cpu() instead of ticks_us() for time taking. This new version of the nanogateweay example does not work with older versions of the firmware. Uplinks work, but no downlinks, including teh one sent during OTAA join. Solved by downgrading the firmware on the LoPy4 running as the node to version 1.13.0.b1. OTAA join requests work and messages can be sent from the node and appear on the TTN console. @robert-hh I tested the LoPy4 units with code for Raw LoRa and I was able to transmit and receive messages between the two units so I don't think there is a problem with the antennae I'm using. Carrying on using ABP to join, the program definitely gets stuck with the s.send() function. I tried this by setting up the socket with the main program and then typing s.send('Hi')into the REPL. This returned a value of 2 (for the number of bytes I'm guessing??) and then became unresponsive. If the settings between gateway and node are different, am I correct in thinking that the node should still be able to send messages? Just the gateway I'm using won't be able to detect them? Are there any reasons why the send function might make the LoPy4 unresponsive? Are there some socket parameters that I may have not set? @robert-hh Checking the codes for both node and gateway, I have the following parameters set: - Gateway frequency and node single channel frequency - both set to 915 MHz - Spreading rate - both set to 7 - Coding rate - both set to CODING_4_5 - Bandwidth - both set to 125 kHz - Data rate - "SF7BW125" in config file for the gateway, 3 for the node socket Is there anything I'm missing? Also, the documentation says that rx_iq cannot be changed from False when initialising a LoRa object in LoRaWAN mode for the node. Is there another function to change this? @dillang You will always see some messages at a very low rssi level. That's just noise. Besides that, gateway & node have to be set to the same parameters. There is one parameter, which can be different. At the node, it's rx_iq=True, whereas on the gateway it's tx_iq=True. Although with just one node & gateway, it should work with the default settings. If I read the spec right, it's DR3. With the call to add_channel, you can set the frequency for that channel. Having the antennas a metre apart is a little bit too close, according to the recommendation. But I did that too. Just take care, that the antennas have the same orientation. The should stick both upright. @robert-hh The gateway does receive some message packets but I don't think they are from my node as they do not correspond to when I try to send from the node. For the gateway RF characteristics, is the only thing I need to change the datarate input to the gateway initialisation? Currently it is set up as "SF7BW125". Is the data rate set in setsockopt(socket.SOL_LORA, socket.SO_DR, 3)correct for this? Or should the '3' be something else? I read that SF7BW125 is DR_5 for the EU868 plan but DR_3 for the US915 and AU915 plans. Are there any other settings for the node that I need to change? For the node, I checked the spreading factor with lora.sf()and this returned '7' and lora.bandwidth()returned '0' which the documentation says means BW_125KHZ. When I use the lora.frequency()function, it returns '915000000'. Is this incorrect if I want the node to transmit at 916.8 MHz? Or is it okay to just set the channel frequency to be what I want? I tried changing the node channel and gateway frequencies to 915 MHz but still no luck. With regards to the antenna setup, the node and gateway are about a metre apart and I'm sure I've attached the antennae to the correct 868/915MHz slot on the LoPy4. The actual antennae have been purchased from Pycom and I'm sure they're the correct antennae. @dillang At least the log of the gateway should show, that it receives a packet, even if the TTN server cannot deal with it.. That is completely independent from the settings of the TTN server. Then, you should check the basics, like having set the same RF characteristics (frequencies, spreading factor, data rate) for both the node and the gateway, and things like proper antenna set-up for both devices. @robert-hh, I've copied the correct entries for the keys and IDs from the TTN page for the device. I double checked the device EUI from the LoPy4 but I still can't get anything to work. @dillang ABP join normally works, but requires some more manual configuration than OTAA. All the keys and IDs listed in your script have to be entered manually. The dev_eui is assigned to your device by Pycom, and has to be entered in the TTN Server registration. The app_eui and app_key are generated by the TTN server and have to be entered into your script. Furtheron, when using ABP, the TTN server creates the dev_addr, nwk_swkey and app_swkey. These have to be copied form the server into your scripts. These three values are exchanged automatically when using OTAA join, encrypted by the app_key.
https://forum.pycom.io/topic/3025/lopy4-lorawan-nano-gateway-and-node-abp-and-otaa-issues
CC-MAIN-2019-35
refinedweb
2,444
66.94
strncat Go Up to string.h Index Header File string.h, mbstring.h Category Memory and String Manipulation Routines, Inline Routines Prototype char *strncat(char *dest, const char *src, size_t maxlen); wchar_t *wcsncat(wchar_t *dest, const wchar_t *src, size_t maxlen); unsigned char *_mbsncat(unsigned char *dest, const unsigned char *src, size_t maxlen); unsigned char *_mbsnbcat(unsigned char *__dest, const unsigned char *__src, _SIZE_T __maxlen); Description Appends a portion of one string to another. strncat copies at most maxlen characters of src to the end of dest and then appends a null character. The maximum length of the resulting string is strlen(dest) + maxlen. The first three functions behave identically and differ only with respect to the type of arguments and return types. For _mbsnbcat, if the second byte of 2-bytes character is null, the first byte of this character is regarded as null. _mbsnbcat also copies at most maxlen bytes, not characters as the other functions do. Return Value strncat returns dest. Example #include <string.h> #include <stdio.h> int main(void) { char destination[25]; char *source = " States"; strcpy(destination, "United"); strncat(destination, source, 7); printf("%s\n", destination); return 0; } Portability
https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Strncat
CC-MAIN-2022-40
refinedweb
193
56.55
Question: I am trying to to create structure "Date of birth", and function that will assign values to the structure, and i am wondering is that possible to do that somehow like this: (PS. I am constantly getting error "Argument list syntax error", for 2nd and 23th lines.) #include <stdio.h> void input (dob_st *); int main () { typedef struct { int year; int month; int day; } dob_st; dob_st date; dob_st *p; p=&date; input (*p); printf("%02i.",p->day); printf("%02i.",p->month); printf("%i.",p->year); return 0; } void upis (dob_st *p) { printf ("Date of birth:\nDay?\n"); scanf ("%i",&(p->day)); printf ("Month?\n"); scanf ("%i",&(p->month)); printf ("Year?\n"); scanf ("%i",&(p->year)); } Solution:1 I think you're getting this because the definition of dob_st is local only to main -- it's not defined outside this method. The void input (dob_st *); method has no way to know what the dob_st is, and it's called upis later on, not input, which is probably another error. Solution:2 Some things: You should declare your structure outside of the main function, and before the prototype of the input function. You should also pass to input a pointer to a dob_st structure and not a structure itself: The possible code now as dob_st date; dob_st *p; p=&date; input (*p); should be dob_st date; input (&date); and the output be later based on date directly. PD: Is the upis function be meant to be the input function? Solution:3 You're changing the name of the function from 'input' to 'upis'. You also need to define dob_st outside the main() function. Solution:4 p is a pointer, so the argument should be "input(p)" in stead of "inuput(*p)". Using *p deferenences the pointer, and it is not necessary in this case. Solution:5 In standard C, you write "struct dob_st *p" instead of simply "dob_st *p". Also make sure that you declare the struct dob_st before you first use it. Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com EmoticonEmoticon
http://www.toontricks.com/2018/06/tutorial-c-prog-structure-as-argument.html
CC-MAIN-2018-51
refinedweb
351
70.63
Qt Console Application - Print colored text Hey guys! I want to print colored text in a Qt Console Application. This is what I wrote: main.cpp: #include <QCoreApplication> #include "helper.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); Helper h; h.print("print: Hello World\n"); h.printInfo("printInfo: Hello World\n"); h.printWarning("printWarning: Hello World\n"); h.printError("printError: Hello World\n"); return a.exec(); } helper.h: #ifndef HELPER_H #define HELPER_H #include <QDebug> #include <QTextStream> class Helper { public: Helper(); void print(QString str); void printInfo(QString str); void printWarning(QString str); void printError(QString str); }; #endif // HELPER_H helper.cpp: #include "helper.h" Helper::Helper() { } void Helper::print(QString str) { QTextStream out(stdout); out << str; } void Helper::printInfo(QString str) { print("\033[90m" + str + "\033[0m"); } void Helper::printWarning(QString str) { print("\033[93m" + str + "\033[0m"); } void Helper::printError(QString str) { print("\033[91m" + str + "\033[0m"); } But the output is like this: print: Hello World [90mprintInfo: Hello World [0m[93mprintWarning: Hello World [0m[91mprintError: Hello World [0m Hi! Works for me. What's your operating system? @Wieland Windows 10.0.10586 @AliReza-Beytari Ah, ok. I'm on Linux. Where did you read about the terminal codes? My strong guess would be, that these are codes for a Linux terminal emulator. @Wieland I had used these ascii codes in one of my Python applications and it worked for windows and linux. @AliReza-Beytari but dont python comes with its own shell? (or command prompt) Anyway, you can hax the prompt to support colors not tried in win 10. only win 7. I know its not what u wanted so just considered it a note :) - mrjj Lifetime Qt Champion @AliReza-Beytari didnt work on win 10 or what you mean? @AliReza-Beytari yes but its not really supported in windows anymore. In command prompt i mean. in ooooold times ansi.sys gave us colors. :) update using native api, there are colors to some degree :) but your app is then tied to windows :( - AlgorithMan Yes, the code you have there uses VT100 Escape Codes (note that \033is the octal representation of character 27=escape. You could also use the hexadecimal \x1binstead), see These require a terminal emulator that supports VT100, which almost all linux terminal emulators do. Windows Command Prompt doesn't support them by default, but at the bottom of there is some code that shows how to turn that on (it's only a few lines of additional code that you only need to run once at the beginning - I would put it into an #ifdef __WIN32 #endif for platform independence.) I haven't actually tried that though and I'm not sure on which versions of windows it works. Regarding python: python doesn't natively support VT100 either, but the colorama package enables them (to my knowledge, it replaces the print or write methods with something that extracts the escape codes and does the manipulations via calls to kernel32.dll methods).
https://forum.qt.io/topic/70203/qt-console-application-print-colored-text
CC-MAIN-2019-26
refinedweb
498
66.54
How can one return multiple values from a function ? Is there an example I can see ? How can one return multiple values from a function ? Is there an example I can see ? The easiest way to return multiple variables is to define them in a structure and simply return that. Code:#include <iostream> using namespace std; struct mystruct{ int x; char y; float z; }example, example2; mystruct myfunction(void); int main(){ example2 = myfunction(); cout<<example2.x<<" "<<example2.y<<" "<<example2.z; cout.flush(); cin.get(); cin.get(); return(0); } mystruct myfunction(void){ cout<<"Enter a integer: "; cin>>example.x; cout<<"Enter a char: "; cin>>example.y; cout<<"Enter a float: "; cin>>example.z; return example; } Last edited by Traveller; 07-21-2002 at 09:29 AM. >> The easiest way to return multiple variables You can't return more than one variable, unfortunately. But, what you can and should is pass the variables that you want changed by reference. Eg.Code:#include <stdio.h> void function(int* num1,int* num2,int* num3) { *num1 = 10; *num2 = 20; *num3 = 30; } int main() { int one=1, two=2, three=3; function(one, two, three); printf("%d %d %d", one,two,three); return 0; } Try reading the whole response, before you correct, thanx.Try reading the whole response, before you correct, thanx.The easiest way to return multiple variables is to define them in a structure and simply return that. >> function(one, two, three); Sorry, that should've been function(&one,&two,&three); >> Try reading the whole response, before you correct, thanx. huh? The Dog, you were correcting the previous post but he was right. Struct can be returned, thus a multiple variable value. It's a naughty way of doing things though. I would go with the reference parameters as was suggested. example2 = myfunction(); so whatever variables written in myfunction will be stored in example2.... ? (in the case that both are of the same struct, i mean) can you also copy two structs directly ? example2 = example ?? I think someone misunderstood something. Check this: Can you return more than one DOG?Can you return more than one DOG?Code:typedef struct { /*blah blah blah*/ }DOG; int main() { DOG busta; //busta is a variable of type DOG return 0; } Do you get what I'm saying? The Dog, Respectfully, if I may, No need to use the indirection operator when "passing by reference", however, thanks for letting me "play" with your code.No need to use the indirection operator when "passing by reference", however, thanks for letting me "play" with your code.Code:#include <iostream> #include <conio.h> void function(int& num1,int& num2,int& num3) { num1 = 10; num2 = 20; num3 = 30; } int main() { int one = 1, two = 2, three = 3; std::cout << one << " " << two << " " << three << '\n' << std::endl; function(one, two, three); std::cout << one << " " << two << " " << three << '\n' << std::endl; std::cout << "Done!"; getch(); return 0; } P.S. Traveller, The Dog wasn't "correcting" your post that I could discern, just offering another option. -Skipper "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow Dog, Traveller was saying that you can put those extra values in a struct and return the struct. This "returns" more than one value within that struct. That is all. It's not major stuff here. He just didn't like that you corrected him when what he was saying was correct. Learner007: Yes, you can copy to structs directly, that is after all what the code is doing: Hope this answers your question.Hope this answers your question.Code:example2 = myfunction(); /* Since my function returns a structure of type mystruct, example to be correct, the code executes myfunction first then the statement evaluates to: example2 = example; */
https://cboard.cprogramming.com/cplusplus-programming/22063-returning-multiple-values-function.html
CC-MAIN-2018-05
refinedweb
624
66.23
by Mohammed Salman How to build native desktop apps with JavaScript (Proton Native) When I was writing this article, Atwood’s Law came to mind: Any application that can be written in JavaScript, will eventually be written in JavaScript. - Jeff Atwood Originally posted on my blog! Today we are going to take a look at Proton Native, and make a simple app with it. Unlike Electron apps, apps built with Proton Native are actually native (hence the name) and not web-based on chromium. Proton Native is like React Native but for desktop. It compiles to native platform code, so it looks and performs like a native app. So let’s get started. Windows Install the build tools by running: npm install --global --production windows-build-tools Linux You’ll need these libraries: - libgtk-3-dev - build-essential Mac You don’t need anything. Now run the following: npm install holds the Window and Menu, and the Window has three props: title (the window title), size (takes an object that contains the width and height of the window), and menuBar (set to false because we don’t want a menu bar). Before we start coding, let’s install crypto using npm: npm i crypto We will use crypto to hash the text with the MD5 algorithm. index.js import React, { Component } from "react"; import { render, Window, App, Box, Text, TextInput } from "proton-native"; import crypto from "crypto"; class Example extends Component { state = { text: "", md5: "" }; hash =.hash(text)} /> <Text>{this.state.md5}</Text> </Box> </Window> </App> ); } } render(<Example />); I first imported Text and TextInput so I could use them later. Then in the class after setting the text and md5 to empty strings in the state object, I created a function hash that takes a text argument. In the hash function, we set the state to text and declare md5 to store the encrypted text (as below) this.setState({ text }); let md5 = crypto.createHash("md5") .update(text, "utf8").digest("hex"); and set the state object to the updated md5. this.setState({ md5 }); The render method returns some jsx element. The Box element is just like div in React, or View in React Native, which holds the TextInput and Text . This is because the parent window element doesn’t allow having more than one child. TextInput has an onChange prop that will be called every time the text changes. Therefore, we set it to a fat arrow function that takes a text argument and returns the hash function we declared earlier. So now every time the text changes, text is hashed and set to md5. Now if we run it with npm run start this window should pop up: And if we enter some text, it gets hashed to md5 like this: You might say “It looks ugly — let’s add some styling to it.” Well, at the time of writing this article, Proton Native is still at it’s infancy. It’s very buggy and it doesn’t support styling (yet), but it’s a fun project to play with. If you want to contribute to the project, check out the repo. If you have any questions or suggestions, feel free to comment or reach me on Twitter @4msal4 and don’t forget to hit that clap button :) How to build a news app with React Native.
https://www.freecodecamp.org/news/build-native-desktop-apps-with-javascript-a49ede90d8e9/
CC-MAIN-2022-05
refinedweb
556
68.81
This page is DEPRECATED, please refer to the new source In order to use the Convention plugin, you first need to add the JAR file to the WEB-INF/lib directory of your application. Code behind hello world::: Please notice that the expression ${message} will work without adding JSP directive isELIgnored="false". If start up the application server and open up in our browser, we should get this result: Results and result codes.: The "foo" action will be executed, because no result is found, the Convention plugin tries to find an action named "foo-bar" on the same package where "foo" is defined. If such an action is found, it will be invoked using the "chain" result. XWork packages-default), which is a custom XWork package that extends struts-default. Therefore the naming for XWork packages used by the Convention plugin are in the form: Using our example from above, the XWork package for our action would be: Annotation reference:. You can specify className parameter which can be especially useful when Spring Framework is used to instantiate actions.". If you get errors: Parameters can be passed to results using the params attribute. The value of this attribute is a string array with an even number of elements in the form {"key0", "value0, "key1", "value1" ... "keyN", "valueN"}. For example: Namespaces and Results Make sure the namespace of the action is matched by one of the locators. The rest of the namespace after the locator, will be the namespace of the action, and will be used to find the results. For example, a class called "ViewAction" in the package "my.example.actions.orders" will be mapped to the URL /orders/view.action, and the results must be under /WEB-INF/content/orders, like /WEB-INF/content/orders/view-success.jsp. Use the Configuration Browser Plugin Add the Config Browser Plugin plugin to the lib folder or maven dependencies, and then visit:, to see the current action mappings. Enable trace or debug mode The Convention plugin can generate a rather verbose output when set to debug mode for logging. Use "Trace" logging level if you are using the JDK logger. If you are using Log4J, you can do something like: log4j.logger.org.apache.struts2.convention=DEBUG: 4 ?
https://cwiki.apache.org/confluence/display/WW/Convention+Plugin?focusedCommentId=23338329
CC-MAIN-2018-13
refinedweb
375
52.8
On Sun, Jan 07, 2007 at 09:24:00AM +0100, Thorsten Leemhuis wrote: > Rahul Sundaram schrieb: > > Anticipating the upcoming merge of Fedora Core and Extras I have been > > removing the references to Fedora Core and replacing it with appropriate > > terms throughout the wiki but I would need suggestions on how to handle > > pages within the /Extras namespace. Would moving them to /Packaging > > make sense? Can we considering dropping the ACL's in the packaging page > > and just add a note on top that changes needs to be handled by the > > packaging committee? > > +1 for moving most of the stuff to Packaging/ (¹) . I would against merging /Extras and /Packaging for the same reasons merging fedora-extras and fedora-packaging lists. The space under /Extras is more or less about everything, from organisational strutures over _Review_ Guidelines, CVS requests and a lot more. The Packaging area remained rather packaging (not package) focused and is mainly maintained by the people for the packaging committee. Perhaps some parts of /Extras make sense to land in /Packaging, but generally I feel like simply removing the /Extras prefix from the URL may be a better idea. -- Axel.Thimm at ATrpms.net Attachment: pgpH5Z3cReqji.pgp Description: PGP signature
https://www.redhat.com/archives/fedora-devel-list/2007-January/msg00488.html
CC-MAIN-2014-15
refinedweb
202
53.61
. Private is a category for features that are accessible but are not intended for use outside of their component (module). Such features are subject to change with every release and depending on them is risky and should be avoided. Friend API is used for features accessible to specific components in the system, that help to overcome the lack of a real stable API, but are intended only for use between these friend components and nobody else. Often friend components are developed by the same group of people. A change to this contract can be done every release, but owners of those friend components must be notified in advance. No one else should depend on such features - the author of this API does not have the intent to create a general purpose API. Under development is a name for a contract that is expected to become a stable API, but that has not yet been finished. The current state serves as a proof of concept, and others are encourage to try it and comment on a dedicated mailing list. Incompatible changes may be done between releases, but should be rare, not radical and properly announced on the mailing list. Stable interfaces are those that have received a final state and the maintainers are ready to support it forever and never change them incompatibly. The "forever" and "never" should not be taken as absolute: It is possible to change the contract, but only in major versions and only after a careful considerations and in cases where it is imperative that a change be made. Stable contracts should [#poi preserve the investments ] of those entering into them (users of an API). Official are stable ones and also packaged into one of NetBeans official namespaces: org.netbeans.api or org.netbeans.spi or org.openide. By packaging a contract into this package (and making it part of a release) one notifies others that the contract is stable - with all the consequence (except the conditional support for early adoptions - such modules has code base name that ends with with /0). Also, the impact of possible incompatible changes to official API should be minimized by providing compatibility bridges and keeping binary compatibility even when source one is droped (see the preservation section). org.netbeans.api org.netbeans.spi org.openide Third party interfaces are provided by other parties that do not follow the NetBeans rules and thus are hard to classify. It is prefered not to expose such interfaces as part of own contracts, in order to insulate users of NetBeans APIs from unexpected changes made in the imported interfaces. Standard is similar to the third party classification. Also provided by someone out of NetBeans, but by someone expected to evolve the interface in compatible way (for example JSRs). The standard is expected to not change frequently. Deprecated. After a while, nearly every API, regardless of what state it is, becomes obsoleted. Usually a new, better support for the same task has been developed which replaces the old API. In such case, mark the old API deprecated. A previously stable API that changed its stability to deprecated shall be supported for reasonable amount of time (a release) to communicate to users that they shall migrate from it to the new replacement. After that time the API can be removed from the product, while trying to preserve it for old clients by making it available in alternative ways (e. g. autoupdate centers).
http://wiki.netbeans.org/wiki/index.php?title=API_Stability&oldid=50822
CC-MAIN-2013-20
refinedweb
575
50.26
:. The parameters defining the connection have to be exactly the same, including the connect attributes ! If there is no appropriate database handle or if the ping method fails, a new connection is established and the handle is stored for later re-use. There is no need to remove the disconnect statements from your code. They won't do anything handle to every subsequent server. This will cause clashes when the handle is used by two processes at the same time. With this limitation in mind, there are scenarios, where the usage of Apache::DBI is depreciated. Think about a heavy loaded Web-site where every user connects to the database with a unique userid. Every server). Here is generalized ping method, which can be added to the driver module: { package DBD::xxx::db; # ====== DATABASE ====== use strict; sub ping { my($dbh) = @_; my $ret = 0; eval { local $SIG{__DIE__} = sub { return (0); }; local $SIG{__WARN__} = sub { return (0); }; # adapt the select statement to your database: $ret = $dbh->do('select 1'); }; return ($@) ? 0 : $ret; } }. the initial data_source sets AutoCommit = 0.::Status module has to be loaded before the Apache::DBI module ! The module should be loaded upon startup of the Apache daemon. Add the following line to your httpd.conf or startup.pl: PerlModule Apache::DBI It is important, to load this module before any other modules using DBI ! A common usage is to load the module in a startup file via the PerlRequire directive. See eg/startup.pl for an example. There are two configurations which are server-specific and which can be done upon server startup: Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr) This can be used as a simple way to have apache servers establish connections on process startup. Apache::DBI->setPingTimeOut($data_source, $timeout) This configures the usage of the ping method, to validate a connection. Setting the timeout to 0 will always validate the database connection using the ping method (default). Setting the timeout < 0 will de-activate the validation of the database handle. This can be used for drivers, which do not implement the ping-method. Setting the timeout > 0 will ping the database only if the last access was more than timeout seconds before. For the menu item 'DBI connections' you need to call Apache::Status BEFORE Apache::DBI ! For an example of the configuration order see startup.pl. To enable debugging the variable $Apache::DBI::DEBUG must be set. This can either be done in startup.pl or in the user script. Setting the variable to 1, just reports about a new connect. Setting the variable to 2 enables full debug output. Note that this module needs mod_perl-1.08 or higher, apache_1.3.0 or higher and that mod_perl needs to be configured with the appropriate call-back hooks: PERL_CHILD_INIT=1 PERL_STACKED_HANDLERS=1. The Apache::DBI module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://search.cpan.org/~mergl/ApacheDBI/DBI.pm
CC-MAIN-2016-22
refinedweb
491
57.67
Code sample 1: def count_lines1(file_name) open(file_name) do |file| count = 0 while file.gets count += 1 end count end end def count_lines2(file_name) file = open(file_name) count = 0 while file.gets count += 1 end count end which is the better way to implement the counting of lines in a file. Neither. Ruby can do it easily using foreach: def count_lines(file_name) lines = 0 File.foreach(file_name) { lines += 1 } lines end If I run that against my ~/.bashrc: $ ruby test.rb 37 foreach is very fast and will avoid scalability problems. Alternately, you could take advantage of tools in the OS, such as wc -l which were written specifically for the task: `wc -l .bashrc`.to_i which will return 37 again. If the file is huge, wc will likely outrun doing it in Ruby because wc is written in compiled code. You can also read in large chunks with read and count newline characters. Yes, read will allow you to do that, but the scalability issue will remain. In my environment read or readlines can be a script killer because we often have to process files well into the tens of GB. There's plenty of RAM to hold the data, but the I/O suffers because of the overhead of slurping the data. "Why is slurping a file bad?" goes into this. An alternate way of reading in big chunks is to tell Ruby to read a set block size, count the line-ends in that block, looping until the file is read completely. I didn't test that method in the above linked answer, but in the past did similar things when I was writing in Perl and found that the difference didn't really improve things because it resulted in a bit more code. At that point, if all I was doing was counting lines, it'd make more sense to call wc -l and let it do the work as it'd be a lot faster for coding time and most likely in execution time.
https://codedump.io/share/Lmna1h3Te8Et/1/opening-file-in-ruby
CC-MAIN-2017-13
refinedweb
339
71.24
Hi i've been trying to figure out where to find the biggest number in an array. I know how to find the biggest number but i need to find out where the biggest number is, like which row or whatever it's in. Code : import java.util.Scanner; public class array { public static void main (String args[]) { Scanner keyboard = new Scanner(System.in); int r[] = new int[50]; int n=0; int x, bigSoFar; System.out.print("Enter list: "); x = keyboard.nextInt(); while( x!= -999); { r[n] = x; n++; x = keyboard.nextInt(); } for(int k = 0; k < n; k++) if(r[k]> bigSoFar) { bigSoFar = r[k]; } System.out.println(r[k]); } } Although first i'm having trouble trying to get my first code to work, i keep getting this error array.java:34: error: cannot find symbol System.out.println(r[k]); ^ symbol: variable k location: class array 1 error
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/29005-how-find-where-biggest-number-array-printingthethread.html
CC-MAIN-2015-18
refinedweb
151
61.12
Stack log messages Project description stacklog Stack log messages - Documentation: Overview Stacklog is a tiny Python library to stack log messages. A stack-structured log is an approach to logging in which log messages are (conceptually) pushed onto a stack and emitted only when the corresponding block returns. Stacklog provides a single method, stacklog, which serves as either a decorator or a context manager. This is exceptionally useful in small projects or one-off scripts. This is illustrated best with an example: with stacklog(print, 'Running some code'): with stacklog(print, 'Running some other code'): pass This produces the following logging output: Running some code... Running some other code... Running some other code...DONE Running some code...DONE When the code within a stacklog context completes, the provided message is echoed along with the return status, one of DONE or FAILURE. That's pretty much it. Customization and advanced features are available through callbacks. Install stacklog has been developed and tested on Python 2.7 and 3.5+. pip install stacklog Quickstart How often do you find yourself using the following logging anti-pattern in Python? import logging def a(): logging.info('Running a') do_something() logging.info('Done with a') def b(): logging.info('Running b') a() logging.info('Done with b') try: b() except: logging.info('There was an error running b') The intention here is to log the beginning and end of procedure calls for use in debugging or user monitoring. I call this an anti-pattern because: - it requires excessive manual attention to writing/updating logging calls at entry/exit sites - it results in redundant exception handling logic - the resulting log messages can be misleading if errors occur Instead, the approach taken by stacklog is to accomplish this using only decorators and context managers. Usage as decorator Here is the above example using the stacklog as a decorator: @stacklog(logging.info, 'Running a') def a(): raise Exception @stacklog(logging.info, 'Running b') def b(): a() b() This produces logging output: INFO:root:Running b... INFO:root:Running a... INFO:root:Running a...FAILURE INFO:root:Running b...FAILURE Usage as context manager Here is another example using stacklog as a context manager: >>> with stacklog(logging.info, 'Running some code'): ... do_something() ... INFO:root:Running some code... INFO:root:Running some code...DONE Providing custom conditions A condition is a tuple exception, status. If the provided exception is raised during the execution of the provided code, the provided status is logged instead of the default FAILURE. >>> with stacklog(logging.info, 'Running some code', conditions=[(NotImplementedError, 'SKIPPED')]): ... raise NotImplementedError ... INFO:root:Running some code... INFO:root:Running some code...SKIPPED Customization with callbacks The behavior of stacklog is fully customizable with callbacks. The main thing that a callback will do is call the passed stacklog instance's log method with some custom suffix. First, there are three callbacks to customize the behavior of logging at the beginning of the block, at successful completion of the block, and at failure of the block. Only one function can be registered at a time for each of these events. on_begin(func: stacklog -> None) on_success(func: stacklog -> None) on_failure(func: stacklog -> None) Second, one can customize failure behavior given different possible exceptions that are raised, by passing a pair of functions, the first to match an exception that was raised during block execution and the second to respond to the exception. Many pairs of functions can be registered, but only the most recent one to be registered will be executed in the case that multiple functions match. on_condition(match: *exc_info -> bool, func: stacklog, *exc_info -> None) Third, one can initialize and dispose of resources before and after the block's execution. This is relevant for starting/stopping timers, etc. Many functions can be registered and they will all be executed. on_enter(func: stacklog -> None) on_exit(func: stacklog -> None) See the implementation of stacktime for an example. Adding timing information One can customize stacklog with callbacks to, for example, add information on the duration of block execution. >>> with stacktime(print, 'Running some code', unit='ms'): ... time.sleep(1e-2) ... Running some code... Running some code...DONE in 11.11 ms History 1.0 (2019-12-10) Initial release. Project details Release history Release notifications | RSS feed Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/stacklog/
CC-MAIN-2021-04
refinedweb
731
50.43
A nice and customizable cronfield Project Description A nice and customizable cron field with great, easy to use UI. Attention! To propose features, always open pull requests on the develop branch. It’s the branch for features that will go into the next django fancy cronfield feature release. For fixes for 0.1.x releases, please work on support/0.1.x which contains the next patch release for 0.1.x series. The master branch is the current stable release, the one released on PyPI. Changes based on master will not be accepted. Features - Cron format validation - Custom django field - Ability to specify a daily run limit Requirements Fancy cron field requires Django version 1.5 up to 1.8.7, Python 2.6, 2.7, 3.3, 3.4 and python-crontab 1.9.3. Installation pip install django-fancy-cronfield Basic usage Use it like any regular model field: from django.db import models from fancy_cronfield.fields import CronField class MyModel(models.Model): timing = CronField() Getting Help Please Write to our mailing list.
https://pypi.org/project/django-fancy-cronfield/0.1.0/
CC-MAIN-2018-13
refinedweb
176
61.83
By Peter Chng I've ran the Boston Marathon for the past five years (2011-2015, inclusive) and wanted to get an idea for how the participants and their finishing times had changed across those years. To do so, I wrote a script to download all the results from{year} and aggregated them into a single CSV file. I then loaded that CSV file into Pandas to analyze the data. Because Boston has qualifying times that limit registration to only faster runners, this race tends to be much faster than other similar-sized marathons. import time import datetime import scipy.stats as spstats import pandas as pd %pylab inline #%matplotlib inline # Default plot styles. figsize(15, 5) # Set default figure size. # Set default colours/styles. # Requires matplotlib >= 1.4. plt.style.use('ggplot') matplotlib.rcParams.update({ 'font.family': 'Arial', 'axes.titlesize': 20, }) Populating the interactive namespace from numpy and matplotlib # Aggregate results taken from:{year} # Some data wrangling had to be done to get all results into the same format. results = pd.read_csv('boston-marathon-total.csv') Each row corresponds to a finishing time for a runner for a particular year. In addition to the net finishing time, you also get the gun finishing time, first half split time, {overall, gender, division} finishing place, gender, age group and bib number of the runner. The age groups generally line up with the age groups used for Boston qualifying times, with the exception of the 18-39 group, which actually contains two BQ age groups: 18-34 and 35-39. I believe the reason for this was the distinction between "open" and "masters" age groups typical at most races. (Masters competitors usually start at age 40) This data allows us to take a look some interesting properties of runners of the Boston Marathon. # Example of what the data looks like: results[results.name_location.str.contains('Chng')] Here are the number of results I was able to pull from the website. For some reason, they are all different than the number of finishers listed in the official statistics. (Take, for example, the 2015 statistics) I don't know why this is the case, but the differences are likely small enough to be negligible. 2013 had the smallest number of finishers in recent history, because the bombing/terrorist attack at the finish line prevented many from finishing. 2014 was the largest year because the field size was greatly expanded to accomodate the runners who were not able to complete following the terrorist attack in 2013. Interest remained high in 2015, and so the field size remained higher than in prior years. 2012 had a smaller number of finishers than 2011 because of the high temperatures that year. This reduced the number of finishers in two ways: results.groupby('year').size().plot(kind='bar', fontsize=16, title='Number of finishers each year') results.groupby('year').size() year 2011 23879 2012 21554 2013 17580 2014 31805 2015 26610 dtype: int64 Because the name and country of the runner were combined into one field, we'll extract those into separate fields. We'll also convert the string representation of finishing time ( HH:MM:SS) into a pandas.tslib.Timedelta object, and at the same time, compute the first and second half splits. This will allow us to analyze the finishing times better. # Data wrangling/data fixing to make the data more useful. # Extract the name from name_location. (Could have done this in the scraper script, but whatever) results['name']= results.name_location.map(lambda x : x.rsplit(' ', 1)[0]) # Fix country column, was not extracted properly by the scraper script. # TODO: PC: Anyway to do this with a Series.str.<method> operation? Series.str.slice() doesn't take non-scalars! results.country = results.name_location.map(lambda s : s[s.rfind('(') + 1: s.rfind(')')]) # Convert half_split and finish_net to timedelta objects. def timestring_to_timedelta(time_string): if type(time_string) != str: return time_string parts = time_string.split(':') return datetime.timedelta(seconds=int(parts[0])*3600 + int(parts[1])*60 + int(parts[2])) # Compute first half, second half and finish times as timedelta objects. results['first_half'] = results.half_split.map(timestring_to_timedelta) results['finish'] = results.finish_net.map(timestring_to_timedelta) # Based on net finish time. results['second_half'] = results.finish - results.first_half # List of years covered. years = results.year.unique() print 'Results with missing half_split: {}'.format(results[pd.isnull(results.half_split)].shape[0]) Results with missing half_split: 186 There were 186 results with missing half splits, but none with missing finishing times. This is sort of self-evident, as the results posted on the website only included those with finishing times, so the total numbers don't necessarily match up with the official BAA statistics. However, the discrepancies were minor. For some reason, there were no bib numbers for 2011. Let's look at some broad statistics between each year. Keep in mind that 2013 was the year of the bombing/terrorist attack, and according to the official statistics, only 17,600 runners were allowed to complete, the lowest (75.4%) finishing rate in recent history. This acted as an artificial limit, and as we'll see, this reflects in the major differences in aggregate statistics between 2013 and the other years, making any comparison with 2013 less useful for drawing any inferences. For this, I'm using the number of finishers (male, female) as a proxy for the number that entered. This is not entirely accurate, as the number that entered, the number that started, and the number that finished are all distinct values. The definition of each is: Each subsequent value is less than or equal to the former. The exact relation is: Entered >= Started >= Finished As an example, see the 2011 Boston Marathon official statistics. Because I'm using the number of finishers (my results only capture finishers), the exact ratios of male/female and other demographics may not be correct, if certain groups were more predisposed to not finishing/not starting. male_female = results.groupby(['year']).gender.value_counts().unstack() male_female_normed = male_female.div(male_female.sum(1), axis=0) ax = male_female_normed.plot(kind='barh', stacked=True, fontsize=16, title='Male/Female Ratio') ax.xaxis.set_major_locator(MultipleLocator(0.05)) ax.invert_yaxis() # Show raw data male_female_normed.applymap(lambda x: '{:.2%}'.format(x)) For 2014 and 2015 the male/female ratio was almost identical at 55%/45%. This contrasts with 2011 and 2012, where it was more like M/F 58%/42%. 2013 had a far higher percentage of males than females because the the course was shutdown far earlier than normal following the bombing at the finish line. Since females, on average, are slower than males, this created an artificial limit on the number of females who could finish. It is interesting to note that that the male ratio has seemingly fallen by 2-3% from 2011/2012 to 2014/2015. Although I don't have enough years' worth of data, it is interesting to note that the change lines up with the change in qualifying standards that happened between 2012 and 2013. This would seem to indicate that the five-minute across-the-board reduction in qualifying times slightly benefited women by increasing their participation. Looking at more years in the past along with more data in the future would confirm or deny this assertion. However, the current ratio of 55%/45% (M/F) is still inline with other big marathons that have no qualifying time restrictions, such as the 2013 Chicago Marathon. Other examples: Thus, the current BQ standards are "fair" to both males and females in that there is not a marked difference in gender ratios from other big marathons. (An informal survey of MarathonGuide.com results reveals that most marathons are somewhere between 55-60% male) # TODO: PC: Need more colours! year_age_groups = results[results.year != 2013].groupby(['year', 'gender', 'age_group']).size().unstack().unstack() year_age_groups_normed = year_age_groups.div(year_age_groups.sum(1), axis=0) ax = year_age_groups_normed.plot(kind='barh', stacked=True, fontsize=12, figsize=(15, 7), title='Age/Gender group distribution') ax.xaxis.set_major_locator(MultipleLocator(0.05)) ax.invert_yaxis() # Show underlying DataFrame. year_age_groups_normed.applymap(lambda x: '{:.2%}'.format(x)) Here, we can see a more detailed view of how the 5-minute tightening of BQ standards affected each age group/gender. First, let's go over a summary of the changes that have happened to Boston registration in the past five years: These changes seem to have reduced the percentage of various groups in the Boston Marathon. For instance, the M18-39 group is noticeably smaller in 2014/2015 after remaining almost constant in 2011/2012. In particular, the tighter qualifying times seemed to reduce the percentage size of all male age groups up to and including 50-54, after which the change was too small or actually in favour of the new BQ times. It should be noted that the older age groups have far fewer participants, so it's harder to draw conclusions since various fluctuations can affect the percentage much more. Again, I'm only looking at two years' worth of data (two before and two after the change), so take this all with a grain of salt. It's important to note that I am not arguing for or against any of the changes the BAA has made, just observing changes that may have happened as a result of it. Whether you are for/against/indifferent to the changes depends on your point-of-view. age_group = results[results.year != 2013].groupby(['year', 'age_group']).size().unstack() age_group_normed = age_group.div(age_group.sum(1), axis=0) age_group_normed.plot(kind='barh', stacked=True, title='Age Group Percentages') age_group_normed.applymap(lambda x: '{:.2%}'.format(x)) At first glance, the 18-39 age group is clearly the largest, accounting for >40% of the entire field across all years. However, this is expected since this age group spans the most number of years. With the exception of the 80+ age group, all other age groups span only five years. (I don't know why Boston defines age groups this way, but it's probably because of the division between the 'open' and 'masters' fields, with master-age competitors typically beginning at age 40) There is no way to properly breakdown the 18-39 age group without actually knowing the runners' ages, but a crude approximation would be to note that this age group spans 22 years, and that this is 4.4 times the size of the five-year age groups. Assuming a uniform distribution within 18-39 (likely not the case), we "normalize" this age group by dividing by 4.4, yielding a normalized result of 9-9.5%. This would mean that the largest five-year age group, by far, is either 40-44 or 45-49. You can draw your own conclusions as to why this might be the case. My personal explanation is that younger folks have other things on their mind, and that the training and recovery necessary for getting a BQ is tougher at older ages. The 40-49 age range seems to be the "sweet spot" where these folks have the {time, interest, money} to train and qualify for Boston, while not being old enough to make it too hard. Almost all races have a huge local bias, and Boston is no different, with over 80% of all runners over the past five years being from the USA. Canada and the United Kingdom (which is abbreviated as GBR) are consistently second and third. The distribution over the remainder of the countries appears to follow some power-law distribution, with the amounts getting progressively smaller, though I didn't bother to confirm this. country_counts_sorted = results.groupby('country').size().sort_values(ascending=False) def top_n_group_other(s, n, label='others'): top_n = s.sort_values(ascending=False)[:n] top_n[label] = s[n:].sum() return top_n n_countries = 5 top_n_group_other(country_counts_sorted, n_countries).plot( kind='pie', autopct='%.2f %%', figsize=(15, 15), colormap='coolwarm', shadow=True, legend=True, fontsize=14,title='Top {} nationalities represented at Boston'.format(n_countries)) <matplotlib.axes._subplots.AxesSubplot at 0x144639b0> # Non-US countries: Does this follow some sort of power-trend law, i.e. the decrease between subsequent numbers? top_n_group_other(country_counts_sorted[1:], 15).plot( kind='pie', autopct='%.2f %%', figsize=(15, 15), colormap='coolwarm', shadow=True, legend=True, fontsize=12, title='Top nationalities excluding USA at Boston') <matplotlib.axes._subplots.AxesSubplot at 0x144638d0> # Pandas doesn't support aggregate operations (mean(), etc.) on GroupBy objects for Timedelta/timedelta64[ns]: # year_describe_comparison = results.groupby(['year'])['finish']\ .describe(percentiles=[0.10, 0.50]).unstack()\ .reindex(columns=['count', 'mean', '50%', '10%', 'std', 'min', 'max'])\ .rename(columns={'50%': 'median'}) ax = year_describe_comparison.drop(['count', 'max', 'min'], axis=1)\ .applymap(lambda t: t/np.timedelta64(1, 's') if isinstance(t, pd.tslib.Timedelta) else t)\ .plot(kind='bar', title='Finishing time comparison across years', fontsize=16, rot=0) ax.yaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: str(datetime.timedelta(seconds=x)))) ax.yaxis.set_major_locator(MultipleLocator(30*60)) ax.set_xlabel('') # Show dataframe for reference year_describe_comparison.applymap(lambda t: t.to_pytimedelta() if isinstance(t, pd.tslib.Timedelta) else t) In ideal years, the mean finishing time in Boston is in the high 3:40's. For comparison, the Chicago Marathon (comparable in size), considered "fast and flat", has had mean finishing times in the 4:30's for the past few years. A ~40-50 minute difference in mean times is quite a big difference. Thus, it's no surprise that Boston itself is among the marathons with the highest percentage of Boston qualifying times. Interestingly, the 10% percentile time appears to be around one standard deviation below the median during most years, except for 2013. The fastest year was 2013, where, because of the bombing/terrorist attack at the finish line, only the fastest runners were permitted to finish. Outside of this year, the fastest was 2015 in my five-year sample set. This is interesting, because there was a considerable amount of rain and crosswinds during that year. It didn't seem to have an effect on most runners, myself included. (2015 was my fastest Boston) In particular, it was considerably faster than 2014, a year where weather conditions were considered ideal, but may have been on the warm side for many, rising to a high of 62F/17C. 2012 was by far the slowest year, owing to the heat during that year. In almost all years, the median was faster than the average/mean, except for 2013, where only the faster runners were permitted to finish. This is likely to there being more "slower" runners than "faster" runners, creating an asymmetric distribution. I've also shown the fastest 10th percentile time; this is the time that the fastest 10% of runners met, or in another words, if you ran this time or faster, you were in the top 10% of all finishers. As you can see, it's always been around the 3-hour mark, except for the hot 2012 year. This is pretty significant, when you consider that in most other marathon races without qualifying times, running a sub-3 will get you into the top 2-3%. This gives you an ideal for just how competitive the overall field is in Boston. increase_2014_2015_mean = (year_describe_comparison.ix[2014]['mean'] / year_describe_comparison.ix[2015]['mean'] - 1) increase_2014_2015_std = (year_describe_comparison.ix[2014]['std'] / year_describe_comparison.ix[2015]['std'] - 1) print '2014-2015 increase in mean={:.2%}, std={:.2%}'.format(increase_2014_2015_mean, increase_2014_2015_std) 2014-2015 increase in mean=7.08%, std=25.52% Obviously, heat has a detrimental effect on running pace; that should be no surprise to any serious runner. What's more interesting, however, is that it appears to affect runners differently, at least in the Boston Marathon. Now, mind you, I have only five years' worth of data, so that is likely not enough to draw any conclusions, but it's still worthwhile to note that the two hottest years (2012 and 2014, where the highs were 87F/31C and 62F/17C, respectively) had the highest standard deviation (48:43 and 50:52) in finishing times. In cooler years, the standard deviation was much lower. The increased standard deviation in hotter years is not simply explained by each runner slowing down by a percentage of their "ideal" finishing time, as that would result in the mean and standard deviation both increasing by the same percentage, but this did not occur. For example, let's compare 2015 (cool year) with 2014 (a warmer year): 2014 had a mean that was 7.08% higher and a standard deviation that was 25.52% higher than 2015. The exact relation between finishing times and heat is difficult to determine from the data I have, as there are other variables at play, including (but not limited to), other weather conditions, BQ cut-off times for the year, etc. that also affect finishing times. But it's clear to me that it's not simply a case of each runner slowing down by a fixed percentage off of their "ideal" time. Instead, it's likely that slower runners are affected more, perhaps because they are out on the course for a longer time and during the hotter part of the day. In particular, it's worthwhile to note that Boston starting times are done in stages/waves, with slower runners starting progressively later in the day, when it's likely hotter. (The start is also later than most marathons) This may not be obvious (at least it wasn't to me), so we'll do a quick explanation. Suppose the "ideal" distribution of finishing times, $x$, has a mean and variance for the entire population given by: (Standard deviation would just be the square root of variance)$$ \bar{x} = {1 \over N} \sum_{i=1}^{N} x_i $$$$ s_x^2 = {1 \over N} \sum_{i=1}^{N} (x_i - \bar{x})^2 $$ Now, suppose all finishing times are slowed by a fixed percentage (say, because of heat) to create a new distribution, $y$, where $y = ax$ and $a > 1$. Then the new population mean is:$$ \bar{y} = {1 \over N} \sum_{i=1}^{N} ax_i $$$$ \bar{y} = {a \over N} \sum_{i=1}^{N} x_i $$$$ \bar{y} = a\bar{x} $$ And the new population variance is:$$ s_y^2 = {1 \over N} \sum_{i=1}^{N} (ax_i - \bar{y})^2 = {1 \over N} \sum_{i=1}^{N} (ax_i - a\bar{x})^2 $$$$ s_y^2 = {1 \over N} \sum_{i=1}^{N} (a^2x_i^2 - 2a^2x_i\bar{x} + a^2\bar{x}^2) $$$$ s_y^2 = {a^2 \over N} \sum_{i=1}^{N} (x_i^2 - 2x_i\bar{x} + \bar{x}^2) $$$$ s_y^2 = {a^2 \over N} \sum_{i=1}^{N} (x_i - \bar{x})^2 $$$$ s_y^2 = a^2s_x^2 $$ Since standard deviation is just the square root of the variance:$$ s_y = \sqrt{a^2s_x^2} = as_x $$ This shows that both the population mean and standard deviation would be scaled by the same amount if all runners slowed by a fixed percentage. Since this did not occur, and instead the standard deviation increased by a greater percentage than the mean, we conclude that heat does not slow down all runners by the same percentage. Looking at the distribution/histogram of finishing times often gives a more useful insight than just looking at the mean and standard deviation. Note that the 2013 distribution is not directly comparable to other years as not all runners were allowed to finish. The course would have been shut down sometime before 3:00 PM local time, and since the last wave started at 11:15 AM, this probably had an impact on the distribution after the 3:30 mark; thus the distribution is probably comparably up to, but not after, the 3:30 time. bins = [7200 + i *5*60 for i in range(5*12)] results['raw_finish'] = results.finish.map(lambda t: t/np.timedelta64(1, 's')) for year in years: pyplot.subplots() ax = results[results.year == year].raw_finish.hist( bins=bins, xrot=90, xlabelsize=14, ylabelsize=14, color=(0, 0.4, 0.8)) ax.set_title('{} Boston Marathon Finishing Times'.format(year)) ax.xaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: str(datetime.timedelta(seconds=x)))) ax.xaxis.set_major_locator(MultipleLocator(10*60)) # Highlight {2:55-3:00, 3:25-3:30 3:55-4:00} bins. ax.patches[11].set_facecolor('r') ax.patches[17].set_facecolor('m') ax.patches[23].set_facecolor('c') I've chosen to highlight the 3:00, 3:30 and 4:00 marks in all of the distributions. Some notes on this: High temperatures appears to have at least two effects on the distribution: bins = [3000 + i *5*60 for i in range(3*12)] results['raw_half'] = results.first_half.map(lambda t: t/np.timedelta64(1, 's')) for year in years: pyplot.subplots() ax = results[results.year == year].raw_half.hist( bins=bins, xrot=90, xlabelsize=14, ylabelsize=14, color=(0, 0.4, 0.8)) ax.set_title('{} Boston Marathon Half Splits'.format(year)) ax.xaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: str(datetime.timedelta(seconds=x)))) ax.xaxis.set_major_locator(MultipleLocator(5*60)) # Highlight {1:30, 1:45, 2:00} bins. ax.patches[7].set_facecolor('r') ax.patches[10].set_facecolor('m') ax.patches[13].set_facecolor('c') I've highlighted the 1:30, 1:45 and 2:00 marks in the above distributions, to align with projected 3:00, 3:30 and 4:00 finishes. The most striking feature of the histogram/distribution of half times is that they are much more "smooth" than the overall finishing times. What I mean by "smooth" is that the bins are always decreasing in value as you move away from the mode, or the highest bin. This is in sharp contrast to the distribution of finishing times, where there are sometimes local peaks/modes that correspond to specific goal times that runners were aiming for, i.e. a sub-3 finish. This behaviour has a clear effect on the distribution of finishing times, causing it to reflect runners' goals rather than perhaps their all-out ability. By contrast, the half-split times look more "natural", but there are still some interesting results: In most years, a lot of runners try to make it under the 1:30 mark at the half, resulting in this bin perhaps being larger than it "should" be. This presumably reflects their goal of running a sub-3-hour marathon. Suggestion by no_other_plans Note: You can safely skip this section if you don't care about statistics. An interesting question is: Are marathon finishing times normally-distributed? Some other research has pointed towards this, but based on my own observations, I was skeptical of this. However, I was able to find at least one paper supported the idea that marathon finishing times were normally distributed. El Helou et al. looked at 60 marathon races in their study, Impact of Environmental Parameters on Marathon Running Performance, and found: I decided to see if finishing times across the sub-populations of {men, women} and individual age groups (such as M18-39, F40-44, etc.) were normally or log-normally distributed. # Quick sanity check: Sample 1000 numbers from a normal distribution and calculate the test statistic. # Should produce a p-value > 0.05. spstats.mstats.normaltest(np.random.normal(10.0, 1.0, size=1000)) # Mean is 10.0, Std. Dev is 1.0 (0.66207350822001909, 0.71817877253387097) min_samples = 200 # raw_finish is the finishing time in seconds; this is the sample we wish to test for normality. results.groupby(['year', 'gender']).raw_finish\ .apply(lambda x: (len(x), (spstats.mstats.normaltest(x)[1])) if len(x) >= min_samples else NaN).unstack() The p-value calculations were obtained using scipy.stats.mstats.normaltest, which does some super-special-elite-black-ops-ninja normality test based on D'Agostino and Pearson's work. I have no idea whether this normality test is appropriate. The first number in each cell is the number of samples, and the second is the two-sided p-value from the normality test. So, for example, in 2015 the male age group n=13806 and p=0.0. The p-value can be interpreted as the answer to this question: Assuming that the distribution is normal (the null hypothesis), what is the probability that the observed/actual distribution would have occurred? If the p-value is sufficiently low (usually either p < 0.05 or p < 0.01) then you conclude the distribution was not normal. Since the p-values were all extremely small, none of the finishing time distributions for male/female across any of the years I looked at were normally distributed. Visually looking at the distribution of finishing times for a sub-population (such as M18-39, which I've done below) also reveals that the times don't appear to be normally distributed. # Apply numpy.log() to the raw_finish distribution and check if the resultant distribution is normal. results.groupby(['year', 'gender']).raw_finish\ .apply(lambda x: (len(x), (spstats.mstats.normaltest(np.log(x))[1])) if len(x) >= min_samples else NaN).unstack() I don't know exactly why my result differ so much from El Helou et al., but here are some possibilities: After some research, it turns out I was asking the wrong question. The answer to whether run times are "normally distributed" is almost certainly "no", since the normal distribution is not bounded, i.e. the probability only asymptotically approaches zero as x approaches +/- infinity. Clearly run times are bounded, i.e. there is no finishing time above some certain time and no finishing time below ~2 hours. Instead, the question I should have been asking is: "Is the normal distribution a reasonably good model for finishing times here?" At first glance, this might seem like the same question, just re-worded, but the difference turns out to be important. This article, by Dr. Allen Downey, clearly explains the pitfalls of using just a statistical test to determine if a dataset is drawn from the normal distribution, and instead advocates comparing the CDF of the model to the CDF of the dataset to perform a visual check for how good the model is at representing the data set. So, I'll do that here. By doing a visual check, we can possibly see ranges for which the normal distribution is a good fit, and ranges for which it is not. Just doing a statistical test and coming up with a p-value doesn't capture this. I'll break each year's finishing times out into {male, female} sub-groups, then compute the mean and standard deviation for each sub-group. This mean and variance will then be used to plot a normal CDF with the same mean and variance (since a normal distribution is fully defined by mean and standard deviation) and the goodness-of-fit will be assessed visually. # References: # # def plot_cdf_with_norm(sub_group, ax, title, histtype='step', num_norm_samples=100000, lognormal=False): # Using 1-min bins from 2 hours to 7 hours. bin_width = 60 start = 7200 range_hours = 5 num_bins= range_hours * (3600/bin_width) bins = [start + i*bin_width for i in range(num_bins)] # If plotting against a lognormal model, take the log of the finishing times, then compute the # {mean, std. dev} of this dataset and use these as the parameters for a normal model. data = sub_group.raw_finish if lognormal: bins = np.log(bins) data = np.log(data) # Generate an approximation of normal CDF by taking 100,000 samples from the normal distribution. # Use the sub-group mean and standard deviation. norm_model = pd.Series( np.random.normal(loc=data.mean(), scale=data.std(), size=num_norm_samples)) # Plot CDF of finishing times. ax.hist(data, bins=bins, cumulative=True, color=(0, 0.4, 0.8), histtype=histtype, normed=True, label='Data') ax.set_title(title, size=14) if not lognormal: ax.xaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: str(datetime.timedelta(seconds=x)))) ax.xaxis.set_major_locator(MultipleLocator(10*60)) # Plot CDF of associated normal distribution. model_title = 'Lognormal Model' if lognormal else 'Normal Model' ax.hist(norm_model, bins=bins, cumulative=True, histtype=histtype, normed=True, label=model_title) for tick in ax.xaxis.get_ticklabels(): tick.set_rotation(90) ax.set_ylim([0, 1.0]) ax.set_xlim(bins[0], bins[-2]) ax.set_xlabel('Finishing time') if lognormal: ax.set_xlabel('Finishing time (log s)') #ax.set_ylabel('CDF') ax.legend(loc=4) # Returns slices grouped by the specified keys and a sorted list of tuples of the groups. def sorted_sub_groups(results, keys): results_groupby = results.groupby(keys) # The keys (which are tuples) are not sorted by default. sorted_keys = sorted(results_groupby.groups.keys()) return results_groupby, sorted_keys)) i += 1 pyplot.tight_layout() Comparing the normal CDF to the finishing time CDFs, the normal distribution was not a good model for any regular year. The only year for which the normal distribution was decent was 2013, and that was the year where the race was cut short and slower runners were not permitted to finish. In particular, in all years observed, whether a "fast" or "slow" year, the normal CDF overestimated the number of faster runners, underestimated the number of "middle-pack" runners and underestimated the number of slow runners. This last part is seen in the long right tail of the finishing time distribution graphs seen previously. Comparisons of the CDF with the lognormal model showed a slightly better fit, but there were still some systematic discrepancies. This was the methodology I used:), lognormal=True) i += 1 pyplot.tight_layout()
http://nbviewer.jupyter.org/github/pchng/boston-marathon-2011-2015/blob/master/Boston%20Marathon%202011-2015%20Results%20Analysis.ipynb
CC-MAIN-2017-04
refinedweb
4,872
55.74
Euler problems/31 to 40 From HaskellWiki 1 Problem 31 Investigating combinations of English currency denominations. Solution: This is the naive doubly recursive solution. Speed would be greatly improved by use of memoization, dynamic programming, or the closed form. problem_31 = pence 200 [1,2,5,10,20,50,100,200] where pence 0 _ = 1 pence n [] = 0 pence n denominations@(d:ds) | n < d = 0 | otherwise = pence (n - d) denominations + pence n ds 2: problem_33 = undefined 4 Problem 34 Find the sum of all numbers which are equal to the sum of the factorial of their digits. Solution: import Data.Char problem_34 = sum [ x | x <- [3..100000], x == facsum x ] where facsum = sum . map (product . enumFromTo 1 . digitToInt) . show 5 Problem 35 How many circular primes are there below one million? Solution: problem_35 = undefined 6 Problem 36 Find the sum of all numbers less than one million, which are palindromic in base 10 and base 2. Solution: = maximum $ catMaybes [result | j <- [1..9999], let p2 = show j ++ show (2*j), let p3 = p2 ++ show (3*j), let p4 = p3 ++ show (4*j), let p5 = p4 ++ show (5*j), let result | isPan p2 = Just p2 | isPan p3 = Just p3 | isPan p4 = Just p4 | isPan p5 = Just p5 | otherwise = Nothing] where isPan s = sort s == "123456789" Other solution: import Data.List mult n i vs | length (concat vs) >= 9 = concat vs | otherwise = mult n (i+1) (vs ++ [show (n * i)]) problem_38 :: Int: problem_40 = (d 1)*(d 10)*(d 100)*(d 1000)*(d 10000)*(d 100000)*(d 1000000) where n = concat [show n | n <- [1..]] d j = Data.Char.digitToInt (n !! (j-1))
http://www.haskell.org/haskellwiki/index.php?title=Euler_problems/31_to_40&oldid=14919
CC-MAIN-2013-48
refinedweb
271
60.95
Opened 6 years ago Closed 4 years ago Last modified 4 years ago #10696 closed Bug (duplicate) manage.py throws away exception information Description When an ImportError occurs in manage.py, the exception is caught and stored in a variable - e, but that data isn't used in the error message at all. Because settings.py is a python file, there could be a variety of issues that come up and its useful to see what the actual underlying error is. In my usecase, I have the line from settings_local import * at the end of the main settings.py file. If settings_local.py doesn't exist, then an import error gets thrown but the exception handling in manage.py swallows it. It would be great to add something like: sys.stderr.write(e.message + '\n') to manage.py to surface the actual error that's occurring. Change History (7) comment:1 Changed 6 years ago by thatch - milestone set to 1.1 - Needs documentation unset - Needs tests unset - Patch needs improvement unset - Triage Stage changed from Unreviewed to Design decision needed comment:2 Changed 6 years ago by jacob - Triage Stage changed from Design decision needed to Accepted comment:3 Changed 6 years ago by jacob - milestone 1.1 deleted comment:4 Changed 6 years ago by jacob - Triage Stage changed from Accepted to Design decision needed comment:5 Changed 4 years ago by sethtrain - Severity set to Normal - Type set to Bug comment:6 Changed 4 years ago by graham_king - Easy pickings unset - Resolution set to duplicate - Status changed from new to closed comment:7 Changed 4 years ago by Leo Thanks Graham. It is a dup and it's all fixed. Looks like a duplicate of #14130. Please re-open if I'm mistaken. Either way, the problem is gone. I've tried every which way I can think to cause an error in settings.py (import errors, regular errors, file permission errors deep within the logging module, etc) and it always gets reported correctly to the console.
https://code.djangoproject.com/ticket/10696
CC-MAIN-2015-35
refinedweb
340
63.29
Enums are really useful if you want to, well, enumerate the possible values for a field. An example of enumeration is the list of movie genres: public enum MovieGenre { Action, Comedy, Drama, Musical, Thriller, Horror } This way, you can define that a field accepts only values coming from that specific enum, thus narrowing down the list of possible values: public class Movie { public string Name { get; set; } public DateTime ReleaseDate { get; set; } public MovieGenre Genre { get; set; } } So, now, you can instantiate a new movie as new Movie() { Name = "My movie", ReleaseDate = DateTime.Now, Genre = MovieGenre.Drama }; Simple, right? As usual, there is more than this, even if we are used to staying on the surface. #1: Enums are nothing but masked numbers Even though their structure may let you think of a complex structure, enums are value types. This means that if you pass an enum to a function, you will not modify it as if it were an object. In fact, if we define a function that sets a given MovieGenre to Musical: static void SetToMusical(MovieGenre genre) { genre = MovieGenre.Musical; } and we try to update a value, we will notice that we haven't actually updated the value. MovieGenre genre = MovieGenre.Action; Console.WriteLine(genre);// Action SetToMusical(genre); Console.WriteLine(genre);// Action Internally, an enum is a numeric type: it can be made of byte, sbyte, short, ushort, int, uint, long, or ulong values. By default, an enum is a static, Int32 value, whose first element has value 0 and all the following elements have their value increased by 1 compared to the previous one. We can customize this default behavior by using a different starting value and then have all the other values will follow the numeric order. public enum MovieGenre { Action = 23, Comedy, Drama, Musical, Thriller, Horror } This means that if you reorder the elements (for example, because you want the values to be in alphabetic order, so moving Horror between Drama and Musical), you might mess up all the following values and bring subtle bugs in. How to fix it? Simple: specify a value for each element! public enum MovieGenre { Action = 23, Comedy = 24, Drama = 25, Musical = 26, Thriller = 27, Horror = 28 } This way you can reorder the items without the risk of creating bugs. #2: Many ways to get the value Even if internally an enum is nothing but a number, you can get its friendly name. There are many ways to do that. If you want the string value of a statically defined enum value, you can rely on the nameof operator, with nameof(MovieGenre.Comedy); or, using the Enums class, try with the GetName method: Enum.GetName(typeof(MovieGenre), MovieGenre.Comedy); The GetName method is a bit cumbersome to write, so probably you'd prefer using the nameof operator, which was released with C# 6. How can you get the value if it is set at runtime? Of course, you may use the ToString method. MovieGenre mg = MovieGenre.Musical; var musicalValueAsString = mg.ToString(); Or, if you want to rely on the Enum class, you can try with Enum.Format(typeof(MovieGenre), mg, "g") Have you noticed the last parameter of the previous snippet? What does it mean? Well, as you can format Guids, you can use flags to format an enum as well. - G and F return the name of the enum. There is a small difference that occurs when an enum is used with the flag attribute (I'll talk about it later) - D represents the value in decimal form - X represents the value in hexadecimal form. These flags can be used both on the Enum.Format and the ToString method. var action = MovieGenre.Action; // remember, its value is 23 action.ToString("g"); // "Action" action.ToString("x"); // "00000017" action.ToString("d"); // "23" You can read more details on those values on Microsoft documentation. If you need the numeric value of the enum, you can simply cast it. (int)MovieGenre.Action #3: Parsing and casting enums You can transform an enum to a string, and of course you can do the opposite! MovieGenre e; Enum.TryParse<MovieGenre>("Action", out e); or, if you prefer defining the variable inline, Enum.TryParse<MovieGenre>("Action", out MovieGenre e); neat and clean, isn't it? A thing that you must keep in mind is that, if the string you pass to the method does not exist, TryParse will set to 0 the out variable: this can cause bugs if you have defined a value associated with 0. public enum Status { OK = 0, Failed = 1, Waiting = 2 } // and, within a method... Enum.TryParse<Status>("Feiled", out Status st); // OK In the above example, "Feiled" is not a valid value, so the assigned value is 0 which is casted to OK. You can prevent this bug in 2 ways: by checking on the returned value of TryParse, which returns true if the parsing was successful, false otherwise; or you can add an additional check before the parsing, using the IsDefined method, with something like Enum.IsDefined(typeof(Status), "Feiled"). #4: Flagged enums What if an enum fields must allow multiple values? After all, a movie can have more than one genre, right? You could implement it as a list (or an array) of flags, or... you can use the Flags attribute. This flag allows to easily apply OR operations on enums, making the code cleaner and more readable. The downside is that now enums values can't have custom values, but must be a power of 2, so 1, 2, 4, 8 and so on. [Flags] public enum MovieGenre { Action = 1, Comedy = 2, Drama = 4, Musical = 8, Thriller = 16, Horror = 32 } So now we can create an action-comedy movie var movie = new Movie() { Name = "Bad Boys", ReleaseDate = new DateTime(1995, 4, 7), Genre = MovieGenre.Action | MovieGenre.Comedy }; Now that you have flags on enums, whatcha gonna do? You can use the HasFlag method to, well, check if a value has a certain flag MovieGenre mg = MovieGenre.Action | MovieGenre.Comedy; if (mg.HasFlag(MovieGenre.Comedy)) { // Do something } This is more performant than looping though a list of enums, since now we're working directly on bits. #5: Enum best practices As always, there are some best practices to follow. The following ones are suggested directly on the Microsoft documentation: - If you have a default value for the enumeration, set its value to 0; - If there isn't an obvious default value, create a value (set to 0) that represents the fallback case (for example, create a None value and set it to 0); - Validate inputs for methods that allow enums as parameters, since enums are nothing but numbers, so a simple cast can cause unexpected results; Let me explain the third point: do you remember the Status enum? Here's a method that tells if the input is valid: string printValidity(Status status){ switch (status) { case Status.Failed: case Status.OK: case Status.Waiting: return "Valid input"; default: return "Invalid input"; } } and well, you can imagine how it works. What happens if you do this? var validity = printValidity((Status) 1234); Exactly, the value is Invalid input. So, remember to validate inputs! Conclusion In this article, we've seen that - enums are just numbers in disguise; - you can format an enum as a string, a hexadecimal value or a numeric value; - you can use flags to define multiple values; - you should follow best practices: remember to define a default value and to validate inputs; Happy coding! Originally published at code4it.dev. 📝📝📝 I write about C#, .NET, Azure, and everything around them. Check it out! 🐧🐧🐧 Let's keep in touch on Twitter! Discussion Thanks.
https://practicaldev-herokuapp-com.global.ssl.fastly.net/bellons91/5-things-you-didn-t-know-about-enums-in-c-47m
CC-MAIN-2021-04
refinedweb
1,275
63.59
PHP Succeeding Where Java Has Failed 610 ficken writes "Web browser pioneer Marc Andreessen recently announced his prediction that PHP will be more popular than Java for building web-based applications." From the article: useage is steadily increasing. About 450 programmers have privileges to approve changes to the software. Major companies that employ PHP include Yahoo, Lufthansa and Deutsche Telekom's T-Online." Meanwhilie, Piersky writes "Zend has announced its rival to .NET and J2EE, with the Zend PHP Framework. In a press release, they stated that it will be 'A Web application framework which will standardize the way PHP applications are built. The Zend PHP Framework will accelerate and improve the development and deployment of mission-critical PHP Web applications'. This will for part of Zend's PHP Collaboration Project" I am completely unbiased... (Score:5, Funny) Re:I am completely unbiased... (Score:5, Insightful) I have to say, just not working with Tomcat is a plus (though I give major Props to the Fedora team for the option to install Tomcat right off the install disks)...When gcj finally catches up, I'll be a happy puppy. Re:I am completely unbiased... (Score:5, Interesting) Does definitely remind me of VB, though the syntax isn't as screwy. Re:I am completely unbiased... (Score:5, Insightful) Huh? Not sure what you mean here. If by integrate you mean communicate with other languages there's things like CORBA and SOAP, if you mean call other shared libraries there's always JNI if you can't find a java lib to do something. Until, as you say, gcj or any other piece of free software catches up, Java won't be usable. Strange, I'm using it every day at work. Have been in one way or another professionally for 8 years now. It died as a client-side language, and is struggling on the server as well. You do realise that is no better than a BSD is dying troll right? Just checked Moster.com. 105 java positions available within 50 miles of my house, 18 for PHP, 42 for perl Now I'm saying that as someone who also uses PHP. I've been using it quite a bit lately and don't mind it at all, but we're talking apples and oranges here. Sure PHP can be used to write monstrously sloppy and/or insecure code, but so can any language. PHP can also be used to write clean easily maintable secure code. PHP wasn't even close to java in terms of object oriented coding until PHP5 came out, which unfortuneatly has been very slow to appear on most 3rd party hosting servers and distros. My only real gripes with PHP are the lack of a standard DB connectivity layer like JDBC. PEAR:DB and ADODB are close, but they still rely on non-php libraries so setting up a connection to oracle or sql server is painful. The other thing is a lack of type hinting for primatives. Seems kinda silly to have to do a check if something is an int or double in the method instead of just putting it in the method's signature. I'm know its a loosely typed language, but type hinting is there as an option for objects, why not primatives too? I'm looking forward to PHP5.5 its going to have some real nice features that will bring it little closer to server side java and a little further from something like Re:I am completely unbiased... (Score:3, Insightful) Re:I am completely unbiased... (Score:3, Insightful) I think it's a bit more readable than Perl, simply because Perl lets you get away with things that php does not. $_ leaps to mind. But Perl gets a bad rep from people who write sloppy Perl code. If you break things out into packages and functions and aren;t afraid to use linebreaks, the code doesn't become an illegible snarled mess. The things I see Re:I am completely unbiased... (Score:5, Interesting) [Java] died as a client-side language. Not sure how much this is worth, but as we speak the top item on the Most Active Projects list over on SourceForge (insert tinfoil hat disclaimer here), Azureus [sourceforge.net] is a client side Java app. For those of you keeping score at home, the #2 spot, GAIM [sourceforge.net], is in C and PHP comes in at #3 via phpMyAdmin [sourceforge.net]. Keep in mind this is looking at quality (and a pretty wierd messure of quality, at that), not quantity, but still intersting. Re:I am completely unbiased... (Score:4, Funny) PHP is great stuff (Score:2, Insightful) I suppose that's true in most jobs, though. Re:PHP is great stuff (Score:5, Interesting) Don't know about you, but it sounds dangerous to me. Re:PHP is great stuff (Score:3, Interesting) Pardon me while I roll my eyes (Score:5, Insightful) This is just silly. PHP is far from "simpler" than Java. PHP *is* better suited to basic page generation tasks. Its syntax is easy to learn, and it's quick to get a page running. However, any sort of complexity thrown at the system starts making PHP look difficult and Java look easy. For example, I often write web applications that require that user sessions communicate with each other. Now this is stupidly simple in Java thanks to the use of Singletons or named derivitives. One can easily build a chat room, for example, whereas PHP begins to get a bit more tricky. Now throw really complex needs like PDF generation, Dynamic Excel Spreadsheets, XML/SOAP/XML-RPC/EDI communication, mainframe interfaces, off-brand databases, performance caches, and other large scale features, and suddenly Java doesn't look so hard anymore. PHP, OTOH, begins screaming for mercy. One would think that Andreessen would understand how to use the right tool for the right job, but apparently not. He should be kept away from the press. He always manages to sound 50 IQ points dumber than he actually is. (A common problem when dealing with the press.) Re:Pardon me while I roll my eyes (Score:2, Interesting) Re:Pardon me while I roll my eyes (Score:4, Funny) Re:Pardon me while I roll my eyes (Score:4, Informative) Java is not slow in server-side, it is just slow on desktop with Swing. Get Tomcat and try benchmarking some JSPs if you don't believe me. Templates with java might be slower than JSP, but anyway, page rendering is something that impacts the performance of web application the least. With java you EXTREMELY RARELY need to write extensions, usually you can find java libraries (most of them open source) that do the stuff you need. Or you can just use standart java class libraries, that are enough for 95% of cases. This way you can get a platform-independent solution for no additional cost. While your DLLs (.so's?) will have to be compiled for each architecture, coded to be cross-platform, installed by system administrators, etc. If you need to interface with C++/C, there is JNI (Java native interface, It is hairy and unfriendly though). Of you can integrate via some kind of interprocess communication (pipes still work, as will TCP, with java you can write TCP client/server in 10-30 lines of code). This way you can have any language on the other side of IPC. You can use webservices/CORBA/XML RPC if you want to be fancy. --Coder Re:Pardon me while I roll my eyes (Score:3, Informative) That's called a theory. It's much harder to build in reality, and mostly sucks anyway since you still don't get any namespace and have to decorate every damn function like there was no god. Thing is in Java you can write your extensions in Java (the JIT compiler is running behind so perfs are good anyway), Re:Pardon me while I roll my eyes (Score:3, Informative) No, especially not server side. Reaches within a few % of C++ speed in well-established benchmarks: [shudo.net] bulky, No. It can run within a few 100k on mobile devices. Non-GUI java apps can run in just a few MB. not user friendly. A vague term, which could mean anything. Re:Pardon me while I roll my eyes (Score:2) PHP is a great language for small web applications, but doing something complex like an insurance intranet site, and Java is clearly the better option. Re:Pardon me while I roll my eyes (Score:2) He does not mean simple as in stupid, he means simple as in easy to use. The infrastructure, the language, the libraries are all more accessible in PHP than in Java. It is for these reasons programmers like PHP. Your points Re: Tasks that are more sophisticated are right on though. Re:Pardon me while I roll my eyes (Score:5, Insightful) Andreessen knows exactly how to use the right tool for the job, like a surgeon. His tool is the media, and his job, as a new member of the board at Zend, is to promote PHP. Re:Pardon me while I roll my eyes (Score:5, Informative) OK, this is a troll if I ever saw one and may I be damned for feeding one but here it goes: Go look at PEAR [php.net] and the PHP manual index [php.net] and then tell people PHP doesn't have a platform offering all those. Re:Java failing? (Score:3, Insightful) On the contrary, the article makes it very clear: Java is failing to provide income for Marc Andreesen. Re:PHP is great stuff (Score:3, Interesting) AFAIK: J2EE won't fail... (Score:5, Insightful) Re:J2EE won't fail... (Score:3) And nobody said J2EE was going to die. It's just that more people are realizing it isn't always the best way to develop a web app. IMO (and some people say I'm wrong sometimes), Java excels where you need to interface with legacy and/or disparate systems. If you don't need to do that, Java and J2EE might Re:J2EE won't fail... (Score:3, Interesting) This is exactly contrary to my experience. Java *sucks* at playing nice with other systems, unless you build up a "play nice with Java" layer in those other systems first. PHP, shitty as it is, is much better. Python and Perl are both much better (Python more than perl these days, imo) as glue code. Java works best when it can run in long running, memory hogging, monolithic processes, where it's development and execution model ca In other news (Score:5, Funny) What? The two do different things. Will be? (Score:3, Insightful) Help me out here (Score:5, Insightful) I am prepared to have my mind blown here, can someone enlighten me? Re:Help me out here (Score:5, Informative) Re:Help me out here (Score:2) Re:Help me out here (Score:4, Informative) Re:Help me out here (Score:4, Insightful) People recommend Smarty because PHP feels pretty incomplete without it. And it's not about separating code from contentit's about separating business logic from display logic. And the syntax is really easy. Re:Help me out here (Score:3, Insightful) It's nice to be able to give the people responsible for content and layout access to the files of the website, without giving them access to the code that actually contacts the database, has access to server globals, etc. You can enforce that sort of separation via policy rather than code, but if its only policy, there's a temptation to bend the rules, es Re:Help me out here (Score:3, Insightful) Re:Help me out here (Score:4, Insightful) Come again? You're saying that {$value} somehow separates presentation from code more than does <?=$value;?>? Re:Help me out here (Score:3, Insightful) Re:Help me out here (Score:2, Interesting) On the flip side, I've been working with Ruby on Rails [rubyonrails.org] and it's beautiful. Scripts to generate the starting points for your web files, separation of design and implementation, a great framework. Only thing Re:Help me out here (Score:3, Informative) Re:Help me out here (Score:2, Informative) Re:Help me out here (Score:2, Insightful) Re:Help me out here (Score:2) We use one servlet/many handlers to generate XML, and the presentation layer is XSL(T). So yes, you can do Java with no code in your presentation layer. Re:Help me out here (Score:3, Interesting) Templating is part of the solution, but so is good app design. If you don't want to mix your logic, you simply need to code it that way. Zend PHP Framework will help enforce some of the same separation as Java does, but it's not strictly necessary. You can do MVC app design withou PHP Desktop Apps?! (Score:4, Insightful) Re:PHP Desktop Apps?! (Score:3, Interesting) Actually, php-gtk is very useful when you have an existing PHP web app that you want to port into a desktop app. It's a great project, but is definitely not meant for large-scale apps. Re:PHP Desktop Apps?! (Score:5, Funny) What are you talking about? I'm posting this right now on my php-coded web-bro&%($(*#&%#&@&NO CARRIER Guessed wrong again! (Score:5, Funny) So I decided that I'd focus on Java for my depth. Now I read that I guessed wrong again! Maybe I should have gone C#/.ASP. No, Python and Zope are where it's at! No way, Ruby is the way to go. Arrrgh! Re:Guessed wrong again! (Score:2) You make a good point. Fortunately PHP, Python, and Ruby are simplistic enough where specialization require a huge investiment in time like Java or C++. I think the hacking world is pretty saturated with languages. It started with Java in 1995, Perl, ASP, PHP, Python, and really ended with Ruby a few years ago. None of these languages has really advanced the state of the art. I am still waiting for Lisp to become fashionable again. We'd all be better off. Re:Guessed wrong again! (Score:3, Insightful) The Success of PHP (Score:3, Informative) Well, of course. PHP works for free. Wondering where the '22 million web sites' comes from? [php.net]. Re:The Success of PHP (Score:2, Informative) Caching (Score:2, Interesting) I don't know much Php but as far as I can tell there is no way to do this natively. This is one of the reasons I don't use php. You see site like groklaw get overloaded when Slashdot hits them because they pull the freaking article out of the database every time it's requested. If somebody could show me some in process caching that'd take me a long way to ditching php. I don't mean caching to disk either. Caching to disk is much slower t Both have strengths and weaknesses (Score:4, Insightful). Till next year (Score:2) Marc Andreessen is on Zend's Board of Directors (Score:5, Informative) Little "full disclosure" for everyone. PS There's more to Java on webservers than J2EE. There's also multiple Open Source versions of J2EE. Re:Marc Andreessen is on Zend's Board of Directors (Score:2) Good to hear though since this just seemed a bit too silly to be true. Sure PHP is a way easier way to get the typical website up and running, but the Java stack of libraries and tools is incredibly much more comprehensive. Sure this means that PHP is an excellent pick for 90% of all web applications in the world, whereas Java shoots for the full 100% but is more difficult to deal with. This is Re:Marc Andreessen is on Zend's Board of Directors (Score:3, Informative) Either Ruby (and RoR) or Python (and Django, Zope, the terrific TurboGears or any other framework) would probably be much more interresting and enjoyable. Do remember, though, that none of them are Java, you have to forget the Java way and "get" the philosophy of those languages or you'll end up frustrated with very slow apps and bloated code. lingo... overload (Score:2, Interesting) Seems like every post mentions some form of standards or framework, and everyone wants to standardize everything within a framework. Or perhaps make a framework which will help standardize everything. I can't stop saying standards framework.......standards framework..... I miss the old days when "ware" was the hot term.. webware..awareware..opencourseware..cookware.. On topic.. Php is just so much more fun then Java... (excep Here we go... (Score:2, Insightful) J2EE has a very well-respected place in larger organizations. The support is fantastic, the tools are fantastic, and the language is actually very nice, once you truly get to know it. I used to think that Java was slow and useless, but when I actually started writing a lot of it, I found that its really not as bad as everyone told me it woul Re:Here we go... (Score:2) Re:Here we go... (Score:2) Oh you really made the case for Java here... "You don't like Java? How can you? It's the new COBOL! Everybody's loving it!" PHP, or Ruby? (Score:3, Insightful) I've certainly found Rails to be a good fit with interfacing with a Jabber PostgreSQL backend [blogs.com]. Good times! Apples and Oranges? (Score:3, Insightful) Bitter (Score:2, Interesting) PHP wins - it's economics (Score:3, Insightful) I'm talking about the network effects [wikipedia.org] of PHP being available on every shared host in the world. Try to find a cheap, reliable tomcat hosting service. Then throw a dart at a google search for "web hosting." You'll find that outside of enterprise, PHP is the lingua franca. So if you're a poor student or struggling entrepreneur looking to make an experiment or prototype, you will naturally gravitate toward PHP (same argument works for mySQL/postgre v the world). And guess who will populate the next gen of enterprise? Re:PHP wins - it's economics (Score:3, Insightful) But now I use Java, because I think it's much easier to work with, when you have teams of more than two people. PHP gives you too much freedom to be easily managed. It's nice for experimenting, for stuff you want to see right away, for complex stuff PHP Succeeds Because It's Not Overkill (Score:4, Insightful) PHP is procedurally oriented, works well, and -- most important -- is free. I can't convince my boss to touch it, of course, but if some names get behind it, it might become a much easier sell. Java vs PHP development (Score:5, Informative) All that aside, we typically use PHP for all web-based applications. The ease of coding, and the ability to affect change with zero downtime is a big plus. We can have several programmers affecting changes in one codebase in real time. And, for a program which took us six months to develop in PHP, it would have taken at least fifty percent longer with Java. Re:Java vs PHP development (Score:3, Insightful) I'm not sure why you think a) this is a good idea to do in PHP, and b) this can't be done in Java. And, for a program which took us six months to develop in PHP, it would have taken at least fifty percent longer with Java. And now it will take you at least two hundred percent as much time to maintain. the best thing about java is... (Score:2) The Zend announcement of a technology to rival .NET and java might change the picture though. very biased article (Score:5, Insightful) I find the comparison that the article makes between them is very one dimensional, it's saying that PHP is better than JSP, which I suppose is debatable (I prefer JSP I won't try and say Java is better (because of my limited PHP experience) but if an author wants to convince me that PHP is better than Java, it's going to have to talk about more than simplicity and hype. Let's send an in email (Score:2, Insightful) This is an API complaint, not a language complaint (Score:4, Interesting) Mailer.mail(to,from,subject,message,header1 Many java frameworks are terrible, but that's a matter of API aesthetic. For instance, I hate the Java frameworks' APIs for reflection and dynamic method invocation and such. So I wrap it all in two methods public boolean canPerformMethod(String methodSignature); public Object performMethod(String methodSignature,Object param1 (Note: the above is pseudo-code so I don't have to explain how to do variable number of parameters in Java 5 - not all (Note2: By using aspect-oriented programming, I can insert these methods high-up in the object-hierarchy) The point is that now, anywhere in my code I can dynamically invoke methods by: Foo result = null; if (target.canPerformMethod("processFoo:String:Foo") result = (Foo)target.performMethod("method:String:Foo","Pr } That simple structure replaces about 10-20 lines of exception handling, method lookup, and all sorts of crap, because I (wait for it) encapsulated it. I'm not saying it's not convenient to have mail(...). Of course it is. But the point of languages like Java is that if you have a preferred API, you can wrap the complexity of a crappy API with a nicer convenient one in your own code. That's called good programming. No actualy need to whine. It's only when the raw functionality is not there, or when the raw langauge/runtime capabilities don't actually allow you to create the functionality you want in a convenient form - that's when whining is necessary. But modern Java, with Java 5 + aspectJ pretty much allows anything to be created in relatively convenient APIs. The only remaining issue is to convince someone at Sun to refactor their core APIs into something that provides some of this convenience out-of-the-box. Or go write Objective-C against the Cocoa APIs on MacOSX. They're pretty nice. Success through lack of hype (Score:3, Interesting) - it's used on its merits, not because of hype, or a New Gospel of Platform Independence - it's simpler and faster - it's not being touted by a huge company such that it shows up on MS's radar as a challenge sun death wish (Score:2) For instance, in order to install Java so that you could use a java app on the web you had to go to their web site and hunt around to find the download, even then you had to choose between whether you wanted to download the Java SQW1.2 or ZXY4.2 - it was as if they didn't really want normal people to be able to use it. Java was an amazing opportunit flamebait! (Score:2, Insightful) "wooing windows programmers" ?? (Score:2) That ended when they stopped including QBasic and started selling VB for $100-$700. For a neat example of what PHP can do (Score:2) this is sad (Score:4, Informative) Hey, i'm just as annoyed at java and I risk being tagged elitist, but... (Score:5, Insightful) PHP is and will be continue to be popular with the masses simply because, like HTML, the entry barrier is very low. It will fail to make deep inroads at the high end for the same reason: The entry barrier is very low. Sounds like a contradiction? Not really. The entry barrier for PHP is so low that we are seeing zillions of poorly written, insecure and unscalable PHP apps written by amateur programmers. Resulting in numerous security scares about PHP and contributing more than slightly to the infamous Slashdot Effect where a site that gets a sudden traffic surge craters as it runs out not of datapipe but simple CPU power. This scares the hell out of anyone who considers using PHP in the enterprise. Don't get me wrong: It is possible to write good, secure, scalable code in PHP. It just isn't very common. PHP: good for admins, not so good for developers (Score:4, Interesting) PHP is good for an admin to set up some forum, photo gallery, database administration front end, a CMS, whatever tool you can download form sourceforge and install in a few hours to give users/customers a service. When you need to develop a solution with specific needs and there's no tool to download and use right off the shelf, PHP gives you lots of headaches. The API changes a lot, very fast. This is not good. From PHP 3.0 to 4.0 things break and new stuff gets added so fast some sites have to keep using PHP 3 in order to avoid spending many hours recoding old code. Now PHP 5 is a new language altogether. Lots of changes are for good since PHP was really bad in some areas in early version so the rewrote everything form scratch, that forces developers to relearn and recode. The lack of abstraction in the PHP API leaves lots of stuff to the developer. For example, working with HTTP headers. The header function just sends whatever header you send in. You have to account for browser bugs on your code and maitain that. The manual is full of user comments regarding how to use certain function that give different results with different databases, browsers, platforms, Apache configurations, etc. Those things don't belong to API, there are bugs, but you have to work around them in your code. If you use a PHP CMS or a PHP forum, you know the people developping it will do the dirty work for you and release a quality product, but for a small organization with a few programers, migrating from PHP3 to PHP5 to get the new cool stuff they implemented is hard, painful and takes a lot of debugging time. In contrast Java has managed to keep backwards compatibility while adding new functionality and the API has been quite stable. Of course it has bugs, migration problems and imcompatibilities, but the java developers (SUN, Apache foundation, IBM, etc) make an effort to make developers' life easier. The PHP developers also try, but are less sucessful. At the same time in Java you don't have such a wide selection of free tools ready to use in a web site, but you do have tons and tons of libraries ready to be integrated in your java web app, which PHP has but in much smaller quantity. Java never seemed intregrated with the browser (Score:3, Insightful) Unfortunately, the answer to "it's not fast enough" always seemed to involve a very heavy, expensive machine from Sun. Hrmm. Microsoft's solutions always seemed inelegant to me. PHP always was, and is, about making web applications and database interfaces very efficiently. Why is it suprising then, that it would be adopted? web apps all have the same problem: the browser (Score:5, Insightful) Web apps all have the same problem. They use a goddamn BROWSER as the application platform. This sucks. I'm looking at a typical jsp right now. Its an awful demoralizing conflation of xml, css, jstl, html, and javascript-- all in one file. As developer, it sucks to work with and it is a major hassle to create a nice user experience with this trash y stuff. I have not worked with PHP, but looking at the source from the browser page, I imagine the same problems apply. Whatever happened to the "applet" concept? True, there were problems with it initially, but one would think that these problems could have been solved by now. Instead, the industry turned away from nice clean designs to the brutal mess that is today's web app. As a Java developer with PHP experience... (Score:5, Insightful) I feel like there's a lack of standardized libraries for PHP. I've used PearDB, but it's sure not ActiveRecord or Hibernate. Smarty's o.k., but I'm already developing in a template language for HTML pages, why do I need another one? It's like working with JSP tag libraries (which I find equally wasteful). Fundamentally, I think the tight coupling between view, controller, and model that PHP naturally engenders is bad. Practically, I've seen where Ruby on Rails has gone in just a single year, and it's further than PHP's gone in the last 5. Things you can do in Rails in a few days take weeks of coding in PHP, even with the help of third-party libraries. PHP has a strong foothold with small, inexpensive ISPs, which is the only reason I think that people still use it. Unfortunately, the "war" between 4 and 5 has really hurt the credibility of PHP moving forward. Does any ISP support PHP 5? If PHP wants to compete against Ruby on the low end and J2EE and Since When Has Java Failed? (Score:4, Interesting) Try doing this [verosystems.com] in PHP. There is a reason that eBay handles 1 billion transactions a day on Java. Re:Since When Has Java Failed? (Score:5, Funny) Because they run it on a million servers? Parallel universe? (Score:4, Funny) Fact: PHP was released on June 8, 1995 [wikipedia.org]. Fact: The Java Servlet spec (first server-side Java) was released over 4 years later on October 1, 1999 [sun.com]. After 5 years, Java as caught up with and far surpassed PHP in terms of usage, tools, maturity, etc. Java is showing no signs of slowing down. I don't know what iPlanet Marc is on, but on my planet, if you want to do any server-side web programming, you better know J2EE or .NET. Also funny was this quote from TFA:Uh, yeah, Marc. That falls solidly in to the category of "thing we wish were true but aren't." I wish Flash wasn't so popular, but the fact is it's used very heavily. It's getting there, but it has its problems (Score:3, Informative) PHP may have a bunch of issues, but it's still the best tool for my job. Have to chime in here as a new Railer... (Score:3, Informative) I've started my first small-scale Ruby on Rails [rubyonrails.com] project, having done work in the past in ASP, 1) RoR may be highly buzz-worthy but it is certainly NOT a panacea. It has a definite and slightly steep learning curve, especially if you are also new to Ruby and/or OOP and/or MVC (I am sort of but not completely new to all of these). You will still have to do the work of developing your application- you just won't have to do the "stupid" kind of work that much (repeating code in views, bubbling new database fields through umpteen app tiers to the surface of your app, hand-validating everything, building a mechanism to bubble errors or notifications to the surface, etc. etc.) That said... 2) I can see that if I can get past the little syntactic things that are currently tripping me up, a lot of the RoR technology (and all the assistance its framework provides, once you get to know it... again, that takes time) helps to make web development a breeze. 3) MVC [google.com] certainly seems like a pattern to seriously consider for anything other than a small web app. Mixing code in the presentation layer is not the way to go if you want easy unit testing, separation of view from code (so your graphic designers can go in and do their thing separately), arbitrary mixing of controller code with different views, etc. 4) Ruby itself is a pretty great language to code in and highly readable. It has a few quirks (doesn't every language?) but if you are aware of them then they won't get in your way. Some of the things I like about it were apparently "borrowed" from Perl (as I never really got that into Perl). If you are not a static-typing purist, I'd say check it out on its own. 5) Installing some Ruby/Rails components that depend on each other is not at ALL as painless as it should be on OS X. For example, I'm currently having issues with RMagick and GraphicsMagick even though I followed a guide [poocs.net] I found online, to the letter. I think the darwinports, fink, and rubygems people should get together and work some shit out, as all the different default paths these packaging/deployment tools install their stuff to causes mutual interdependencies to sometimes fail. I've also seen some MySQL issues that will require good troubleshooting to resolve, for some people- some of it is based on incompatibilities with GCC 4.0, or between the password hashes of different MySQL versions, or... Basically, this is all stuff that as a Rails scripter (as opposed to a C++ programmer) you wouldn't want to focus too much time on. If you want to know what I'm talking about just google "rmagick 'os x'" or "mysql rails 'os x'" and read up. That said, if you can get a good host [textdrive.com] with good Ruby/Rails support, you might not need to worry about such things... Unless you want to develop locally on that shiny Powerbook (grrrr). You better be a good troubleshooter, as Google won't get you out of EVERY bind! 6) The people on the #rubyonrails IRC channel on freenode are generally helpful, but not at all hours of the day. It also helps if you put up small PayPal rewards to get someone to help you over those time-sensitive humps 7) Managers at big corporations (such as my employer) who have been out of direct touch with technology for a while will only tend to recommend the "usual big stuff"- in this case Java/EJB/Oracle, or Silly argument (Score:3, Informative) The setup I use is basically the J2EE model, except I get the best of all worlds, because I can access code written in any language seemlessly, use n-tier architecture without even thinking about it, use advanced cacheing libraries available in the higher end/heavier languages, and because the backend code is running as a daemon running a soap or xml-rpc server, I sidestep the whole perl/python interpretter startup bottleneck. It's not about which language is "best" its about what tool gets the job done. What about the long run? (Score:5, Interesting) When I work with PHP, I find it a pain to work with, because of its apparent lack of design. It feels like a cobbled-together heap of features and hacks, and so does the code written in it. I tend to write cleaner code than what I've seen from other people, but that doesn't make the final product any less messy when various people have worked on it. Neither language is absolutely horrible; comparing them to others, Java is a language with a relatively clean design, and PHP is a good choice in its niche of writing web applications. However, my pain in working with these languages is a direct result of these languages being poorly designed. I'm into programming languages, and I know many that have better designs than Java and PHP. I wonder if these languages won't take over in the future. Some changes are happening already. Various organizations are moving away from Java for web applications, and I know others that would do well to do so as well. Much of the work that went into PHP 5 comes from a realization that earlier versions were flawed (the same can be said of Perl 6). Ruby appears to be on the rise. Paul Graham and others have had good results employing Common Lisp for web applications. The only thing I can see standing in the way of better languages taking over the web application sphere is the fact that the decision making process is based more on fame than on qualities. I maintain that Java has become so successful largely because of the enormous hype surrounding it. PHP, Linux and MySQL have also risen largely due to hype. Of course, it's true that you won't overly disadvantage yourself if you use whatever most others use, but it would still be better if decisions were made based on sound knowledge of technical benefits. Programming tools? (Score:3, Insightful) > regarded programming tools, which make it easier for > developers to write software that run on Windows. Bleh. Windows doesn't even come with a compiler. I think that's probably why a lot of developers like Unix so much - most systems come with a compiler as standard and the man pages give you all the APIs you need. Grab your favourite editor and off you go! I won't step into the language wars here, but... (Score:3, Informative) For proof, just look at some of the projects using PHP: Mantis Bug Tracker [mantisbt.org], PHPMyAdmin [phpmyadmin.net], MediaWiki (Wikipedia) [mediawiki.org], several top discussion boards, Friendster, reportedly apps by Yahoo, and countless others. These are HIGH-QUALITY web applications. Of course, great things can be done with other platforms, but it's nonsense to slam PHP because "it's so easy that non-programmers produce a lot of crap code with it". The proof that it's worthy is in the *best* apps that are produced, not the worst ones! J2EE Sucks (Score:5, Funny) C Coders perspective: PHP - I wrote some objects for PHP5 about eight months ago. The documentation blows, I had to use gdb and a notepad to figure out some of the idiotic details for accessing the symbol table and so forth. The Horrible, horrible dangling-if-macros are terrible. Took 3 days (from "I know nothing" to "I'm done and debugged"). Java - I wrote some JNI interfaces. Actually, they interfaced to the exact same code as the PHP5 modules! (Making a useful C library, encapsulated in C++ objects usable across Java and PHP platforms). Easy stuff! I used cxxwrap. Took 1 day. Manager's Perspective (I wear that hat, too): PHP is pretty cool, as long as you treat it like a programming language and perform proper data abstraction, code layout, blah-de-blah. "Web guys" need to learn awful fast that "Web Programming" had better be treated the same was as system programming, or large applications become difficult to manage. PHP does little to enforce this (hey, just stick some code right in the middle of the style sheet!), but good discipline will solve all of PHP's major problems. It's also nice when PHP the guys ask for help, I say "C library function XXXX will solve your problem" or "the underlying OS call behaves this way, that's probably why you're having issues..." and it transliterates directly into PHP. (And I can look at the PHP sources and actually understand them). Java, on the other hand -- I can't take my years of experience with the UNIX OS and help anybody coding on Java, because it has absolutely nothing in common with the underlying OS, POSIX, etc. Now, that may not be all that bad, but it's damned frustrating when you plan on doing common, every day operations that work anywhere else BUT Java, and have the platform smacks you in the face. For example, say you need to link two different web hierarchies together (say, images from your apache server and the same images in your tomcat container). You'd make a software link, right? OH, NOOOOO, you make a soft link and then you spend the next three hours figuring out why the fuck it doesn't work, because those asshats who designed the platform didn't like them, so you instead have to hunt through cryptic XML configuration files to find out how to turn on some asshat undocumented directive to allow a BASIC FUNCTION OF THE OPERATING SYSTEM. For fuck's sake! Now, I suppose the above criticism is more a J2EE criticism than a Java critism, but, if we want to compare apples to apples, J2EE SUCKS HUGE DONKEY BALLS. Essential redux: Each PHP guy gets more done in a day than two Java guys get done in a week. Why? How can this be? Java solves everything except world hunger! The Java guys spend three days a week debugging shit that's gone wrong with Tomcat on one server or another. It's always some incompatibility here, surprise-bite-you-in-the-ass-there. Two applications on the same server use the same JAR file, so the containers refuse to load. That sort of thing. Sheer idiocy. Then they spend one day debugging shit that's gone wrong with Eclipse (or its mangling of the CVS repository, or some ant dependency problem, or)... then they spend half a day each writing code, and another half day synchronizing their changes. And meanwhile they whine that 256 megs of RAM isn't enough to edit a fucking text file (and do NOTHING else at the same time). And Lord help you if you want to add another table to the database and want them to do something as silly as retrieve the data from it and put it on a web page. Apparently, this is incredibly difficult, because it involves creating new hibernate objects, which of course fucks everything else in the ass, well, because, something called hotspot didn't get it's monthly fucking hormone shot or som Re:Java failed because it's a slow toy. (Score:2, Insightful) Re:PHP can do allot (Score:5, Informative) Re:PHP can do allot (Score:3, Informative) Two Re:Ajax? (Score:2) This, of course, applies since PHP (and also many other "scripting languages") is actually not "three" or "n-tier-oriented". Re:Cliche Elitist Reply (Score:4, Insightful) * PHP sucks. PHP has functions for practically anything you can imagine. Of course, I'll get into why it doesn't suck in the replies below, as this is a bit too general. * PHP is for n00bs. PHP is for developers who want to get something done quickly. The syntax is very easy to learn, and variables are loosely typed, but in my experience this doesn't mean that the language is flawed; it means that one can code up something without having to worry about unnecessary things like pointers, variable conversion and the like. And to be honest, in website scripting I've never come across a need for more advanced syntax than PHP provides in my five or more years of using it. * PHP is usually poorly written. This, unfortunately, is usually true. Because PHP is easy to use, it is often used by people who don't want to worry about writing good code either. But like everything else, there are varying grades of professionalism. PHP *can* be written well, it's just a case of taking the time to do so. * PHP is a scripting language and you can't do anything but write web pages with it. Scripting language, yes. But it most certainly can [php.net] be used for things other than websites. * PHP sucks because the function names are inconsistent. True, but this is why one has a manual. I've never been all that concerned about it. * PHP is slow. Actually, it's really not. Take a look at this comparison between different CGI modules for Apache [dmst.aueb.gr]: PHP actually outdoes Perl here. * PHP isn't capable of working in a real enterprise. I haven't had experience with integrating PHP into an "enterprise" situation personally, but I'll refer you to Zend's Enterprise PHP [zend.com] page for various reasons why PHP is indeed ready for the enterprise. * Real coders use Perl. Real coders use the tool that best fits the problem. * PHP doesn't scale. Now THIS is something I can definitely refute. I work for a company that creates mods for a PHP / Smarty-based online shopping cart known as X-Cart [x-cart.com] and I can tell you, PHP scales wonderfully, otherwise stores wouldn't use it as a base of their business operations. X-Cart is on the order of hundreds of thousands of lines of PHP code, and very commonly has tens of thousands of customers accessing it concurrently. And yeah, I know you were joking, but hey, I was bored. Re:Native compiled PHP with a widget set? (Score:3, Informative)
http://developers.slashdot.org/story/05/10/21/1240258/php-succeeding-where-java-has-failed
CC-MAIN-2014-10
refinedweb
7,536
71.44
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. [odoo 8 ] : How to update value of one2many field with at second level by using create and write method using API? Hello All, I've asked this Question again, because i was not able to EDIT my question.. EDIT E.g. Class A(models.Model): _name = 'main.model' x_ids = fields.one2Many('sub.model','main_id',"Test") Class B(models.Model) _name = 'sub.model' main_id = fields.Many2one('main.model', "Main Model") #remaining fields. xx_ids = fields.One2many('another.sub.model','sub_model_id',"Test") Class C(models.Model) _name = 'another.submodel' sub_model_id = fields.Many2one('sub.model',"Sub Model") #remaining fields..go here Consider this is model structure, now when i create record of Class A model, I want to updated one2many field of Class B and Class B is having Class C one2many field, so how to update the values or create records with 2 level of one2many field? is there any option? I am looking for the solution for both side create and write method. Please anyone has idea than it will be really helpful. Regards, Prince You can achieve that in 2 ways: Case 1: Default Values if you have fixed data, then you can set default values in both objects i.e in ClassA set default values for 'x_ids' and in ClassB set default values for 'xx_ids' Case 2: Create/Write method In the First object (ClassA): while creating itself you can add its lines using One2Many and/or Many2Many semantics. According to your sample object hierarchy: @api.model def create(self, vals): valsC = {....} # dict of values needed for creating ClassC valsB = { 'xx_ids': [(0, 0, valsC)], ....} # dict of values needed for creating ClassB vals['x_ids'] = [(0, 0, valsB)] # appending it into the values of ClassA return super(A, self).create(vals) In Odoo, at the time of creating a record, you can pass values to its child be it a One2Many or Many2Many by using its semantics, here [(0,0,{})] represents am trying to create new One2Many record. Note: In valsB, I have appended the values of ClassC, and this dict am appending the original Vals of Class A, which will be like passing nested dict of values into ClassA Similarly there exists a semantics for editing/updating, deleting and so, please refer the below samples which are used for both One2Many & Many2Many. ) Hello, In creation you need to override the create method of class A to be something as: @api.model def create(self, vals): res = super(A, self).create(vals) #creating C record c_res = self.env['another.submodel'].create({'field_name': value, ...}) #creating B record b_res = self.env['sub.model'].create({'field_name': value, ...}) #Adding C to B b_res.xx_ids += c_res #Adding B to A [it is also a One2many] res.x_ids += b_res return res You can do similar thing in the write method with some modifications ... Hope this could helps ... @Ahmed: Thanks for the nice example, i will try and check it. Ahmed given solution does not work , gives me this error, defaults.update(values) ValueError: dictionary update sequence element #0 has length 3; 2 is required Hi, can you share your code some where ? About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/odoo-8-how-to-update-value-of-one2many-field-with-at-second-level-by-using-create-and-write-method-using-api-104615
CC-MAIN-2017-17
refinedweb
569
58.38
This site is supported by donations to The OEIS Foundation. Category:10-gonal numbers From OeisWiki This item has been flagged for DELETION. Discarded items are items flagged for deletion to facilitate the maintenance of the wiki. If an item (a category page, an article page, an extras page, a help page, a template page, a file page, ...) is created erroneously (wrong namespace, wrong naming convention, wrong spelling, wrong capitalization, wrong grammatical number (singular/plural), and so on...) only a sysop or an administrator has the proper rights to delete it, but we may facilitate their task by flagging the item as discarded. To categorize an item as Category:Discarded items you just use the template tag {{discarded|Reason for discarding}} in the item's (a category page, an article page, an extras page, a help page, a template page, a file page, ...) page, where "Reason for discarding" is a short explanation of the request for deletion. This category currently contains no pages or media.
http://oeis.org/wiki/Category:10-gonal_numbers
CC-MAIN-2014-42
refinedweb
165
53.51
I dunno, you figured out how to use strcpy - perhaps you should look at how that function is declared, and make addNode have the same kind of 'char-pointery-stringlike' interface. I thought you were meant to be learning C++. What you're asking is a backward step. If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. If at first you don't succeed, try writing your phone number on the exam paper. Now I' ve done the try-catch-block. Is that OK so? Code:int main(int argc, char* argv[]) { Tree tree; Tnode* root = 0; string word; try { for(int i = 1; i < argc; i++) { word = string(argv[i]); Tnode* node = tree.addNode(root, word); if (!root) { root = node; } } cout << "Tree:" << endl; tree.printTree(root); cout << "Alphabetical:" << endl; tree.alphabeticPrintTree(root); tree.freeTree(root); } catch (exception& e) { cout << "Standard exception: " << e.what() << endl; } return (0); } In this try-catch-Block above, is it neccessary to check the return value of new (nullptr if no memory allocatable) or is it handled by exception class automatically? I need to ensure that there is no memory leak.. Keep in mind, you usually only want to catch exceptions when you can a. handle it and b. actually want to do something about it. In the case of being out of memory, there's nothing you can do, really, except let the process die. Fortunately, operating systems are well-coded enough that process death releases the acquired resources anyway so you don't need to worry about a memory leak in the case of an exception. If you get an out-of-memory exception, just let your code die. Or catch the exception, print out a nice little error message about it and then let it die. There isn't much you can do if you need RAM and none is available.
https://cboard.cprogramming.com/cplusplus-programming/171611-enter-write-out-words-into-tree-nodes-4.html?s=eaa069512e1739c763c2c2f354305302
CC-MAIN-2020-10
refinedweb
319
75
29 December 2009 12:00 [Source: ICIS news] By Florian Neuhof LONDON (ICIS news)--The European biodiesel industry is no stranger in the hallways of bureaucratic power in ?xml:namespace> In March 2009, lobbying by the European Biodiesel Board (EBB) led to the implementation of punitive import tariff on biodiesel coming into the EU from the Then, in November, the board followed up this success with the announcement that it was to push for measures to stamp out the alleged practice of circumventing those tariffs by changing blend levels or re-routing In the closing days of 2009, the EBB voiced further disgruntlement. Argentinean biodiesel producers, it claimed, where unfairly advantaged by taxes that incentivised the export of finished product over the shipping over soybean oil feedstock. The board is likely to take further action on these “differentiated export taxes” (DETs) in January, by which time its official anti-circumvention complaint on US biodiesel should have been made to the EU. Heavy lobbying is common fare in EU politics, especially when the subject at hand is even remotely related to agriculture. Yet the EBB’s vigorous defence of its members’ interests also highlights their vulnerability. When the government started raising those taxes in 2008, sales took a nosedive. Industry body Verband der Deutschen Biokraftstoffindustrie (VDB) estimates that the amount of B100 sold in the German market in 2009 was down to 230,000 tonnes, from a peak of 1.84m tonnes in 2007. The government has backed off a proposed further tax increase. But the fact remains that an industry reared on generous handouts is now hopelessly bloated, as vast overcapacity is undernourished by flagging demand. And without protectionist measures, European producers are struggling to compete with cheaper rivals abroad. It remains to be seen how European producers will fare in 2010. But the new year holds some promise at least. For a start, market sources predict that the EBB protestations will most likely bear fruit over the course of the year. Market participants believe that success in abolishing DETs could lead to a firming of prices. In addition, imported feedstock could become cheaper. After soybean production in Yet it remains to be seen how much of this feedstock finds its way to An estimated 700,000 tonnes of soybean methyl Ester (SME) biodiesel will flow out of domestic use next year, much of which would otherwise have been earmarked for export into In In the Despite its support of the industry in the past, not everything the EU does receives a favourable reception from producers in The Renewable Energy Directive and the Fuel Quality Directive, agreed as part of the EU's climate change and energy package in December 2008, require the European Commission to compile a report "reviewing the impact of indirect land-use change on greenhouse gas emissions" and to seek ways to minimise it. The deadline for the report is 30 June. There is much speculation in the market that palm oil, the feedstock of palm methyl ester (PME), will not be classified as renewable under the new guidelines. Resulting uncertainty has acted as a deterrent for potential buyers. “A few weeks ago it would have been profitable to sell FAME,” says one producer, referring to the fatty acid methyl ester biodiesel, of which palm oil is a major component. “But there were no buyers, as no one is willing to take on product which might not be usable under new regulation,” added the producer. Like it or not, legislation is set to dominate the industry for some time yet. For more on biodiesell visit ICIS chemical intelligence
http://www.icis.com/Articles/2009/12/29/9321855/OUTLOOK-10-Bloated-biodiesel-industry-on-EU-life-support.html
CC-MAIN-2014-52
refinedweb
602
55.98
Hi, i have input image with size(1,1,28,28) and output image y with the same size. y= cnn(x) and i want to calculate the gradient between every output pixel image with respect to every pixel from input image but i have : RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([784]) and output[0] has a shape of torch.Size([]). my cod is : def jacobian(y, x, create_graph=False): jac = [] y = cnn(x) x.requires_grad_(True) flat_y = y.reshape(-1) flat_x = x.reshape(-1) #y= cnn(flat_x) grad_y = torch.zeros_like(flat_y) for i in range(len(flat_y)): for j in range(len(flat_x)): grad_y[i] = 1. grad_x,= torch.autograd.grad(flat_y[i] ,flat_x[j],grad_y,retain_graph=True,create_graph= create_graph,allow_unused=True) jac.append(grad_x.reshape(x.shape)) grad_y[i] = 0. return torch.stack(jac).reshape(y.shape + x.shape) print( jacobian (y,x,create_graph = True) ) could someone help me why i have this error?
https://discuss.pytorch.org/t/mismatch-error-jacobian-gradient-matrix/69942
CC-MAIN-2022-21
refinedweb
161
52.97
Aim: To control a 4 wire bipolar stepper motor using a Raspberry pi, external power source and a L298 H-Bridge Board. Parts: External Power source for stepper - I used a 8 x AA battery pack from jcar - $1.20 L298N H-bridge Board - $3 from ebay 12V DC Bipolar Stepper - From an old epson printer T-Cobbler board - Not required, but useful Bread Board - Also not required, but useful 4 x F to F Jumper cables 6 x M to F Jumper cables Raspeberry Pi Firstly you need to connect two GPIO pins to the L298N board. These two pins will be used to enable the stepper motor by setting the ENA and ENB pins to high (Some boards have a jumper to do this and you wont need to connect to pi) For this I chose pins 18 and 22. Pin 18 connects to ENA and 22 to ENB. Please view image below for reference. Next you need to connect the pins which with control the movement or step sequence of the motor. For this I have chosen pins 23,24,4,17. As you can see from the below image, 23 connects to IN1, 24 to IN2, 4 to IN3 and 17 to IN4. You can use whatever pins you like, but you have to make sure you update the code for this to work. Now, the raspberry pi doesn't have enough power to run the a stepper motor of this size by itself, so this is where the external power source comes into play. The power soruce V and AMPS will vary depending on the kind of stepper you have. For my stepper I have used a 8 x AA battery pack. Connect the red and black wires of your power pack to the VMS and GND on your L298N board as shown below. Next step is to connect your stepper motor to the L298N board. Each stepper is different, but if it has 4 wires then it is probably bipolar. Stepper motors are very interesting little motors, in order to get them moving you have to power each of the internal windings in the right sequence. Sometimes you have be lucky and get it right, however the best output comes from the stepper motor datasheet, which tells you all about warm up , warm down, stepper sequence and loads more. If you want to learn more have a look at this wiki page. To work out how to connect your motor you use a OHM meter to check the resistance between to wires, if there is a small resistance then those wires are a pair, if you get none then they aren't. For my stepper, each second wire was part of a pair so I connect the stepper below with one of each pair both MOTA and MOTB output on the L298N board. Once you have it all connected correctly, its time to for the code. I will be using a python script to give a very basic examples of moving the stepper motor forward then reversing. As you can see from the code below, you can set the variables delay and steps to whatever you want, the higher the delay in ms, the slow the steps and generally the higher the torque, the less delay, the lower the torque the faster the steps. Hopefully this tutorial has been beneficial to those starting out with the raspberry pi and interesting in the GPIO motor control side of things. Code: Select all import RPi.GPIO as GPIO import time # Variables delay = 0.0055 steps = 500 GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) # Enable GPIO pins for ENA and ENB for stepper enable_a = 18 enable_b = 22 # Enable pins for IN1-4 to control step sequence coil_A_1_pin = 23 coil_A_2_pin = 24 coil_B_1_pin = 4 coil_B_2_pin = 17 # Set pin states GPIO.setup(enable_a, GPIO.OUT) GPIO.setup(enable_b, GPIO.OUT) GPIO.setup(coil_A_1_pin, GPIO.OUT) GPIO.setup(coil_A_2_pin, GPIO.OUT) GPIO.setup(coil_B_1_pin, GPIO.OUT) GPIO.setup(coil_B_2_pin, GPIO.OUT) # Set ENA and ENB to high to enable stepper GPIO.output(enable_a, True) GPIO.output(enable_b, True) # Function for step sequence def setStep(w1, w2, w3, w4): GPIO.output(coil_A_1_pin, w1) GPIO.output(coil_A_2_pin, w2) GPIO.output(coil_B_1_pin, w3) GPIO.output(coil_B_2_pin, w4) # loop through step sequence based on number of steps for i in range(0, steps): setStep(1,0,1,0) time.sleep(delay) setStep(0,1,1,0) time.sleep(delay) setStep(0,1,0,1) time.sleep(delay) setStep(1,0,0,1) time.sleep(delay) # Reverse previous step sequence to reverse motor direction for i in range(0, steps): setStep(1,0,0,1) time.sleep(delay) setStep(0,1,0,1) time.sleep(delay) setStep(0,1,1,0) time.sleep(delay) setStep(1,0,1,0) time.sleep(delay)
https://www.raspberrypi.org/forums/viewtopic.php?f=49&t=55580
CC-MAIN-2020-16
refinedweb
806
71.65
jq recipes All demos link to jqterm - an alternative interactive jq web terminal with autocomplete (and faster querying with large datasets as they're cached online in private gists). Here's a collection of jq recipes I've collected over the last few months. READER DISCOUNTSave $50 on terminal.training I've published 38 videos for new developers, designers, UX, UI, product owners and anyone who needs to conquer the command line today. $49 - only from this link Push on to an existing array (where source is [1, 2, 3]): . + [ 4 ] # result: [ 1, 2, 3, 4 ] Convert object to array, moving the key into the array item under the property slug: to_entries | map_values(.value + { slug: .key }) Convert an array to a keyed object (the inverse of the above example): map({ (.slug): . }) | add Swap the key/value pair to read as value/key object: to_entries | map( {(.value) : .key } ) | add Read a plain list of strings from a file into an array, specifically splitting into an array and removing the last empty \n: echo "1\n2\n3" | jq --slurp --raw-input 'split("\n")[:-1]' Convert a plain list of timestamps to an array of objects with date and time separated (using jq's --slurp and --raw-input options combined): cat timestamps.txt | jq --slurp --raw-input 'split("\n")[:-1] | map({ date: (. | strptime("%a, %d %b %Y %H:%M:%S") | todate[0:10]), time: (. | strptime("%a, %d %b %Y %H:%M:%S") | todate[11:19]) })' From a plain list of timestamps, count the occurrences of unique days (the first part is from the example above): split("\n")[:-1] | map({ date: (. | strptime("%a, %d %b %Y %H:%M:%S") | todate[0:10]), time: (. | strptime("%a, %d %b %Y %H:%M:%S") | todate[11:19]) }) | reduce .[] as $item ( {}; # initial value .[$item.date] += 1 # reducer ) Take an object with two similar objects, but separated between team and formerly, and merge into a single object, adding a flag for all those from the formerly group: [.team, (.formerly | map(. + {formerly: true }))] | flatten Download and extract all the files from a gist: eval "$( curl | jq -r ' .files | to_entries | .[].value | @sh "echo \(.content) > \(.filename)" ' )" Update all outdated npm dependencies to latest (possibly unsafe as it'll also update to major changes): npm i $(echo $(npm outdated --json | jq -r 'to_entries | .[] | "\(.key)@\(.value.latest)"')) Change the above from .latest to .wanted for a safe upgrade. Install the dependencies from one node project to another: npm i $(cat ../other-project/package.json| jq '.dependencies | keys[]' -r) Add a new property to every object: map(. + { "draft": true }) Or [.[] | . + { "draft" : true }] Add new property to every object in a nested object, i.e. source looks like: { "offline-panel": { "title": "Offline Panel", "tags": [ "web" ] }, "rewrite-it": { "title": "Let's just rewrite it", "tags": [ "business" ] } } Command: with_entries(.value += { "draft": true}) Remove a property from a nested object (example as above): with_entries(.value |= del(.title)) List all the dependencies in a package.json for use in other commands, like npm uninstall: echo $(cat package.json | jq '.dependencies | keys | .[] | "\(.)"' -r) Get mongodb data into jq compatible format: mongo <host>/<db> --norc --username <user> --password <pwd> \ --eval 'printjson(db.getCollection("users").find().toArray())' | \ jq '.[]' From Twitter's API, take all DM received and sent and transform into readable format sorted by date order: [ .[] | { text, date: .created_at, from: { screen_name: .sender.screen_name }, to: { screen_name: .recipient.screen_name} } ] | sort_by(.date) Using Serverless and Next.js and working out which dependencies I need to force include (because they live in the .next directory): $ depcheck --json | jq ' .using | [ to_entries[] | select(.value[] | contains("/.next/")) | .key ] | unique | sort[] | "- \(.)" ' -r Note: also uses depcheck to resolve the npm dependencies. From a nested tree of objects, find the object whose id matches X: curl -sL | \ jq '.. | objects | select(.id == "0:16")' Strip all occurrences of a property ( walk(if type == "object" then . | del(.email) else . end) Note that the walk function is missing from jq@1.5 and needs to be added (seen in demo). Bulk insert into elastic search using a vanilla JSON array, i.e. [1,2,3,4] - zipping the array with the required elastic search metadata: $ cat data.json | \ jq 'reduce .[] as $n ([]; . + [{ "index" : { "_index": "my-index", "_type" : "my-type" } }, $n]) | .[]' -c | \ curl -H "Content-Type: application/x-ndjson" -XPOST --data-binary "@-" Filter an array, similar to a JavaScript array filter: def filter(cond): map(select(cond)); filter(. > 2) Converting a text output of columns and converting to a JSON object. In this case, running Zeit's now ls | jq --raw-input --slurp to find out how many running instance I have: split("\n")[1:-3] | # split into an array of strings, removing the 1st and last few blank lines map([ split(" ")[] | select(. != "") ]) | # convert large spaces into individual colmns map({ # map into a usable object app: .[0], url: .[1], number: (if (.[2] == "-") then .[2] else .[2] | tonumber end), type: .[3], state: .[4], age: .[5] }) | # now I can query the result - in this case: how many running and are npm map(select(.number > 0 and .type == "NPM")) | length Find duplicates in an array based on a key: [ reduce .[].id as $item ( {}; # initial value .[$item] += 1 ) | to_entries[] | select(.value > 1) ] | from_entries Quickly convert a list of strings into an array (for JavaScript dev, etc): $ pbpaste | jq -Rs 'split("\n")' | pbcopy Strip empty strings from arrays (at any level deep): walk(if type == "array" then map(select(length > 0)) else . end) Note that this requires the walk method (that was removed in jq@1.5) but included in the demo below Install my missing dependencies (determined by using depcheck): .missing | to_entries | map(.key) | join(" ") | "npm i \(.)" How to avoid non-existant keys when filtering for null. Where endpoint is sometimes missing, sometimes it's set to null and I want those objects. First ensure the key is present, then select if null: map(select(has("endpoint") and .endpoint == null)) How to find null, ignoring non-existant keys - the invert of the above: map(select(has("endpoint") | not)) CSV content transformed to a structured object, using rawInput and slurp. First the lines are split and the header is dropped, then each line is split by comma and mapped to a new object: split("\n")[1:] | map(split(",") | { name: .[0 ], url: .[1], image: .[2], category: .[3] | tonumber }) Recursively find all the properties whose key is errors whether it exists or not. The .. unrolls the object, the ? checks for the value or returns null and the select(.) is like a filter on truthy values: [.. | .errors?[0] | select(.) ] A generic CSV to JSON in jq. Obviously overkill (see csvkit and specifically csvjson), but it's doable and a good example of variables and reduce: split("\n") | # break into lines map(split(",")) | # comma sep .[0] as $header | # save the header .[1:] | # drop the header map( . as $o | # save the current object, then reduce .[] as $item( # reduce into a header keyed object {}; ($o | index($item)) as $index | .[$header[$index]] = $item ) ) Take an objects properties and use them as both the key and value, for instance with this source: [ { "label": "house", "value": "lloyds pharmacy" }, { "label": "house_number", "value": "105" }, { "label": "road", "value": "church road" }, { "label": "postcode", "value": "bn3 2af" } ] …to: { "house": "lloyds pharmacy", "house_number": "105", "road": "church road", "postcode": "bn3 2af" } Using ( .<prop> ) as a dynamic key: map({ (.label): .value }) | add Getting the standard deviation (and variance and mean) for a series of numbers: def mean: reduce .[] as $n (0; . + $n) / length; def pow2: . * .; def variance: . | mean as $mean | map_values(. - $mean | pow2) | mean; def stdev: . | variance | sqrt; # pick those scores who [.[].score] | # convert numbers to array stdev as $stdev | # store in a variable mean as $mean | # also store numbers in mean variable map(select(. - $stdev > $mean) | . - $stdev) # filter those > 1 x stdev (and show by how much) Drafts may be incomplete or entirely abandoned, so please forgive me. If you find an issue with a draft, or would like to see me write about something specifically, please try raising an issue.
https://remysharp.com/drafts/jq-recipes
CC-MAIN-2019-39
refinedweb
1,315
66.33
Welcome to the first newsletter for Neovim, a project that hopes to give a new beginning to a text editor that we all love. We asked and the support was overwhelming; the community wanted a newsletter. The plan is to release a newsletter each month to detail the progress and anything else newsworthy for the project. Future newsletters will be released on the first Friday of every month. That makes the next one scheduled for July 4th. Let’s take a look at some of the milestones of the months preceding May: You may be wondering, “just how much has changed since it forked from Vim?” Well, let’s look at some Git statistics. Taking into account the initial import of Vim which happened January 31, 2014, there have been 1,010 commits across 77 contributors. This has resulted in: 887 files changed, 575371 insertions(+), 500868 deletions(-) according to git diff --stat. Using a more sophisticated tool such as gitinspector, we can see some more interesting statistics. The entire report of the analysis can be viewed in this Gist. Now that we have detailed some of the milestones before the month of May started, we can now look at what has happened in the last month. Neovim has turned on some of the features that were optional in Vim at compile time. This has led to various ifdef FEAT_* macros that are no longer needed. These macros were removed. Discussion arose regarding Neovim’s inherited crypto code. It was determined that the crypto code should be removed rather than to provide a possibly insecure implementation. The removal was then promptly handled. Due to name collisions with some of Neovim’s headers, the source code was moved into a ‘nvim’ namespace. It was also determined that nvim would be the internal/technical identifier for the project from that point on. Vim did have some logging in place but effort was made to create a better logging utility. The utility uses macros and can log a standard debug message, basic info, a warning message or an error. The logging can be turned on or off depending on if NDEBUG or DISABLE_LOG is defined. There are Vim specific types that are used where standard types would be better options. The complete information regarding these types can be found in this guideline. So far short_u, int_u, and long_i types have been removed. long_u removal is currently underway as well with char_u and long types planned for the near future. Rather than check to see if malloc returns a NULL when there isn’t enough memory for the allocation, a suite of functions were introduced to handle these out of memory errors. The functions take care of error handling if this ever were to happen. The removal of the checking for out of memory has spanned many issues (and months) and have been listed in this issue. The last removal of the memory errors has almost been completed. A function called mch_stat() was used to populate a struct that contained info about a given filename. The struct contained the stat info regarding the file. To increase developer clarity, the code for this was refactored into new functions defined in os/fs.c. The existing calls to mch_stat() were then switched over. Coverity Scan is a service that performs a static analysis on source code to look for defects and vulnerabilities. It can look at multiple paths through execution and find issues that might only arise under certain conditions. Neovim now has a Coverity check that runs multiple times a week in addition to the continuous integration that is used with TravisCI. You can now listen and register for various API events. This is done by using the API channel id when making the request. In addition to this, a Wiki page has been created to detail the current look at the plugin architecture. As the top warns, not all the features have been implemented but take a look at it to learn more. The following is a list of things that are either in progress or on the roadmap. system()and use pipes instead. There has been some questioning on the motivation for this feature. The reasoning is that the evaluation of the VimL language is housed in the file called eval.c. The file currently has 19,164 lines of code. By creating the translator, it would remove the need for this evaluator. Instead the Lua code could rely on the newly developed API that would be properly tested. When asked in the mailing list about the progress, Thiago detailed the list of things that’s necessary for the first official release: - Finish implementation of redraw events <- doing this right now - Use the redraw events to implement a new infrastructure for integration tests based on busted/lua. - Write a cross-platform GUI program - Compatibility layer for old python plugins on top of the python client(except for plugins that use python features introduced in 7.4) - Make it compile/run on windows(I dont think this will be hard since a lot of platform-specific stuff already runs on libuv) If there’s a volunteer, I’m going to delegate writing the GUI program after I finish implementing redraw events since I’m not very good with designing UIs. If you’d like to help support development, you may donate using Bitcoins here: 1Evu6wPrzjsjrNPdCYbHy3HT6ry2EzXFyQ or back the team on the Neovim Bountysource page. If you an experienced developer or inexperienced but wanting to learn, visit the GitHub repo and check out the README, CONTRIBUTING guide, and finally the Wiki to learn more. There are plenty of opportunities to help out and plenty of things to do. Do you have any feedback or suggestions regarding this first newsletter? Feel free to reach out through the Neovim Twitter. Also be sure to subscribe to the RSS feed to stay up-to-date on what is happening in the Neovim world. The next newsletter will be released the first Friday of July. Until next time. :wq Find more updates in the news archive. Neovim is a Vim-based text editor engineered for extensibility and usability, to encourage new applications and contributions. Visit #neovim:matrix.org or #neovim on irc.libera.chat to chat with the team. RSS clients can follow the RSS feed.
https://neovim.io/news/2014/june/
CC-MAIN-2022-21
refinedweb
1,056
63.9
Latest stable release Download: Source, Documentation - Mac OS X 10.6 dmg - Ubuntu 12.04 amd64 deb - Ubuntu 14.04 amd64 deb - Fedora 20 x86_64 rpm - Centos 6 x86_64 rpm - Arch Linux (AUR) Note: Binaries are out of date (v1.0.1) and will no longer be provided starting with v1.1. See the Installation Guide for system requirements and installation instructions. This download is CUDA-enabled to accelerate on GPUs. Download archived builds. Releases v1.0.3 Released 2015/03/18 Download: "Source": Bug fixes - Enable builds with intel MPI - Silence warnings coming from boost and python headers v1.0.2 Released 2015/01/27 Download: Source, Documentation Bug fixes - Fixed a bug where `linear_interp` would not take a floating point value for zero - Provide more useful error messages when cuda drivers are not present - Assume device count is 0 when `cudaGetDeviceCount()` returns an error - Link to python statically when `ENABLE_STATIC=on` - Misc documentation updates v1.0.1 Released 2014/09/09 Download: Source, Documentation Bug fixes - *ntegrator. Simulation results in hoomd v1.0.0 are correct, just the temperature and velocity outputs are off slightly. - Remove MPI from Mac OS X dmg build. - Enable import hoomd_script as ... Other changes - Added default compile flag -march=native - Support CUDA 6.5 - Binary builds for CentOS/RHEL 6, Fedora 20, Ubuntu 14.04 LTS, and Ubuntu 12.04 LTS. v1.0.0 Released 2014/05/25 Download: Source, Documentation Bug fixes - Fixed a bug where init.create_random_polymers failed when lx,ly,lz were not equal. - Fixed a bug in init.create_random_polymers and init.create_random where the separation radius was not accounted for correctly - Fixed a bug in bond.* where random crashes would occur when more than one bond type was defined - Fixed a bug where dump.dcd did not write the period to the file Changes that may require updated job scripts - integrate.nph: A time scale tau p for the relaxation of the barostat is now required instead of the barostat mass W of the previous release. The time scale is the relaxation time the barostat would have at an average temperature T 0 =1, and it is related to the internally used (Andersen) Barostat mass W via W= d N T 0 tau 2 p, where d is the dimensionality and N the number of particles. - sorter and nlist are now modules, not variables in the main namespace. - Data proxies function correctly in MPI simulations, but are extremely slow. If you use init.create_empty, consider separating the generation step out to a single rank short execution that writes an XML file for the main run. - update.box_resize(Lx=...) no longer makes cubic box updates, instead it will keep the current Ly and Lz. Use the L=... shorthand for cubic box updates. - All init.** commands now take *data.boxdim objects, instead of hoomd.boxdim (or 3-tuples). We strongly encourage the use of explicit argument names for data.boxdim(). In particular, if hoomd.boxdim(123) was previously used to create a cubic box, it is now required to use data.boxdim(L=123) (CORRECT) instead of data.boxdim(123) (INCORRECT), otherwise a box with unit dimensions along the y and z axes will be created. - system.dimensions can no longer be set after initialization. System dimensions are now set during initialization via the data.boxdim interface. The dimensionality of the system can now be queried through system.box. - system.box no longer accepts 3-tuples. It takes data.boxdim objects. - system.dimensions no longer exists. Query the dimensionality of the system from system.box. Set the dimensionality of the system by passing an appropriate data.boxdim to an init method. - init.create_empty no longer accepts n_*_types. Instead, it now takes a list of strings to name the types. Deprecated - Support for G80, G200 GPUs. - dump.bin and read.bin. These will be removed in v1.1 and replaced with a new binary format. Removed - OpenMP mult-core execution (replaced with MPI domain decomposition) - tune.find_optimal_block_size (replaced by Autotuner) v0.11.3 Released 2013/05/10 Download: Source, Documentation Bug fixes - Fixed a bug where charge.pppm could not be used after init.reset() - Data proxies can now set body angular momentum before the first run() - Fixed a bug where PPPM forces were incorrect on the GPU v0.11.2 Released 2012/12/19 Download: Source, Documentation v0.11.1 Released 2012/11/2 Download: Source, Documentation v0.11.0 Released 2012/07/27 Download: Source, Documentation. API changes - Bond potentials rewritten with template evaluators - External potentials use template evaluators - Complete rewrite of ParticleData - may break existing plugins - Bond/Angle/Dihedral data structures rewritten - The GPU specific data structures are now generated on the GPU - DPDThermo and DPDLJThermo are now processed by the same template class - Headers that cannot be included by nvcc now throw an error when they are - CUDA 4.0 is the new minimum requirement - Rewrote BoxDim to internally handle minimum image conventions - HOOMD now only compiles ptx code for the newest architecture, this halves the executable file size - New Messenger class for global control of messages printed to the screen / directed to a file. Testing changes - Automated test suite now performs tests on OpenMPI + CUDA builds - Valgrind tests added back into automated test suite - Added CPU test in bd_ridid_updater_tests - ctest -S scripts can now set parallel makes (with cmake > 2.8.2) Older versions Older versions are archived in the HOOMD-blue git repository. Older change log entries are available in the project wiki
http://codeblue.umich.edu/hoomd-blue/download.html
CC-MAIN-2015-14
refinedweb
918
59.5
Description editSnit's Not Incr Tcl (Snit for short) is a module of tcllib.It is pure-Tcl object framework which relies on object composition and delegation rather than object inheritance. It can be used for both GUI objects (i.e., Tk megawidgets, aka Snidgets) and for non-GUI objects.Snit used to be a software package on its own, hosted separately on the Snit Home Page [1]. For some reason the old home page is not removed thus only offer historical information. See the Tcllib documentation for the latest information on Snit.As of 2010, Tcllib ships both Tcl-8.5-depending Snit v2.3.1 and Snit 1.x that works with Tcl 8.3 and 8.4.Will's Snit page Usage edit package require snit(note the lower case s) to include the package. Documentation edit Community editThere is a Snit mailing list; discussion topics will include Snit usage, but also (and more importantly) future development. If you're a Snit user or are interested in how it evolves, you can subscribe here Testimonials editNEM: "Snit really is excellent. I use a very similar idea in my tkbrowser Examples edit Widgets and other functionality - A Snit News Ticker Widget - Using Snit to make Tk DOM Glue - snitbrowser a snit::widget for wrapping the tkhtml library. - snitfinddialog a snit::widget toplevel providing a standard search dialog - snitbutton a snit-port of the nice gbuttons-widget - MappingEntry - Multiline expanding entry widget - snit toolbar - oomk - an oo binding for metakit, uses Snit - Snit Lambda - a simple function type - Snit design patterns - some GoF design patterns as Snit types - Snit cfg package - snitScrollWindow - a wrapper for any scrollable widget, to manage the scrollbars - tcanvas (obsolete, see Paved Widgets) - A New Megawidget Library - Snit Tooltips - Sliding panel - Designing SNIT widgets as mixins - Snit Id/Label menubutton - Uses ttk - Simple Download Progress Widget - Dynamically adding methods to a Snit object Applications - Life in Snit - Using Snit to glue diff, patch, and md5sum - Snitscope - the Snit-o-scope lets you peek into snits - Freshmeat Newsletter Filter - enhance the standard Freshmeat newsletter - Simple Newsreader - RSS Monitor - Notebook App - dgHelpBrowser - advanced help viewer for tcl doc - searchfield - nifty little search widget - Rss Reader - TFTP Client - TreeQL adaptor - itunesdb - kwic - Freshmeat Newsletter Filter - Windows Inspection Tool Set Articles edit - Wikipedia - My favorite Tcl package - by Andreas Kupries ,2010-04-26 See Also edit - dict in snit - snitvfs - iGloo - a project to see what's involved in building Snit on top of TIP #257: Object Orientation for Tcl. - A simple comparison of Tcl object extensions - Tcl OO Bench - Notebook App - User Supplied Patches - Snit under Tcl/TK 8.3 - Optimizing Snit - Itins - attempt to emulate Snit with Incr Tcl - Xoins - attempt to emulate Snit with XOTcl - Snit like delegation in XOTcl - snitwiz - Category Snit Widgets - snitdom - Experiment with data manipulation and Snit - AM 2008-10-17: After a suggestion by Michael Baudin I looked into Snit to create an object-oriented interface to numerical functions Also, see below for a read-only text widget written using Snit. Details editWhile developing Notebook App I decided I was tired of writing object-like commands by hand, and wanted a little help. And none of the Tcl object systems that I'd seen really gave me what I wanted, which was to create new objects by delegation rather than inheritance. If you rely on inheritance, then you're tied into that object system. But in Tcl, any command that acts like an object should be treated as an object. Hence, Snit, which doesn't provide for inheritance, but which makes it really easy to build an object out of other objects by delegation, regardless of where those objects originated.(I should add, I don't have anything particular against Incr Tcl; but the name Snit occurred to me, and then wouldn't go away.)Just as an example, here's a Read-only text widget written using Snit V0.95: package require Tk package require snit 0.95 ::snit::widgetadaptor rotext { constructor {args} { # Turn off the insert cursor #installhull using text $self -insertwidth 0 # DDG the $self gaves an error at least with 0.97 onwards installhull using text -insertwidth 0 # Apply an options passed at creation time. $self configurelist $args } # Disable }WHD: This isn't pseudocode; this is actual code that was used in version 1.x of Notebook App. VK 2006-10-03: Thanks for the code, now I'm using it in Tcl::Tk. I don't understand why the need for hiding a cursor? Line "# Turn off the insert cursor" and few lines below it just make things more complicated to the user. IMO having the cursor in read-only widget for navigation and selection is good.So please shrink the code even more and thus make it better! :) :)BTW: "rotext" is a really useful widget; I'm curious why it's not in the core widget set... WHD: Update, 11 October 2002: You can now use "%AUTO%" in object names to get an automatically generated name, e.g., Stack Example editChang LI: The example of stack: ::stack % stack create mystack ::mystack % mystack push a % mystack push b % mystack peek b % mystack pop b % mystack peek aI like the $mystack representation and you can easily think it as an object. This is my prefer representation: stack mystack $mystack push a $mystack push b set x [$mystack peek] puts $x $mystack pop $mystack peekWHD: I gather what you're wanting here is for the new "stack" command to treat "mystack" as a variable, generate an object command with a unique name, and pop it in mystack. I really don't want to do that; it's not like Tk, to begin with, and that's essential. But second, when you're using widgettype to create a megawidget, there's no reason with the hull widget needs to be created in the widgettype's constructor. There are times when you want to create the hull, and have a widgettype that creates and manages its contents. The BWidgets "Notebook" widget is an example. It wants to create the individual frames in the notebook, and hand them to you. Snit is perfectly happy to accept such a frame, and then take it over.RS: But Chang Li can easily have his style (as also often done in Tk), by: set mystack [stack mystack]given that the stack command returns the name (as Tk widgets do).WHD: If I understand what he's asking for, that's not quite the same, as he has to provide the object name himself. In his example, it looks like the "stack" command is providing the object name. If you're creating hundreds of objects of the same kind, I can see that automatic name generation might be helpful. WHD: Update, 11 October 2002: You can now use "%AUTO%" in object names to get an automatically generated name, e.g., set mystack [stack %AUTO%] $mystack push a set a [$mystack pop]escargo: Is there any reason for the user to retrieve the generated name? If so, is there a standard way of doing so? If you have the generated name, is there any way to tell what kind of object was created? Is there an advantage in doing so?WHD: Yes, there is; the name is the object command, so obviously you have to know it to use the object. Where you stash it is up to you, and consequently how you retrieve is up to you. Or am I missing something? As for looking at the name--%AUTO% is replaced by something that looks like "<typename><counter>", where <counter> starts at 1 for the type and increments each time %AUTO% is used. In the example above, the name would probably be "stack1". Two other wrinkles: first, you can specify a longer name with %AUTO% embedded in it (e.g., .foo.bar.%AUTO%); and second, Snit makes sure that the name isn't already in use. If it is, it keeps incrementing the counter until it has something unique. Is there an advantage to having the type name in the generated name? It might help with debugging, I suppose.escargo: If I understand correctly the result returned by [stack %AUTO%] is the name of the object. So set mystack [stack %AUTO%] puts $mystackwould output something like "stack1". That's right -- WHDI don't necessarilly think having the type name in the generated name is a requirement, but there should be a function that given a generated name can return the type name. (For symmetry, it might be nice to be able to have another function that given a generated name can return the instance number.) Having the generated name be something easily split might be useful, just in case somebody defines a type "stack1" and a "stack2". (Or is there a rule that says that typenames must be purely alphabetic?)Certainly the object itself should also be able to provide its type name if politely asked.It can: [$mystack info type] returns the type name. -- WHD lv: any thought of a snit command like info that will return names of all snit objects of a specific class? Also, it would seem like natural extension to have a zero-arg constructor (e.g., [stack]) that implies %AUTO% as the default first argument.WHD: That's a good idea. Snit V0.7. :-)escargo: Or maybe Snit V0.8....WHD: Actually, I've decided not to do this, as it doesn't work for megawidgets, and it was yet another gratuitous difference between snit::types and snit::widgets. RS: proposes to use "#auto" (number automatic) as in Incr Tcl - I know Snit is not, but reusing knowledge can make things easier...WHD: I thought about doing that originally, and rejected it for two (not particularly important) reasons. The first is, I don't like using "#" for anything but comments; the Emacs editing mode I use always wants to put a "\" in front of every non-comment "#" whether it needs it or not. The second is, I've started using "%placeholder%" as a standard for replaceable parameters in strings when normal variable interpolation is inappropriate. I can reconsider the decision if enough people think it's a good idea.WHD After a poll of folks on the Snit mailing list, I've decided to leave it as it is.DKF: FWIW, I think that objects ought to always be created with an automatic name under normal circumstances, and that it is up to the caller to rename them if they want them to have a specific name. What about a 'Snit lite', that just implements snit::type, maybe as a Tcl-command 'widget' (or 'object' or 'gadget' ;-)? If you're just programming in Tcl (and not use Tk at all or use another toolkit or are happy with Tk as it is) it would be nice to have such a mechanism to create and use abstract 'widgets' (objects) in a total natural, intuitive Tcl'ish way. I like Snit, by the way.Actually I think that a 'widget' command is desperately missing in Tcl and should be included in the core. That would be the 10% of OO that could be enough to get 90% of OO's handyness without any of the trouble. Does someone get what I mean? That would be the step beyond 'proc' that more often than not could make the difference between nastyness and fun in everyday scripts.WHD: Actually, Snit works perfectly well in non-Tk code--if Tk isn't available, then snit::widget and snit::widgetadaptor aren't either, but snit::type works perfectly well.joh: It works without any problem, but if you're not using Tk at all, dragging all that with you and constantly reading about Tk in the docs just feels wrong. (The point is that I'm in the very process of tossing Tk for good finally. I almost exclusively use gnocl now and run constantly into extensions that work perfectly well without Tk but treat Tk as if it were a part of Tcl. Which it isn't). It also makes the docs look much more cluttered than it needs to. Maybe I'm just pedantic, but this somehow hurts that quite clean feeling that Snit gives me otherwise.WHD: There's actually not that much code that's Tk-specific; you're not dragging that much around with you. From my point of view, having a single solution that supports both GUI and non-GUI objects is a good thing, not a bad thing. CMcC: I want to use a snit object in a callback. Not a snit method, but an actual instance, as follows: Given instance O, I want an O' such that [eval O' $method {*}$args] will invoke $method on instance O with $args.I note that [mymethod] called without args will give me a plausible-looking formulation, am I ok to just use that as O'?WHD: Yes, exactly. CMcC: I need the type signature of a snit method, in a similar form to standard tcl's [info args]. Is there any sanctioned way to do this?Meanwhile, I've run this proc up to do it, could it be made into a [$obj info signature] facility within Snit? proc methodsig {obj method} { set xcmd "[$obj info type]::Snit_method$method" if {[info procs $xcmd] ne {}} { set a {} foreach var [lrange [info args $xcmd] 4 end] { if {[info default $xcmd $var value]} { lappend a [list $var $value] } else { lappend a $var } } return "$method $a" } else { error "No such method $method in $obj of type [$obj info type]" } }WHD: The above proc will only work for non-delegated methods. Making it work for delegated methods is difficult--and impossible, in some cases. LV: I was wondering whether anyone has investigated making use of Tile in Snit - at least when available.WHD: I've not tried it, but given that Tile widgets are widgets, and can be packed or gridded in standard frames and toplevels, I don't see any reason why it shouldn't work just fine. That said, I wouldn't be surprised if there were some quirks. But I'm not expecting any. AMG: How about a [namespace ensemble] [2] -enabled version of snit? Actually I find it really curious that same isn't already available.(Update, 2005-Mar-20: Where the freg [3] did the "ghttp" come from? I wanted an [N]-style link. Wikibug?RS: Seems so: the URL parser got confused by the dash behind the URL. Inserting a space helped. Lars H: The basic problem is that Wikit first looks for free-text links and only later starts considering brackets. See my note on Wikit Problems for more details.)CMcC: I think namespace ensemble was created in consultation with WHD, so we can hope there'll be an ensemble-enabled snit.WHD: Trust me, getting ensembles into Snit is something I'd dearly love to do--it should speed everything up quite amazingly. It doesn't exist yet because I've got limited time, multiple projects, and Tcl/Tk 8.5 isn't stable yet. I don't have access to a ready-to-install Tcl/Tk 8.5 for OS X, and I haven't made the time to download and build my own. Trust me, though, the day is coming. I don't know the day or the hour (nor yet the month) but the day is coming.LV: Why not just download the Tclkit for MacOS X PPC and Tcl/Tk 8.5 - should have what you need. See [4] for the details. Might not be the latest and greatest - but I'd guess it's relatively recent.WHD: Actually, I just now discovered that Tcl/Tk Aqua 8.4.9 includes executables for 8.5 as well. AMG: itunesdb uses Snit but I'm considering (temporarily/experimentally) switching it to namespace ensembles. Would having such an example be a help? And why don't we have a namespace ensemble page yet? Somebody go write one!! RLH: Is there a comprehensive tutorial for Snit somewhere?WHD: At present, the Snit FAQ is the closest thing there is to an on-line tutorial. There's a possibility that I might be doing a half-day Snit class at the Tcl conference in Portland this fall, though.RLH: While I could not attend (unless that is Portland, Maine) I would eagerly devour any info you put up about it. I will look through the FAQ and as much code I can find. Thanks for Snit!Despite Will's diffidence, such witnesses as Aric Bills testify that, "The Snit FAQ is an excellent tutorial ..." escargo 2005-05-25: Luban
http://wiki.tcl.tk/3963?redir=5494
CC-MAIN-2015-40
refinedweb
2,792
62.38
Qt Designer supplied with Qt 4.0 comprises many features that makes it the fastest and easiest way to lay out and design forms. In this article, we'll take a look at the history of Qt Designer and some of the new features and design decisions in Qt 4.0. - Early GUI Builders - The First Designer - The Second Designer - Making a Better Designer for Qt 4 The Qt API has always made it easy to create a form. Using layout managers, we can create forms relatively quickly. Still, this approach can rapidly become tedious if you have many forms to create. There's also the "edit, compile, run" cycle as you check the positioning of widgets. During all of this you may start to think that there really should be a GUI for making your GUI. Already with Qt 1, there were a few GUI builders available as open source software, with varying levels of layout and widget support. Trolltech released Qt Designer 1.0 at the same time as Qt 2.2. From day one, dialogs created in Qt Designer were stored in well-structured XML files (.ui files) that a separate tool, the User Interface Compiler (uic), converted into C++ code. Qt applications could also create forms based on .ui files at run-time, using the QWidgetFactory class. Qt Designer 1.0 also had the ability to define signals and slots and to connect them together. The actual implementation of the slots was done by subclassing the uic-generated classes and reimplementing the slots, which were declared virtual by uic. The diagram below summarizes the situation. The first version of Qt Designer also provided full support for horizontal, vertical, and grid layouts. Qt developers could rapidly add child widgets to a form, snap them into a layout, and see how they would behave when the user resized the dialog. This immediate feedback cut out the "edit, compile, run" cycle of laying out widgets. It wasn't all rosy, though. Support for custom widgets was very limited; they were rendered as a static image in the form, making it hard to tell how the actual form would behave without building it. Additionally, the subclassing technique was somewhat cumbersome (as the diagram above illustrates) and required two classes, both with the Q_OBJECT macro, resulting in needless overhead on Qt/Embedded. Finally, Qt Designer 1.0 didn't support the creation of main windows with menus and toolbars. Qt Designer 2.0 was released with Qt 3.0. It offered many features that set it apart from the original Qt Designer. First, it allowed developers to cut subclassing by using the .ui.h mechanism. The .ui.h file was included by the uic-generated source and allowed you to reimplement slots and even deal with construction and destruction of the form. A code editor was included inside of Qt Designer to edit the .ui.h file. Furthermore, there was a Source tab that allowed you to add member variables, includes, and forward declarations, in addition to signals and slots. The second Qt Designer could also load several types of plugin. Widget plugins allowed you to create a plugin of your custom widget, making it possible to see the widget when using it on a form and access its properties. Another use of plugins was for wizards. It was even possible to connect to databases from inside Qt Designer and view their data. In addition, Qt Designer 2.0 included a .pro file parser, enabling you to manage your project from Qt Designer and to use the built-in code editor to edit your source files. Some users developed entire applications using Qt Designer. Qt Designer was now an integral part of Qt, but there were still things that could be done to make it better. For instance, the code editor missed such features as being able to go to a specified line. There were also synchronization issues if you were editing a .ui.h file outside Qt Designer. Another issue with Qt Designer was that it couldn't be integrated into existing IDEs. This meant that developers who enjoyed the productivity of IDEs had to leave it to use Qt Designer. Also, adding signals, slots, data members, declaration and implementation includes, and more inside the Source tab was usually considered more troublesome than just editing the source files directly. All this and more lead to the work that would be part of the next Qt Designer. Many concepts needed to be revisited. As a result, an early glimpse of Qt Designer was part of the first Qt 4 beta. A second version containing a more complete feature set was introduced in beta 2 of Qt 4. The version contained in Qt 4's Release Candidate should be almost identical to that in the final Qt 4 release. Let's take a look at some of the features that are part of the new Qt Designer. Qt Designer has now been fully compartmentalized to make it possible to integrate it with existing IDEs. This means that you can create a form, edit its properties with the property editor, double click on a widget, and be taken to a slot that a widget's signal connects to, all without leaving the IDE. For Qt 4.0, a Visual Studio .NET integration is available. Work on integration with other IDEs, notably KDevelop and Eclipse, is planned for later Qt 4 releases. Like before, Qt Designer still writes out .ui files that contain the specification of an interface, and uic generates C++ code based on the .ui file. What has changed is that uic now generates a simple struct containing all the widgets and a setupUi() function that creates the widgets and layouts. The struct does not inherit from QObject and is entirely defined in a header file. There are three approaches to using a form in your application, reflecting the various ways in which standard C++ classes can be combined together. #include "ui_myform.h" // defines the Ui::MyForm struct int main(int argc, char *argv[]) { ... QDialog dialog; Ui::MyForm ui; ui.setupUi(&dialog); dialog.show(); ... #ifndef MYFORM_H #define MYFORM_H #include "ui_myform.h" class MyForm : public QDialog { Q_OBJECT public: MyForm(QWidget *parent = 0) : QDialog(parent) { ui.setupUi(this); private slots: void on_inputSpinBox_valueChanged(int value); private: Ui::MyForm ui; }; #endif #ifndef MYFORM_H #define MYFORM_H #include "ui_myform.h" class MyForm : public QDialog, public Ui::MyForm { Q_OBJECT public: MyForm(QWidget *parent = 0) : QDialog(parent) { setupUi(this); private slots: void on_inputSpinBox_valueChanged(int value); }; #endif Another novelty of Qt 4 is that slots that follow a certain naming convention are automatically connected by uic. The naming convention is on_objectName_signalName(), where objectName is the name of the child widget that emits the signal and signalName the name of the signal. To handle .ui files created with earlier versions of Qt Designer, Qt 4 includes a tool called uic3 that converts old .ui files to the new format (with some help from the Qt3Support library). Previously, when you wanted to add a widget to an existing layout, you first had to break the old layout, add your widget, and then reapply the layout. With the new Qt Designer, you can simply drag your widget onto the form and if there is a layout, it is automatically inserted into it. Hints help you determine where the widget will end up in the layout. The grid layout in particular has been improved. Instead of some magic routine that appeared to pick correct positions for widgets, you have the ability to drop the widgets where you please. In addition, you can manipulate the widgets already in the layout so that they have proper stretch factors. It's never been easier to have one widget take the place of two in a layout. The new Qt Designer still lets you add widgets to a form and then group them in a layout. In addition, it is now possible to add the layout first and then add your widgets to the layout. Qt Designer now makes extensive use of drag and drop. This allows us to show a preview of the widget the moment you start the drag instead of just guessing where you want the widget to go. It also allows the user to quickly clone widgets on a form and drag them to other forms. It is now possible to create custom widgets on the fly that are just a combination of other widgets, simply by dragging them from the form to the tool box. Qt Designer will remember these widgets and make them usable in future forms. The drag and drop interface also makes it possible to drop a widget into an already existing layout and to move widgets around in a grid layout. Qt Designer now also shows an overview of the connections between widgets. Changing to connection mode will show all the current connections. You can then add new ones by dragging connection lines between them. We have also made it possible to change the interface of Qt Designer. The trusty old MDI interface is still present, though changed a bit. It is complemented by a new interface that uses top-level windows. If you aren't sure which one you like, you can switch between them on the fly. In addition to being embeddable, Qt Designer is also extensible through plugins. There are interfaces for custom widgets, for special widget editors, for special preferences, and even for your own Qt Designer components. In fact, several of the Qt3Support widgets are provided through plugins. Some examples of how to write your own widget plugins are included in examples/designer. This is made possible by Qt 4's generic plugin mechanism. In Qt 3, only five types of plugins were supported (image format, SQL driver, style, text codec, and widget plugins). In Qt 4, arbitrary plugins are possible by inheriting from an arbitrary interface and declaring the plugin using the Q_EXPORT_PLUGIN() macro. Qt Designer will then be able to use qobject_cast<>() and load the plugin. See the QPluginLoader class documentation for details. We have seen the evolution of Qt Designer from some ideas developed by a handful of devoted open source developers to a full-fledged supported application provided by Trolltech which has become an essential tool for creating Qt applications. We encourage you to give it a try in the next version of Qt 4.
http://doc.trolltech.com/qq/qq14-designer.html
crawl-001
refinedweb
1,734
64.1
Why TDD Isn't Crap After my recent vitriol about unit testing, a couple of people sent me Why TDD is Crap as a thorough debunking of TDD and unit testing. As someone very interested in software correctness, I ended up writing a debunking of his debunking. Transcriptions will be in quotes, my responses below. Some important notes: - From what can tell, neither of us is using TDD in the “purest” possible sense of “write the bare minimum that makes the smallest unit test pass”. I’m definitely thinking about TDD as it’s commonly practiced and I believe Smith is, too. - I really half-assed these transcriptions. - While Eric Smith is attacking TDD and I’m defending it, keep in mind that he does TDD Consulting and I give talks on TLA+. I don’t think this changes the validity of what either of us say, but it does mean that both of us care very deeply about writing good software, and this isn’t an argument so much as both of us trying to improve engineering. Civility is lacking in online debates and that’s a problem with our community.1 [Mac and] Linux doesn’t use TDD, Linux doesn’t have unit tests either. So I guess you can all switch to Windows, because Windows has TDD built into Visual Studio. … TDD means being a professional as long as you use an unprofessional operating system and an unprofessional programming language. There’s two ways to read this, and I’m guessing Smith means a little of each. The first is that “Some stellar programmers don’t use TDD, so you don’t have to use TDD to be a professional.” One of the toxic bits of programming culture is to mock anybody who doesn’t believe everything you do. Robert Martin does this with TDD, while Amanda Laucher and Paul Snively do this with static typing. On the whole, we’d be a lot better off if we stopped this nonsense. The less charitable way to read this is “These people didn’t need TDD, so you don’t either.” And this is a common argument many programmers make. But examples aren’t data. Just because Linus Torvalds didn’t need TDD doesn’t mean that you and I, who aren’t anywhere as good, don’t need it either. I mean, I could point at the J codebase and say “you don’t need whitespace.” Fact is, we’re all mediocre at best, and we should be choosing our techniques on what we need, not what programming legends need. Have you seen any studies comparing unit testing to other methods? There aren’t any. … We have no evidence that TDD produces fewer bugs, we just have people that think it does. A lack of hard data on TDD is more a comment on our industry than it is on TDD. One frustrating thing about software engineering is that it’s really, really hard to study. For example, we still don’t know whether static typing reduces bugs!2 The best we have is a collection of pilots, case studies, and controlled experiments on students. I can’t give you anything that conclusively affirms or debunks the value of TDD, just like I can’t do that for anything. The best I have is intriguing papers. So does TDD work? The best study I’ve seen on it is the Dr. Nagappan case study, where he compared TDD and non-TDD projects in Microsoft and IBM.3 Each pair of teams worked on different features in the same large project to avoid comparing “computer games and nuclear reactors”. He found the TDD projects had roughly a 60% decrease in defect density and took about 25% longer. That cautiously suggests that yes, TDD might be a useful correctness technique. On the other hand, TDDers might not need to stick to a strict “red-green-refactor” cycle: Fucci et. al found that there was no difference between writing the tests before a chunk of code and writing them after. On the other-other hand, George and Williams found that when people don’t have to write tests before the code, they often forget to write them at all… Look, studying software is hard and we’re not very good at it. But if you put a gun to my head and asked if TDD worked, I’d probably say “yes”. I think most software engineering researchers are on the same page there. Most bugs are in the interaction level, and we know this. Agreed. Nonetheless, the studies (tentatively) show that TDD helps. Most bugs are at the interaction level, but having a shaky foundation certaintly doesn’t make things better. People who don’t write tests have fewer bugs because they have less code to debug. We say code is liability, but we continue to create liability with code nobody actually needed. This is a real problem with testing and general software correctness. One systems saying I’ve heard is “When your system gets large enough, most critical failures are caused by your failsafes”. However, that’s not an argument against failsafes; it’s an argument to be just as careful with our failsafes as we are with our production code. Everything you build is, by definition, part of the problem. In the specific case of unit testing, we can “ask less” of tests than we do production code. It’s a common guideline that your tests should be as simple as possible, which reduces the defect surface for bugs. Additionally, the failure mode of unit tests is less dangerous than production code: either the test is a false positive, which guides us to fix it, or it’s a false negative, which reduces our coverage but doesn’t exactly make things worse. Of course it can give us false confidence, but every verification techniques does that. That’s why we need defense-in-depth. Failsafes can cause critical failures in large systems, but the failsafes are the reason your system can afford to grow large in the first place. How are you going to be faster when you’re writing all these unit tests? When you go home, you write a spike because we know it’s faster. But that’s fine, what about production code? TDD evangelists ignore maintenance! Ever spend a day or a week trying to debug CI? It’s a common argument that “TDD takes less time to write”, which doesn’t seem to be true. The Nagappan study suggests it reduces defects, but it does take longer. TDD takes less time overall”, though, is slightly different, because it includes post-release maintenance. The study explicitly does not factor this time in. Using a conservative estimate that the amount of time it takes to fix a bug is equal to the amount of time it took to code the bug, a 50% reduction for 25% longer time probably saves net time in the post-release maintenance. I haven’t been able to find any studies that give solid numbers.4 As for the “you have to debug CI” argument, that’s a common discussion mistake we make: comparing “something” to “nothing” when we really should be comparing it to “something else”. TDD has maintenance overhead, but so does every other correctness technique! You’ll need a server if you want to compile a statically-typed language. You’ll need a few servers if you want to run a staging environment. You’ll need a bunch of servers and a hug if you want to validate behavior across microservices. And you’ll need an Aphyr if you want to test a distributed system. If you’re doing any of that, adding unit tests isn’t going to be much of a marginal cost. Testing is about design! Good thing we put ‘testing’ in a title! Test driven development makes your designs better. Why? Because they’re more testable. That’s a circle. We don’t know what a good design is, we have some principles, principles we made up just like we made up TDD. I’m honestly a little “meh” on the “TDD is about design.” Beck and Cunningham intended it that way, but in practice it’s better as a testing and scaffolding technique than a design technique. TDD does help mildly by forcing you to constantly be calling your functions, so you realize if they’re awkward sooner. But as much as we’d like to turn design into a coding project, design is much more fundamental than whatever makes up the implementation. Testing does not substitute for thinking. I’ve read a few articles that suggest that testing does, in fact, lead to better designs, but for the life of me I can’t dig them up. If you have any, feel free to send them my way. Testing is more fun! … You know what’s not fun? Debugging tests. Paying for tons of machines so we can run tests. This is a case of comparing something to nothing. Most existing correctness techniques are miserable to use.5 If you don’t hate it, you haven’t pushed it hard enough. My friends have stories of struggling to fit a program they knew was correct into the language’s type system. I once spent three hours trying to debug a broken TLA+ spec, eventually finding that I mixed up => and =>. Debugging tests ain’t got shit on that. At this point Smith talks about alternative techniques to TDD and unit testing to ensure software correctness. All of these approaches are very good and catch bugs TDD will miss, but all also have their tradeoffs. I’d like to go into them in detail. Design-by-contract has done some empirical studies and does really well for itself. With design-by-contract, you can prove it works. Smith doesn’t explain what design-by-contract is, so here’s an example from the Babel Contracts javascript library: function withdraw (fromAccount, amount) { pre: { typeof amount === 'number'; amount > 0; fromAccount.balance - amount > -fromAccount.overdraftLimit; } post: { fromAccount.balance - amount > -fromAccount.overdraftLimit; } fromAccount.balance -= amount; } Whenever you call withdraw, it checks every statement in the precondition. If any are false, the program errors. The same thing happens in the postcondition, which is called when the function ends. This makes it much easier to find bugs in development and testing because errors don’t “propagate” from where they originate. Additionally, since everything has contracts and calls other things with contracts, you get assurance on the integration level. EiffelStudio (the Eiffel IDE) can even generate tests that check your contracts. There are two main problems with contracts, though. First, it provides safety that your program won’t do bad things, but it doesn’t confirm that it actually does what you want. It’s telling that EiffelStudio, in addition to providing world-class contract support, also comes with a unit testing library. You combine both unit tests and contracts for better confidence. The other problem is that contracts require first-class language support, while you can do simple unit testing pretty much anywhere. Babel Contracts got lucky with Javascript: there’s an unused feature called “labels” that they were easily able to hack into pre/postconditions. But even their system is crude compared to Eiffel. A toy example: class ACCOUNT feature balance: INTEGER -- Bunch of methods invariant no_overdrafts: balance >= 0 end no_overdrafts is a class invariant. It’s checked whenever any method on an account called or any kind of mutation happens, and EiffelStudio can compare it to all internal methods and all users of the object to generate extremely intricate tests. no_overdrafts can also be inherited, composed, or overridden like any other class property.6 In Eiffel, you can do incredible things with contracts. In Javascript, you just have pre/postconditions. In Ruby, you have a glorified type checker. But all three languages have solid unit testing frameworks. Haskell has property based testing. It throws tons of tests at your code, well more than you’ll ever think of. PBT (also called generative testing) is where you give a generator some rules and ask it to make tests for you. While the first PBT library was Haskell Quickcheck, arguably the most sophisticated is the Hypothesis Python library. Here’s what a property-based test in Hypothesis looks like: from hypothesis import given from hypothesis.strategies import text from lexer import lex # str -> List[Lexeme] @given(text("+-*/()123456789", max_size=10)) def test_lexes_properly(maths): lexeme_strings = map(str, lex(maths)) assert "".join(lexeme_strings) == maths Hypothesis grabs a random string, such as 10**2+3. lex takes that and turns it into a list of lexeme objects, like [NUM(10), POWER, NUM(2), PLUS, NUM(3)]. We assert that it stringifies back into 10**2+3. Hypothesis will keep throwing random and pathological strings into the test until it either finds an error or is satisfied that my lex function passes the test. This single property test replaced the original ten unit tests and had better coverage, too: it found a lexing error I hadn’t tested for.7 PBT vs TDD, though, is a false dichotomy. I don’t see TDD as meaning only unit tests. Sometimes, before writing code, I’ll write a few unit tests. Other times I’ll write a few property tests. The main benefit property tests have is they test a wider space. The main drawback they have is that they’re not very specific. With unit tests, you know exactly what input you’re giving in and exactly what output you want out. With property tests, you only know what kinds of inputs are going in and can’t provide the exact output you want. Instead, you have to be clever and look for patterns. test_lexes_properly is an example of an encode/decode invariant, where you test that some transformation is perfectly reversible. Another technique is using an oracle, where you find some trick to start out with the answer. Compare these to the simplicity of writing assert foo(bar) == baz as a unit test. Unit tests and PBTs complement each other. You use the former to check a couple of cases work right, and then use PBTs to draw conclusions about the wider input space. There is no conflict with TDD here.8 Hammock-driven development. We reject big design upfront … it’s important. It needs to be done sometimes. I disagree very strongly with Eric Smith here. Upfront design does not “need to be done sometimes”. Agile was a response to how miserably BDUF is… and went too far the other way. We should not be thinking of careful design and planning as a niche thing. Design is fundamental and necessary to software correctness. This does not mean going back to BDUF and 1,000 page requirements documents. But it’s vastly harder to fix a bug in development than it is to fix it in design. Before writing code, I try to draw a directed graph in graphviz or a sequence diagram in mermaid. The amount of errors I catch in the diagrams is a little embarrassing. If your only takeaway from this essay is “learn mermaid”, I’ve done my job. If you want to go further than that, I’d recommend exploring formal specification, in particular the two “flyweight methods” languages. The first, Alloy, is used to verify data structures. I’ve not used it in production but have heard good things from people I trust. I have used TLA+ to find concurrency bugs in my designs, and it’s absolutely incredible. I genuinely believe it could revolutionize software, and have written a comprehensive beginner’s guide to help that process along. But does this replace TDD? No. Good design is critical, but then you need to code and test your design. And TDD is quite often a good technique to do that.9 Every organization has a QA department. If TDD was a silver bullet, we wouldn’t need it. I agree. We also have a bad habit of seeing software test engineers as being somehow “lesser” than the product engineers. Rigorous testing is as much as specialist skill, with specialist programming knowledge, as any other part of software. In fact, you shouldn’t have the QA department write unit tests any more than you should have the product department do pentests. TDD is a technique for developers. Testers should be busy writing more complex, more terrifying tests. Here are my main takeaways: - We don’t actually know that much about what good software engineering looks like. - TDD is likely a good correctness technique and is probably useful in many projects. - There are other correctness techniques that have different strengths and weaknesses relative to TDD. You should probably be using a mix, with the optimum ratio being dependent on the project, external constraints, and size of your correctness budget. - Regardless of how you approach correctness, it’s definitely worthwhile to do some design in advance. - We shouldn’t call people unprofessional just because they disagree with us. - QA don’t get enough respect. Thanks to Richard Whaling for their feedback. - I’m not blameless here either. [return] - I’d be remiss without mentioning a recent paper that looks more rigorous than its peers. There’s a couple of threats to validity I want to look into, though. [return] - Surprisingly, Microsoft is probably the biggest investor in software engineering research in the world. I wouldn’t be surprised if they spent more on it than the rest of the Big Five combined. In terms of formal verification research, the only group that’s comparable is the country of France. [return] - Yes, I know about the “IBM Systems Science Institute” graph. It’s probably not real. [return] - I think this is 20% “testing is intrinsically hard” problem and 80% “Nobody invests in software correctness UX”. [return] - I wonder if the reason OO languages are considered so buggy is because none of the popular ones went all-in on class contracts. It seems like a killer feature of classes that nobody’s heard of. [return] - Specifically, if the string ended with a multicharacter token followed by a multidigit number, it would leave off the last digit. For example, 2**10would lex as [NUM(2), POWER, NUM(1)]. [return] - PBT also synergizes really well with contracts. [return] - There are some formal verification languages, like ACL2 and Coq, where you can formally prove your code matches the design. In practice, though, they are much too difficult and expensive to use for 99% of projects. But I’ve heard Idris is showing promise. [return]
https://hillelwayne.com/post/why-tdd-isnt-crap/
CC-MAIN-2018-17
refinedweb
3,120
65.42
Understanding Struts Controller Understanding Struts Controller In this section I will describe you the Controller.... It is the Controller part of the Struts Framework. ActionServlet is configured Rajnikant, Thanks for reply..... I am... is the advantage of interface and what is the use of interface... Thanks... from unrelated classes just to get the required functionality. For example, let Thanks Thanks This is my code.Also I need code for adding the information on the grid and the details must be inserted in the database. Thanks in Thanks for fast reply - Java Beginners Thanks for fast reply Thanks for response I am already use html... to fetch data from table in the data grid I am using mysql database package... = con.createStatement(); ResultSet res = st.executeQuery("SELECT * FROM Struts - Struts Struts how to set value in i want to set Id in checkBox from the struts action. Hi friend, For more information,Tutorials and Examples on Checkbox in struts visit :// Thanks... in struts 1.1 What changes should I make for this?also write struts-config.xml...=connection.createStatement(); rst=stmt.executeQuery("select * from login where username Answer me ASAP, Thanks, very important Answer me ASAP, Thanks, very important Sir, how to fix this problem in mysql i have an error of "Too many connections" message from Mysql server,, ASAP please...Thanks in Advance Doubts on Struts 1.2 - Struts visit for more information. Thanks...Doubts on Struts 1.2 Hi, I am working in Struts 1.2. My requirement is to display data in a multiple selected box from database in a JSP page. Can Struts How to retrive data from database by using Struts Doubt in struts - Struts Doubt in struts I am new to Struts, Can anybody say how to retrieve data from database and display it in jsp. Some said to use beans but i dont... : Thanks how to write Dao to select data from the database... applications. You can learn Struts at our Struts tutorials section. Thanks - Framework in struts... Hi Friend, You can get login applications from the following links: 1) 2)http...struts Hi,roseindia I want best example for struts Login struts can easily learn the struts. Thanks...struts how to start struts? Hello Friend, Please visit the following links: Struts Struts How will you retrieve a collection of records from business logic to presentation logic in framework About Struts processPreprocess method - Struts to : Thanks...About Struts processPreprocess method Hi java folks, Help me... is not valid? Can I access DB from processPreprocess method. Hi Struts validations Struts validations Can you please provide the login page example in struts1.x and struts 2.x Where the login page should interact with the DB... the given input from the form. i.e, the given username and password have to be compared Struts - Framework , Struts : Struts Frame work is the implementation of Model-View-Controller... of any size. Struts is based on MVC architecture : Model-View-Controller..., dispatching the request to the controller and then receiving response from to retrieve from radiobox and comparing with a string - Struts to retrieve from radiobox and comparing with a string im creating... the questions how to do it?? thanks in advance manoj Hi Friend, Create...: Thanks configuration - Struts /struts/ Thanks... class,ActionForm,Model in struts framework. What we will write in each... services are accessed by the controller for either querying or effecting a changeId struts struts I have no.of checkboxes in jsp.those checkboxes values came from the databases.we don't know howmany checkbox values are came from... the checkbox.i want code in struts struts2 - Struts struts2 hello, am trying to create a struts 2 application that allows you to upload and download files from your server, it has been challenging... Hope that the above link will be helpful for you. Thanks Java - Struts :// Thanks. my doubt is some... logic and application data from the presentation data to the user> <p>hi here is my code in struts i want to validate my... rs=st.executeQuery("select seq.nextval from dual"); while(rs.next... }//execute }//class struts-config.xml <struts Struts-jdbc into database and retriew the data from database using struts please let me know... the following link: Struts JDBC Thanks...Struts-jdbc <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 iteraor Struts iteraor Hi, I am making a program in Struts 1.3.8 in which i have to access data from mysql. I am able to access data but data is not coming...;(); try { String str = "select * from emp where userId Using radio button in struts - Struts - selection 2 I need to get two values from the selection of the user the first... source code to solve the problem : For more information on radio in Struts...-tag.shtml Thanks Struts - Struts . Please visit for more information..... Thanks Sreenivas Struts 2 Video Tutorial Struts 2 Video Tutorial I think its easy to learn from Struts 2 Video Tutorial. What is the url of Struts 2 Video Tutorial on roseindia.net website... tutorial page. View the Struts 2 Video Tutorial. Thanks struts - Struts . Struts-config.xml is used for making connection between view & controller.../struts/ Thanks...struts hi, what is meant by struts-config.xml and wht are the tags upload file - Framework Struts upload file Hi, I have upload a file from struts... Thanks. Hi friend, For upload a file in struts visit to : Thanks struts - Struts struts am retrieving data from the mysql database so the form bean will be null for that action.... if i give it in struts config it is asking me to have a form bean.... how to solve this problem Servlet - Struts Servlet Can I can my action class from servlet? If yes, then how? Hi friend, I am sending you a link. I hope that this link... in detail. Thanks. Amardeep2 - Struts weird, meaning that the drop down wen clicked it just jumps out from the first row... in Mozilla displays very well. Im trying to figure out from a long time, not succesful.../struts/struts2/struts2uitags/autocompleter-example.shtml Thanks. hi i Struts - Struts Struts Hi All, Can we have more than one struts-config.xml in a web-application? If so can u explain me how with an example? Thanks in Advance.. Yes we can have more than one struts config files.. Here we Tapestry - Struts respond me fast thanks Hi friend, Code to help in solving...("data received from "+postUrl); adjustPostTooltipDimensions... modify this function from the original in dojo.widget.html.Tooltip help - Struts HelloWorld.jsp Remove the attribute "namespace" from the Tag Use... : Thanks  .../struts/struts2/struts-2-hello-world-files.shtml Thanks struts What is model View Controller architecture in a web... architecture is to separate the business logic and application data from the presentation data to the user. Model-view-controller (MVC) is an architectural Update delete perticular row from brower on link - Struts Update delete perticular row from brower on link how can update and delete perticular row from List of employee in brower format are ramesh... page with textbox update , if delete click then that row also delete from Struts - Struts Struts is it correct to pass the form object as arg from action to service struts flow - Struts struts flow Struts flow Hi Friend, Please visit the following links: Thanks PHOTO UPLOAD AND DISPLAY - Struts some help urgently from your side. My problem is I want to upload the photos and display photos usin Struts technology. Please give me some suggestion to me..., For solving the problem visit to : Struts Validation - Struts Struts Validation Hi friends.....will any one guide me to use the struts validator... Hi Friend, Please visit the following links: http struts - Struts . send the mail with attachment - Struts in struts. when i added the attachemt logic in struts,i am not able to send the mail . Mail Problem is file path: how to get the file path from the browse("we... Thanks Pradeep Hi Friend, Please visit the following link: http Struts+Hibernate - Development process Struts+Hibernate Hi I am Using Struts+Hibernate in my web... records from the form using lazy validator. and i got one local bean where i could copy all the records that i retrieved from the form .but i am getting thanks - JSP-Servlet thanks thanks sir i am getting an output...Once again thanks for help thanks - JSP-Servlet thanks thanks sir its Advertisements If you enjoyed this post then why not add us on Google+? Add us to your Circles
http://www.roseindia.net/tutorialhelp/comment/21600
CC-MAIN-2015-18
refinedweb
1,425
76.22
Created on 2020-02-27 21:52 by leezu, last changed 2020-03-03 09:10 by vstinner. Below sample program, will raise "Modules/gcmodule.c:110: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small" on Python 3.8.2 debug build. On 3.7.6 debug build, "Modules/gcmodule.c:277: visit_decref: Assertion `_PyGCHead_REFS(gc) != 0' failed." is raised. ``` import collections import gc import weakref hooks_dict = collections.OrderedDict() hooks_dict_ref = weakref.ref(hooks_dict) gc.collect() print('Hello world') ``` The complete error message on 3.8.2 debug build is ``` Modules/gcmodule.c:110: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small Memory block allocated at (most recent call first): File "/home/$USER/test.py", line 6 object : <weakref at 0x7ff788208a70; to 'collections.OrderedDict' at 0x7ff7881fab90> type : weakref refcount: 1 address : 0x7ff788208a70 Fatal Python error: _PyObject_AssertFailed Python runtime state: initialized Current thread 0x00007ff789f9c080 (most recent call first): File "/home/$USER/test.py", line 7 in <module> zsh: abort PYTHONTRACEMALLOC=1 python ~/test.py ``` Thanks for the succinct example! Although you don't need the print() ;-) I can confirm this crashes the same way under a current master build (albeit on Windows 64-bit). gc is calculating how many references in the current generation are accounted for by intra-generation references, and gc's visit_decref() is getting called back by odictobject.c's odict_traverse(), on line Py_VISIT(od->od_weakreflist); gc has found a second pointer to od->od_weakreflist, which is more than its refcount (1) claims exist. Python's weakref implementation gives me headaches, so I'm adding Raymond to the nosy list under the hope the problem will be obvious to him. I'm suspecting that maybe we shouldn't be doing Py_VISIT(od->od_weakreflist); at all - best I can tell from a quick (non-exhaustive!) scan, the objects in the weakref list aren't incref'ed to begin with. And even if they were, that line would only be looking at the head of the list, ignoring all the non-head weakrefs after the head. Yes, I don't think other weakref-supporting objects traverse the weakreflist in their tp_traverse. I concur with Antoine and Tim. The GC already has the machinery to deal with weak references in the correct way (even more after recent bugfixes regarding callbacks). Traversing the weak reference list in incorrect because the object does not "own" the weak references to it, as the weak references can die even if the object is alive. Also, as Tim mentions, the traverse will be called on the head of the list, in the same way if you do object.__weakref__ you will only get the HEAD of the list: >>> import weakref >>> class A: ... >>> a = A() >>> w1 = weakref.ref(a) >>> w2 = weakref.ref(a, lambda *args: None) # Use a callback to avoid re-using the original weakref >>> id(w1) 4328697104 >>> id(w2) 4328758864 >>> id(a.__weakref__) 4328697104 I think that this is not very well documented, as there is no pointers on what should and should not be traversed in. I will prepare a PR to the documentation if everybody agrees and another one removing the traverse unless someone sees that something else is at play. After some thought, I'm sure the diagnosis is correct: the weakref list must be made invisible to gc. That is, simply don't traverse it at all. The crash is exactly what's expected from traversing objects a container doesn't own references to. I agree the tp_traverse docs should point out that weakref lists are special this way, but I think the problem is unique to them - can't think of another case where a container points to an object it doesn't own a reference to. > I agree the tp_traverse docs should point out that weakref lists are special this way, but I think the problem is unique to them - can't think of another case where a container points to an object it doesn't own a reference to. Agreed, I was thinking a small warning or something because this is not the first time I see similar errors or users confused about what they should and should not track (with this I mention that we should say that "only objects that are *owned* should be tracked, and then the weakref warning or something similar). I will prepare a PR soon. New changeset 0c2b509f9d1d3a9065bc62c2407e1dc2ed70e9c2 by Pablo Galindo in branch 'master': bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) New changeset 69ded3944c202da972754644c0bbf7f77cc5e8ea by Miss Islington (bot) in branch '3.7': bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) New changeset 9ddcb914f9c2debe7c1359b2450cd1573e86b91c by Pablo Galindo in branch '3.8': [3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) (GH-18756) New changeset 6df421fe87a9418d6c59f89dbc5d5573b6826855 by Pablo Galindo in branch 'master': bpo-39778: Add clarification about tp_traverse and ownership (GH-18754) New changeset 72fff60d7649df88026838d8b5f14f541393f268 by Miss Islington (bot) in branch '3.7': bpo-39778: Add clarification about tp_traverse and ownership (GH-18754) New changeset 1827fc30f463786ebff13752e35c3224652bc94e by Miss Islington (bot) in branch '3.8': bpo-39778: Add clarification about tp_traverse and ownership (GH-18754) It seems like OrderedDict was the only type which visited weak references: $ scm.py grep 'VISIT.*weak' master: Grep 'VISIT.*weak' -- <4284 filenames> ============================================== Objects/odictobject.c:1457: Py_VISIT(od->od_weakreflist);
https://bugs.python.org/issue39778
CC-MAIN-2021-04
refinedweb
896
63.39
I have a program for clas that requires me to write a random number guessing game. I completed the game but i have to use functions in the program and I am not to familiar with this. Can some one help me? Here is the code and here are the functions that I have to use #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int num; int guess; bool done; int noOfGuesses=0; int ncount=0; int sum=0; int noofgamesplayed=0; int avgNoOfGuesses=0 ;sum+=noOfGuesses; avgNoOfGuesses=sum/noofgamesplayed; num = (rand() + time(0)) %; } These are the functions /* PrintHeading simply prints the introductory output. Parameters: initial amount of money received */ void PrintHeading(int money) /* GetBet prompts for and reads in a bet. The function performs all error checking necessary to insure that a valid bet is read in and does not return until a valid bet is entered. Parameters: money: the amount of money the player currently has bet: the bet chosen by the user */ void GetBet(int money, int& bet); /* GetGuess reads in a guess. The user is not prompted for the guess in this function. The user only gets one chance to input a guess value. Return Value: the value of the guess if the input is valid 0 if the input guess was not valid */ int GetGuess(void); /* CalcNewMoney determines the amount of money the player has won or lost during the last game. Parameters: money: the amount of money the player had going into the game bet: the amount the player bet on the current game guesses: the number of guesses it took the player to win. -1 if the player did not guess correctly Return Value: the new amount of money the player has */ int CalcNewMoney(int money, int bet, int guesses); /* PlayAgain prompts the user to play the game again and reads in a response, using a single character to represent a yes or no reply. Error checking is performed on that response. Return Value: 1 if the user wants to play again 0 if the user does not want to play again. */ int PlayAgain(void); /* PlayGame plays a single game, performing all the necessary calculations, input, and output. Parameters: money: the amount of money the player has at the start of the game. Return Value: how much the player has after the game. */ int PlayGame(int money); /* Generates a random number between 1 and MAX_RANDOM_NUM, inclusive. Return Value: the generated number */ int GenerateRandomNumber(void) { /* GenerateRandomNumber */ /* calculate and return a number in the required range */ return(rand() * MAX_RANDOM_NUM / RAND_MAX + 1); } /* GenerateRandomNumber */ srand((unsigned)time(NULL));
https://www.daniweb.com/programming/software-development/threads/136595/random-number-guess
CC-MAIN-2018-13
refinedweb
434
57.81
Machine Learning/Kaggle Social Network Contest/load data Revision as of 23:30, 22 November 2010 R) Python How to load the network into networkx There is a network analysis package for Python called networkx. This package can be installed using easy_install. The network can be loaded using the read_edgelist function in networkx or by manually adding edges NOTE: John found that it took up about 5.5GB of memory to load the entire network. We may need to process it in chunks - or maybe decompose it into smaller sub networks. Method 1 import networkx as nx DG = nx.read_edgelist('social_train.csv', create_using=nx.DiGraph(), nodetype=int, delimiter=',') Method 2 import networkx as nx import csv import time t0 = time.clock() DG = nx.DiGraph() netcsv = csv.reader(open('social_train.csv', 'rb'), delimiter=',') for row in netcsv: tmp1 = int(row[0]) tmp2 = int(row[1]) DG.add_edge(tmp1, tmp2) print "Loaded in ", str(time.clock() - t0), "s"! Ruby')
https://www.noisebridge.net/index.php?title=Machine_Learning/Kaggle_Social_Network_Contest/load_data&diff=14430&oldid=14423
CC-MAIN-2015-22
refinedweb
157
60.21
Your Account by Jason McIntosh A common theme among many reponses I received frommy ComicsML article involved SVG, the vaguely buzzy W3C standard for describing graphics through XML. Due to its name -- which expands to Scalable Vector Graphics -- I had a vague idea that it let you write XML elements that described a picture via plotting points and drawing lines between them, and I guess if I stopped to think about it, which I didn't, I would conjure up pleasantly nostalgic visions of my fourth grade computer class, drawing pictures on graph paper and then trying to code them inApple ][ BASIC via blocks of carefully enumerated HLINE and VLINE statements. (Mine was a picture of a shining Atari logo blowing up an evil Apple logo, for it would be years before I'd mature into platform agnosticism, and I suppose I harbored some resentment at this activity. Anyway:) After spending Sunday afternoon immersed in SVG specs, articles, and tutorials, I have found myself bedazzled at its true purpose as XML's solution for describing and rendering all sorts of graphics and animation, so much so that many consider it positioned as competition for Macromedia's Flash. (I suspect that if I had any idea how Flash worked I would have figured this out sooner, but, anyway; there you have it.) This is very interesting, an open file format not owned by any one company and therefore generatable through whatever tool one wishes to use (I used emacs), and which has support from major vendors -- see especiallyAdobe's SVG viewer plugin for Windows and Mac browsers (which, incidentally, you'll probably need in order to see the stuff I point to later in this entry), not to mention that their Illutsrator 9.0 product can export its files as SVG -- and viewable through any application that cares to parse the XML and figure out how best to draw all these flying shapes, given the environment, whether it be a PC's web browser, or the itty-bitty LCD screen of a palmtop device, or a superprecise plotter printer. Despite all this, at first I wondered if the Flash-competing angle was a crackpot viewpoint -- I had previously viewed Flash as just Flash, a domain unto itself -- but Dale alluded to this as well ina recent interview, so I would tend to believe him, even though his interview subject responded by scoffing at SVG's comparitavely puny browser penetration figures. I scratch my head at that, though: to compare market penetration with regard to electronic media formats that are not only free but very easy to obtain and use seems a little weird to me. When I hit a page that wants to show me a little SVG magic, and I don't have the right plugin, my browser will beep and offer to go fetch it for me, and I will say "Duh, OK," and click the Install button, and there you have it: one more SVG user, who will use it seamlessly from then on. It's not anything like comparing OS usage, or even browser application usage, as far as I can tell. Of course, I'm out of luck unless I have a Windows or a Mac machine handy. My experimentation was made possible by my trusty old home Mac, but my main box there runs RedHat Linux, and at work I use Solaris. (Well, there's a shared Windows box here, but Erik keeps moving the icons around and confusing me by renaming the computer icon to I like gherkins or Dorky Plunk Xob or something every day, so I don't use it too often.) I wrote a friendly letter to Adobe thanking them for making a Mac version at all, and added my voice to what I hope is a sizeable collection of Unixheads who'd like to share the love as well. Hey, look, they wrote me back tonight!. Adobe notes in their online documentation that they consider their plugin a placeholder until the major browser vendors start supporting SVG natively. Innnnteresting optimism, and actually encouraging. After receiving that email, I was most hopeful about that Mozilla page, but its tone is mostly an expectant "Gee, it sure would be nice to support SVG, wouldn't it?" Oh well. This is why open source is beautiful; you can get away with posting this sort of webpage. :) A couple of things I made very quickly, hammering in just a few lines of XML (use the plugin's contextual menu (accessed via right mouse button or control-click) to check out the source for yourself, if you'd like), based on a mixture of ripping off the tutorials available at <svg-spot> and skimmingthe W3C spec (palatable reading, but dry; I recommend a beverage on hand to ease things): (Note also thatSun Microsystems has an SVG resource page some tutorials that cover specific sub-topics, andAdobe has a general tutorial, though it's aimed at Illustrator users) Since I was researching all this with ComicsML in mind, I quickly homed in on the <image> element, which lets you import whole files containing raster graphics -- that is, the far more common image format involving descriptions of which bits go where and with what color on a two-dimensional grid, rather than the collections of pure-math points, lines and arcs that form the basis of vector graphics. This, plus the fact it takes the same coordinate and size attributes of every other SVG element, made it a shoo-in for the first solution I'll create to the problem of describing comic panels' layout. Within a few minutes I had already chopped up my example comic and recast it in three directions. Woowoo! It's not the solution I was envisioning, but definitely a start in that direction, especially considering that fiddly bits like figureing out coordinates could be greatly assisted through a little bit of programmatic magic. It's worth noting that importing these graphics goes a little bit against the point of SVG, since raster graphics are, by definition, neither S nor V, but the standard would never have caught on had there not been room made for the well-established Web graphics formats we know and love. (Well -- most of them. JPEG and PNG are represented, but not GIF. (To which I say:right on.)) An power plant engineer made an interactive schematic of a power generation system in SVG, letting you poke buttons to open and close switches (or something) and watch the little things turn off and on and spin around and stuff while numbers shuffle past. It's the interface the Enterprise's power generator would have if it was located in Wisconsin. He made some other SVG stuff, too. A mad map of Moscow that makes stunning use of SVG's zoomability, starting you a mile high, and letting you zoom, zoom, zoom in until you can see all the individual shrubs and streetlights that someone took the time to render. Yikes! Finally, I like this self-depreciatory demonstration of how JavaScript and SVG can be combined to sink the Web into new depths of design depravity, mostly because it's on the W3C's server. (Actually, it's not all that ugly, but I appreciate the effort nonetheless.) The moral of the story, as far as I'm concerned, is SVG Good, so I'm going to do what I can to support its growth, which is to say, import its namespace into the ComicsML spec. I think it will not only help to solve its immediate problems involving layout, but will enourage comics creators (and their comics' readers!) to use this open and powerful language. This is my first O'Reilly Network weblog entry. Now I am l33t. Thanks, Dale and Nancy! What do you think of those little meerkat heads at the top? Scaled down so much, and lacking their cute little meerkat bodies, their species becomes disturbingly ambivalent. I think they look something like a jury of little Edward Gorey puppets, craning their necks around in unison to peer at something off to the right, perhaps that there Oracle ad banner. Bizarre!! © 2015, O’Reilly Media, Inc. (707) 827-7019 (800) 889-8969 All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
http://archive.oreilly.com/pub/post/exploring_svg.html
CC-MAIN-2015-11
refinedweb
1,394
58.66
Prev C++ VC ATL STL Installation Experts Index Headers Your browser does not support iframes. Re: Seeing a lot of time to compile with g++ 3.3.6 From: James Kanze <james.kanze@gmail.com> Newsgroups: comp.lang.c++ Date: Sat, 03 Nov 2007 09:39:10 -0000 Message-ID: <1194082750.052059.260910@v3g2000hsg.googlegroups.com> On Nov 2, 9:46 pm, "parag_p...@hotmail.com" <parag_p...@hotmail.com> wrote: I have been seeing a consistent slowness in g++ compilation for a small file like the following , The uptime is near ( load Is near to 0 ) . I have put the time output for the same, The file looks like the following #include<iostream> #include<vector> #include<deque> using namespace std; int main() { int data[5] = {6,7,8,6,5}; vector<int> v(5,6); deque<int> d(data, data+5); deque<int>::iterator p; cout << "\n Deque values" <<endl; for (p= d.begin(); p!= d.end(); ++p) cout <<*p<<'\t'; cout <<endl; d.insert(d.begin(), v.begin(), v.end()); for (p= d.begin() ; p != d.end(); ++p) cout<<*p <<'\t'; cout <<endl; } First, of course, what the compiler "compiles" is the output of the preprocessor, with all of the includes. Try doing a line count of that. Option /E for VC++, -E almost universally for Unix based compilers---if you're on Unix, the output of "g++ -E source.cc | wc -l" might surprise you. Secondly, compiling templates *is* hard work, and you've got a lot of templates there. (Don't forget that all of iostream is also templated.) With Sun CC, I can request compatibility with a very old, pre-standard version of the compiler, where <iostream.h> is not templated---hello, world compiles ten times faster if I do. The difference for most real programs isn't that significant, of course, because in most of my real programs, most lines of code don't involve templates. But the fact that iostream is a template does mean that most of the implementation is physically in the headers, and must be read by the compiler; when the network is slow, I still notice. a.outvgamd261> /usr/bin/time g++ p237.cc 0.84user 0.17system 0:05.14elapsed 19%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1968major+20640minor)pagefaults 0swaps Off hand, it looks like the problem is reading the sources (including the headers). Unless you've got something else going on which uses a lot of C++, the only thing which could explain the different between less that a second user time and over 5 seconds elapsed time is IO wait. You might look at where the g++ headers are installed. If they're on a slow disk, or remote mounted over a slow network, copying them to a fast disk or locally might spead things up. Also, if you have enough main memory, you'll probably notice that when you compile a lot of sources one after the other, only the first one is particularly slow; for the others, the header data is still cached in the system, and doesn't have to be read again from
https://preciseinfo.org/Convert/Articles_CPP/Installation_Experts/C++-VC-ATL-STL-Installation-Experts-071103113910.html
CC-MAIN-2022-05
refinedweb
521
70.94
![if !(IE 9)]> <![endif]> There are many system functions, such as malloc, realloc, and calloc, that return a null pointer in certain conditions. They return NULL when they fail to allocate a buffer of the specified size. Sometimes you may want to change the analyzer's behavior and make it think, for example, that malloc cannot return NULL. This can be done by using the system libraries, where 'out of memory' errors are handled in a specific way. An opposite scenario is also possible. You may want to help the analyzer by telling it that a certain system or user-made function can return a null pointer. To help you with that, we added a mechanism that allows you to use special comments to tell the analyzer that a certain function can or cannot return NULL. Comment format: //V_RET_[NOT]_NULL, namespace:Space, class:Memory, function:my_malloc The controlling comment can be written next to the function declaration. However , you cannot do this for such functions as malloc because changing system header files is a bad idea. A possible way out is to add the comment to one of the global headers included into each of the translation units. If you work in Visual Studio, the file stdafx.h would be a good choice. Another solution is to use the diagnostic configuration file pvsconfig. See "Suppression of false alarms" (section "Mass suppression of false positives through diagnostic configuration files (pvsconfig)"). This is illustrated by the two examples below. The function does not return NULL: //V_RET_NOT_NULL, function:malloc Now the analyzer thinks that the malloc function cannot return NULL and, therefore, will not issue the V522 warning for the following code: int *p = (int *)malloc(sizeof(int) * 100); p[0] = 12345; // ok The function returns a pointer that could be null: //V_RET_NULL, namesapce:Memory, function:QuickAlloc With this comment, the following code will be triggering the warning: char *p = Memory::QuickAlloc(strlen(src) + 1); strcpy(p, src); // Warning! Analyzer warnings are of three levels of certainty: High, Medium, Low. Depending on the used constructs in code the analyzer estimates the certainty of warnings and assigns them an appropriate level in a report. Some warnings may be issued simultaneously on several levels. In some projects, search for specific types of errors can be very important, regardless of the level of warning certainty. Sometimes there can be a reverse situation, when the error messages are of little use, but a programmer does not want to disable them at all. In such cases, you can manually set the diagnostics level of High/Medium/Low. To do this, you should use the special comments that can be added in code or the diagnostics configuration file. Examples of comments: //V_LEVEL_1::501,502 //V_LEVEL_2::522,783,579 //V_LEVEL_3::773 Finding such comments, the analyzer issue warnings at the specified level. ...
https://www.viva64.com/en/m/0040/
CC-MAIN-2017-51
refinedweb
473
52.6
Opened 9 years ago Closed 9 years ago Last modified 4 years ago #1169 closed defect (wontfix) HTTPAuth doesn't validate against AccountManager htpasswd file Description (last modified by stp) HTTPAuth dialog comes up, but username & passwords are rejected. Doesn't look like the Accountmanager plugin's password file is being consulted, as per your page's declaration that AccountManagerplugin is used to check passwords. Using in conjunction w/XMLRPC plugin so we can use Mylar w/Eclipse & Trac. Standard form-based login still works. Pop-up dialog appears for /xmlrpc & /xmlrpc/login targets, but username & password doesn't work. - Does crypt scheme in passwd file make two-bits of a difference? [using md5] - What's with the "Control Panel" name in the login dialog? - Is it a misconfiguration on my part? I'm using trac 10.3, on Debian. I'm using Py-24 Thanks for taking a look. Attachments (0) Change History (16) comment:1 Changed 9 years ago by jlevy@… comment:2 Changed 9 years ago by jlevy@… More details yet... Snooping source, I see log entries... so I check my log: 2007-02-02 22:20:37,117 Trac[init] INFO: HTTPAuthFilter: No/bad authentication data given, returing 403 comment:3 Changed 9 years ago by jlevy@… get_header('Authorization') always seems to return None... has api changed? comment:4 Changed 9 years ago by beau@… I see this too with a similar setup; 0.10.3, Python 2.4, FreeBSD. /xmlrpc and /login/xmlrpc targets work but reject all users and passwords. I also noticed that get_header('Authorization') is returning none. I added a debug line to print out req._inheaders: 2007-03-29 17:54:36,852 Trac[filter] DEBUG: HTTPAuthFilter: req._inheaders = [('cookie', 'trac_form_token=f8938fa4194db5ac822c5260; trac_auth=27841af7dce3a81d8a685e62b3f467a0'), ('keep-alive', '300'), ('accept-charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'), ('user-agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3'), ('connection', 'keep-alive'), ('host', ''), ('cache-control', 'max-age=0, max-age=0'), ('accept', 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'), ('accept-language', 'en-us,en;q=0.5'), ('accept-encoding', 'gzip,deflate')] I then double-checked that I was sending the authorization header using 'Live HTTP Headers' for Firefox. It seems that something (The AccountManager plugin?) is stripping this header. comment:5 Changed 9 years ago by beau@… comment:6 Changed 9 years ago by chechu I had the same problem. In my case the problem was that the header "Authorization" doesn't arrive to the cgi (or fcgi). I could get it in the .htaccess file, and I could set rules with this header in this file, but in the trac.cgi I could not see it. I have my hosting with Dreamhost, maybe it's a server configuration problem. My solution First step I set the next rules in the .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP:Authorization} ^Basic.* RewriteRule ^(.*)$ index.cgi/$1?INTERNAL_AUTH=%{HTTP:Authorization} [L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.cgi/$1 [L] </IfModule> The second one is the normal rule for Trac. The first one is an special adaption of the second one: when the header "Athorization" is present in a request (and starts with "Basic") I rewrite the url to pass an argument to the cgi. I pass as argument the value of the header Athorization. So, the next step is to get this argument in the cgi. Second step In the file trac.cgi (or trac.fcgi) I added the next code in the beginning: import os, sys from cgi import escape valor = os.environ["QUERY_STRING"] if valor: clave, valor = valor.split('=', 1) if clave == "INTERNAL_AUTH": os.environ["HTTP_AUTHORIZATION"] = valor QUERY_STRING is an environmen variable with all the variables passed in the URL. We split this value to get the value of INTERNAL_AUTH variable, and only if this variable exists we set and environment variable: HTTP_AUTHORIZATION. This variable will be used then by the HttpAuthPlugin. comment:7 Changed 9 years ago by yuji.od That solution overwrite query strings.I changed following. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP:Authorization} ^Basic.* RewriteRule ^(.*)$ index.cgi/$1?INTERNAL_AUTH=%{HTTP:Authorization}&%{QUERY_STRING} [L] </IfModule> comment:8 Changed 9 years ago by progrium@… If you're using mod_wsgi, auth info is stripped before passing to the app. Turn WSGIPassAuthorization On for it to work. See comment:9 follow-up: ↓ 10 Changed 9 years ago): <IfModule alias_module> AliasMatch ^/trac/[^/]+/chrome/common/(.*) "/usr/local/share/trac/htdocs/$1" AliasMatch ^/trac/([^/]+)/chrome/site/(.*) "/usr/local/www/trac/$1/htdocs/$2" ScriptAlias /trac /usr/local/www/apache22/cgi-bin/trac.fcgi </IfModule> <Location /trac> SetEnv TRAC_ENV_PARENT_DIR "/usr/local/www/trac" RewriteEngine on RewriteCond %{HTTP:Authorization} ^Basic.* RewriteCond %{QUERY_STRING} !INTERNAL_AUTH=.* RewriteRule ^.*trac\.fcgi/(.*xmlrpc)$ $1?INTERNAL_AUTH=%{HTTP:Authorization}&%{QUERY_STRING} [L] </Location> I also came across the following we should have worked but did not: # <IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi FastCgiConfig -pass-header Authorization </IfModule> LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so comment:10 in reply to: ↑ 9 Changed 9 years ago by anonymous Replying): Holy formatting, Batman! Next time please hit preview. comment:11 Changed 9 years ago by coderanger - Resolution set to wontfix - Status changed from new to closed This an Apache issue clearly. I can't do anything about it. comment:12 Changed 9 years ago by stp Please note that Mylyn should support form-based authentication via the AccountManagerPlugin in the latest releases. Please file a bug against Mylyn if it does not work for you: comment:13 Changed 8 years ago by anonymous When you use the apache cgi you run in this problem, since the CGI specification told that the apache does not send the "authentication" header to python. I moved from cgi to mod_python and all works fine. When you start trac with its own http server (tracd) also all works fine. comment:14 Changed 6 years ago by lee.calabrese@… I know this is old but I was having lots of troubles with this and couldn't get the above to work. On shared hosting, I didn't have access to the Apache configuration, so I had to use this hack. What I ended up doing was the following: I changed my .htaccess file with the following RewriteRule (which will then give you the request environment variable "REQUEST_HTTP_AUTHORIZATION": RewriteRule ^(.*)$ index.fcgi/$1 [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] Note I had a couple of these RewriteRules in there because I was prettying the URL (removing the index.fcgi from the address and accessing it that way). Your mileage may vary but the idea is the same, use E= to pass through an environment variable. The trick that took me so long is it got prepended with "REQUEST_" automatically... Then I modified the HttpAuthPlugin filter.py _check_password function to look at this variable as a fallback in case the headers weren't passed along properly. The full function became: def _check_password(self, req): header = req.get_header('Authorization') token = None if header: token = header.split()[1] if not token: # try the environment variables try: val = req.environ['REDIRECT_HTTP_AUTHORIZATION'] if val: token = val.split()[1] except KeyError: pass if token: user, passwd = b64decode(token).split(':', 1) if AccountManager(self.env).check_password(user, passwd): return user Hope this helps someone else as it was a really tough one to deal with. comment:15 Changed 6 years ago by anonymous Here is my filter.py _check_password method : def _check_password(self, req): val = req.environ['QUERY_STRING'] token = None if val: token = val.split()[1] if token: user, passwd = b64decode(token).split(':', 1) if AccountManager(self.env).check_password(user, passwd): return user And here is my apache configuration <IfModule alias_module> AliasMatch /trac/[/]+/chrome/common/(.*) "/home/trac/htdocs/$1" AliasMatch /trac/([/]+)/chrome/site/(.*) "/home/trac/$1/htdocs/$2" ScriptAlias /trac /home/trac/cgi-bin/trac.fcgi/ </IfModule> <Location /trac> SetEnv TRAC_ENV_PARENT_DIR "/home/trac/Prisme" RewriteEngine on RewriteCond %{HTTP:Authorization} Basic.* RewriteCond %{QUERY_STRING} !INTERNAL_AUTH=.* RewriteRule .*trac\.fcgi/(.*xmlrpc)$ $1?INTERNAL_AUTH=%{HTTP:Authorization}&%{QUERY_STRING} [L] </Location> <IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi FastCgiConfig -pass-header Authorization </IfModule> comment:16 Changed 4 years ago by anonymous Adding the following Apache configuration directive worked for me FcgidPassHeader AUTHORIZATION my mistake: /xmlrpc & /login/xmlrpc targets work. They both result in a login dialog. But, again, username & password aren't accepted.
https://trac-hacks.org/ticket/1169
CC-MAIN-2016-26
refinedweb
1,425
52.46
The following article discusses how one would achieve exporting a function from C#/VB.NET code to be used in native code (such as C/C++). I've seen a few methods around the internet about doing this, but most of them require you to tediously add things to your project to identify methods that will be exported, such as this. With that, these articles inspired this project which is an extension of the IL-compiler from one of my previous articles. As I previously mentioned, this article is built upon one of my previous articles (link above). This required the InlineILCompiler.exe tool from the previous article. The way this works is I have modified InlineILCompiler.exe to add a new directive which I called .exportnative. This directive marks methods so that the tool knows what to export.Here's how the magic works: Find out how many methods are being invoked. Once this is done, we add .vtfixup directives and .data directives for each function. With only one method being exported, here's a sample: .exportnative .vtfixup .data .vtfixup [1] int32 fromunmanaged at VT1 .data VT1 = int32(0) According to this, it's also important to note that the .corflags directive needs to be changed to 2. I haven't actually tested if it works without this, but as far as I could see, Delphi .NET uses this corflag as well when exporting functions so I assumed it was required. .corflags corflag .corflags 0x00000002 According to what I saw in Delphi.NET as well, a method must also apply a modopt() declaring a calling convention. I chose to always use stdcall as a standard. So, we end up with an exported method having the following definition: modopt() stdcall .method public hidebysig static void modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall) DllMain() cil managed Inside of that method, we need to declare the virtual table entry it is associated with as well as the export entry and name. .vtentry 1 : 1 .export [1] as DllMain This is done for every method being exported which is all handled automatically by InlineILCompiler.exe. Exporting a method is incredibly easy. I'm not going to provide any elaborate guides about marshalling between native code and managed code as I think you can find other articles which cover this fairly well. As a rule of thumb, your methods shouldn't return anything greater than 4 bytes (int), anything larger than that should be passed using a ref or out parameter. int ref out It's important to note that the name you use with .exportnative must be the same as the .NET function's name and that method must be static. static Here's an example of an exported function (C#): public struct Foo { public int A; public int B; public int C; } public static void CreateFoo(out Foo foo) { #if IL .exportnative CreateFoo #endif foo = new Foo(); foo.A = 22; foo.B = 44; foo.C = 55; } And now, here's using the code (C): #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <Windows.h> struct Foo_t { int32_t A; int32_t B; int32_t C; }; typedef void (__stdcall *LPFCREATEFOO)(struct Foo_t *foo); int main(void) { HMODULE mod; LPFCREATEFOO CreateFoo; struct Foo_t foo; mod = LoadLibraryA("ExportNativeTest.dll"); CreateFoo = (LPFCREATEFOO)GetProcAddress(mod, "CreateFoo"); CreateFoo(&foo); printf("%d %d %d\r\n", foo.A, foo.B, foo.C); return 0; } I find it kind of disappointing Microsoft has a standardized DllImport attribute but not a standardized a DllExport attribute and such hacks need to be developed to achieve it. I expected .NET 4.5 to have such an attribute, but alas it did not which was disappointing as it doesn't seem like they will be adding one anytime soon. I currently have not tested the limitations of using these natively exported methods, so if anyone would like to provide any feedback about bugs, etc., it would be greatly appreciated. I hope you enjoyed the article and learned something new or useful. DllImport DllEx.
http://www.codeproject.com/Articles/439223/Exporting-functions-in-Csharp-VB-NET-to-native-cod
CC-MAIN-2014-35
refinedweb
667
58.69
/)0)/#&')12/$*(#/"$$3$045678$9$$3$$:;<;=:;<< Journal of Global Affairs &$/8>47?4@ABC$+D@EF4 +4BE8GE6D5AHABC$%8B4>AI8 *47D5AD$DBI$EJ8$KAG8I$ $ L58@@ABC@$4M$&BDF>JN What is a global aair? As we all watched and perhaps participated in the protests across the Middle East, particularly Egypt, as well as the earthquake in Japan, we were experiencing global aairs. And these events, whose ongoing eects will be unfolding for many years, certainly took hold of the media and our imaginations. e Journal of Global Aairs is committed to providing a forum for discussions about these kinds of tremendous occurrences. In fact, this years Journal has a piece addressing the uprising in Egypt by NYU Assistant Professor Sinan Antoon whose research interests lie in pre-modern Arabo-Islamic culture as well as contemporary Arab culture and politics. is work is followed by responses from his students, in line with our dedication to providing students the opportunity to bring their thoughts out from classrooms into the wider community. As work in the classroom includes questioning such tremendous events, so too does it extend to many events and questions not as widely publicized. We are committed to providing a forum for these important discussions as well. We believe that the many workings of the world are worth investigating and understanding, so we seek to publish the best work that demonstrates the vastness of the possible answers to the question: What is a global aair? International aairs has long been a term used to describe an approach to understanding the world through historical and economic lenses. is is an incredibly valuable way to investigate the systems and trajectories that contribute to a currently observable position. is years journal has excellent examples of this method including, for example, a comparative exploration into the implementations of participative employee strategies across nations and an assessment of the benets of statelessness, temporal and geographical, in Somalia. In the word global, however, we hope to expand our scope to also include distinct but related approaches. ese unique perspectives include: looking at sociology and psychology to understand gender inequality across cultures; investigating the relationship between the culturally particular and the universal in narrative, memory and policy concerning genocide; and documenting ones experience of a place. ese are all, we believe, valid and fruitful ways to approach the world. In publishing works that expand possible ways of thinking about worldwide situations, we also hope to expand possible ways of documenting and eliciting such thinking. rough poetry, narrative and photography, the dynamics in question nd a deeper expressive power. As the world becomes more and more connected, the questions we nd ourselves asking have less to do with individual or even interacting nations and instead with more broad, global solutions. In particular, as the well-being of the globe itself becomes of increasing concern and we begin to realize our connection to it, questions regarding our responsibility will expand as well. In this years Journal, one author addresses the question of environmental refuges in this changing world. We expect in years to come, these questions and many more will demand further creative, curious and investigative study. We thank the contributors to this years Journal of Global Aairs and hope that they inspire you, as they inspire us, to continue asking: What is a global aair? Letter from the Editors Editor in Chief Sarah Zapiler Executive Editor Jenna King Brill Maggie Carter Laura Esposito Amanda Holpuch Managing Editors Colleen Veltd Associate Editors Creative Director Sarah Zapiler Mary McCullough 1 4 16 20 8 14 21 26 6 7 Singing for the Revolution Dr. Sinan Antoon Student Responses : Colleen Veldt and Mitchell Weaver A Decomposing Castro Patricia Guarch Wise Ambush Drew McKenzie Oppenheimer Danny Herman Gender Inequality Spanning Cultures rough Triabalization: Tribal Afghanistan and Tribal American Mormons Shana Oppenheim From Dirt to a Dream Olivia Jovine Essays on Consumerism in Asia Laura Esposito e Signs of Globalization Leigh Rome Religion, National Identity and Education in the Islamic World: A Look at Egypt, Turkey and Saudi Arabia Jenna King Brill Locura Emily Pederson Contextualizing Genocide Julia Burnell Peace and Quiet Emily Pederson Hugo Chvez, Chavismo and Rethinking Latin American Populism Darius Lerup 28 33 35 72 78 It Was Just a ought Andrew Boston e Unmarketed Economy Yasmin Ogale Dreams of Ascension Jamie Denburg Somalia and the Mixed Blessings of Anarchy Zachary Caceres Under the Inuence: Patterns of Dependency in Latin American Development Maggie Carter Identity Drew McKenzie La Bandera Ana Radolinski Protecting Rights and Promoting Development: Participative Management in Germany and Argentina Paz Petersson Appendicies Ekphrasis Drew McKenzie Chaos and Cosmos: Madidi Park, Bolivia William Roberts Eleuthera Emma Young Environmental Refugee Status: International Reception of Climate Displacement Jacqueline Hall Notes Bios 40 42 39 44 47 50 51 52 60 62 64 68 So was it Wikileaks, Facebook, or Twitter? Perhaps all three contributed to the revolutionary winds in the Arab world? is is one of the questions repeated ad nauseam by a great number of commentators and parroted by many in the United States and elsewhere in the civilized world. Others wonder if perhaps it was Obamas speech in Cairo or even the Bush doctrine (for Fox-infested minds and they are many). Yes, new technologies and social media denitely played a role and provided a new space and mode, but this discourse eliminates and erases the real agents of these revolutions: the women and men who are making history before our eyes. Members of our species have done that before, you know, before Bookface and Kleenex [Wikileaks] as Qadhdha calls them. In a very familiar gesture displaying the discursive cargo of colonial mentality, any positive phenomenon has to, somehow, be traced back to this or that white man (well, in Obamas case, its a black man, but his words are white). As if the inhabitants of the region didnt wasnt an inspiration as well. But why do I even have to expect the citizens of the civilized world to know about the strikes, riots, uprisings, intifadas and protests of previous decades. As if there wasnt a proud and potent revolutionary tradition and a collective memory crowded with symbols, martyrs, moments, poems and songs about freedom and justice. One of the rallying chants in Tunisia was a line from the Tunisian poet Abu l-Qasim al- Shabbi (1909-1934) If, one day, the people want life, fate must yield Every literate Arab knows this line by heart. ese new revolutions are spearheaded by a new generation and they already have their symbols and aesthetics. If Bouazizis self-immolation was the spark in Tunisia, the brutal beating to death of Khalid Said, a 28-year old man from Alexandria, at the hands of two undercover policemen back in June of 2010 angered many Egyptians and spurred Singing for the Revolution Dr. Sinan Antoon 1 Antoon| JGA is piece was originally published on Jan 31, 2011 as a blog post on Jadaliyya () under the same title. Antoon is a co-founder and co-editor of Jadaliyya, an independent ezine produced by a network of writers associated with the Arab Studies Journal. Antoon is an editor of the Arab Studies Journal as well as Banipal and Middle East Report. Antoon is a published poet, novelist and translator and is an assistant professor at NYUs Gallatin School for Individualized Study. demonstrations. A few days before the Day of Anger last week, Saids mother recorded a message that was posted on YouTube on January 23rd. She urged young Egyptians not to stay at home and to go out on January 25th and protest against injustice, emergency laws and torture and said she too would protest. Facebook has a number of pages for Khalid Said with clips and links, including one titled We are all Khalid Said. Two days ago, the great vernacular poet, Ahmad Fuad Nigm, was on al-Jazeera. He told the youth who had led the revolt: Egypt is cleansing herself through you. Nigm is one of those great symbols of resistance and opposition, not only for Egyptians, but Arabs. Hed been an outspoken critic of Mubarak and his regime and supported the various opposition movements that sprang in the last decade. In May of 2008, he recorded a YouTube message in support of a movement called Solidarity: Project Hope. A Message from e People's Poet, Ahmad Fuad Nigm" People of precious Egypt. Egypt is a bride, but it needs a groom. We all feel what were going through. I cant imagine that anyone is thinking alone. We all have the same thoughts and have one concern. I recently received a piece of paper from a group of youth. May God save them and multiply their numbers. It fascinated me that there are people who think this way. ey say that their project is called Solidarity: Project Hope. Lets all get together, brothers, and forget about those in power. We have nothing to do with them. Lets see why our country is drowning and how we can save it. What can we do? You will read the paper, of course, after these words. Whoever is in agreement, just give us your signature. Lets act to save our country. Our country is drowning. Do we want to look back and say: we wish what happened had never happened? No! Its still in our hands. ere are a lot of us. . . ere are many of us. . . who love Egypt. Lets see what we can do for Egypt. Lets put our hands together in solidarity. I dont know what this solidarity would look like? Like this? [clasps his hands] Lets stands in solidarity to save our country and save the future of our children. And to save ourselves as well! (May 2008) Nigm is one of the greatest vernacular Arab poets of the 20th century. I came across one of his books when I was still a teenager back in Baghdad. e title was Ishi ya Masr (Egypt, Wake Up!). A few years later, like so many across the Arab world and beyond, I listened to his lyrics sung by al-Shaykh Imam (1918-1995), the blind musician, with whom Nigm formed an immortal duo. eir songs spoke to the struggles of the poor and the downtrodden and celebrated the spirit of resistance to dictatorship and imperialism. Imam wouldve been leading with chants these days at al-Tahrir Square, but he isnt alive. His songs, however, are living and can be heard everywhere. e protestors in al-Tahrir Square are singing them as I write this. Imams comrade, Nigm, lived to see and take part in the revolution he wrote about for ve decades. So many of Nigm/Imams songs are memorable and apt these days, but the determination and resilience of Egyptians these past few days reminded me of Ana sh-Sha`b (I am the People): I am the People I am the people, marching, and I know my way My struggle is my weapon, my determination my friend I ght re will destroy Seas of dogs and prisons out of my way I am the people and the sun is a rose in my sleeve e days re horses galloping in my blood My children will defeat every oppressor Who can stand in my way? I am the people, marching, and I know my way Another of Imams immortal songs is Unadikum (I Call on You). e words belong to the Palestinian poet Tawq Zayyad (1929-1994) and the peoms title was that of Zayyads rst collection, published in Haifa in 1966. When one of the Egyptians protesting outside the Egyptian embassy was asked what he wanted to say to Egyptians back home, he recited this poem: I Call on You I call on you I clasp your hands I kiss the ground under your feet And I say: I oer my life for yours I give you the light of my eyes as a present and the warmth of my heart e tragedy I live is but my share of your tragedies I call on you I clasp your hands I was not humiliated in my homeland Nor was I diminished I stood up to my oppressors orphaned, nude, and barefoot I carried my blood in my palm I never lowered my ags I guarded the green grass over my ancestors graves I call on you I clasp your hands We all clasp your hands! 2 JGA | Singing for the Revolution 3 Student Responses to Singing for the Revolution Pioneers of Revolution in the Internet Age Colleen Veldt When I rst read through this article, I sympathized with Antoons premise that the West is not the gatekeeper of revolutions in the Arab world. To claim that this wind of change has blown into the Middle East directly from the West discredits the eorts of the revolutions participants and ignores the history and political climate of the region. Additionally, to say that Barack Obamas speech in Cairo or the Bush doctrine led to the Arab revolutions would also be a fallacy. However, Facebook and Twitter are not Obama and Bush. I feel as though Antoon is implying that these social networking websites and U.S. presidents are interchangeable because they are Western. is could not be further from the truth. Facebook and Twitter did play a role in the Arab revolutions, but that role was not inherently Western and does not in any way diminish what the people of these nations have been able to accomplish. Social networking cannot have an ethnicity because it is innately dependent on the individual user. is is a revolution of people who used social networking sites eectively, not a revolution brought on by Facebook. Employing the Internet to work for your cause is no small feat. In a world where everyone has a voice, what you say into that mouthpiece is a self-dening choice. e Arab revolutionaries deserve full credit for what they have accomplished politically and socially, and that includes giving credit for the compelling way tools like Facebook and Twitter were used to spread information, videos and inspiring words. Even more to their credit, they have been able to maximize this potential of connecting people to bring about incredible social change in a way that other young people in other areas have yet to do. impact and realness of what is actually going on. College students and young people are not only the future, but as the revolutionaries in the Arab world have proven they are also the present. It only makes sense to reach youth as well as others through the social networking sites that they have come to depend on. Using these sites to post videos about revolution has been the best way for revolutionaries to spread their message to peers and sympathizers quickly, as well as an eective way to catch the attention of young people in other countries. rough these videos and Internet advocacy, we have been witness to a constant stream of information via social networking sites as well as the social media of news networks. In a way, the coverage of these protests and revolutions has been comparable to the revolution that took place in the United States during the Vietnam War. Like the television war, these protests are being brought to us through the outlet that we use for our news information. Unlike the television war, however, these images, posts and videos are being brought to us instantaneously. is is the rst revolutionary event in history that is being digitized and spread through outlets and mediums such as Twitter, demonstrating how closely the world is connected. Newscasters are now Tweeting about their experiences in the foreign countries and posting their footage on various social media sites. ough the instantaneous spread of information is amazing, we cannot ignore the problematic side eects it comes with. Desensitization comes as a result of being tuned into social media literally almost all day. Yes, we are all aware of what is going on; we are plugged in and knowledgeable about the events taking place around the world, unless we are making an eort not to use the tools available to us. But except for those revolutionaries in the Middle East, we are not doing much about it (unlike the wide-eyed American youth of the 1960s and 70s). We have yet to experience the extent to which this desensitization will aect world events. American youth see images of the destruction taking place around the world, but we go on living our lives. We click out of that web page. We do not take the time to understand the origins or results of revolutions, we do not feel for the eort and sacrice of the people whose faces we see on CNNs news feed. It is amazing that we can be plugged in and seemingly know exactly what is going on and what is happening across the globe, but it is sad that we treat it like a television show; it is over when we turn if o. e credits roll, and we go on to the next big thing. e Double Edged Sword of Social Media Mitchell Weaver Like many aspects of our lives that social media has had an eect on, when it comes to broadcasting the news and current events social media is a revolution into a new way of being informed, but it is also a desensitizer that weakens the Veldt and Weaver | JGA When Fidel Castro dies, when he really dies, when his esh and bones once lled with promise for the people on the 42,000 mile island south of the United States, and east of Mexico, in the Caribbean north of Jamaica and south of the Bahamas are decaying and decomposing and turning to dust, eaten by bugs, by maggots and worms Miami will be a party. Cubans dance to salsa music and shake their curvy Cuban butts that dont t in the straight cut jeans made for American girls. Cubans eat bistec empanizado and croquetas and empanadas and platanos and an and tres leches and drink cortaditos and coladas and mojitos. Cubans talk so fast it sounds like theyre singing; less clean than Colombians, cleaner than Puerto Ricans. ey forget the letter s, switch ch for sh, and sometimes leave out syllables. ey do all this in Miami. When Castro dies, when hes buried far, far in the ground, Miami will see a celebration like theyve never seen. Like eighty Super Bowls or like two hundred Fourths of July or like twenty Macys Day Parades. For the past decade at the tiniest rumor, or lie or misunderstanding or exaggeration or word or indication that it could be true, Calle Ocho, home to hookers and home-made food, is ooded with Miami- Cubans. e exiles. ey wear ag beaded necklaces and painted faces and have boom boxes blaring Celia Cruz and booties shaking and mojitos and rum and Cokes owing. ere have been rumors regarding his death since 2006; ve years and several false alarms later, the plans are in place for the real party. When Castro dies, his blood is drained from his corpse and pumped full of embalming uid. He is buried with a face full of makeup to make him look like he is alive. ey ll him with formaldehyde to disinfect him, keep him from spreading any more disease, and keep the proteins in his skin from swelling and blistering in decomposition. We consider this part of the grieving process. e prisoners of Cuba will probably have to pretend to pay their respects until he is safely underground, but in Miami they will publicly and promptly celebrate post-burial, his decay of gure and corpse. When Castro dies, my best friends parents, Lili and Julio, will be in the same room. eyre always in the same room. ey are both exiles. Julio is a judge and Lili makes the best Cuban food in Coral Gables. Once, the pressure A Decomposing Castro Patricia Guarch Wise cooker exploded and formed a geyser in her kitchen so black and full it looked like smoke and she had to clean black beans o the ceiling crying. Lili will be pronouncing ships as chips and chips as ships and Julio will be telling her what he wants for dinner like a good Cuban man. Lili will call her three kids, Carlos, Katia and Lisa, the angels of her world, the focus of her Cuban mother neurosis, worse than Jewish mother neurosis, and shriek to them in Spanish to go to Calle Ocho. No matter how important it is, how life changing, how historic, she will tell them to be careful and ask whos driving and tell her cuchitas her preciosas her entire vida to be careful. Because theres already one important person in her life dead that day. When Castro croaks, when hes crumbling in the ground, when he couldnt recover from another heart attack or whatever, my brother, Jorge, will be thanking Buddha. He gave up on Catholicism or Christianity about two years into his thirteen year Catholic education, but he prays everyday for Castro to die before his graduation so that he can have days o of school. His Jesuit school is run by a priest who cant speak English and an administration of only Spanish speakers and lled with enough rst generation students to be in a Columbia University textbook as a case study of a school with disproportionate success rates for immigrants compared to the rest of the country. ey take Latin American History as a mandatory class junior year, and the school anthem is in Spanish. e mascot is the Wolverine. e founders of the school, who brought it over from Cuba, wanted it to be the little wolves but they didnt know how to translate it from Spanish to English properly and thought it was wolverine. At the games they cheer in Spanish bombo chia chia chia, and theyre better at baseball than football. When Castro is dead Jorge will have at least a week o of school while they wait for their world to settle, and hell hang on the beach or have an excuse to play a weeks worth of Rock Band. When Castro dies, when the bacteria that was eating the food in his intestines starts eating the intestines from inside his con, my father and mother will be the most Cuban they have ever been. My mom will probably be sitting at home watching Law and Order, maybe SVU. We used to 4 JGA | A Decomposing Castro have TiVo and OnDemand and all that good stu until someone told my dad that they could hook him up with a stolen cable box so he wouldnt have to pay for cable. ey installed them in every TV in the house and now theres no guide or menu or TiVo or OnDemand, and channels have started to disappear. Its more primitive than basic cable. No matter how many channels disappear, theres always Law and Order. A ticker tape announcing the breaking news will run across the bottom of the screen the same way it did when Princess Diana died. When Princess Diana died, I kept watching Family Matters; when Castro dies, everyone will get up. My dad will call her and the house phone will ring. e one next to the couch has a broken battery so she has to walk all the way to the kitchen. Hell tell her hes picking her up to go to Versailles, the Mecca of the Cuban community, a restaurant and bakery that takes up a full block of Calle Ocho. ey will discuss how bad the parking will be and hell pick her up to go pretend to be Cuban. He was once called a Cubano arrepentido, or a man ashamed of being Cuban. He said he would be Cuban the day that Castro died. is is his big day. When Castro dies, and the graveyard shift doesnt hear a bell ring, the Miami-Cubans can start to visit. Mami is Panamanian, but we eat our take-out from Versailles, and shes been in Miami for forty-three years. She wants my brother and I to go to Cuba so we can understand what weve heard about forever, about the families on the island who owned all the juice or coee or fabric or paper. ese are things American children dont understand ownership. An island owned by families. But weve seen it in Panama; how they close the jewelry stores when my grandfather walks in, how the maids at the hotel know his name. But, no one else gets to see it because Cuba has been closed; not my boyfriend or his mom or my college roommate or her dad. When Castro keels over, his body will attract death ies and houseies and blowies and they will start to eat his esh, and the parking lot at Versailles will be full. e Cuban restaurant and cultural hub of dominoes and conversations of coup dtats, is decorated like a French palace and lled with reporters from CNN, MSNBC, FOX, NBC, ABC, CBS, CW and, of course, Univision and Telemundo. eyve rented out parking spaces for the vans of the major news outlets years before. My boyfriends mom, a Spanish news anchor for Univision, who was friends with Gloria Estefan in high school, will be there interviewing my college roommate, Alex. Alex is Princess Versailles; her father inherited the restaurant from his father. Alex used to be a fat girl from eating too many pastelitos and medianoches, but she got skinny and now she wears spandex. No matter how skinny she gets, she cant get rid of her curves. Alex will be wearing a tight Dolce and Gabbana dress. ey are Miami pseudo-celebrities celebrating together with the rest. When Castro dies, gases including hydrogen sulde, methane, cadaverine and putrescine will be released by the bacteria and omit putrid smelling liquids. Tata is in her bata de casa, her house robe. She is wearing the everyday garb of a Cuban grandmother, even though she isnt my Cuban grandmother. I dont have a Cuban grandmother, but I have Tata, my cousins Cuban grandmother. Tata will probably be putting water in her husband Tutos whiskey and giving it to him while he smokes Marlboro Reds in the garage, in his house across the street from Julio and Lilis house. Tata has been waiting for Castro to die for my entire lifetime. She left and rebuilt and re-conquered and lives in a two-story house from which shell celebrate her dictator dying with her husband of fty-four years. When Castro dies, though no one knows when exactly that will be, no one will know what to do. Lili and Julio will worry about their kids drinking too much at Versailles, and Lisa, Katia and Carlos probably will drink too much. Jorge will drive to Best Buy and stock up on video games for the next week so that he can keep busy while his schools administration recovers. When they start school again, the boys will come back in their navy blue and white uniforms, and the teachers will continue to threaten them by yelling Spanish profanities at them. My mom will still sit in her living room in Coral Gables, Florida, with no aspiration to move to Oriente, Cuba and soon an episode of Law and Order will pop up that is based on a shooting, or scandal, or some other semi-ctional spin o of some event that happened as a result of this huge political change, so close to America, and Miami and New York, which will most certainly cause enough controversy to have an episode based o of it. If Anna Nicole Smith did it, Castro can too. My Dad will feel no more Cuban because he is dead. Its possible that he will feel less Cuban, that his connection was to the culture that was a result of this man, to the croquetas that he can pick up at a cafesito window before work and not to the island; the translation of the exile culture to America, not really the culture itself. Well go visit. Americans will visit. If the borders open, when the borders open, theyll go the way they do now. eyll say, Oh, mercy me, just look at all the old cars. Its just like being in the fties. Isnt it so cute dear? But the Versailles celebrators will know that the Cadillac with parts from the 1950s and the record players are sad. And the tourists will snap pictures and perhaps pledge to preserve the history, to keep it so cute, but anyone from Versailles will not. Because the only reason Cuba is aesthetically so cute is because its communist. ey will surely celebrate at Versailles, but after that they will wait. ey will probably want to go back, but they wont, not right away. Because after Fidel Castro is dead, when his body is made-up and pumped and gassed and crumbling, there is still another Castro. 5 Guarch Wise | JGA Having just drank a Turkish coee, I walked down a wide street with commercial storefronts and trolley cars. Much like in SoHo, the streets were crowded with unaware tourists and unenthusiastic locals, everyone together but alone. Without warning, clapping and whistling began to grow all around me. e monotony of street life was drowned out by the beat of hands clapping and whistles that had been distributed. e abrupt awakening transformed into a parade, where pink balloons appeared by the thousands. A large number of balloons were being marched down the block, while thousands more were released from rooftops onto the crowd below. e whistles and clapping had mutated into piercing bangs as the crowd stomped and popped the pink balloons that now came up to their waists. e public was amazed by the delightful ambush. Children wildly popped the balloons while music played. It was like a serene war zone. e group responsible for the surprise parade was a young organization attempting to elevate public happiness and well-being in Istanbul. Within twenty minutes, street sweepers had removed all the deated balloons shards, the whistling had ceased and the event had passed. Ambush Drew McKenzie Oppenheimer e atom will yield its secrets to you the kaleidoscope of ssion under blue eyes. Rooms of ne modern art empty like Nagasaki, what do we all see in photographs? Desolation they became caves of echoes centuries old. Tears echoing forward through childhood photographs and photographs of you in New Mexico. And photographs. But what do these say about you in ponderance of destruction and death? You who loved the basin and range of deserts, you as natures antithesisyour brain was a wave that cleared the moss of the rock, it hit so hard. How can photographs iterate the wiring of your psyche? e unwiring of thousands of psyches, lives, eyes. Destroyer of worlds, the snipping of the wiring in a bright death. Danny Herman 7 Gender Inequality Spanning Cultures rough Tribalization: Tribal Afghanistan & Tribal American Mormons Shana Oppenheim 8 JGA | Tribalization When it comes to gender inequality, the American public ranks the Muslim World at the bottom of the list, but at the top of their priorities. From a gender education gap of nearly zero percent between men and women in Iran (incidentally the same as the U.S.s gender gap in higher education) to women in Pakistan needing a 73 percent increase in womens education to equal that of men, there is a vast range of both gender equality and the perceptions of gender equality in the Muslim World. 1 A fundamental question exists: What is causing dierent levels of gender equality between Muslim nations, when majorities in many Muslim countries believe women should enjoy the same fundamental rights as men? 2 is paper will compare Tribal Afghanistan to Tribal Mormonism in America on the topic of gender inequality in relation to the theory of tribalization. i It will consider the interaction between modern states and tribes as a primary causal mechanism in the process of tribalization, and it will make the conclusion that tribalization causes gender inequality. e rst section of this paper will look at the evolution of human society as a sociological justication for the theory that tribalization is the primary cause of gender inequality. e second section will compare the case studies of tribal Afghanistan with that of tribal Mormons in America to assess the validity of state and tribe interactions in tribalization theory as the causal factor in gender inequality in societies that t the model. If the theory of tribalization holds true, this paper will show that the conict between the purest form of social grouping, the tribe, and the evolving forms of society, the state, created a psychological group eect called tribalization which resulted in a shift from what was essentially an egalitarian society to a gender repressive society. i Tribalization is dened by Whitehead (1993) as existing in situations where state form or expand, that this process is resisted by some sections of an ethnic group and not by others, and that the resistant groups then go on to become (or remain) tribal, at the periphery of the state. eory Tribalization, as used in this paper, is a combination of sociological developmental theories and the psychological eects of group consciousness that are brought about by contact between the state and the tribe. e psychological process of group consciousness radicalization that occurs in the conict between the tribe and the state is tribalization. e stages of social development, although they vary according from author to author, are generally separated into four stages. Although these stages are inherently awed because of imperfections in demarcation as well as the lack of homogeneity among the groupings, 3 dening the tribe and the state coherently from a historical basis will later help in comparing this papers case studies. e rst of these stages, called bands, is the earliest of human grouping comprised of anywhere from ve to eight people who, as a rule, are extended relatives. 4-5 Bands exist where there are not enough dense local resources to permit many people to live together. Labeled the original egalitarian society by many social theorists, bands do not contain the formal social stratication of leadership or a monopoly of decision-making power. At the most basic unit of social organization, then, gender inequality is an almost zero-sum situation .6-8 In terms of gender equality models, the band is the theoretical ideal that can never be recreated in modern societies. e next tier up the social evolutionary ladder is the tribe. In historical terms, tribes began to emerge around 13,000 years ago in the Fertile Crescent. A tribe consists of 100 to 200 members that have moved beyond the extended family structure of the band to a slightly more formalized clan-based relationship. Generally they have a settled location and more than one formally recognized kin group. In a tribe, land and other possessions belong to particular clans and not to the whole tribe. 9-11 Early tribes were egalitarian to an extent. It is important to note that women were not inherently at a disadvantage or repressed. Tribes usually had a merit based leadership position or council, although the position of leader was codied. 12 e modern tribes in this papers case studies most closely resemble 9 Oppenheim | JGA ancient tribes with a big man as the leader. Around 5,000 BC in the Fertile Crescent, chiefdoms, the next stage of social development between tribes and states, began to emerge. Chiefdoms consisted of several thousand to several tens of thousands of people who were most notably not related. e massive gap in size between the populations of a tribe and a cheifdom caused a problem where strangers fell under the same authority. e solution was the development of a Chief, who exercised a monopoly on authority, and had the right to use force and information to control the population. 13 States began to appear in Mesopotamia about 2,000 years after chiefdoms rst arose. From around 3,000 BC until just over 1,000 years ago in West Africa, states evolved from chiefdoms to become the largest and most modern form of society. 14-16 States evolved from chiefdoms but consisted of far larger populations. Information was conned to an elite few, and control was centralized and monopolized. Extreme economic specialization became the norm, and a multi- layered bureaucracy arose as a necessity in order to maintain control over a much larger population. e state was, fundamentally, dierent from all earlier forms of society in that it was organized on political and territorial lines instead of kinship lines. 17-20 In terms of gender inequality, the early state saw some of the largest gaps between the social status of men and women. In the U.S. it took 144 years for women to get the vote. In 1776 Abigail Adams famously pleaded in her letters to John Adams, I desire you would remember the ladies and be more generous and favorable to them than your ancestors. Do not put such unlimited power in the hands of Husbands. 21 Today, women are still paid on average 77 cents to every dollar that men earn. 22 Yet through the mechanism of democracy, which is only possible through the state structure, women have earned the same rights as men. While some of the originally egalitarian tribes have maintained a near-equal status for men and women, other modern tribes have become some of the most unequal societies in the world. e tribe and the state are polar opposites in terms of human organizational structures. It then follows logically that conict would arise between these two frameworks when they co-exist within the same societal boundaries. 23-25 In general there are two theories on how and why tribes are formed when they come in contact with a state. e rst is that warfare is the primary force of tribal formation. e argument goes that modern tribes are a reaction to state intervention, particularly colonial state intervention, into societies that would have naturally evolved from band to state of their own volition with far fewer tribal outliers. 26 e second theory argues that intensifying contact between various autonomous kin groups is the primary force for tribal formation. is theory of tribal formation is more grounded evolutionarily and is a realistic look at how society progresses. But the tribes that experience tribalization are those that form either from within the state in resistance to it or those that are already in existence and reinforced by state force. us for the purposes of this paper, the theory of conict in modern tribal formations is more accurate. It is important to keep in mind that not all tribes are formed through conict with the state, nor are all tribes unable to reconcile their tribal identity with that of the state. 27 Psychologically a society denes itself by two broad categories: internal and external. Essentially the individual must be aware that (s)he belongs to a group. Once the member is aware that (s)he belongs, then (s)he evaluates this membership and places some sort of value connotation on participating. Finally, the individual member associates an emotional utility with belonging to the group. is is bolstered by the external processes labeling them as part of this group. An outside consensus that the group exists is critical to psychologically belong to a coterie. 28 , 29 e formation of group identity has often been compared to the cognitive process of stereotyping. 30-37 Members of a group stereotype not only their adversaries or the outside world, but also themselves. Members of both tribes and states, and indeed of any type of social group, form an identity for themselves that they then are able to tie to their membership. at membership psychologically oversimplies themselves and the opposition in a process similar to that of stereotyping, which reinforces the group membership. 38-45 Out of this mindset, women within the group begin to be dened by traditional, and thus subservient, roles. Additionally, the tribe has an incentive to portray the women of the out-group in a negative light (as they are portraying everything of the out-group in a negative light in order to codify their own in-group status). In contrast to the modern state, where there is greater gender equality, the modern tribe takes the opposite view point and begins to justify the repression of women. ere are two schools of thought regarding how out- group members are stereotyped and in turn stereotype other groups: based on individuals non-typical or typical to the group. e rst, supported by the works of Rothbart et al. in their article From Individual to Group Impressions: Availability Heuristics in Stereotype Formation, holds that out-group members can identify groups negatively by the actions of a few individuals, thus reinforcing in-group stereotyping and membership. 46 e second school of thought holds that groups can only be stereotyped (by the out-group) by the actions of their individual members if those individual members are typical of the group, thus reinforcing the process of group psychology. In the book, Intergroup Relations: Essential Readings, authors Michale A. Hogg and Dominic Abrams make this case based on works by Johnston and Hewstone. 47 In cases of realistic contact between in and out-group members, typical members of both groups are associated 10 JGA | Tribalization with negative attributes to the detriment of their interaction. In both of these arguments it is clear that psychological group formation occurs because of how individuals are perceived when their group interacts with other societal formations. Where there is contact with an outside, opposing or dierent group, there tends to be the development of a more positive self-view and a more negative view of others. e stereotyping goes both ways and is reinforced by contact with individuals of the group, whether typical or atypical. 48-50 Conicts over status, or other scarce resources, often precipitates a greater psychological group eect. Scarce resources can refer to land or food in less economically developed situations or to non-material resources of rank, status and prestige. When the norms of the social situation encourage and legitimize this competition, there is more of a tendency to express in-group preference. 51 When there is already a basis for competition over the scarce resources of status and physical gains between the in-group and the out- group, there is more incentive for tribe members, already stereotyping their women as the opposite of modern state women, to decrease the status of women in order to eliminate some of the competition for limited resources such as status and jobs. Tribalization is the extreme of these in-group preferences. It is the general contact with an out-group that provokes an inward spiral of group psychology in the individual members, and a disinclination to assimilate into a larger group. It is a perfect storm of stereotyping which leads to adverse reaction against the modern gender equality among the sexes present in the state as well as stereotyping of intra-group demarcations, most notably that of women into traditional roles. It leads to conict over scarce resources (both the material and non-material) which result in women competing with men over status and jobs in a climate already predisposed by stereotyping to justify gender inequality. Tribalization leads directly to the repression of women. Experiment & Methodology To test whether tribalization is the causal factor in gender inequality in modern tribal societies, this paper compares two case studies from two dierent models of states and two dierent cultures to avoid the culture bias claim. For the test case of Tribal Mormons in the U.S., this paper will look at the town of Colorado City/Hildale (which for the purposes of this paper will be referred to as Colorado City) spanning the Arizona/Utah border. e towns contain a combined population of about 5,000 people, almost all of who are members of the Fundamentalist Church of the Latter Day Saints. 52-53 e second test case is the Ghilzai Pashtun Tribe in Afghanistan. A historically tribal group, the Ghilzai are part of the ethnic ruling Pashtun Tribe but part of the nomadic poorer subset that is concentrated mainly in the south and east of Afghanistan. 54-56 Since it is dicult to nd data on this nomadic tribe, a group that often distrusts outsiders, this paper will concentrate on the data that does exist on the four provinces that have the highest concentration of Ghilzai: the Paktika, Zabul, Ghazani and Paktya provinces. 57-58 e application of the theory of tribalization as the causal factor in gender inequality makes two assumptions. First, the modern tribe must be in interaction with a state, whether on the borders of an undened state (as in Afghanistan and the Federally Administered Tribal lands that fall between Pakistans western and Afghanistans southeastern borders) or inside of a clearly dened state (as in the case of Tribal Mormons living in the U.S., although the argument can be made that their extended tribal ties stretch to communities across parts of Mexico and Canada). ii Second, this modern tribe must be in the process of resisting the state inuence, not integrating as in the studies of West Indian and Asian children in Britain done by Mullin (1980) as well as Davey and Norburn (1980). is resistance, which this paper classies as tribalization, is the causal factor in gender inequality in cases that t this model. e independent variable in this study is whether or nor the two case studies t within these two assumptions: interaction with a state and tribalization. is can be measured by looking at the history and sociological make- up of the two case studies. e dependant variable is the presence of severe and measurable gender inequality. is can be measured from the limited data available on these two societies and how they treat their women. Specic indicators of this inequality fall under the two categories of education level and marriage age. e history of the mainstream Mormon Church is one of a separatist society trying to ee the state in order to preserve its way of life but eventually succumbing to the pressure to integrate. 59 Whitehead (1993) gave three options for tribal societies coming into contact with the State: assimilation, destruction or tribalization. 60 e Colorado City Mormon Tribe belongs to e Fundamentalist Church of the Latter Day Saints (FLDS) which broke o from the mainstream Church of the Latter Day Saints primarily over the issue of polygamy. Mainstream Mormons deny that Joseph Smith, the founder of Mormonism, practiced polygamy and was married to at least 33 women and probably as many as 48. Polygamy was one of the sacred credos of the early Mormon Church, canonized as Section 132 of e Doctrine and Covenants, one of the three holy books of the Mormon faith. 61 ii An estimated 30,000 to 100,000 members of the Fundamentalist Church of the Latter Day Saints polygamists live in a swath from Canad down to Mexico. Since 1830 more than two hundred schismatic sects of Mormons have slit o from the main church (Krakauer, 2003, p. 6). 11 Oppenheim | JGA After Smith was murdered by an Illinois mob in 1844, Brigham Young became the leader of the Church and led the Saints to what would become Utah, where they established a colony that embraced polygamy. 62 e persecution of early Mormon society continued with the Utah War in 1857, when President James Buchanan sent the U.S. army to invade Utah to put a stop to polygamy. e war was unsuccessful, but in 1887 the Edmuns-Tucker Act was introduced which would disincorporate the Mormon Church and forfeit their property, worth more than $50,000, to the Federal Government if they did not renounce polygamy. 63 In his book Under the Banner of Heaven Jon Kraukuer dened the choice they faced: Mormon Fundamentalists...believed that acceptance into the American mainstream came at way too high a price. ey contend that the Mormon leaders made an unforgivable compromise by capitulation to the U.S. government on polygamy over a century ago. ey insist that the Church sold them out -- that the LDS leadership abandoned one of the religions most crucial theological tenants for the sake of political expedience. 64 e early Mormon Church faced a dilemma: assimilate, be destroyed or tribalize. Mainstream Mormonism assimilated, while the Mormon fundamentalist groups (including the FLDS church) tribalized. Colorado City is home to a FLDS tribe that split from the main LDS church in the 1920s. A few dozen families left the LSD church and set up a community in a back country stretch of the Arizona strip that is cut o from the rest of the state by the 277-mile-long Grand Canyon. It ercely resists the inuences of the state, demonizing the outside world and defying one of the U.S.s most basic creeds by practicing polygamy. Residents of Colorado City are forbidden to watch television, read newspapers or have contact with people outside of Colorado City including family members who have left the Church. Krakauer articulates their situation: ey live in this patch of desert in the hope of being left alone to follow the sacred principle of plural marriage without interference from government authorities or the LDS Church. 65 e United Eort Plan, the business name of the FLDS, owns all of the church assets and all of the land in the town under the direction of Uncle Rulon, the prophet and leader of the society and the governing board of all male Church elders. 66 Uncle Rulon has married at least 75 women and fathered more then 65 children. Some of his wives were given to him when they were 13 or 14 by their fathers. All of the public ocials in the town are FLDS members. Every city employee, the superintendent of the school and the police force answer solely to Uncle Rulon, eectively cutting the town o from outside inuence. 67 Sam Roundy, Colorado Citys police chief asserted, What goes on in our homes here is nobodys business. 68 Colorado City is a modern tribal society that has gone through the process of tribalization in its interaction with the state. It has physically and mentally isolated itself from mainstream society by cutting o contact and outing its laws against polygamy. It has a history whereby the choice between assimilation, destruction and tribalization plays a large part in its societal myth. ere is a documented pattern of abuse in Colorado City. Frequently married early and against their will, it is not uncommon for women, girls in truth, to be raped by their fathers or brothers at an early age before being given to an elder of the city as a wife. 69 e son of Mayor Barlow of Colorado City molested ve of his daughters over a period of ten years. Charges were never brought against him in the closed society of the tribe. Ruth (only rst names are given to protect identities), the wife of a Colorado City police ocer, was given to him when she was 16 years old. She was one of the few women that managed to escape and press charges. But the community rallied around her husband, and when it came time to bring him to court, Ruth backed down under the pressure of her tribe. 70 Stories like those of Ruth and the granddaughters of Mayor Barlow are far too common in Colorado City. On May 3, 1987 Ruby was born in Colorado City. She was 14 when she was discovered kissing a boy she liked. For this she was forced to wed an older man and was raped so brutally that she spent her wedding night hemorrhaging blood. She ed to her brothers house, but in May of 2001, she was allegedly abducted by members of the FLDS Church and brought to her stepfathers house, the second councilor to the prophet of Colorado City. At 16 Ruby gave birth to a child, and since the summer of 2001, nobody outside of Colorado City has heard from her. In the view of anti-polygamy activist Lorna Craig: Ruby Jessop was born into a polygamous community that has been allowed to break state and federal laws with impunity for many decades.... because the mayor, the police, and the judge in Colorado City- Hildale are themselves polygamists who are absolutely obedient to the prophet, there is nowhere for victims of abuse to turn... I would say that teaching a girl that her salvation depends on her having sexual relations with a married man is inherently destructive... a crime, not a religion. 71 12 JGA | Tribalization e stories of abuse in Colorado City are indicators of extreme abuse, but on a day-to-day basis there is also more subtle gender inequality. In Colorado City the percentage of women with a bachelors degree is an average of seven percent compared to the national average of 24.4 percent. 72 is could be attributed to state averages. Both Arizona and Utah have high Mormon populations. According to the Association of Religion Data Archive, Utah is ranked rst for the most mainstream LDS congregations while Arizona is ranked fourth. 73 e estimated total percentage of FLDS members in Utah as of 2003 is around 1.126 percent. So FLDS members make up a statistically insignicant percent of the total population of Utah, and according to the Association of Religion Data Archive, Utahs percentage of those above 25 who are college educated is 27.9 percent, well above both the level of Colorado City and the national average. 74-75 It is evident that Colorado City has a much lower than usual rate of higher education among the whole population and especially among women. e second measure of gender inequality falls under the broad category of marriage. ere is no data on the age of marriage for women in polygamous unions in Colorado City and state-wide. e mean ages for these marriages are not calculated because of the illegality of the unions. is paper substitutes the average household size in Colorado City as a possible indicator for large families and evidence of the early polygamous unions Krakauer shows are occurring. In Colorado City the average household size is 7.81. 76 When compared to the average household sizes of 3.14 for Utah, 2.59 for Arizona and a national average of 1.7, it is clear that the households in Colorado City contain a far higher number of residents. 77-78 is suggests higher birthrates over the long term, which may lead to fewer educational opportunities for women. So for the case study of Mormon Fundamentalists in the U.S., it is clear that tribalization is a causal factor in gender inequality and even abuse. However, the eect could be argued to be produced by the unique tribal situation or the impact of an individual culture. To counter this argument, the next case study is set in tribal Afghanistan. Afghanistan has been characterized by many as a peasant-tribal society. 79 Only 12 percent of Afghanistans land is arable, and less than a quarter of that can hold a permanent crop. Given the geographic and climate realities of this region, population dispersion is naturally preferred over centralization. Anthropologically there are two typical types of settlement patterns: the nuclear clusters around villages or the linear settlements along waterways and other vital routes such as roads. Afghanistans population is distributed in the nuclear pattern. e population is clustered around the cultivated pockets of Kabul, Kandahar, Mazar-i Sharif and Herat. 80 is anthropological climate allows easier formation of isolated tribes on the edges of the societies that defy the highly centralized government. e stage is set for the formation of tribes. Afghanistan is a heterogeneous country with 21 dierent identied ethnicities. e Tajik, Uzbek and Turkomen ethnic groups straddle the borders of their respective homelands north of the Hindu Kush Mountains that bisect the country from east to west. e Hazaras and some of the smaller ethnic groups have settled into the valleys of those mountains. e tribe that is the case study for this comparison is the Pashtun tribe, mostly located south of the Hindu Kush Mountains. 81 e Pashtun represent the largest tribal entity in Afghanistan, and within it the Ghilzai federation of Pashtun has the strongest tribal institutions. Ideally a Pashtun tribe features egalitarian, democratic decision making through jirgah councils. 82 e four provinces that contain the greatest population of the Ghilzai federation of Pashtun are Paktika, Zabul, Ghazani and Paktya. 83 , 84 e Ghilzai Pashtun are a good case study because they are not of the dominant Tajik ethnicity that rules in Kabul, but they are part of the Pashtun ethnicity that composes most of Kandahar, one of the most secessionist and anti-state provinces in the country. 85 Most political scientists agree that modern Afghanistan is composed of two types of societies: modern, those that are clustered around city centers, and tribal, those that are spread through the rest of the country. Where experts disagree is on the role that tribes play in the overall society. Bernt Glatzer (2008) argues that economics and close kinship overshadow the role of the tribal system while Kenneth Christie (2008) argues that common kinship, language, self-suciency and mythology create a stronger tribe that is better able to resist state inuences. Christies tribe is also dened as having a high degree of internal conformity and little tolerance for outsiders. 86 Both, however, agree that tribes in Afghanistan have been encouraged by the modern history of a weak state and the inuence of foreign state apparatus. 87 Whereas the FLDS members reacted against a state already in place and tribalized based on a history as a separate community, the Ghilzai federation of Pashtun have been in and out of control of Afghanistan for centuries, competing with the Durrani Pashtun and other groups for Oppenheim | JGA dominance. 88 Having established that both case studies fulll the independent variable criteria of interacting with the state and tribalization, we can now examine the dependant variable. Since 1959 growing numbers of women in Afghanistan, mostly from urban backgrounds, have been joining the public arena, participating in politics and working. Gender reform was rst ocially introduced in the 1964 Constitution, which enfranchised women and guaranteed them the right to education and work. Although statistics showed by 1978 that women were joining the workforce, only about eight percent of the female population of Afghanistan received an income. Under the Taliban, a mostly rural Pashtun group, conservative mujahidin leaders repealed the gains made by women up until that point. 89 Following the Taiban, major strides have been made in improving womens rights including the passage of the Constitution of the Islamic Republic of Afghanistan in 2004. Under the second chapter of the new constitution, Article 22 states that the citizens of Afghanistan - whether women or men - have equal rights and duties before the law. 90 A recent Environics survey showed that a majority of Afghans believed that the situation of women in their country had improved dramatically since the Taliban was deposed. 75 percent of women in Kandahar, the mainly Pashtun (but not Ghilzai Pashtun) province, believe that they are better o today than they were under the Taliban. 91 Although the overall situation in Afghanistan for womens rights is still deplorable, the situation within the four provinces inhabited by the Ghilzai Pashtun are worse. e Paktika, Zabul, Ghazani and Paktya provinces that contain the largest percentage of Ghilzai Pashtun (although it is dicult to count them because of their nomadic nature) are ranked 20th, 21st, 14th and 10th respectively out of the 32 key provinces in Afghanistan for womens rights. In Paktika and Zabul provinces, 5.7 percent and 1.4 percent of girls, respectively, attend primary school as compared to the national average of 63 percent. In Paktya, Ghazani and Zabul the female literacy rate is three, nine and ve percent, respectively, as compared to a sub-par national rating of 29 percent. 92 Although gender equality in Afghanistan is among the worst in the world, within the country the regions which the Ghilzai Pashtun inhabit have some of the worst records. A history of traditional tribalism, exacerbated by multiple instances of state interference, has caused extreme tribalization in this region and the results can be seen in the horric record for gender equality. Findings and Limitations At the start of this paper, I posited that tribalization is the causal factor in gender inequality in instances that t the model. In order to t the model, the society in question must have undergone a process of tribalization when it came in contact with a state. Qualitatively, both the FLDS community of Colorado City and the four provinces inhabited by the Tribal Ghilzai Pashtun t the required model of having undergone tribalization. However, this tribalization occurred in two dierent manners. Colorado City separated from within a state apparatus when they faced the choices of assimilation, destruction or tribalization. e Ghilzai Pashtun have been a formalized tribal society for centuries and have sometimes formed the coalition necessary to control the region. In their current iteration, they are a ercely nomadic tribal society that has undergone repeated contact with states, both internal and external, and radicalized as a result. Additionally, both cases showed extreme instances of gender inequality satisfying both the independent and dependant variables necessary to validate the theory. Although this author is condent in the causal logic this paper takes, the data to prove the theory beyond a shadow of a doubt does not yet exist. To quantitatively prove the theory of tribalization as causing gender inequality, statistics would be needed on the long term eects of tribes in contact with the state and the way the treatment of their women has evolved. Also, more than two case studies is preferred with the condition that at least one or two of the cases not have instances of strong religious associated within the tribe in order to avoid the confounding eect of religion. Further research is required in this area. Conclusion e original theory of this paper was that tribaliation is the causal mechanism of gender inequality in modern tribes. Although the theory holds for these case studies, a lack of data as well as a necessity for more case studies and the possibly confounding eect of religion make it dicult to authoritatively say that tribalization is the sole cause of gender inequality in modern tribes. But it can be condently stated that tribalization is a causal theory in the creation of gender inequality in modern tribes. Understanding the underlying causes of gender inequality in these modern tribes may help create lasting solutions to the problems these women face. From Dirt to a Dream Olivia Jovine is timeline is a road map (pun intended) to Americas highway history and the correlated growth of the auto industry. e timeline begins in year 1900 and ends in year 2000. In 1910 there were only ten miles of paved road, making it very dicult for cars to navigate the system. In the early 1900s roads were still primarily traveled with horse drawn carriages. In 1919, Second Lieutenant Eisenhower joined a military cross-country convoy; the trip took 2 months and averaged about 50 miles a day. Clearly, Americas roads were dangerous, unpaved and dicult to navigate. is convoy served as Eisenhowers inspiration for the Federal Highway Act. e Federal Highway Act was rst brought to congress in 1921 by the Bureau of Public Roads, where it failed due to lack of funding. It then reemerged in 1938 with the addition of a toll-nanced system and introduction of the super highway; but the act failed once again. Only in 1952 was Eisenhowers Federal Highway Act successfully passed, partially due to the joint Federal-Aid Highway Act that proposed funding solutions. e primary motivation for building a federal highway system was to promote national security for the Unites States. After the act was passed, Eisenhower and members of congress proceeded to develop the national highway system. 1952 also marked the explosion of the auto industry, measured in number of cars owned by Americans. My conclusion is that this is no coincidence, and that the development of the Federal Highway System spurred the American dream to own and drive cars. 15 Essays on Consumerism in Asia Laura Esposito 16 JGA | Consumerism in Asia Consumption and Production in China and Using Culture to Distinguish Social Class In Xun Zhous work, Eat, Drink and Sing, and Be Modern and Global: Food, Karaoke and Middle Class Consumers in China, 1 and Douglas Holts Does Cultural Capital Structure American Consumption?, 2 both authors discuss the role of consumption in determining social class and conveying status. However, while Holt is focused more on the dierentiation between high versus low cultural capital accumulation and its relation to class formation, Zhou analyzes the Westernization of Chinese consumption patterns and how this in turn reects emerging societal values. Additionally, Zhous argument stresses the tension between traditional rituals and the adoption of Western ideas that conict with cultural and social values. Embedded in both Zhou and Holts texts is also the idea of the adoption of articial taste and practices in order to achieve societal recognition as belonging to a specic class. is idea was furthered in a radio broadcast 3 that identied the articial representation of luxury goods as coming from sophisticated countries, while in fact the majority of goods are produced in China. Zhous description of the emerging middle class of consumers in China was particularly interesting because of the limitations of being identied as middle class. Similar to how Allison Pugh 4 identies the boundaries of childrens interactions as unique enough to set one apart, but not so unique as to be considered strange, Zhou writes that by consumption of certain activities, consumers are not only able to dene their individual status and identities, but [are] also transformed into a desired social collectivethe middle class. 5 In order to be considered part of a certain group, one must adhere to the consumption limitations that are imposed by that group. Another component of Chinese consumption patterns reects the desire to be accepted on a global scale. Zhou notes that China began importing foreign foods because the local became a sign of backwardness, while imported goods from France, England or Germany were embraced as prestige symbols. 6 is corresponds to the argument that we have constructed ideas of where valued goods come from and which cultures produce them. However, this construction is also contradicted by the radio broadcast 7 that points out the irony of luxury good production in China that still allows the luxury good to maintain the illusion of cultural sophistication. In Holts argument and interpretation of high versus low cultural capital accumulation, he suggests a similar pattern of identifying some countries as being more sophisticated and therefore more adept at cultural capital accumulation. However, he also points out that increased access to cultural goods has undermined this system of class dierentiation. Holt writes, us, as cultural hierarchies have dramatically blurred in advanced capitalist societies, objectied cultural capital has become a relatively weak mechanism for exclusionary class boundaries. 8 e ability to easily gain cultural capital threatens existing class boundaries and is further weakened by the production of imitation luxury goods. In addition, Holt maintains that high levels of consumption cannot only be reached by elites, but that now to consume in a rare, distinguished manner requires that one consume the same categories in a manner inaccessible to those with less cultural capital. 9 erefore, a sign of class is consistently engaging in high cultural capital accumulation because class can now be determined based on how frequently one is able to consume. is is a mechanism for the upper class to surpass the symbolic indulgence 10 of lower income families who cannot aord to maintain consumption at such a high level, and instead are only able to gain status by occasionally prioritizing expensive goods. In conclusion, Zhou and Holt both address the new ways for people to gain cultural capital accumulation and status in society through consumption practices. Zhous example of the emerging roles of food and karaoke in China reect the idea that Westernization of consumption practices signies sophistication and luxury. Holts examination of cultural capital accumulation addresses how class is determined based on access to culture and highly regarded goods. However, he also argues that people with high cultural capital accumulation can no longer rely on lack of access to create exclusionary class boundaries. Underlying both arguments is the idea of articiality of culture, consumption and values that considerably clash with notions of luxury (imitation brands and luxury production in China) and tradition (food in China). Eventually, people will need to reevaluate what they actually value, as opposed to what advertising, desires for sophistication and aspirations to be set apart dictate that they value. e Dualities in Shoveling Smoke In his work, Shoveling Smoke, 11 William Mazzarella analyzes the Indian advertising industry and its role in changing the consumer culture and mindset in post- independence India. He begins his study by detailing the historical context of Indias consumption how since gaining independence and choosing to implement protectionist economic measures, people have been faced with the dualities of progress versus tradition, protectionism versus liberalization, developmentalist versus consumerist, global versus local, and the new versus the old swadeshi. Mazzarella explains swadeshi as literally meaning, of ones own country, but identies the new swadeshi as heightening rather than eacing the importance of locality and local identity. 12 Using examples from the advertising industry, such as the campaign for KamaSutra condoms, Mazzarella furthers the idea of the new swadeshi by analyzing how local brands can become widely consumed and how tradition and cultural signicance enable an advertising campaign to become both locally and globally relevant. Mazzarella also discusses the ability to access these new goods and brands that became available after India opened its markets. Mazzarella writes, e tension between individualism and standardization was justied in terms of equity: equal access to the dream of self-transformation. 13 Part of the transition from protectionism to liberalization involves making choices, as an individual and as a society, as to the value of national traditions and rituals compared to those of the rest of the world. Advertising inuences this decision because it creates value and meaning, lling the post-colonial and post-protectionist void. Xun Zhou discussed this with regards to the Chinese adopting forks and knives and reducing their use of chopsticks. e Chinese do not need to have forks and knives, and while chopsticks are more prevalently used, their role has been compromised by Western values adopted by the Chinese. rough the examples of condoms and utensils, we can identify that the divide between incorporating local culture and dismissing it lies in the cultures ability to withstand the standardizations of globalization. For instance, the KamaSutra brand was successful in merging one of Indias cultural components with a mass-marketed product. Because the advertisers were able to build demand for the KamaSutra condoms through the local culture, they simultaneously strengthened and reinforced the value of that cultural symbol. Instead of completely replacing the condom market with a foreign brand that would have no cultural relevance, KamaSutra represents a brand with which people can identify. Overall, Shoveling Smoke presents an interdisciplinary approach to advertising and the presence of brands and consumerism in postcolonial countries. rough his research, Mazzarella questions the contradictions of the local and the global and the role of tradition and culture in a global market. As a result of globalization and the liberalization of economies, we must learn to recognize and measure the presence of local versus global values, brands and goods. is will allow us to determine how consumerism and globalization allow both the local and global to exist without limiting or eliminating the other. Internal and External Dualities within Globalization In Golden Arches East, 14 the presence of McDonalds in East Asia is shown both to globalize and localize the regions economies and cultures. James Watson discusses how the introduction of McDonalds in Beijing, Hong Kong, Taipei, Seoul and Japan has created a variety of responses and has played an integral role in merging cultural traditions with global markets. Several aspects of the McDonaldization process encourage development and market success that require the negotiation of the global and the local, similar to the advertising campaigns in Shoveling Smoke. Watson notes that many people view McDonalds as a form of American cultural imperialism, working its way into popular culture. is can create the presence of an exotic foreign brand, which in this case eventually became a staple of local culture. With regards to Douglas Holts work on cultural capital accumulation, McDonalds became absorbed into local culture and thus lost its exoticism. However, this did not diminish its appeal in East Asia, but rather allowed it to also integrate local specicities, such as cultural and religious dietary restrictions. In addition, Watson also Peoples Republic of China, was celebrated as a model of modernization, sanitation, and responsible management. 15 Perhaps stemming from previous development theories that used immigration of Europeans to spur industrialization, McDonalds is providing the same eciency and standardization of the labor process. McDonalds, therefore, can be utilized as a development technique, able to socialize 17 Esposito | JGA McDonalds and Westernization in order to completely understand the role of McDonalds and how it has shifted cultural norms and family dynamics. Wus research also suggests that the food tensions that arise within states are a result of a preexisting political or social hierarchical tension. e presence of globalization and localization becomes completely intertwined with businesses, trade, the political and social structures of countries. In Golden Arches East, the cultural specicities of a global brand are explained and detailed in relation to its success. McDonalds depends upon local success to create aggregate success, which is why the convergence of globalization and localization is integral to its presence and success in the global market. e Commoditization of Buddhism In Penetrating the Tangle 20 by Stephanie Kaza and Marketing the Dharma 21 by ubten Chdrn, both authors discuss the commoditization of Buddhism and the conicts between Buddhist and consumerist culture and ideologies. Kaza analyzes the moral issues that arise because of the Buddhist principle to not cause harm. Ultimately, her solution encourages more self-awareness of the processes by which we engage in consumerism what is motivating our desires and are we happier or more satised by obtaining them? Chdrn, in contrast, discusses the commoditization of Buddhism and how the practice has evolved into a 18 JGA | Consumerism in Asia and educate citizens in the Western manner (which Watson also refers to as consumer education.) 16 Another aspect of Golden Arches East focuses on the invariability of one product coupled with the cultural specicity or locality of another. For example, Mazzarellas KamaSutra condoms combined Indian culture with a common, global product. McDonalds accomplishes a similar outcome: its French fries represent the standardized product, while the hamburger portion varies depending on the countrys preferred food. In his chapter on Taipei, 17 David Wu discusses a dierent tension that arose from food and the globalization of McDonalds one that is specic to Taiwans role as a post-colonial state and its strained relationship with China. He describes eating as a political act, one that distinguishes mainlanders from Taiwanese and prompted the revitalization of ethnic culture through consumption of betel nuts. Wu explains this connection further: Whereas McDonalds is a reection of the globalization process that has transformed Taiwan into a modern industrial power and a center of world business, betel-nut chewing is associated with the symbolic revival of a Taiwanese rural lifestyle among people who are searching for ways to construct a new national identity. 18 As Wu discusses the success of McDonalds in Taiwan, he also notes the demographics and how McDonalds growth has been steady because of generational absorption into local culture, which is somewhat dependent on parents and children being educated in the U.S. 19 is contributes to how McDonalds lost its exoticism by becoming a local xture for future generations. Additionally, present and future generations must develop a connection between 19 Esposito | JGA consumer/market-oriented relationship instead of a spiritual one. In addition, she discusses the many similarities between Buddhism and consumerism how they cultivate and express taste and connoisseurship, the individual versus the community mindset, the use of numbers to determine success and the loss of genuine meaning or authentic Buddhism. Kazas arguments for moralistic decisions within the consumerist framework are very similar to other texts that discuss the negative consequences of consumerism. While Kaza is primarily concerned with the environmental repercussions of harmful and destructive actions taken by large companies, her analysis of the need for morals can also be applied to discussions on culture and authenticity. For example, what are the moral consequences of a homogenized culture, i.e. the McDonaldization of the rest of the world? Who is responsible for these choices and changes? In addition, Kaza notes the perpetual cycle of consumerism and encourages individuals to take responsibility for the unsustainable and harmful eects of their consumption. For Kaza, this has signicant implications on the formation of self-identity and allows the individual to take full advantage of spiritual practices that may be neglected by the desire to consume. Building upon Kazas idea of prioritization of the individual and spirituality over consumerist vices, Chdrn discusses a variety of factors that hinder the ability to engage in healthy consumerist practices. For example, Chdrn describes the commoditization of Buddhism, which allows it to appeal to more people and gain more support within popular culture. However, the very methods that enable Buddhism to grow are deeply consumerist ideals and practices that conict with Buddhist ideology. Chdrn writes, We dont give to support earnest practitioners who dont teach. Instead, we give to teachers when weve received their services. 22 e idea of exchange receiving some good or service for ones personal benet has replaced the previous Buddhist practice of giving because one wants to give (which is intended to create positive karmic energy). She also evaluates the Wests inability to form communities because of a lack of commitment, which allows us to neglect responsibility and continue the on-going search for satisfaction through material gain. 23 Chdrns argument is also similar to Bill McKibbens 24 and Tim Kassers 25 because she identies the lack of happiness and fulllment that results from the commoditization of spiritual life. What was once above the market and its money-oriented motivations is now subjected to the same consumerist standards. Kaza and Chdrns discussions of the role of Buddhism in a consumerist culture are both fascinating and devastating. Both fear that Buddhism could become susceptible to consumerism and success as determined by numbers if it continues to grow within popular culture. e commoditization of Buddhist ideals and spiritual life, as shown by Kaza and Chdrn, corresponds to all other aspects of consumerism that we have previously discussed. Both on individual and communal levels, it requires that people reevaluate the happiness and satisfaction that they receive from real Buddhism as compared to the market- motivated Buddhism. Africas sign culture is fascinating and demonstrates the reality of global systems of cultural production. ese images of signs taken throughout East and West Africa range from advertisements for local businesses to public service announcements. e West often perceives Africa as disconnected, but implicit in these signs is a demonstrated awareness of popular culture worldwide, repurposed to serve the aims of African proprietors. Signs are an indicator of social conscience since they must adhere to norms in order to be understood by their intended audience what is on a sign reveals what resonates with the people. erefore, these signs from Africa evidence participation in a globalized culture far beyond continental boundaries. e Signs of Globalization Leigh Rome King Brill | JGA Religion, National Identity and Education in the Islamic World: A Look at Egypt, Turkey and Saudi Arabia Jenna King Brill INTRODUCTION In 2007, 35 percent of people in the Arab world did not know how to read or write. 2 Couple this with a population growing at an estimated rate two times that of the rest of the worlds already quickly increasing population, and there is a clear challenge presented to governments of these countries hoping to put their future generations in a position to be competitive in the global market. 3 Education has consistently played a central and highly valued role in Islamic culture throughout its history. Seeking knowledge is framed as an honor and an obligation. 4 During the early years of Islam, before its spread across the Near East and North Africa, learning was focused solely within religious centers such as mosques and kuttabs (small schools where the Quran was taught and memorized, and sometimes supplemented with other subjects of learning). Quickly though, as Islams inuence spread to surrounding areas, the natural sciences too became a center of focus and prestige. e colonial era marks a pivotal point in the development of Islamic history generally, and the upheaval of the educational systems is an example of the societal restructuring that took place at the hands of reigning colonial powers at this time. With independence, the newly sovereign countries were faced with a choice, in developing new systems of infrastructure, between the progress and modernity of the West and their own history of cultural and religious development. ere is now a debate within the Islamic world about the best way to build a generation able to compete in the global political and economic markets while also maintaining a morally and culturally Islamic society. Over the past few decades, leaders have also had to respond to a return to religion by younger generations as a reaction to the Westernization of the colonial and post- colonial years of their parents generation. Recent popular Islamic resurgences in all three of our case countries, Egypt, Turkey and Saudi Arabia, oer a new challenge to the formation of education policy, and government responses to these challenges have shifted the discourse between religion and secularism in the larger Islamic world. Education policy reects and in turn impacts everything from cultural development to political movements and unemployment levels. How a country develops and structures its educational system is a signicant indicator of its broader goals and values. us, there is an unlimited number of ways to approach a discussion of education. As case studies, these three countries together oer particular insight into the relationship between government policy on education and on religion. Egypt and Turkey oer two very dierent examples of a mainly secular education system, while Saudi Arabia will oer a brief look into the challenges and complexities of an education system that is outwardly and staunchly religious. In the West, we often make the mistake of analyzing everything within the Islamic world in religious terms. is is a trap that this paper will do its best to avoid. ere are an unlimited number of inuences and events that have made the educational systems of these countries what they are today. is paper is a brief, limited look at how a developing sense of Islamic identity in these three countries plays out in their educational systems. Egypt e Egyptian educational system is comprised primarily of a central public school system, rst developed under British colonial rule and now attended by the large majority of Egyptian students. ere is also a parallel primary through university system under the auspices of al-Azhar University, a global center of learning for Sunni Islam, which less than In no other sphere of social life does the question of Islam make itself more starkly apparent than within the national education systems of Islamically-oriented nations. 1 21 four percent of the student population attends. If someone wants to become a religious scholar they must enter this system, but it also provides a basic modern education and oers advanced degrees in non-religious subjects (such as medicine). 5 In all systems, nine years of primary education are compulsory, 6 after which students can attend either an academic (preparatory) or vocational school. If a student earns a diploma from one of the general or academic secondary schools, they are eligible to enroll in a university. Exam scores at the end of the primary and secondary levels determine which further schools a student is eligible to apply to. us, for instance, if a student is not among the top scorers on their Basic Education exam, they are not allowed to attend an academic secondary school and will be far less likely to have the opportunity to enroll in university. All levels of education (even university) are paid for by the government, except for the approximately eight percent of students who attend private school. Curricula in the public, private and al-Azhar systems are entirely government mandated and regulated, and its main goal is to cultivate a strong national identity within its younger generations. 7 Turkey Like Egypt, the Turkish national educational system is centralized, with all decisions concerning the management of the school system, such as curriculum and textbook development, coming from the Ministry of National Education. Education in Turkey, as in Egypt, is compulsory through primary school, though in Turkey this is equivalent to eight rather than nine years. is primary education is extremely intensive, putting a students level in math at the end of ve years on par with what would be expected of an eighth-year student in some parts of Europe. 8 Post primary education there is, as in the Egyptian system, a general preparatory and a vocational or technical track and it is dicult, though not impossible, to enter university from the vocational track. 9 Saudi Arabia As in Egypt and Turkey, the Saudi government fully funds education at all levels. In fact, it spends more than any other country in the region on the education and training of its citizens (19.3 percent of total government spending in 2008, down from 38.5 percent in 2003). 10 However, education is no longer compulsory, even at the primary level. Despite this, Saudi Arabia maintains enrollment rates on par with (if not higher than) the rest of the region. Where it fails to compete is in its university completion rates. Intermediate education oers a specialized religion track to male students, but Islamic studies play a central role in curricula at all levels. EGYPT % of Govt Spending 11.9 % Literacy 66.4 Primary Secondary (Vocational or Academic) University Free & Compulsory Free Free 79.3% Enrollment of gross 99.7% Enrollment of gross 28.5% Enrollment of gross TURKEY 14.7 88.7 82.0% Enrollment of gross 99.3% Enrollment of gross 38.4% Enrollment of gross SAUDI ARABIA 19.3 85.5 94.6% Enrollment of gross 98.4% Enrollment of gross 29.9% Enrollment of gross i ii (2006) (2007) (2004) (1994) (2007) % of Govt Spending % Literacy Primary Secondary (Vocational or Academic) University Free & Compulsory Free Free % of Govt Spending % Literacy Primary Secondary (Vocational or Academic) University Free Free Free 22 i All percentages are from the World Banks World Development Indicators, (), 2008 except where otherwise noted ii Literacy rates are for adults age 15 and above JGA | Education in the Islamic World THE ISSUES Egypt: Nationalism vs. Secularism Egypt is not only an example of, but in many ways is central to, the history of and current debate over educational systems in the Arab and larger Islamic world. Education was key to the development of a larger culture of Arab nationalism that began in the 1940s and began to decline after Egypts defeat at the hands of Israel in 1967. 11 In the West, our recent emphasis on the importance of understanding and analyzing Islamic culture and history has lead to an upsurge in focus on issues of education and secularism in our own press and academic circles. Far before this, however, Egypt, along with much of the post-colonial world, had turned to education as the instrument through which it would rebuild its place in the post-colonial world. In 1952 the Free Ocers party overthrew the parliamentary government in a military coup. e subsequent restructuring of the educational system under Gamal abd al-Nassers government reected a wider societal transformation that was taking place. is restructuring was characterized by standardization of curriculum and teaching philosophies and a centralization of administrative control within the hands of the new military government. In Nassers Egypt the focus was on building the identity of a nation that was increasingly inuential and competitive within the global community. us, the focus from secondary school on was overwhelmingly on science and technology. Arabic became the main vehicle for the shaping of this identity and the unication, not just of Egypt, but also of the larger Arab world. e language itself received overwhelming emphasis in Nassers new educational system. 12 As the character of Egypts international involvement began again to change, with the loss of the Arab-Israeli war in 1967, followed by the signing of the Camp David accords in 1978, the government had to respond to a fear of many Egyptians that their country would revert to a position subservient to the West. 13 Failure within the educational system, compounded by issues such as an overtaxed economy and steep population growth, had helped form a society poised to turn elsewhere for a solution. Religion (in addition to nationalism) became the focus of this search. 14 e character of religious identity within Egypt was brought to a startling new light in the wake of the 1981 assassination of President Sadat by members of the Muslim Brotherhood. at same year, the government instituted a ve-year process of signicant education expansion and reform. As mentioned above, the majority of Egyptian students today attend secular public schools. e focus of Nassers education reforms was the development of an Arab, not an Islamic, identity. Yet, Egypts population is overwhelmingly Muslim. e largest minority, Coptic Christians, make up about 10 percent of the population. 15 Even in Nassers Egypt, there was a required three hours of religious education each week, either Muslim or Christian, built into the primary curriculum. However, with the increased emphasis on religious interests in the political sphere over the past few decades, the government has felt pressured to adjust and clarify the role religion plays in society at large and in the educational system specically. Before the recent uprisings, it had become politically important to Mubaraks government, in a way it had not been for Nassers, that it assure the population of its dedication to maintaining the signicant role Islamic history and religion play in the Egyptian national identity. In the West, one of our popular fears is of a system which, combining religion with government, may leave itself vulnerable to inltration by forces of violent extremism. Mamoun Fandy makes the argument that extremist religious tendencies among todays Egyptian youth are a result of the Egyptian government losing control of its own xenophobic nationalist rhetoric and policies that created a system of education with the sole purpose of generating regime support. 16 In the early 90s the government sought to rectify this situation, ring 3,000 teachers, apparently for holding radical views that they were passing on to their students. 17 Interestingly, most Egyptian extremists were educated, not in the al-Azhar religious system, but in the secular schools and universities, receiving their religious education from other places, such as mosques. 18 e pre-February 2011 Egyptian government believed that it was not secularism, but a proper understanding of religious values, that would successfully combat religious extremism. 19 A Ministry of Education publication in 1996 stated that: Religious and moral values should be deeply ingrained among our children. Religious instruction should push our children to adhere to lofty values and morals. 20 e government had also instituted a set of non-religious ethics classes at the primary level. As of 2003 the lessons included: cleanliness, hygiene and environment, honesty, love, sense of beauty and order, peace and tolerance, among others. 21 In the textbooks for these lessons is an overarching sense of patriotism and national unity. It will be interesting in the wake of the recent the uprising to see what the result of a national revolution centered on popular, universal rights will have on an education system that currently has the dual focus of promoting tolerance and stalling resistance. Turkey: National vs. Islamic Identity e 1923 revolution that marked the formation of the Turkish Republic signicantly shaped the priorities and methods of the new government. e Turkish government has used education as one of the most important tools not just with which to modernize but also to secularize. us, the system is inherently political and often acts as the stage of the larger secular versus religious debate. After 23 King Brill | JGA the revolution, Turkish became the required language of instruction, whereas before minorities were taught in their own languages. In 1928 the Arabic alphabet was replaced with a Western one, and Islamic history was removed from school curriculums. e adoption of Islam, a force portrayed as innately Arab, was touted as the pivotal point in the downfall of the Ottoman Empire and thus religion was seen as a threat to the survival and prosperity of the Turkish state. 22 e West and modernization became the new goal and education was, as in Nassers Egypt, the central force through which Ataturk, the Republics new leader, sought to formulate a new national identity. By 1965 education was second only to defense in the national budget. 23 In many ways, this approach worked. Literacy rates went from nine to 48 percent between 1924 and 1965 and are now somewhere near 90 percent. Today Turkey has a higher university enrollment rate than either Egypt or Saudi Arabia. e system still faces problems, especially in terms of access to education in many non-urban areas. 24 Overall, however, in terms of national development the educational system in Turkey appears to have been generally successful. Some of the biggest changes in the education system over the past three decades have stemmed from a rethinking of the importance of Islam to the Turkish identity. e qualication of modernity as inherently secular and Islam as anti-Turkish was called into question by a group of intellectual Islamists, know as the Intellectuals Hearth, who gained access to power in the aftermath of a military coup in 1980. ese scholars, and other thinkers like them, put forth the idea that the clash between Western modernism and Ottoman tradition had occurred, not because Islam or religion are antithetical to modernity, but because Western culture and the way it conceptualizes the individual does not t with traditional Islamic and Turkish values. 25 Like Egypt, the primary goal of Turkeys educational system is to foster a sense of Turkish unity and inimitability. e eect of the loosening of staunch secularism, which began in 1980, is simply that this uniqueness is now taught as stemming from a natural connection between Turkish tradition and Islam. In textbooks and classrooms Turkey is now portrayed as having been vital to the successes of the Islamic world. Post-revolutionary history has been rewritten to portray Ataturk as having exemplied this special Turkish-Islamic relationship. 26 Out of this has come a sense of a uniquely Turkish Islam. It is this Islam, and only this Islam, that the government allows to be taught within the school system. Secularism is still ingrained in the constitution of the state, and what exactly Turkish Islam looks like is constantly being debated. Headscarves for instance, the universal symbol by which the world often mistakenly judges the Islamic fervor of any given society, are still strictly banned within schools and universities. 27 Saudi Arabia: Religion vs. National Advancement e basic principles of Islam are integral to Saudi education, and courses in religion and Islamic culture form a core curriculum for students of all ages. 28 e story of Saudi Arabian education has been one of late and rapid growth. Despite its signicance as a religious center of the Islamic world, for a long time it was far behind in the development of a modern educational system. In 1925 (two years after the Revolution in Turkey), the Directorate of Education was founded. Until this point education had been dispersed and unregulated, left largely up to kuttab. 1926 heralded the establishment of an entirely new educational system. Much like during the reforms in Egypt and Turkey, elementary education became free and compulsory for all males of student age. 29 Education, along with textbooks, health services and travel costs are all still free today, though no level is compulsory. 30 By 2001 there were more than four million students in over 23,000 institutions throughout the country, 31 compared to just 10,000 students in 65 schools in 1947. 32 In the same year, the literacy rate for youth ages 15 to 24 was 93.1 percent, likely a consequence of the 94 percent of children who had attended ve or more years of school. 33 Dierent from both Turkey and Egypt, the Saudi system of education is professedly religious. e Saudi Ministry of Education sets out several principles, which outline its goals for its education system. Among them is the intent to, strengthen faith in God and Islam, and in Mohammed as Gods prophet and envoy. 34 Similar to Turkey, Islam in Saudi Arabia, at least as it is put forth by the government, is uniquely Saudi. e monarchys close, interdependent relationship with the countrys leading Wahhabi ulama (who represent a very fundamental, orthodox version of Islam) leaves the educational system vulnerable to inltration of extremist ideologies. For example, because of the deciency of its own system, when it began to institute reforms in the 1920s, Saudi Arabia had to bring in teachers from other Arab countries to teach in their schools. In 1975, 51 percent of Saudi teachers were foreigners. 35 Because of the strict religious standards of the ulama, the only teachers that qualied to teach in a Wahhabi system ended up being largely members of the Muslim Brotherhood, a violent extremist party founded in Egypt. Once hired, these teachers, as in Egypt, tended to use the classroom to propagate their own views. 36 By 2000 the number of foreign teachers in Saudi Arabia had still only lowered to 25 percent, which signies to a certain extent a failure of the Saudi system to become fully self-sucient. 37 Part of this failure is the problematic level of Saudi unemployment rates. Although at 29.9 percent, Saudi university enrollment seems comparable to Egypts 28.5 percent, 38 the dropout rate in Saudi Arabia is extremely 24 JGA | Education in the Islamic World high. Additionally, over 40 percent of those enrolled in university choose to major in Islamic studies. 39 us, many graduates are largely unqualied for anything except religious positions, leading to estimated unemployment rates far above 10 percent, 40 and a nearly $9,000 drop in the average per capita income between 1980 and 2001. 41 us, despite its claimed intent to build a generation able to raise the nations standard of living, 42 the Saudi government is struggling to reconcile this goal with its own emphasis on the importance of religion above all else. CONCLUSION e educational systems of Egypt, Turkey and Saudi Arabia oer insight into the debate on the role of religion in the modern Islamic state. e integration of religious and government institutions does not have the contradictory connotation in these countries (even, it seems, in Turkey) that it tends to in the West and, if taught right, religion has the possibility of oering a strong and unifying moral structure. Yet as the Saudi case especially teaches us, in order to benet the progression of the state, education for the majority of students must lead somewhere other than a high degree of religious knowledge. ere are some who believe that Egypts al-Azhar system is an encouraging example of a religious education system that also oers advanced technical degrees. However, the complicated histories Egypt and Saudi Arabia have with extremism act as a warning of what can happen when governments do not adequately monitor the ideas being disseminated through their curricula. Religious thought is an inherently personal process and yet what these three countries teach us is that it is also a powerful political tool. In all three cases Islam has been used, and often reinvented (most clearly in the case of Turkey), throughout history to t the needs of a threatened or overly ambitious government. Education is just one of the spheres in which religion takes its political form. is politicization of religion is, of course, not a uniquely Islamic process. It is however one that, with the recent popular upsurge of orthodox religious identication, especially among its youth, the Islamic world is being forced once again to confront. 25 King Brill | JGA When I was in Peru in the month of July 2007, all the teachers and taxi drivers went on strike, and for a few days the roads leading to Cuzco, the ancient Incan capital, were blocked by burning tires. Soldiers started patrolling the streets more and more because of the unrest in the city. I was drawn to the people who were authorized by the government to use violence, to record their faces, but also show them as everyday people who smile and fall asleep in the sun. e second photograph is of a festival in a small town called Paucartambo that celebrates its patron saint with a notorious esta every summer. At nightfall the town square is full of bonres and giant homemade rework towers, and dancers and musicians careen around leaping over the res. ese photographs are memories of two dierent sides of Peru, the total chaos and joy of a small town in the middle of the night and the political fever watched over by soldiers under the bright sun. Locura Emily Pederson Contextualizing Genocide: An Examination of Complexities in Cambodia and Guatemala Julia Burnell Why Study Genocide Genocide is an immediate and visible expression of mass human aggression. And it is perhaps due to the extreme nature of such violence that it is often characterized as unthinkable or as an anomaly. is characterization often allows for genocide to be dismissed as outside of historys trajectory. 1 However, genocide is not a spontaneous event but rather the manifestation of historical constructions, politics and economic stressors, whose conuence within the right context can be disastrous. Although these factors can shape genocide, the violence itself is not the only form in which they are present in a community, and they do not dissipate when the violence nally abates. In this way, contextualizing genocide becomes a project in pursuit of clarifying genocide itself, and also those inuences and the legacies it leaves in its wake. Because genocide requires some level of popular participation and aects all layers of society, there are many divergent experiences and accounts of events and their signicance. ese dierences further complicate narratives surrounding the violence, and these nuances have concrete implications for genocide prevention, for post- genocidal societies and their relationship to the past. Although a convenient response to this complexity would be dismissal, the extreme nature of the violence as well as the complexities themselves beg examination and contextualization. ese nuances can provide insight into questions that historians, human rights workers and policy makers have to confront when working with societies that are moving forward from extreme violence. Questions regarding what can cause such violence, how people are galvanized into participation and what role historical legacies play in shaping the violence are of paramount concern. Although genocides are destabilizing, they do have specic political goals, whether they are the maintenance of the status quo, a return to an historical order or a revolutionary shift in relations. Further, the way that groups are delineated, how justice is conceived of and how some histories are told while others are silenced all have concrete implications for peoples lives. I am not introducing new stories of genocide, but rather taking a critical look at the way that genocides are understood and portrayed. rough this examination I will work to draw out a space where cultural and contextual specicity and institutional mechanisms can inform each other rather than compete, as well as demonstrate how cultivating awareness of a specic context has the potential to strengthen institutional responses. Approach and Purpose In order to delve into questions regarding causes, narratives and responses to genocide, I focus on two specic cases: Cambodia and Guatemala. Both countries had centralized civilizations prior to being colonized by European powers. Similarly, after independence both countries struggled with economic, social and political instability and eventually devolved into genocide. ese were particularly complex cases in which historical narratives, international political environments, economic stressors and perceptions of ethnicity and ideology converged and emerged as violent ssures in society. Indeed, my examination of genocide in Cambodia and Guatemala highlights that genocide is supported by deep historical legacies of inequality that are inamed through changing political currents and struggles over resources. In order to gain an understanding of how to mitigate the destructive nature of these forces, I examine how they evolved. Both of these countries have colonial pasts that cultivated legacies of inequality based on the marginalization of many. However, these legacies preexisted the genocides and do not seem sucient to constitute a singular explanation for the violence that was perpetrated using ideological language. Neither historical legacies nor political, economic and ideological struggles for supremacy are solely responsible for genocide. Rather, popular participation gives those legacies power by acting upon them, while conversely popular participation in the violence looks to those legacies as justication. e genocides of Cambodia and Guatemala demonstrate how these legacies can be wielded to galvanize and legitimize a policy of violence and the elimination of a group of people. Because of the power that narratives wield, institutional responses to genocide should work to render 28 JGA | Contextualizing Genocide them impotent through a process of examination and deconstruction. In this way, an examination of genocides in both countries will sharpen the understanding of their underlying processes. Indeed, these genocides have many similarities. However, their rhetoric is driven by specic conditions and historical legacies that have traction within their social contexts. Elongating the Lens In an eort to understand these complex processes, explanations for genocides tend to truncate history or dismiss its relationship to the violence altogether. In his book, When Victims Become Killers: Colonialism, Nativism, and the Genocide in Rwanda, Mahmood Mamdani challenges understandings of genocide as either spontaneous or inevitable. 2 When genocidal violence is divorced from the forces it sprung from, broader culpability as well as comprehension is inhibited. e genocides and political upheaval in both Cambodia and Guatemala have been met with such horror that they have similarly been severed from the social roots that sustained them. Not only does such a limited vision preclude functional responses to the violence, it establishes certain countries and their associated ethnicities as inherently violent. is perspective is not only incorrect but also dangerous. erefore, the context out of which each period of genocide erupted is an essential element of the picture. Prior to the arrival of Spanish colonizers, the Mayan empire as well as an array of other indigenous societies called contemporary Guatemala their home. With the arrival of the Spanish, both indigenous appearance and practices became markers of lower social standing. However, the Spanish also constructed a class of intermediaries. By raising such groups as the indigenous Kiche and the Ladino class above others, the Spanish simultaneously cultivated resentment and a system of self-sustaining repression. 3 ese class divisions, which relied heavily on the rhetoric of indigeneity, persisted after independence. Although Guatemalas independence was recognized by Spain in 1850, the majority of citizens continued to live in abject poverty without the possibility for political participation. As in other countries in the region, the early and middle 20th century saw increasing organizations of those seeking to reform their marginalization and exploitation. is movement, comprised primarily of peasants, students, teachers, military reformers and emerging middle class, succeeded in ousting the dictator Jorge Ubico. His removal ushered in a decade of democracy known as the ten years of spring, during which time successive governments worked to alter the socio-economic structure of the country through land reform, increased transparency and participation. 4,5 However, these changes were dangerously destabilizing for elites who benetted from the old order. Indeed, Guatemalas archbishop Mariano Rossel y Arellano cited his concern that this democracy and the resulting structural shifts were encouraging the emergence of a political outspokenness that was distinctly undesirable. 6 is shifting social landscape was deeply destabilizing for those who beneted from the traditional power structure. Indeed, faced with an unprecedented challenge to their authority, the state, the military and the oligarchy, supported by the United States, identied Indians as the collective enemy and launched a wave of repression that the United Nations has classied as genocide. 7 e Khmer Empire (800 AD 1200 AD), which ourished in what is contemporary Cambodia, is central to Cambodians understanding of their past. e legendary strength and advancement of that society continues to carry nationalist weight in Cambodia today. 8 However, even before the French colonized the area as part of French Indochina, Cambodia was the center of border disputes and competing spheres of inuence including those of China and Vietnam. 9 Once France gained control of the area, it brought large numbers of Vietnamese settlers into Cambodia to work as civil servants, teachers and laborers. 10 Indeed, the French developed a colonial system based on elevating Vietnamese above either Cambodians or Laotians who they regarded with distain. 11 In this context, many Cambodians felt pride regarding their historical inheritance and simultaneous resentment for their degradation under the French. ese competing narratives of greatness and inferiority cultivated a growing sense of nationalism among Cambodians in general and ethnic Khmer especially. 12 e extreme nature of World War II meant that France was greatly occupied with domestic policy and became increasingly absent from its colonies in Asia. Japan occupied Cambodia during this time, and the shift in power provided a window that nationalist movements seized upon. 13 In this way, Cambodia gained its independence from France in 1953 but quickly plunged into political turmoil. In the greater Cold War context, armed struggle over the leadership of Cambodia, territory, resource and ideological disputes became increasingly volatile. It is within this context that the Khmer Rouge came to power in 1975. eir four years in power saw the deaths of approximately two million people as they, based upon these historical narratives and resentments to justify genocide, aimed at purging non- ethnically Khmer residents and other undesirables. rough the use of a longer lens that can incorporate historical legacies as well as contemporary forces, the structures that support genocide come into focus. is expanded lens of engagement accentuates the ways in which a circumscribed approach to context alters the understanding of violence itself, but more importantly, the legitimacy of 29 Burnell | JGA its causes. When confronting a society marked by genocide, this approach provides space to simultaneously question assumptions such as those that construct distinctions within societies as well as give credence to constructed narratives, insofar as they have power to incite action and dictate interactions. Cultivating Divisions of Convenience e construction and juxtaposition of two groups as inherently antagonistic is present in both the cases of Cambodia and Guatemala. In Cambodia, a central tenet of the Khmer Rouge regime in the 1970s was the creation of a country only populated by those deemed true Cambodians through the elimination of other groups and the creation of a Khmer State. eir image of the ideal Khmer State was based on the conation of Khmer ethnicity and Khmer Rouge communist ideology. In this way, the division between enemies and supporters of this violent state was negotiable, but conversely, one could be targeted either because they were not ethnically Khmer or because they did not embody the agrarian Khmer ideal. 14 is negotiability created a sense of arbitrary fate that has shaped the lives of the survivors portrayed in the documentary e Khmer Rouge Killing Machine. 15 In the lm, documentarian Rithy Panh brings the artist Vann Nath and fellow ex-prisoner, Chum Mey, back to the notorious Tuol Sleng prison (S21). e two not only revisit the prison itself but also confront former guards and their families in order to probe their justications for taking part in genocide. It quickly becomes apparent that Chum Mey is deeply troubled by the fact that he survived when so many others did not. Further, the guards inability to defend their actions or even communicate a consistent reasoning for their participation augmented the sense of arbitrary fate. Nath similarly expresses survivors guilt through his matter of fact assertions that he survived because the Khmer Rouge wanted a portrait artist and he fullled their requirements. Even though they were intent on eliminating those elites deemed detrimental to the creation of an agrarian peasant utopia, such as artists, he was saved. In this way, Naths fate was determined based on Khmer ideology, selectively implemented. His status as ethnically Khmer could have categorized him as part of the Khmer State. However, he was an artist, an intellectual, and therefore a target. Ultimately, the Khmer desire for his elite art imbued him with the usefulness necessary to survive. Naths survival demonstrates the permeability of categories in this context of ruthless violence, and this instability of categories continues to haunt Cambodians on both sides of the violence. Further, Naths story reveals the ideological justications for genocide to be debatable, even among its strongest proponents. Although there was some level of negotiability within the categories in genocide, for many the narratives of historical and colonial legacies placed them in one group or another. One of the groups that was targeted for elimination in Cambodia was the ethnic Vietnamese, who were a remnant of uctuating borders and French Colonial practices of divisive rule. Despite their status as long-term residents of Cambodia, groups of Vietnamese were deemed occupiers and therefore targeted for elimination. Other groups were also targeted, such as the Chams, whose claim to residency in Cambodia was challenged by the Khmer Rouge. 16 is discrimination had traction among many Cambodians, and has survived and been fortied by the presence of an actual Vietnamese Occupation in the wake of Khmer Rouge rule. Delineating social divisions in this way gives credence to underlying social tensions through the use of an ahistorical or a circumscribed historical perspective. is removal of history allows constructed identities to be abstracted, naturalized and then easily politicized. Similar logic was also deployed in the case of Guatemala where divisions relied on racial, ethnic, economic and ideological indicators. However, discriminatory identication was not depicted as being solely on the basis of origins but rather on a desire for a new, modernizing Guatemala. is desire to enter the world stage and market did not include the rights of the majority of the nation where colonial legacies and systematic disenfranchisement created a state reliant on manipulation and repression. However, the early and middle 20th century saw increasing organizations of indigenous groups seeking to reform their marginalization and exploitation through challenging those in power. ese contentions and challenges were not mitigated by the state. Indeed, the exclusionary nature of the state rendered it incapable of achieving social consensus around a national project [and] concomitantly, it abandoned its role as mediator between divergent social and economic interests. 17 It was within this context that indigenous Guatemalans were depicted as stagnating the progress of Guatemala becoming a modern state. 18 In this way, indigeneity became synonymous with movements against Ladino power and therefore contrary to a modern Guatemala. Although the 1894 census in Guatemala dened Ladino as a mixture of European and Indians, the term signied more than a racial category. 19 Over the years it evolved to refer rst to Indians who mastered enough Latin to participate in the Catholic mass and later to those who mastered enough Spanish to circulate and negotiate the world of the Spaniards. 20 Ladinos therefore found themselves negotiating two worlds and were often used as the gatekeepers who maintained the demarcation between categories, but they also represented the vision of progress that was synonymous with the erasure of indigenous 30 JGA | Contextualizing Genocide practices and identities but relied on propertied citizenship. In this way, those indigenous to the area were transformed into the illegitimate residents and the settlers legitimized their own presence through an ingenuitive narrative that promoted neoliberal market values. 21 Neither the divisions in Guatemala nor those in Cambodia were omnipotent and some members of groups targeted for elimination negotiated their social position and were reclassied. is negotiability reveals ethnic categories to be undergirded by ideology and struggles for power. Indeed, these categorizations were carefully deployed and manipulated as mechanisms in struggles for power and land. eir use as political tools is apparent in their deployment when convenient. In Cambodia, members of targeted groups were exempt from the violence if they rose in the ranks of loyal Khmer Rouge. 22 Similarly, in Guatemala, the division between Ladino and Maya and other indigenous populations was negotiated, exploited and reproduced by the Kiche elites who garnered power through their ability to circulate between social categories. 23 However, genocide was a means to assert or reassert control over the relaxing categories and their corresponding claims to power. In Guatemala, as this middle ground gained salience in the political system, its destabilizing nature led to a repression in which the most virulent aspects of Ladino nationalism metastasized into a counterinsurgency that, while it had many causes and purposes, singled out Indians in its rural campaign of repression and murder. 24 e ability of some to manipulate the divisions that demarked who was targeted for state violence is an indication of the role that other factors had in the production of genocide. Both Cambodia and Guatemala were in the process of redening and solidifying the state apparatus when the violence escalated into genocide. Indeed, economic and political struggles were paramount to both of these cases. e context of political and social transformation allowed for genocidal policies. However, the tenuous conditions persisted after genocide had ended. erefore, neither Cambodia nor Guatemala has employed large-scale, state-sanctioned policies of memorialization, recognition or compensation. In Cambodia there is little more than ocial silence on the genocide and in Guatemala the government has repeatedly negated accounts legitimated by international bodies. Looking Beyond Constructed Narratives In both countries, the international community has played a key role in pursuing justice and producing an account of the events so as to ll the gap left by ocials in the countries themselves. In Guatemala, a report was issued by the Comisin para el Esclarecimiento Histrico (CEH) that details and historicizes the civil war and genocide. However, the CEHs mandate was circumscribed by the limits of Guatemalas dubious political transition. 25 is limitation created the potential for a more nuanced approach; because the CEH was unable to pursue retributive justice, it was able to look deeper into the past and at complex causalities that do not put perpetrators in prison but do shed light on how human beings and nations can marginalize a group so that an incitement to genocide has traction. Similarly, the United Nations has been instrumental in the creation of Extraordinary Chambers in the Courts of Cambodia (ECCC) to prosecute human rights abuses that occurred under the Khmer Rouge regime. However it has received little support from the government and has not received widespread recognition. 26 Indeed, the predominance of ocial silence in both Cambodia and Guatemala has meant that the role of recounting, memorializing and documenting genocide has fallen to international institutions, non-governmental organizations, communities and individuals such as Rithy Panh, director of the documentary S21: e Khmer Rouge Killing Machine. In this way, personal accounts of violence and the lives that it touched are integral to understandings of genocide. rough interviews compiled and edited by Elisabeth Burgos-Debray, Rigoberta Menchu shares her story as a politically active, poor Guatemalan Indian woman in I, Rigoberta Menchu. 27 rough her story, Menchu presents herself as depicting and, indeed, exemplifying the experience of all poor, indigenous Guatemalans. Although her ability to share her story with a world audience demonstrates that her life is not like the majority of those whose voices she claims, she is saddled with the responsibility of shedding light on the systematic injustice that Indians organized against and were subsequently killed to maintain. To this end, her nuanced depictions of the circumstances in which Indians live and the discrimination that they faced humanize them and legitimates their claims against landowners. rough her personal negotiations with the expectations of specic categories, Menchu deploys and simultaneously challenges such conations as indigeneity and poverty. As resistance to the political violence directed at indigenous Guatemalans, Menchu works to claim a space for Indian traditions and practices. However, this pursuit is sometimes in conict with her goals of shifting their systematic economic marginalization. Menchu declares that Indian society does not privilege one gender over the other and that all are celebrated, respected and expected to share amongst each other. 28 However, her story also reveals that her work outside of the home and community, as well as the decision not to have children, were all deeply antithetical to Indian tradition and only acceptable because of the repression they were facing that was causing increased demand for mobilization. Indeed, when Menchu became an 31 Burnell | JGA active political organizer she came into conict with fellow Indians who did not want to be under the leadership of a woman. 29 In response, she directly challenges the men who exhibit this opinion. In this example of her own tenacity, Menchu criticizes her compaeros for being too indigenous. is episode reveals a tension between two understandings of indigeneity. e understanding of indigeneity that Menchu attempts to cultivate respect for in her pursuit of economic justice conicts with Guatemalan societys construction of indigeneity as inextricably identied with poverty. In this way, challenging the economic circumstances of indigenous Guatemalans also presented a challenge to practices that had been codied as tradition. However, it is not only within her community that this tension was negotiated. Menchus realization that Ladinos and tourists think our costumes are beautiful because it brings in money, but its as if the person wearing it doesnt exist, underscores how fundamental the performance of ones role was to Guatemalan society. 30 erefore, transgressing the performance of indigeneity was dangerously destabilizing for the system of exploitation that Guatemala was founded on. e state and its elites were deeply invested in maintaining the categorization of people into narrowly dened groups with correlated behaviors. erefore, an increased movement to organize collectively challenged these categories so that those in power reacted with extreme violence to retrench them. Because of the absence of ocial accounts regarding the civil war and genocide in Guatemala, accounts such as these join the public narrative. Similarly, accounts of the genocide in Cambodia such as that of the S21 survivors in S21: e Khmer Rouge Killing Machine become a part of the public narrative of genocide. roughout the documentary, both the survivors and the director seem to be searching for an understanding of why young men would support, join and kill for the Khmer Rouge; they also seem to be in pursuit of an admission of guilt. However, the process of creating this narrative means that the guards are also able to challenge their position as perpetrators and claim victimhood. As these guards, and indeed most of the Khmer Rouge rank and le, were peasants or workers living in extreme poverty, they asserted that their choice was to cooperate with the regime or starve. It is then left to the public, who will circulate these competing narratives of victimhood, to weigh what they see. In this way, S21: e Khmer Rouge Killing Machine clearly depicts a concrete challenge for countries after genocide. Not only are many of the same narratives of discrimination still present, but the dire economic conditions that led to such desperation continue to leave many of the former perpetrators with no means to support their families. Within this context, the lack of an ocial policy regarding genocide, its participants and its legacies leaves social vulnerabilities unaddressed. In the absence of an ocial narrative, informal historicization, such as this documentary, remains an avenue through which communities engage their history of genocide. Living Inheritance As time passes and new generations come into communities with the inequalities and ideologies that fostered genocidal policies, questions regarding memorialization become paramount. How does this history get passed on and how does it live in communities? Whether cultivated by a government, an international committee or individuals and their communities, history and memory are inherently political and personal. In the creation of any narrative, some experiences are privileged over others, and through this process, identities can be further entrenched. In the wake of genocidal violence, the divisive ethnic categories and colonial hierarchies can remain salient. Both Guatemala and Cambodia have had external forces shaping their memorialization, and often people from elsewhere cannot understand the complexity of memory but are still intent on the project of memorialization as a healing process. Although there are few projects to address the genocide in Guatemala that are actually created by Guatemalans, those that do exist have to carefully negotiate indigenous traditions, nationalist rhetoric, international pressures and the continual knowledge that perpetrators of war crimes are still at large. 31 Whether memory is a tool for healing, a means to shed light on inequalities and ideologies or a tool in new political projects, its presence in post-genocide society is the tool through which the complexities of genocide can be contextualized and examined. As the international community leans on the judicial structures of organizations such as the United Nations to dole out justice, it is all too easy to dismiss underlying causes of genocide that are particular to a place and its past, which are inherited through narratives of struggle and rearmed in daily practices. However, relying solely on history as an explanation for genocide does not recognize that these legacies only boil into violence when human beings are moved to kill. It is for this reason that I am calling for an approach to genocide that does not negate either approach but can conceive of them as deeply intertwined and mutually dependent. An over universalization of genocide can erase the particularities of a place and therefore leave the motives of those actors unaddressed and vulnerable for future exploitation. Conversely, the dismissal of universality would shrink our understanding of genocide and make invisible those commonalities such as a colonial past that should be recognized so as to create a nuanced and informed understanding of this phenomena. 32 JGA | Contextualizing Genocide What touched me the most about Eastern Europe was the mysteriousness that suused every little thing. Time seemed dierent, slower, older. In these places that have been Nazi puppet states and Soviet territories with dissent pushed deep underground, there is as much beauty as darkness. Out the windows of the trains are miles and miles of farms, forests, open elds and hills sprinkled with ramshackle villages, no superhighways or strip malls of chain stores like on the roads of the U.S. I kept thinking about all the madness the people and places had known. In the markets and streets, elderly women old enough to have lived through all of it sold owers. Younger women worked behind the counters of the meat markets, wearing makeup and tiny lacy hats. Eastern Europe today is at peace, but there is still a deep sense of bleakness there. e ghosts are just beneath the surface of what our eyes can see. Peace and Quiet Emily Pederson Hugo Chvez, Chavismo and Rethinking Latin American Populism Darius Lerup Introduction In the mid-twentieth century, Latin America saw a boom in the emergence and appeal of populist governments. e success and sustainability of the populist political platform was derived largely from the vast chasm between the upper and working classes resultant of a history of widespread colonialism. Furthermore, the socio-political structure established by colonizers seemed to endure into the post-colonial world. is meant that there was a small social elite controlling the majority of a countrys capital leading to widespread poverty, illiteracy and continued exploitation of the working classes. us, Latin America became fertile ground for a political movement focused on pitting el pueblo, or the people (referring to the working and middle classes), against the elite and aiming to restructure this archaic governmental paradigm. One must ask, however, whether it sucient to dene populism simply as a reaction to a draconian system of cultural exploitation? e denition of populism is still largely debated. Nevertheless, there seems to be a degree of consensus in the conclusion that populism is loosely identied by three characteristics: 1) A Manichaean discourse pitting the people against an elite, 2) the notion of a singular popular will (mediated through democracy) and 3) a charismatic leader who establishes a rhetoric that appeals to the dialectical class tension and is synthesized with the popular will to create a functional political entity. However, such a vague denition raises a critical question: what distinguishes one manifestation of populism from another? An analysis of writings from Daniel James, Kirk Hawkins, Carlos de la Torre and other scholars of populist politics suggests that it is the leader who, through embodying and shaping the will of the people, denes and dierentiates the various forms populism has taken in Latin America over the last century. is essay aims to establish a common understanding of the term populism, as well as investigate which characteristics dierentiate populist movements. Against this backdrop, one of the most intriguing contemporary manifestations of populism has been that of Chavismo and its namesake, Venezuelan President Hugo Chvez. Political scientist Kirk Hawkins goes as far as to proclaim Chavismo to be a paradigmatic example of populism, 1 and as such a necessary case study for students of the phenomenon. Furthermore, the writing of Hawkins, and of journalists Christian Parenti and Jon Lee Anderson, testify not only that Chvez is the quintessential populist leader, but also that his personality and personal agenda have eectively dened Chavismo as a manifestation of both populism and present day Venezuela. Finally, the case of Chvez and Chavismo will be considered as evidence supporting the claim that it is the charismatic leader who characterizes the movement. Dening Populism So far, scholars have been unable to agree on one comprehensive denition of the term populism. In his article Populism in Venezuela: the rise of Chavismo, Hawkins suggests that, much of this confusion results from a tendency to lump together a set of social, economic and political phenomena that occurred together during the early part of the 20th century. 2 As such, he describes the populism of the 20th century as a populism without adjectives, 3 implying that although there is a general understanding of what populism is, it has little to do with the characteristics that dierentiate its numerous manifestations. In Populist Seduction in Latin America: e Ecuadorian Experience, Carlos de la Torre describes populism as a style of political mobilization based on strong rhetorical appeals to the people and crowd action on behalf of a leader... It is a rhetoric that constructs politics as a moral and ethical struggle between el pueblo and the oligarch. 4 By juxtaposing politics with the struggle for freedom from countless years of oppression, populism creates a moral and ethical binary casting a dialectical tension, not only between classes, but also between those who want freedom (the people) and those who do not (the elite). Implicit in the construction of this Manichean discourse is the democratic notion of equality on which Hawkins elaborates: e very word populism refers to a modern democratic context, a situation in which almost 35 Lerup | JGA all adults in society are accorded equal political value. 5 erefore, as equals, the people not only have the power to overthrow the elite, but also a personal responsibility to do so. However, as Hawkins notes, one must keep in mind that the populist appeals to an exaggerated notion of popular sovereignty, one that in Rousseau-like fashion presumes the existence of a single popular will. 6 Here, Hawkins references Rousseaus work Du Contrat Social, in which he suggests each person has both a personal and general will, and that the mystical, general will is the key to freedom. Furthermore, Rousseau posits that the general will can only realize itself through democratic self-legislation. erefore, Hawkins aptly observes that a fundamental characteristic of populism, the singular will, is strikingly similar to the notion put forth by Rousseau. However, Hawkins rightfully points out that it is an exaggeration of Rousseaus original formulation, in that within populism the importance of the existence of the singular will overshadows the importance of its institutionalization and democratization a characteristic of paramount importance within Rousseaus work. e presumption of a single popular will is of particular note when juxtaposed with the Manichaean discourse; together they presume that if indeed this popular will exists, the elite (those nding themselves on the anti-freedom side of the binary) somehow fall outside of the populace. is seems broadly to be a remnant of the disdain still felt for foreign colonizers who instigated generations of exploitation. Casting the elite as foreign intruders serves to further strengthen the bond between el pueblo as a nationally unifying force. Furthermore, the assumption of a popular will requires that there be someone to communicate and administer it, a role lled by the charismatic leader. e populist leader de la Torre states that, Charisma is understood as a double-sided interactive social process that allows us to understand how populist leaders are created by their followers and how they have constructed themselves into leaders. 7 e notion that the followers construct the leaders (at least initially) is key to understanding how leaders function within the country as cultural icons. e process of becoming a populist leader entails the transformation of the leader into a vacuous icon, achieving public support by allowing the people to create multiple uniquely appealing conceptions of the leader on an individual basis. us the leader simultaneously becomes the face and the shaping characteristic of the movement. erefore, perhaps it is the leader who becomes the adjective of his or her unique manifestation of populism. ese fundamental characteristics aside, some populist movements bear little similarity to one another. For example, this adjective-less political entity does little in terms of oering insight into the intricacies of Chavismo. Accordingly, it is critical to understand populist movements on an individual basis, rather than trying to capture a universal concept of the function and manifestation of this political enigma. is in turn begs the question: what characteristics distinguish populist movements? e discussion above seems to suggest that it is the leader who is largely responsible for the expression of the fundamental struggle within populism. Since the leader simultaneously attempts to understand, shape, uphold and become an eternal symbol of the popular will, he or she becomes the face of that movement. Moreover, the leader is largely responsible for dening the elite (those which el pueblo oppose) as well as formulating the rhetoric that demonizes them. erefore, one can surmise that understanding the leader is key to understanding the populist movement. Hugo Chvez, Chavismo and Venezuela e conclusion that populism is characterized more by the element of leadership rather than political structure and institutionalization seems to sit well in the context of Latin American politics. e case of Venezuela provides convincing evidence that it has been Chvez his personality, background, politics and rhetoric that has come to distinguish Chavismo as a populist movement. For instance, his uncompromising vilication of the international elite is undoubtedly a reection of traditional populist discourse. However, upon closer investigation one can see that he himself has a deep personal resentment towards the role of the oligarchy in his country. In his biography of Chvez entitled Hugo!, historian Bart Jones reveals that Chvez grew up in utter destitution in a house that had no refrigerator, no fan, no running water, no indoor bathroom. 8 Since his parents were too poor to support him, he and his brother grew up with his grandmother Rosa Ins Chvez in the small town of Sabaneta, located in los llanos, a vast expanse of sparsely populated marshlands that were Venezuelas version of the Great Plains of the United States 9 Chvez recounts: At Rosas side I got to know humility, poverty, pain, sometimes not having anything to eat. I saw the injustices of this world I learned with her the principles and the values of the humble Venezuelan, those that never had anything and who constitute the soul of my country. 10 His youth spent in los llanos once a battleground for freedom ghter Eziquiel Zamora left a lasting impression on him and ultimately laid the foundation for the worship of his idols: Simn Bolvar, Zamora and Simn Rodrguez three men who stand as symbols of the Venezuelan struggle against oppression. With this in mind, it is clear that the burning conviction behind Chvez venomous rhetoric is rooted in his childhood and is thereby a reection of his own personal struggle. Furthermore, an investigation of his rise to power and political administration will reveal that Chavismo is a reection of Chvez, rather than of some abstract populist political entity. Moreover, this investigation will suggest that perhaps it is the dierences between populist leaders that 36 JGA | Chavismo and Populism should come to identify populism as a political entity rather than the similarities across movements. Eventually, Chvez left Sabaneta; driven by his passion for baseball, he applied to the military academy in Caracas in what he hoped would be a stepping-stone on the road to baseball stardom. However, in the academy he found that his true passions lay in the army. In the years following his graduation, he discovered the body of Marxist and Leninist literature that formed the basis for his desire to reform Venezuelan politics. e catastrophic election of President Carlos Andrs Prez in 1989 was the proverbial straw that broke the camels back. e Prez administrations clear abuse of power led Chvez and the MBR-200 (Movimiento Bolivariano Revolucionario 200) to organize Operation Zamora a military coup-dtat to overthrow the Prez administration. Although the coup failed, it gave Chvez the opportunity to address the Venezuelan people in what has become the famed por ahora (for now) speech. Chvez has polarized his critics with his sharp tongue, but it is hard to imagine his words invoking such profound resonance without his monumental charisma. His por ahora speech is often cited not only as his entry into the political scene but also as the rst time that he initiated a charismatic link with the Venezuelan people. Venezuelan economist Moises Nam commented that although brief, his appearance that day contributed more to destabilizing Venezuelan democracy in two minutes than all the shots red through the night. 11 Journalist Christian Parenti, writing about the dynamics of populism in the Chvez presidency, suggests that Chvezs post-coup speech did two things in particular that garnered popular appeal: First, he took personal responsibility for the botched coup. is seemed to many viewers like a signicant break from the standard political tradition of lying and blaming others for failure. en, in explaining the defeat, Chvez said, For now, the objectives that we have set for ourselves have not been achieved. 12 Powerful words, undoubtedly aided by his oratory skill, on which writer Jon Lee Anderson language and an actors ability to evoke emotions. Within a single soliloquy, he comes up with rhymes, breaks into song, ris on his own words, gets angry, cracks jokes, and loops back to where he started. 13 us, from the beginning Chvez has wielded the gleaming gift of charisma a gift that has become a hallmark of Chavismo. e Venezuelan presidents unwaveringly direct approach to oration is clearly reected in Chavista policies: the immediacy with which relief was provided for the barrios (slums), the formation of an assembly to reform the Venezuelan constitution, the establishment of Bolivarian missions aimed at improving social and economic conditions; the list goes on. Reecting on his presidency, it is clear that Chvezs unique charismatic qualities have essentially superseded conventional governmental structure. Hawkins is quick to point out that in Chavismo, the rule-based structure is much less important than the voice of Chvez. 14 e exaggerated importance of Chvez himself has been evident since his campaign for democratic election in which he represented the Movimiento V [Quinta] Repblica (MVR) party. His current role seems to be largely due to the fact that far more people supported MVR because of their identication with Chvez than because of their identication with the party. 15 However, the lack of signicance of the party is, at least in part, due to the fact that the party relied on two symbols a red paratroopers beret and a silhouette of a soldiers face under the beret that represented Chvezs role as leader of the February 1992 coup. 16 us the MVRs reliance on the image of Chvez as its gurehead led to the development of Chav-ismo rather than MVR-ismo. us, it is clear that although the appeal of Chavismos political goals are rooted in populist discourse, Chavezs success in Venezuela is fundamentally due to his charisma and his mediated image. As previously discussed, the desire to understand and uphold a singular popular will is one of the fundamental characteristics of a populist leader, and understanding the popular will was exactly what Chvez set out to do. In the years following the failed coup, he underwent a programme of self-education in the countrys problems and its possible solutions by traveling around the country, meeting Venezuelans, and studying books and ideas 17 is served as preparation for the broader project of democratic revolution, in which he would represent the MVR and be elected president of Venezuela in 1998 after receiving a presidential pardon for his involvement in the coup. However, Chvezs program of self-education was inevitably colored by his position in the Manichaean discourse i his desire to help the poor and oppose the elite. ii Literally this meant representing certain sectors of the Venezuelan population and alienating others. is intentional polarization has been reected in the reception, both in Venezuela and internationally, of Chavismo: it is either loved and revered or disdained and criticized. ere is no greater testament to the importance of Chvez himself as the sole guiding force behind Chavismo than his televised program Al Presidente (Hello President). Anderson recounts an installment in which government action literally occurred during the show: [Chvez] called out to Rafael Ramrez, the president of P.D.V.S.A [Petrleros de Venezuela, S.A., a Venezuelan state-owned petroleum company] and he promptly stood up and began taking i is underlies an overarching point: that the populist leaders duty to represent the popular will necessarily implies a reection of the populist leader, since the understanding of popular will will always be colored by the personal views and goals of the leader. ii Chvezs desire to help the poor being a reection of his youth, rather than of the Manichaean discourse; their agreement being largely coincidental. 37 Lerup | JGA notes, nodding furiously. is was not a rehearsed moment; to an unusual degree Al Presidente is Chvezs government in action, and it is a government that Chvez does not so much administer as perform live. 18 Andersons suggestion that Chavismo is a performance more than administration is an odd concept, though it is not totally farfetched. To continue with Andersons analogy, Chvezs charisma puts him at center stage in the global political theater and his inammatory character has cast him as the lead in a very real political drama. However, the political drama playing out in Venezuela is peculiar in that its lead actor is also its director. Conclusion What is the importance of understanding populism? And thereby, what is the importance of understanding Chvez? e dwindling status of the worlds oil reserves have set into motion an immense number of social, political and economic shifts that have only just started to manifest themselves. e shifts that have begun to occur suggest that an understanding of populism will, for specic reasons, be of paramount importance in the coming future. For example, the most abundant regional source of oil in recent history has been the Middle East. However, there is now growing evidence that the oil reserves in Saudi Arabia (though they account for approximately 25 percent of the worlds oils reserves) are drying up. is, in turn, means that if and when the Middle East is unable to provide oil as it has, Venezuela may become a cornerstone in the oil-based global economy. Considering that all of Venezuelas oil is state-controlled, understanding Chvez and populism will be key to accessing that resource. Moreover, Chvez is one of the only Latin American leaders who has successfully taken a stand against American imperialism. erefore, in order to access Venezuelan oil, it would be necessary to alter the relationship between the United States and Venezuela, which in reality means altering the relationship between the U.S. and Latin America more broadly. Keep in mind that these developments are largely speculative; Venezuela could run out of oil, or the global economy could nd an alternative to oil. However, modern circumstances aside, populism plays an important role in the ongoing struggle for human freedom. Erich Fromm addresses this timeless struggle in Escape From Freedom, in which he writes: While a class was ghting for its own liberation from domination, it believed itself to be ghting for human freedom as such and thus was able to appeal to an ideal, to the longing for freedom rooted in all who are oppressed. 19 Which is to say, as long as freedom from oppression is considered an inalienable human right and populism demonstrates itself as an appeal toward that ideal, understanding it will be of great importance. With such heavy reliance on a Manichaean discourse and the clear presence of a charismatic leader who purports to represent a singular popular will, there is little doubt that Chavismo is fundamentally populist; but how does Chavismo inform an understanding of populism? Chavismo sets itself apart from other manifestations of populism in a disregard for traditional party structure, replaced by a reliance on Chvez himself as the sole commanding political entity. In doing so, Chvez has created a political system that is a direct reection of his own personal agenda. It is precisely because his personal agenda agrees with the common understanding of populism that Chavismo is, in fact, a populist movement. erefore, the above analysis of Chavismo suggests that perhaps it is more helpful to rethink our understanding of populism in terms of the dierences in the element of leadership rather than in the political similarities across movements. To be sure, in a Manichaean discourse the presumption of a singular popular will and a charismatic leader to enact that will are undoubtedly characteristics of populism. However, it seems to be more informative to focus on the leader as the basis for political structure rather than the aforementioned characteristics. Ultimately, the case of Chvez and Venezuela suggests that perhaps focusing on the element of leadership can dispel Hawkins assertion that 20th century populism is, in fact, a populism without adjectives. 20 38 JGA | Chavismo and Populism It Was Just a ought 1. No matter how bad you think things are going eyre probably going much worse. And isnt it for the best at youve never been elected mayor Of a small central Arizona town Or asked to decide Who would sit next to who At the Potsdam Conference? 2. Ive known people whove disappeared In a completely everyday way. e only time I suspected foul play Was when I was asked to examine myself. 3. I think that a simple history is whats needed, But a precise if pockmarked history. Too much responsibility Is given to the sunburnt and clueless. We need to delegate someone To be in charge of the mashed potatoes. 4. When the committee adjourned, I had already cut you a large slice of papaya And you were giving me lessons in bear baiting. When I touched your hand, it was an afterthought. When I kissed your foot, it was a thought experiment. When I cuddle up to you in the night It will be somewhere between a television show And a psalm And I do not know exactly what it will feel like. Andrew Boston 39 e Unmarketed Economy Yasmin Ogale In Accra, Ghana, markets are the one-stop-shop for locals and visitors alike, but that does not necessarily mean one-price-ts-all. Bias, at a micro-level, abounds and could mean diculties for the economy of the developing nation. Accras Kaneshie Market is a three-story complex bright yellow and jaundiced. A mammoth among markets, micro-economics swarms within. It is infested with things living, dead and inanimate, ranging from soap, salt, tilapia, fabric, peanut butter, pigs feet, papayas and then some. Transactions of buyers and sellers can be heard across tables, dozens of which are piled high, littered identically with merchandise. Traversing through obscure walkways, Western conceptions of economic speculation of buyers reading prices before purchases or sellers reading demand corollary to supply become extinct. It is the buyer, not the good, which is speculated by the seller; love or hate at rst sight. According to experience, bias, rather than regulation, determines prot margins in the Ghanaian marketplace. Like most markets in Ghana, in the dismembered Kaneshie capita is not xed by price tags or stamps, but by word of mouth. Bargaining is an integral part of Ghanaian culture; value can inate or deate at will, by the ip of the tongue. Not unique to Kaneshie by any means, haggling over everything from goats heads to notebooks is commonplace. In an ideal situation, a potential customer walks past a neatly displayed table. A particular article piques his curiosity. He stops to make an initial inquiry as to the cost, which is subsequently nagled over (upwards and downwards and occasionally backwards) until a mutually accepted price is established. e seller rolls her prize into the folds of her pelvic cloth, and the buyer leaves with his polythened item: both players happy with their equal share. But reality on the micro level is dierent. With prices not xed, uctuation is implied, and thus economics is subjective on the sellers behalf. I think that is prejudice, it is denitely prejudice, says local Godwin Ofori-Attah, director of the Micronance and Community Development Organization, because if you [as the vendor] look at me and feel that, because of the way I look, the way I dress, [then] I have money, it is prejudice. Godwin was educated in Ghana and has worked in Kaneshie for over nine years, but he spends weeks at a time traveling around the world for business meetings and conferences. Locally, he engages the market climate on the small-small scale, educating and organizing susu boxes for market women to deposit and store a percentage of their incomes. But despite his expertise, even Godwin has felt the judgment of his own customers: most of the time, the market women look at you and weigh you, they say like, well I know this person can aord like, this price. Rarely does he venture into the moisture of the marketplace for his groceries; rather, he sends his female coworkers to negotiate for him. For Godwin, the pandemic gets physical: When it comes to men, men do not have time to be bargainingso men are always quoted a higher price [than women]. As a female, however, I do not feel immune to price hikes. However, it is not sexism Ive experienced, but an- ever-so slight racism. Lighter-skinned than most vendors in the market, I have frequently experienced personal economic frustration to nd that a loaf of sweet bread, usually 50 pesewas for a local, has been quoted as 1.5 GHS for me (a 300 percent price increase). Godwin empathizes, remembering a time when one of his interns wanted to get his hair weaved and was told a price more than 100 times the norm. It is true that the ignorance of foreigners has been and always will be taken advantage of, but I have been living in Ghana for the past four months. I know what the value of bananas, pencils and sh should be. Furthermore, I am well versed and practiced in the various quirks like ntoso (too soh), or dashing, in which a little more is given, topping o your purchase, at no extra cost. Aware of buyers manipulation, however, I am still cheated. Because of my dress, my look, my skin the price of any tabletop commodity swells. As soon as they see [you], they know that oh! [you] came from the West, or [youre] somebody who could have money, says Godwin, between good natured bouts of 40 JGA | Unmarketed Economy they-told-me-so laughter, as if hearing the experiences of an obruni (foreigner) reinforced the legends of his youth. But this prejudgment, sexist, classist or racist, was current. And not exclusively to me. ey [the market vendors] think that if they charge me a certain way, I will just go with it, says California native Ashley Millhouse, who has spent the last three months in Accra as a part of a New York University Study Abroad program. Honestly, the markets are just a ood of the sensesIt isnt worth the time and the haggling; I would rather go to a store where everything is in one place and the price is the same for everyone that goes there, obruni or local. No longer shopping at local markets or kiosks, Ashley now buys her packaged produce and marked goods from formal retail stores, like Koala Market and Shop-Rite (eerily similar to the squeaky-tiled American ShopRite). But homegoods seller, eresa Quaye, would disagree. In her opinion, the price adjustment philosophy is not practiced in Kaneshie; it is a bad habit germinating elsewhere. To her, the burgeoning formal sectors of Accra pose no threat: they dont disturb our business, no, they dont do that. We, too, we dont disturb them. Her business philosophy is based on friendship and trust: you have to be nice to your customers so that they bring more people to come and buy and then you get money But even friendliness may be subjective: some people can also pretend, they can act, says Godwin, who has fallen victim to pay-more-in-sympathy tricks, too. Unregulated prices give the sellers the power in the hundreds of markets like Kineshie. And although there are some honest vendors, like eresa, their existence, according to Godwin, is isolated. He notes, even if someone quotes you the direct price, somebody will feel that, well, the price should be less, and I will have to bargain. So it has become a culture that the sellers or those who sell in the market, always quote you a higher price. Godwin, who doubles as a private micronance consultant outside the market, says that the biases might in fact be aecting the economics of the shopping center and the developing economy of Ghana: it is not helping the economy, because there is no xed pricewhen a commodity becomes scarceautomatically the price will go up, and when the price goes up, then only the rich people can aord, and the poor people will be left out. Not only would this increase social division, but the bargaining and biased market culture would attract future sellers to the informal sector, wherein regulation is nonexistent and taxes are often evaded. Some buyers, too, would be lured by the belief that goods are cheaper in the marketplace (not considering the condition, quality or sanitation of such things rst). is can have potentially harmful eects in the long term, according to Godwin. While sellers may read males/ females, obrunis/friends or people who travel in private cars/ trotros (shared taxis) dierently, an inux of the stereotypical more expensive customers, would only bandage poverty: more tourists would stimulatebut the danger is that it would make the tourists mistrust because they will always feel like they are being cheated. What can be done to eliminate the prejudice and price uctuations of the micro-market economy, according to Godwin, is a regulation of prices. If we can change our attitude, and educate our market women to call a spade a spade, and always insist on the normal price [then that would prevent mistrust and cheating]. Financial literacy and governmental control would have to be gradual, however, and would not be met without their diculties; but they might clean up the catacombs of the markets like Kineshie, for a more user-friendly, if still putrid, atmosphere. But it would also geld the place. While government regulation would likely eliminate the gumming ies and lack of electricity, it may also mean imbedded taxes, higher rental fees, monopolized businesses and perhaps even job loss. Not to mention an overhaul of the nations economic system. [With price tags] you will get a little money, says eresa, still faithfully beside her kiosk, meanwhile the government will tax you big money. No, I dont want price tags. I want to bargain with the person. Shopping in the market would no longer be a way to connect and satisfy material needs as well as social networks. Like in the West, it would risk becoming a chore. Such is the price of progress. Prejudice in Kaneshie, although a microbe of what it could be, still contaminates the Ghanaian national body. Solving it would deliver a civil right, but also remove what is perceived as right by some of civil society. Even though I personally do not like going to the market, I dont think markets should be regulated, says Ashley with a box of Special K Red Berries. I think being overcharged is part of the experience of coming to Africa. [B]eing overcharged makes you realize and understand that you are dierent or a minority, and that is vital. 41 Ogale | JGA While the serenity of daily life in Buddhism seems common throughout the region of Southeast Asia, the peacefulness of the Burmese people particularly inspires me. Myanmar (still commonly known as Burma) has a history of oppressive regimes. From British colonialism, to Japanese invasion, to the harsh militaristic single-party rule established in 1962 and ending just this spring, the Burmese people have endured endless trials and injustices. Yet they are the most resilient, harmonious of people and their faith in the spiritual and in humanity is unwavering. My intention was to capture moments when a personal interaction helped me understand and take in a little of the magnicence and breadth of a magical place and people. All the places I visited and all the people I met still reverberate in my consciousness. ese images are the notes of an experience in careful observation, sincere admiration and respect. e cover of this years journal is part of this photo essay. Dreams of Ascension Jamie Denburg Somalia and the Mixed Blessings of Anarchy Zachary Caceres 44 JGA |Somalia Somalia is a nation riven by tragedy. Although once lined with bustling ports frequented by Arabic merchants in North Africa, it is perhaps best known today for piracy, domestic lawlessness and its stubborn resistance to international development eorts. Somalias troubles throughout history can largely be traced back to the actions of both intervening foreign powers and domestic political actors. Subsequently, as Somalia lapses further into statelessness, i its development can be best understood as a return to indigenous, pre-colonial institutions, which oer at least a partial escape from generations of violence and predation. At the turn of the 20th century, Somalia was colonized by both England in the north, and Italy in the South. Britain administered the colony as part of its interests in India, mostly concerning itself with cattle exports despite Somalias mineral and oil wealth. 1,2 However, Italy settled southern Somalia, with its legal apparatus in tow. 3 Neither imperial power consolidated total control over its territory; each allowed customary Somali law to exist alongside British Common Law and Italian civil codes. is preserved native institutions by allowing customary law to arbitrate certain disputes, despite the presence of foreign occupiers. In 1960, Britain and Italy merged their colonies to create the independent Somali Republic. Unfortunately, much of the colonial machinery remained and the government of independent Somalia became an engine of patronage and corruption. 4 Using evidence of widespread political corruption as a rallying cry, General Mohamed Siad Barr staged a successful military coup in 1969. He adopted an explicitly Marxist, state-led mode of development, believing Scientic Socialism would bring Somalia wealth and industry. 5,6 But Barrs process of nationalization was also rife with corruption: land was allocated on 50-year leases to useful political coalitions and those nearest Barr plundered the treasury and extorted Somalias poorest. 7,8,9 Barr i e terms state and statelessness thorough the paper should be understood as distinct from nation-state which refers to a geographical area on a map. State refers to the political machinery used for coercion within a nation-state and statelessness its relative absence. also aggressively sent his military to Kenya and Ethiopia, believing Somali-inhabited land in these nations were rightfully his own. 10 He also forbade clanism ii --deeply at odds with Somali history and their legal heritage--and resorted to outright repression to control recalcitrant groups well into the 1980s. 11 During WWII, Italy brought modern weapons to Somalia and armed bands of Somalis to be unleashed onto British lands. is, combined with the policies of the U.S. and other foreign powers throughout the later part of Barrs regime, spurred a culture of perpetual violence in Somalia, as well as drawing the international arms trade into the country. 12,13 After WWII, Barr was courted by both the Soviet Union and the U.S. as part of their proxy feuds during the Cold War. As his early Scientic Socialism proved economically moribund, he broke ties with the Soviet Union. e USSR had provided Barr with trained development advisors as well as military aid; but after Barr realigned with the U.S., he opted instead for outright militarism backed by the US -- to maintain his oppressive regime. Much of the funds for this activity were provided by aid programs through the IMF and other international bodies. As one author described it, Barr moved from Scientic Socialism to IMF-ism using structural adjustment loans to privatize national assets, typically putting them in the hands of powerful, ancillary political actors. 14 While nominally these were market reforms, Somalia like many other African nations became increasingly militarized by redirecting social spending to fund the military. iii Barrs rather modest economic achievements under Socialism swiftly retrogressed. 15 By the mid 1980s, Somalias entire development budget was funded by foreign powers and 50 percent of its operating costs came from international loans and grants. ii A form of societal organization based on kinship, real or ctive. iii Frequently when governments implement structural reform programs, they are required to reduce government spending. is at times results in less funding going towards social programs. In the case of Somalia, the funding previously allocated to social programs was re- appropriated by Barr to fund the military. 45 Zachary Caceres | JGA Indeed, foreign aid counted for 57 percent of Somalias Gross National Product. 16 Most of this was spent on reining in and arming Barrs rapacious military. 17 e USSR, Italy, U.S., Egypt and China all provided Barrs regime with various degrees of military support according to the vicissitudes of world geopolitics. 18 Despite Somalias poverty and relatively small size, Barr elded one of the largest standing armies in Africa, which he used to protect a massive and corrupt civil service from an unruly populace. 19 Barrs policies favored some clans over others, causing disproportionate suering and resentment amongst other groups. Somali economist Jamil A. Mubarak writes that towards the end of Barrs rule, the political base of [his] government narrowed down to his own clan, which dominated most of the key positions in government. Barr and his favored few had, committed so many atrocities against various clans that he was no longer capable of introducing political reform even if he wanted to. 20 is helped seed the violent relations between some clans in contemporary Somalia; today, they vie for control over centralized political institutions. In January 1991, as the Cold War wound to a close, the U.S. drastically cut military aid to Barrs regime. Violent militias that had intermittently sparred with Barr during the last 10 years of his rule were waiting in the wings; they forced Barr from Mogadishu and then skirmished amongst themselves to ll the political vacuum. e specter of a failed state invited international attention from the United Nations and the U.S. e years following Barrs fall were riddled with foreign interventions, including the infamous Black Hawk Down incident in which 19 U.S. soldiers were killed after a failed assassination. 21 Worse still, this upswing in civil strife occurred during a deadly famine, which claimed the lives of about 300,000 Somalis. 22 Despite incursions by Ethiopia, the U.N. and the U.S., Somalia settled into a baing statelessness by the mid- 1990s. Indeed, by as early as 1994, Somalia was mostly peaceful especially outside nodes of political power like Mogadishu. 23 e violence that remains in modern Somalia is disproportionately centered in areas most aected by foreign intervention. e structural dierences between Italian and British colonialism in Somalia carry to the present day. e site of greatest civil strife, violence and clan-feuds for control of Somalia is in and around Mogadishu, where the Italian state brought its settlers and built legal and physical infrastructure for its colonies. In contrast, in the Northern province of Somaliland, which was once the British Somaliland Protectorate, the only mildly stable quasi-state in modern Somalia has formed. 24 Despite British control over this area being relatively loose historically, even under colonialism, is, Somaliland has declared itself an independent nation. While unrecognized and weak, its state maintains internal order while skirmishing on its borders. ese two areas, with their occasional are-ups and attempted coups, stand in stark contrast to the rural majority of Somalia, which is stateless and largely peaceful. 25,26 But even in Mogadishu and on the fringes of Somaliland, a stateless or near-stateless militia equilibrium has repeatedly emerged in the absence of foreign intervention. Andre Le Sage explains, e power base of Somalias warlords declined further as a result of the limited resources at their disposal. Opportunities for plunder gradually disappeared and the amount of foreign aid available for diversion dwindled e large clan-based militias the basis for the worst ghting in Somalia in the early and mid-1990s became dicult to maintain. 27 Western governments and much of the press see in Somalia nothing but the very denition of a failed state, invoking images from Hobbes. 28 Perhaps regrettably, these images of anarchic Somalia as violent and barbaric seared their way into the popular mind. 29 But economists studying the nation nd that Stateless Somalia signicantly outperforms its governed predecessors. Economist Peter Little explains:. iv , 30 is growth in humanitarian indicators has moved at a faster pace than in surrounding African nations governed by central, predatory states. 31,32 For many Somalis, states are synonymous with corruption, plunder and oppression; their experiences historically have taught nothing else. e inability for democracy to take hold in Somalia, despite all the interventions nominally aimed at that end, is in large part because warlords rush to claim the state apparatus for themselves because of the potential gains from using it to exploit the population. Indeed, in some parts of the country, citizens are safer than theyve been in three decades, and atrocities against civilians are now almost unheard of. 33,34 In fact, violence is worse across the governed Kenyan border than in nearby Somalia. 35 Perhaps the strongest endorsement of relative safety in stateless Somalia comes from its citizens themselves: 400,00 Somali refugees voted with their feet v by returning to Somalia in the same year that Barrs government fell. 36 Moments of protracted violence in Somalia tend to follow attemptsusually foreignto re-unify or establish a iv Other improvements have occurred in immunizations, access to water, sanitation, birth weight, maternal mortality, ownership of TVs, radios, telephones, measles fatalities and physicians per 100,000 people. v Voting with their feet has nothing to do with ballots. People are opting to return to Somalia, which can be interpreted as an endorsement of statelessness over previous regimes. 46 JGA |Somalia Somali state. ese moments, unsurprisingly, receive more press-coverage than long periods of relative stability and growth. After botched early attempts, the U.N. in 2000 organized a Transitional National Government, which was promptly expelled by scuing clan militiasall of whom were vying for control over the Federal apparatus. 37 Again in 2002, heads of states began planning to establish a Transitional Federal Government. Immediately, armed clashes aimed at control over Mogadishu spiked and continued for the next two years. vi , 38 In 2006, the U.S. sponsored an Ethiopian invasion of Somalia, which also caused a spike in clan violence. 39 One economist studying Somalias currency has noted that after U.N. troops evacuated in 1995, the Somali economy, rather than deteriorating, actually improved. 40 Jamil Mubarak argues that the relative success of statelessness in Somalia during the low-points between interventions is the fruit of a long tradition of informal legal and economic institutions. Under colonialism, and then under Siad Barrs regime, black markets ourished behind state-central planning and corruption. As Barrs state toppled and the subsequent war to ll his placereached a stalemate, these markets burgeoned. Mubarak declares, In communities which provide a peaceful environment, private sector economic activities have thrived and opened new opportunities for growth and prosperity. In the local economies of these communities, no-government has proven to be far better than the repressive government of Siad Barr. 41 Just as informal markets sustain economic activity in Stateless Somalia, informal legal institutions maintain law and order. Legal disputes, especially in the peaceful regions beyond Mogadishu, are typically settled using customary law called Xeer. In fact, the most peaceful regions in Somalia are those areas most thoroughly governed by traditional Xeer. 42 is tribal law uses numerous levels of restitution according to the severity of the crime instead of punitive punishment. Somalis all belong to a diya group, a familial insurance pool, which is held responsible for the crimes of its members. Once a trial is held with neutral elder arbitrators, the criminal is expected to provide restitution (priced in livestock or their money equivalent) to the victim. vi Other ghting has occurred because of U.S. nancing of particular warlords for the War on Terror. is destroys the balance of power in Somalia and encourages warlords to try to expand their territory (Somali Criticizes US Terror Moves BBC). e diya is responsible if a convicted criminal in their midst refuses to pay restitution. is encourages clans to force its members to uphold the Xeer. If a member still will not comply, a clan can declare that he is no longer in their insurance group, eectively making him an outlaw and unprotected by the clan. is system, while intricate and imbued with traditional religious sentiment, still functions well in modern Somalia to adjudicate both civil and criminal disputes. 43 Even piracy, now the international watchword for Somalia, is testament to the robustness of traditional Somali law. One Somali pirate, when interviewed, called foreigners the real pirates. He complained that illegal trawlers from surrounding nations oversh and dump toxic waste, robbing Somali shermen of their subsistence and livelihoods. Pirating, he claims, was the last resort of a desperate industry to secure rights to shing waters. Moreover, Somali pirates generally do not prey on Somalis and, indeed, a vast network of support industries have emerged from land-dwellers to support their piratical countrymen. 44,45 Somalia, in many ways, has come full-circle. Having started as a trade center it is, despite many handicaps, slowly regaining its former stature as an exporter, as a duty- free port and even as a center for small-scale nance. vii It should be no surprise that Somalis have proven nearly ungovernable in recent years. ey suered tremendous hardship at the hands of states for generations. While one cannot romanticize Stateless Somalia, which remains poor and troubled, one should not brand it as an abject failure in desperate need of political and military intervention. In a world of imperfect alternatives, statelessness in Somalia should not be dismissed. Somalias indigenous institutions, though confusing to some Western eyes, have proven robust and conducive to peace and economic growth. Moreover, they are a return to an era that preceded the actions of irresponsible states that condemned Somalia to a century of blood and poverty. vii Somalia currently has several competing currencies from past regimes as well as the U.S. dollar and notes from Somaliland. Interestingly, the only currency that risks complete destruction through hyperination is Somalilands the only currency (other than the U.S. dollar) that is supported by a State-entity. A massive market in foreign remittances from Middle-East economies provides free-owing credit to Somali businessmen. See (Mubarak, A Case of Private Supply) Under the Inuence: Patterns of Dependency in Latin American Development Maggie Carter Latin American colonialism ended with the hard- won independence of its nations, however it remains to be seen if these countries have truly become independent and escaped the legacy of oppression the colonizers set in motion. e colonialists maximized the output of the colonies by strategically dividing production into dierent areas of the continent. ough this was a successful tactic for the colonizers looking to exploit the land, when individual nations rose out of the struggle for independence, it left each country economically dependent on the one or few commodities it already produced. In its struggle to overcome this and become self-sucient, Latin America has repeatedly looked outward to the developed world, and consequently invited new forms of colonialism that have kept its head underwater for centuries. As colonialism fell, Latin America gained its freedom, but was also left without the nancial support of its former oppressors. As Spain and Portugal moved out, England, France and the United States provided a new market, eager to pick up where the others left o, and quickly gained control of trade in Latin America. ey began investing in transportation technologies such as railroads and steam engines, as well as developing port cities in order to eciently export the products. However, the trade relationship created was by no means an equal one. Dependency and Development in Latin America, 1 by Fernando Henrique Cardoso and Enzo Faletti, illustrates how colonialism worked to oppress Latin America, even after the end of the Spanish and Portuguese empires: When Latin America emerged from its colonial dependence and entered a period of dependence on Great Britain, Britain sought support from national producers of export commodities who, because of the growth of their economic base already under way in the colonial situation could eect a new accommodation with emergent dominant forces at world level. anks to this they gained, if not absolute control, at least a privileged position in local structures of power. 2 ough they proted during colonialism and neocolonialism, the landowners and producers, the domestic elite, were dependent on whoever could purchase their products and set up the infrastructure to export them, which allowed foreign control. Out of the common desire to become prosperous independent nations, which was expected to come with the wealth brought in by the export boom, Latin America dug itself deeper into a circular pattern of dependency. Due to Latin Americas export-based economy, established during colonialism, the majority of commodities had to be supplied by importation. After gaining independence, the only way these poor, newly formed nations could aord these imports was by continuing the production of their export goods, which was enabled by foreign investment. e developed countries with a new stake in Latin America brought with them modernization but only in order to make exportation more ecient. e railroads only ran from the plantations to the port cities, and cities and towns were chiey commercial, administrative, and service centers. 3 ese new developments only entrenched Latin Americas export- based economy more deeply, as now the continents entire infrastructure was designed to support it. Soon foreign investors owned or controlled much of Latin Americas production industries and with the modernization came a price: Progress brought a new brand of imperialism from Great Britain and the United States. e same countries that modeled progress for Latin America helped install it there, so to speakand sometimes owned it outright. 4 e new era of modernization and advancement had not elevated the inferior position of Latin America, and though the powers shifted during neocolonialism, Latin America could still not claim sovereignty. Neocolonialism brought Latin America a vision of progress rooted in technological advancements, and many held these developed nations to be models for the future of Latin America. e great proponent of neocolonialism, Juan Baptista Alberdis essay, Immigration as a Means of Progress, 5 described as his utopian representation of the future, suggests that Latin America cannot become great without signicant European inuence. He asks, How and in what form will the reviving spirit of European civilization come to our land? Just as it has always come. Europe will bring us its fresh spirit, its work habits, and its civilized ways with the immigrants it sends us. 6 To Alberdi, Europe, as Carter | JGA 47 the developed world, represents civilization that will come, just as it has always come, which historically refers to colonization, the original force that brought Europeans to the South American shores. He almost blatantly condones colonialism, but with a nationalist argument. He believes that the nations of Latin America can only become civilized by embracing the qualities of English liberty, French culture, and the industriousness of men from Europe and the United States. 7 Clearly, foreign inuence in Latin America was not limited to the importation of modern technologies but extended to the importation of new ideals. Alberdi wants freedom, culture and eciency, which he believes result from development. However, this is not development in the general sense, but a very specic kind development. After his plea for Europeanization, he outlines his plan to achieve this, stating, Important advice to men of South American countries: Primary schools, high schools, universities, are, by themselves alone, very poor mean of progress without large manufacturing enterprises that are the fruits of great numbers of men. 8 He undervalues education of the public, a necessity of equality, which cultivates both skill and culture, and instead emphasizes industrialization. is tendency to rst implement the physical aspects of progress, assuming that the social ones will follow, is commonly repeated throughout the course of Latin American development. At least for the duration of neocolonialism, this strategy failed to reorganize society. As Chasteen writes, Despite many transformations, neither Latin Americas subordinate relationship to Europe nor its basic social hierarchy created by colonization had changed. Hierarchical relations of race and class, in which those at the top derive decisive prestige and advantage from their outside connections, remained the norm. 9 Ultimately, the progress promised by neocolonialism was unable to improve the lives of most Latin Americans, and instead upheld the superior status of the wealthy elites. e period of neocolonialism solidied Latin Americas dependence on exports, so when depression and war struck its market, its products piled up with no buyers and the nations of Latin America were forced to completely restructure their economies. is led to the widespread implementation of Import-Substituting Industrialization (ISI) in Latin America. ISI was an eort to free Latin American countries from dependency on foreign nations, and by creating a domestic industry and enforcing trade protection, it attempted to keep out foreign inuence, a signicant change from neocolonialism. However, I argue that ISI only redened Latin Americas economic and ideological dependence on the developed world. In terms of economic dependence, though Latin America was no longer importing nished products, it still had to import the raw materials and machinery needed to create them. More notably, it remained dependent on the developed world for technological advances in the manufacturing of their products, as the technologies they used were simply imported and knowledge did not extend past operation. In Albert O. Hirschmans extensive analysis of ISI, e Political Economy of Import-Substituting Industrialization in Latin America, 10 he describes this problem: ISI thus brings in complex technology, but without the sustained technological experimentation and concomitant training in innovation which are characteristic of the pioneer industrial countries. 11 is recalls Alberdis mistaken assessment that education and its benets will follow from large-scale industrialization, rather than the other way around. In Latin America, the physical aspect of progress and development are installed, but the social ones are again neglected. e circumstances surrounding the failure of ISI provide even greater evidence for the rearmation of Latin American foreign dependency. Cardoso and Faletti present the perspective that industrial capitalism is a modern manifestation of the colonial model of the exploitation of peripheries by the core:. ey remain, however, peripheral economies with particular historical paths when compared with central capitalist economies. 12 rough industrialization, Latin America attempted to mimic the model of development that was responsible for its own oppression and exploitation during colonialism. It was ultimately unsuccessful because it has been and remains a periphery, without peripheries of its own where it could exploitatively extract raw materials and export its surplus. is problem is evidenced by the fact that Import substituting industry is aected by seemingly congenital inability to move into export markets, 13 meaning that at some point, once the domestic market has been saturated, ISI is no longer protable. Another disappointment of ISI was its failure to create social derivatives. Hirschman writes: Progressive Latin Americans had long hoped that industry would introduce new, much needed disciplines into the behavior of their governments. e very nature of industrial operations their precision, the need for exact timing, punctuality, reliability, predictability and all-around rationality was expected to infuse these same qualities into policy-making and perhaps JGA | Latin American Development 48 Carter | JGA even into the political process itself. 14 Here again is another example of the tendency to rst install the visible aspects of development and expect the values and practices commonly associated with it to follow. Rationality was expected to come out of industrialism, and yet the frequent irrationality in policymaking contributed to its downfall. Hirschmans conclusion makes the point: Industrialism was expected to change the social order and all it did was to supply manufactures! 15 At the top of this long-standing social order of Latin America was the elite class, which retained its superior position and imposed upon the entire society an orientation based on its own interests. 16 During the periods of ISI and neocolonialism, the dreams and ideals of Latin Americans were rooted in the modernization and technological developments that the worlds most powerful countries had already harnessed, which seemed to be markers of inuence and importance on the global scale. Latin America chose to emulate these countries rather than take a path of development that responded to its own problems and preexisting structure and cultural foundations, a habit that has historically and repeatedly hindered its great potential. e failings of ISI led to the accumulation of vast amounts of debt by Latin American countries, but by the time the repayment was due, the nations had not gained enough prots to pay it back. In response, the U.S. created a set of conditions that must be accepted by any country prior to the dispersal of more loans. In his article What Washington Means by Policy Reform, John Williamson writes that the objectives that the Washington Consensus wishes to achieve by its implementation in developing countries are growth, low ination, a viable balance of payments, and an equitable income distribution. 17 However, despite its intentions, the Washington Consensus presents the obvious problem of a developed country imposing conditions upon and dictating the terms of its relationship with developing countries. is is again a replication of colonial structures, where the developed country has the upper hand. In this scenario, it is hard to believe that the U.S., the dominant power, is not exploiting its superior position. Williamson notes that though it is understood that the U.S. is only interested in the growth and prosperity of Latin America, the most obvious exception to this perceived harmony of interests concerns the U.S. national interest in continued receipt of debt service from Latin America. 18 e Washington Consensus presents the two objectives as parallel, as prosperity in Latin American countries would enable them to pay o their debts, but some of the policies suggest evidence of the U.S.s prioritization of debt repayment. For example, the Washington Consensus promotes the policy of debt-equity swaps, on the argument that this can simultaneously further the twin objectives of promoting FDI and reducing debt. 19 However, though debt- equity swaps do allow nations to pay back their debt quickly and acquire more loans, it is at the expense of state-owned industry. Alberdi, wrote, Grant foreign investors what they require: investment capital is the sure arm of progress for our countries. 20 If a country does not own its industry, nor have any power to dictate its own terms of development, it might as well be a colony. e question remains, then, can Latin America gain true independence? In response to the strict conditions of the Washington Consensus, a new economic policy has risen out of Latin America in an eort to escape this latest attempt at imperialism. e Bolivarian Alliance for the Americas (ALBA), spearheaded by Venezuelan President Hugo Chvez, was developed as an alternative to the Free Trade Agreement of the Americas and aims to create a self-sustainable and independent Latin America through regional cooperation and assistance. ough it is a viable attempt to deny the conditions of the rst world, it possesses characteristics that embody the very process it condemns. e economic foundation of ALBA is based on a system of bartering that promotes trade between countries specializing in certain areas in order to gain each nation access to resources they do not produce. For example, Venezuelas contribution is oil, Bolivias is natural gas and Argentina, should they choose to join, would oer livestock to the equation. is model comes dangerously close to reproducing the colonial system that made these countries so dependent in the rst place, conditioning their industries to produce only one export. It is important to note that Venezuelas reasons for participating cannot be purely economic as the gain from the trade in most cases signicantly favors the other nation. For example, Bolivias contribution is mainly natural gas, practically useless to the oil rich Venezuela. But what Chvez loses economically, he gains politically. By oering to pay the debts of Latin American countries, Chvez implements his own kind of debt-equity swaps, gaining not nancial ownership, but political allegiance as well as acceptance of the conditions of ALBA. e relationship of Venezuela to the other nations involved is also reminiscent of the colonial model, as Venezuela, the core, extracts vast amounts of oil with its expansive industry, exports its surplus to the periphery, and gains raw products from their less developed industries. 21 In this sense, Venezuela overcomes the problem of industrialization in developing nations that Cardoso and Faletti present. Ultimately, ALBA is unable to escape the inuence of colonialism because its existence is born out of a desire to resist the Washington Consensus. As long as Latin America continues to respond to its colonial legacy, whether by embracing it through neocolonialism, reversing it through ISI or blatantly refusing it through ALBA, progress will be impossible. If Latin America desires independence, it must turn to an organic model of development that is itself independent of a past stained with oppression; one cannot move forward while looking backwards. 49 To Spaniards, the ag is of great social relevance, even today. Its association with Franco and the transition into a national democracy heighten its social connotations and its political statement. e photo is of Plaza de Coln, in the heart of Madrid. In it, the commanding Spanish ag billows above the entire plaza, including the concrete macro-sculptures by Joaqun Vaquero Turcios. For months, I spent every afternoon here skateboarding. It is here that I became friends with local skateboarders, whose extension and acceptance gave me insight into the Madrileo youth. Identity Drew McKenzie 50 (La Bandera) Espaa sangrante. Empeorando, se recupera Es posible? El optimismo ota sobre el desierto del dolor. Las cicatrices gotean bajo el vendaje mojado de las memorias que no se pueden contener. Ana Radolinski (e Flag) Bleeding Spain. She worsens, she recovers. Possibly? Optimism oats over the desert of pain. e scars drip below the bandage drenched in memories that cannot be contained. 51 Protecting Rights and Promoting Development: Participative Management in Germany and Argentina Paz Petersson 52 Since the advent of Human Resources theory, the valuing of employees as individuals has been at the top of the list of things to do to create a happy, productive work environment. To what degree this theory is actually practiced, and to what degree it aects nancial sustainability and growth is a set of questions all its own. Some have contended that a High Road i business model, with great degrees of employee participation and more skilled workers creates both a happier work environment and greater nancial growth, serving as a golden goose for some of the problems faced by enterprises. 1 While in theory, and in many real cases, the High Road is clearly the better option for businesses, the majority of global businesses still follow the hierarchical, low worker- involvement, Low Road model. is begs the question: if High Road Participative Management (PM) systems are so desirable, why do more companies not adopt them? ere are a number of obvious reasons, including resistance from powerful employers and managers in hierarchical workplaces and lack of general government assistance. Additionally, the High Road model has not been widely recognized in the global economy as the better option. Keeping this in mind, I will look at the specic debate for PM in the workplace, focusing on the history of two very distinct examples, which clarify some of the reasoning for High Road models and some of the reasons why they do or do not prevail in societies. Namely, I will analyze in detail the lauded German model of Codetermination, dating back to the end of WWII, and the much smaller and more contentious worker-run enterprises in Argentina, appearing during and immediately after the national economic crisis of 2001. ese examples, and their contrasting progressions, bring light to the discussion of what worker participation can mean for businesses and show how it can manifest in very dierent ways. Before detailing the two examples, I will introduce some of the arguments for and against greater employee participation in the workplace and its implication for business. e two examples I will focus on were chosen i ere are many qualities, which characterize the High Road model, all of them, deeply interdependent. For the purposes of this paper, I am focusing particularly on the essential aspect of participative management in any High Road model. For a delineation of the characteristics of a High Road vs. Low Road model, please see Appendix 1. because of their similar outcome of high levels of employee participation despite huge dierences in scale and in the way they came about. Germany, on the one hand, has established a mainstream, national, government-supported business model in which workers are given a voice. Argentina, on the other hand, has experienced a small-scale movement in which unemployed workers forcefully claimed a voice after their situation became unbearable, and they have managed to maintain that voice and maintain the businesses without bosses. ese two examples will be detailed individually and then compared in the last section in terms of their inception, productivity and eciency over time and their relationship with their respective governments in order to illuminate what lessons they can teach us about the future of the High Road model. Worker Participation in Management eory As mentioned above, the established argument for employee participation in the workplace dates back to the rst shift in industrial relations theory with the creation of Human Resources theory. ii Pioneered by Dengler, Likert and McGregor towards the middle of the 20th century, its basic idea is that humans are resources in and of themselves, and treating them as such will increase their motivation and productivity, whereas treating them as expendable will do the opposite. is now widely accepted theory came as a stark contrast to Classic industrial relations theory, which characterizes employees as unwilling actors who work only because they have to and whose eort only reects wages. iii While Human Resources departments in the workplace have become mainstream, there is still a huge disconnect from the actual theory and the way that Human Resources are dealt with in businesses. 2 In many ways, the comparison of Classic vs. Human Resources industrial relations theory is very similar to the newer contrasting Low Road vs. High Road industrial relations systems, especially regarding PM. ii ese are some texts that argue for participative management much earlier than this. See, for example, Ben Selekman. Sharing Management with the Workers, New York: Russell Sage Foundation, 1924]. iii For a detailed description of these theories, see: John Sheldrake. Management eory, (London: omson Learning, 2004) chpt. 2, 16, 25. JGA | Participative Management 53 ese terms encompass a variety of characteristics (See Appendix 1), but most importantly, High Road systems include high worker involvement and less hierarchy in the workplace with fewer lay-os, while Low Road systems result in the opposite. 3 Classic examples of successful High Road systems include the Japanese and German models, in which employees have a signicant voice in the workings of their business (which is guaranteed by the government in Germany) and are generally more skilled. Classic Low Road examples are competitive factories and sweatshops, most well-known in China, among many others, in which employees are highly expendable, with few necessary skills and with little or no say in the workings of their business. Just as Human Resource theory was lauded in its time, so too, almost as a continuation of this, is the High Road model of PM valued today. Part of the appeal of PM is that it has been shown to have a positive eect on productivity, 4 and a strong positive eect on worker satisfaction. 5 Aside from its eect on productivity and satisfaction, PM provides a solution to the inherent principal-agent problem found in hierarchical businesses. As economist Joseph Stiglitz describes, managers have imperfect incentives to ensure that [workers and shareholders] are well-aligned. 6 Stiglitz describes this aspect of hierarchical businesses as not only unfavorable, but also as a cause of market failure in the East Asian economic crisis. As he explains, leading up to that crisis, outcomes were clearly not in workers interests and were probably not even ecient. 7 Eciency plays an important role in PM, since participative businesses often involve a higher level of skill and job rotation than more hierarchical ones. e basic idea is that workers know how to do more and therefore can do more than one simple task. iv When describing High Road vs. Low Road industrial relations systems, the High Road clearly emerges as the ideal option. Yet on the ground, the Low Road, less participative model is more likely to be used. is is true across the board, and is not dependent on the level of development of a country (as can be seen ny the U.S.s Low Road structure). McCarey et al. have argued that barriers to participative systems are embedded in social, economic and political principles and that these are where attention needs to be focused to facilitate a transition to greater participative management. 8 e prevailing principles in Low Road systems, driven by dierential wages, tend to incentivize personal advancement, a by-product of this being that those on top in Low Road systems will most likely be the strongest resisters of any transfer of power towards a less hierarchical, iv Recalling the discussion of Classic vs. Human Resources theories, another facet of the Classic theory was that work should be based on tasks. Human Resources theory took the opposite approach, emphasizing the importance of workers ability to carry out entire processes, and therefore have more understanding, ability and personal-meaning added to the work they are doing. is added personal-value was argued to increase eciency. High Road system. is ts in line with McCarey et al.s principle, but still leaves unanswered the question of how to change those principles. To answer this question, lessons must be learned from successful cases. is brings us to Germany and Argentina, both of which managed a transition to a High Road system via rather unique moments in the histories of their countries. In each example those on top lost their power prior to the shift to PM. While this was the case in these examples, it is certainly not the only way to make the transition. Nonetheless, they do provide an idea of what does and does not work, both in the transition and in overall functioning of a PM model. Codetermination in Germany Germanys industrial relations model has been lauded for its high levels of productivity, worker-involvement and its general successful High Road structure. Often grouped with Japan in discussions of High Road models, both nations current participative industrial relations models date back to the end of WWII, when each national economy essentially had to recreate itself under close international observation after losing the war. In Germanys case, the top priority was to make a system that would never allow for the kind of centralized power that had occurred under the Nazi regime. As it turned out, this ended up including many aspects of the pre-Nazi Weimar regime, in which workers committees and Works Councils (essentially business- level micro-unions) were legally included in the industrial relations system. Abolished under Hitler, a new version of these structures would appear after the death of his regime. ese structures form the current industrial relations system in Germany, called Codetermination, in which workers hold 50 percent of the seats on the supervisory board of their companies, and Works Councils are present in all sizable businesses so that workers voices enter into management and decision-making. is model, supported and protected by the German state, is designed to directly address the conicting interests of workers and employers. It has so far been successful in doing so, in many ways redening the role of collective bargaining. e term Codetermination, or Mitbestimmung in German, is dened in the Oxford American Dictionary as cooperation between management and workers in decision-making, especially by the representation of workers on boards of directors. Although Codetermination as we know it today originated as a Post-WWII model, the concept of worker involvement began early in Germanys history, even prior to WWI. e very rst eorts toward worker-involvement legislation were in 1848 when factory committees made demands for participation rights and improved working and living conditions. ese eorts went unanswered, their success hampered by employers fearing Petersson | JGA 54 an erosion of their power of decision. 9 About 70 years later, under the Weimar Republic Constitution, labor legislation was passed which gave workers and sta equal rights to participate together with the company in the regulation of wages and working conditions, as well as in the complete economic development of the producing powers 10 via Works Councils. Works Councils are organizations run by workers for workers rights at the shop-oor level. ey essentially function as micro-unions within each business, safeguarding employee interests and carrying out at the business-level what trade unions carried out at the national and industry level. e Works Councils Act set the stage for another act two years later that introduced worker representation at the high level of supervisory boards. ese legislations facilitated a high worker involvement system, and functioned well until a number of external and other factors led to the fall of the Weimar regime and the rise of the Nazi regime. In 1934, under Hitler, all of these labor legislations were repealed under the Act to Regulate National Work. 11 One of its many negative eects of the Nazi regime was to leave Germanys economy in shambles. Emerging out of the destruction of war, Germany now has one of the largest global economies and is the highest exporter after China. v is trajectory is a story worth studying. Under Allied occupation starting in 1945, a revived emphasis was put on industrial democracy and worker participation. By 1946, the Allied Control Council Act No 22 was put in place, directly modeled after the 1920 Works Councils Act. 12 Over the next 30 years, a number of new legislations came into place, each of them increasing PM by provisioning for Works Councils in every workplace, culminating in the Codetermination Act of 1976 which universalized Codetermination in Germany. is law stipulated that businesses with over 2,000 employees have 50 percent of the seats on the supervisory board allocated to employee representatives. 13 While this law certainly diers greatly from most countries industrial relations legislation, it passed with an overwhelming majority in Germany. Workers and unions were not incredibly enthusiastic, since all sides regarded it as a compromise. 14 is scenario only further emphasizes the unique political-economic context in Germany. Since 1976, the legislation has not changed drastically, but it has been amended a few times in the 2000s. e only signicant change in industrial legislation was the 1988 Executives Committee Act, which provided a legal basis for executive interests at the establishment level. 15 Compared to the legislation of 1976 and earlier, this Act slightly modied the system in favor of employers. e conicting interests of employers and workers in most of the world, and the conventionally high level of power v e Germany focused on here refers to West Germany until 1989, and then the greater nation from there on. that employers have, is what creates the need for collective bargaining by workers in order to have their demands met. In Germany, Codetermination operates on a company level, while collective bargaining...is conducted on an industry level, therefore alleviating the inherent conict between worker and manager. Nathan goes on to describe this as one of the reasons for Germanys success. 16 is argument adds a piece to the puzzle, but as McPherson holds, contrary to Reich, industry level collective bargaining does indeed occur in other countries, yet managers have still shown no interest in transitioning to a Codetermination system. 17 e main dierence in Germany is the labor legislation, which bolsters the two-leveled structure, separating shop-oor conicts from industry conicts through the existence of Works Councils at the plant level and trade unions at the industry level. at the German model succeeded and made leaps and bounds is no question since Germany still remains one of the largest economies in the world. It is, however, true that its economic trajectory over time has not been a continuous upward shoot. e miraculous growth in the 1970s and 1980s changed speed in the 1990s when the worlds economy was experiencing a decline, and globalization was applying new pressures on national economies. As Jacobi describes in Renewal of the Collective Bargaining System?, the once lauded German model took on a new name in the 1990s decline, the German Disease, due to inexibility in German industry in the face of worldwide competition and demographic change. 18 In the face of this slow decline, Jacobi argues that while Germany did indeed experience decline due to political and labor inexibility, new social and political reforms were already beginning to take place to adjust to these. 19 e cause of this decline was new international competition under globalization, which hurt many world economies in the 1990s. e common approach to this problem was to restructure the labor market. For Germany (and Japan), this meant becoming Americanized. For the U.S., this meant the inclusion of new Human Resources management practices (PM being among these). 20 Another aspect of the German decline, and the entire German system in general, is that Germany has relatively high unemployment levels compared to the U.S. A question for future research would be to look into how Germanys PM system aects unemployment. Despite the slight decline, the German model is still highly praised and has been recognized and introduced on some level in a number of European countries: [e]mployees in 18 of the 25 European member states have the right to have their interests represented in their companys top administrative and management bodies. 21 At an event celebrating the 30th anniversary of the Codetermination laws, the General Secretary of the European Trade Union Confederation called Germanys model a remarkable JGA | Participative Management 55 piece of economic democracy and participation and went on to say: [w]hat we need...is the Europeanization of a coherent concept of participative democracy in the social and economic context. 22 is overview of Codetermination in Germanys history and present provides some answers and many lessons regarding how and why an economy can and should develop a high participation industrial relations system. Argentinas Worker-Run Factories Argentinas recent nancial crisis in 2001 was devastating on a number of levels, with unemployment reaching 25 percent at its peak, unemployment and underemployment combined reaching 35 percent, while 60 percent of the population lived below the poverty line. 23 Out of this economically precarious state emerged a national movement of unemployed workers, characterized by widespread protest and a socio-economic phenomenon: the worker takeover of factories. Laid-o workers, whose factories had been shutdown, came together to reclaim their old jobs by occupying their closed factories and going back to work under their own management. e worker-run factory, or Empresa Recuperada por sus Trabajadores (ERT), essentially a very egalitarian, individual-level cooperative, became a global example of economic democracy and employee participation. Worker-run factories became a small portion of the economy towards the peak of the crisis in December 2001. In June of 2002, the countrys center-right wing newspaper reported 80 ERTs with nearly 10,000 employees, 24 and by January 2003, the number of factories had reached 140 (with the number of employees not changing drastically). 25 A study published in 2006 (conducted by professors and students at the University of Buenos Aires) located 200 recovered factories employing 10,000 workers. 26 More recently, an article published in January 2009 by the countrys left-wing newspaper reported 150 operating ERTs employing 13,000 workers. 27 In a country of 40 million, the worker-run factory represents a minuscule portion of the economy, yet it stands as a very dierent, very organic example of PM. Its smallness in scale also reinforces how impressive it is that the factories managed to maintain business, and even grow a little, in the last (economically grueling) ten years in Argentina. Unlike the German model, which was planned and organized over time, and existed within the system of its national government, the Argentine case was a form of protest in reaction to its nations failure to maintain a stable nancial system in which people could hold onto their jobs. To understand the existence of ERTs, I will present a description of the political economic context followed by specic examples and nally an analysis of media coverage and the international discourse surrounding these factories. e recent economic crisis in Argentina resulted from a history of dictatorship, combined with poor neo-liberal policies in the 1990s, pressure from international banks and an unsustainable peso to dollar convertibility law, all of which led to the explosive devaluation of the currency and the freezing of bank accounts in 2001. is crisis included the classic symptoms of investor withdrawal and widespread unemployment, which became common at end of the 1990s as business-owners on a micro level were closing down their businesses, in some cases because they were unable to pay back their own debts and in others because they recognized the decline and chose to get out before things got worse. Protests by mainly lower class citizens had begun towards the end of the 1990s, but at the peak of the crisis in 2001, the number of unemployed had risen so high that protests became ubiquitous, uniting the lower and middle classes. ese national protests caused the resignation of the then president on December 21, 2001, and in the following 11 days the nation saw four new presidents come and go, essentially run out by the protesting nation that had lost faith in its government. e fourth new president only stayed a year before resigning. e sovereignty and competence of the state was clearly compromised, and with no one else to turn to, and no one to legitimately stop them, workers simply went back to work. is was not restricted to one industry, but famously spanned across a variety of factory industries. 28 Ironically, the ERTs were not well supported by Argentinas labor unions. Yet they still managed to survive, and thrive, mainly through help from fellow factories. 29 A 2002 news article reported that some self-managed (autogestionada) factories 30 achieved salaries higher than their historical average and had also managed to hire new employees. 31 is nancial stability continues today, yet it still functions, in many cases, outside of the law and outside of the norm of any standing business model. Over the years, some legal concessions have been made, including a law on bankruptcy and expropriations, making it possible for some factories to legally own their businesses. Notwithstanding these examples, a large number of factories continue to face claims by previous owners, or previous creditors who attempt to regain ownership of the factories. Nonetheless, business continues. Since the seized, self-managed factory is a relatively new concept, it is by no means a homogeneous, clear-cut model, yet there are some overarching characteristics which appear in most ERTs. e most well-known, well-studied aspect is that these factories are run by direct democracy, with frequent (in most cases, weekly) meetings in which employees vote equally on decisions. 32 Also, employees take on new positions and rotate jobs, becoming more exible and skilled workers (embodying the High Road model). is structure is like a grassroots version of the German model, having a similar positive psychological eect to what Codetermination fostered years before. Ranis, after Petersson | JGA 56 researching and visiting a number of ERTs, noted that [w]orking for the enterprise is no longer seen as external to the worker. is view is supported in a number of accounts, along with a feeling that workers have not only rescued their lost jobs, but have also entered into a much better arrangement than their previous one. 33 Although in the beginning things were dicult, these ERTs are now economically stable and competitive, all the while experiencing irreplaceable economic solidarity. One factory even managed to open up a health clinic in its neighborhood. 34 Many academics and alternative media journalists, along with some factory members themselves, proudly chronicle these events as anti-neoliberal and anti-capitalist. 35 While this reading is understandable, especially regarding the question of private property rights, it is much more productive to interpret it as a political movement of social rights that ts into our capitalist framework. To say that it is anti-capitalist to ght for the social right to employment is to ignore the actual workings of some of the most capitalist modern societies. If we take the U.S. for example, even with its high employment rates, welfare is still oered to those who cannot nd work. China also oers a good example, since employment there is seen as a fundamental right. In his seminal work e Great Transformation, Polanyi gives some insights into the emergence and importance of social rights in the capitalist economy. 36 He looks back to the origins of industrialization and describes that, as the world became industrialized and labor commodied, the economy came to the forefront and society became dependent upon it, whereas historically, economy had been secondary to society. is shift made possible huge violations of social rights, and out of this grew the political need to protect those social rights, and account for the harshness of the economy. With this in mind, we may recall the situation in Argentina and see that neither the employers, nor the creditors, nor the government were doing anything substantial to protect the social rights of the thousands of employees who were laid o. Despite all of this inaction, the people still had the political impetus to protect their social right to work. And when they did nally begin working again, the factories neither went bankrupt nor shrunk in size, but rather stabilized and even grew. In this sense the workers actions are ultimately capitalist, by generating gains on means of production that would have otherwise not necessarily have been used at all. Argentina stands as a case in point of how PM and economic democracy can occur organically, and thrive doing so. Yet its very specic context limits it to being a model to learn from, not necessarily to implement elsewhere. In contrast, the German, and also the Japanese, model, have desirable, replicable qualities. Comparative Analysis and Conclusions Now that the two examples have been historicized and described in detail, we may compare them and think about what worked and what did not work in each, looking separately at their beginnings, their overall performance, the experience of the workers and their relationship with the state. e beginnings of each example are quite dissimilar, mainly on the level of the states role and each countrys place in the world economy. Whereas Germany had just experienced the end of Nazism and was receiving controlled support from other nations for its restructuring, Argentina was in economic crisis as a result of its own bad policies combined with pressure from global banks. e similarity in the examples origins is that they arose out of a malfunctioning system. is suggests the tentative conclusion that PM systems are more likely to prevail when the contemporaneous system is not doing well. Without this, it becomes dicult to imagine a scalable implementation of the model, since hierarchical employers will do their best to resist this. e eect of PM and a High Road structure on productivity and eciency remains a debated question. Many have argued a positive or insignicant correlation, while others have contested it. vi A recurring contestation is that it is basically impossible to measure whether or not higher productivity is causing higher performance and satisfaction, or vice versa (as proponents of PM want to prove). 37 Although this classic correlation problem can never be fully solved, one way of addressing this question is by comparing like businesses with dierent management systems. Researchers Locke and Romis do just this in a recent research paper on work conditions in global supply chains and oer promising ndings. 38 Comparing two shirt factories in Mexico (both Nike suppliers) of roughly the same size and age...and producing more or less the same product and subject to the same labor regulations, the authors nd that their dierent management systems (one more High Road, the other more Low Road) lead to a dierence in working conditions, worker satisfaction, wages and even eciency, with the High Road factory doing better in all of these areas. is adds important empirical evidence to the debate by bridging the vi For support of positive or insignicant correlation, see: Addison, Schank, Schnabel, Wagner. Do Works Councils Inhibit Investment? Industrial and Labor Relations Review, 60:2 ( January 2007):187- 203.; Ichniowski et al., 1996; Tyson, David and Levine, DAndrea . Participation, Productivity, and the Firms Environment, 1990, quoted in Stiglitz, Democratic Development, 12.; and Osterman and Kochan, 2006. For contestation, see: William H. Form. Auto Workers and eir Machines: A Study of Work, Factory, and Job Satisfaction in Four Countries, Social Forces, 52:1 (September 1973): 1-15. Hall; Jones. Why Do Some Countries Produce So Much More Output Per Worker an Others? e Quarterly Journal of Economics, 114:1 (February 1999): 83-116. JGA | Participative Management 57 question of eciency and of worker experience, since the better management of one factory led to better treatment of workers and better eciency. More studies such as Locke and Romis would help to clarify the debate and bring concrete conclusions. While the debate on productivity remains, very few disagree that worker satisfaction increases greatly when workers themselves participate in decision-making and have personal stake in their workplace. Additionally, the eect of PM on collective bargaining is undeniably benecial for all parties. Recalling Stiglitzs discussion of the principal-agent problem, we see that in both examples this problem was gracefully dealt with. In the Argentine case, the classic principal-agent problem does not exist, since workers became the sole actors in the business (this would probably change if the Argentine model grew in scale and became more institutionalized and if investors became more interested). By doing this, the Argentines now only need to use collective bargaining when dealing with the state. e prices they receive are entirely based on the market. Germany, by making workers both principals and agents (principals because they are part of the decision- making process and are also receiving their livelihoods; agents because they are representing the interests of their investors as well) and by separating plant-level conicts from industry-wide ones (with Works Councils and trade unions), managed to create a less conict-ridden collective bargaining system. e help of the state was essential in making this an established structure. Looking at Germanys success and Argentinas example brings two main ndings. First, that PM works and can appear in virtually any society. Second, for PM to become successfully established in an economy, labor legislation is needed to overcome resistance from self-interested employers. e most signicant dierence between the two examples was that in Germany, PM had the state behind it, whereas in Argentina it was the failure of the state which caused people to act. Germanys model became nationally ubiquitous, while Argentinas remained localized. Argentinas ERTs and the Mexican shirt factory are two isolated examples of successful High Road systems, proving that PM works even when it is not the established model. Germany, however, provides lessons for how to establish this desirable model. In e Mutual Gains Enterprise: Forging a Winning Partnership Among Labor, Management and Government, the authors make clear that any successful High Road business must include the three groups mentioned: labor, management and government. 39 Without government support, there is not a strong enough impetus for employers and managers to cede power for the greater good of their corporation. ere is a particular aspect of the PM systems role in the public eye in both these examples and in general that deserves some attention here. A prevailing opinion of high worker involvement workplaces is that they are part of a system which shies away from capitalism and moves towards something much more socialist. e worker-run factories in Argentina, to give an extreme example, have been regarded both by outsiders and even by people within the movement as anti-capitalist. When looked at more closely, we can see that this line of thinking is wrong, both intuitively and in practice. High worker involvement does not mean that work and wage is standardized and equalized by a sovereign power, but rather that wages become a true reection of the market. By having PM systems, businesses manage to avoid possible monopolies by rent seeking employers. ese potential micro-monopolies of labor in hierarchical workplaces are deemed impossible in situations of high worker involvement. A quote from an Argentine recovered factory worker perfectly highlights my point: we are going to ght with everything to maintain the levels of production. 40, vii Overall, these two examples are inspiring manifestations of highly participative systems, one becoming very successful and established, the other remaining tiny but resilient. Comparing the German and Argentine cases brings new insights because of their extreme dierences. Among these insights are some lessons for the future, of what to do (and what not to do) when making the transition to a High Road PM model. Of course, many economies are far from making that transition, although as Ichniowski et al. describe in What Works at Work, new high-involvement, high-skill trends have been slowly appearing in the United States and other countries since the 1990s. 41 Also, international media and the supranational European Union have begun to pay attention to Germanys successful social market economy, especially in the face of the most recent economic crisis. 42 On every count, Germany embodies an ideal successful model worth emulating. e fact that the Argentine example even exists, however, speaks greatly to the value of participative management in any workplace. In many ways, the fact that these examples of successful PM arose out of mal-functioning economic systems makes it dicult to imagine their expansion on a global scale. However, history is beginning to tell a dierent story, with examples like the Mexican factory and increased worker involvement in a number of economies. On a last note, the fact of the recent economic crisis may indeed represent just enough economic mal-functioning to see a global transition to a more stable, and more satisfying, social market economy. vii For a further theoretical discussion of this, see Appendix 2 Petersson | JGA Appendix 1: High Road and Low Road Source: Stiglitz, Joseph E. Democratic Development as the Fruits of Labor. Keynote Address, Industrial Relations Research Association (IRRA), Boston: January 2000 JGA | Participative Management | Appendix LABOR MARKET Inducement to high eort High unemployment and eciency wage High involvement induces eort even with low unemployment Compensation Contractual wages Wages plus prot sharing Wage dierentials High dierentials as incentive for individual adavancement Low dierentials for increased group solidarity and cohesiveness Employment security Low; dismissal is credible threat for discipline High security to promote identication with enterpise Training costs Paid by individual to increase marketability Paid by rm as long-term human capital investment Macro-environment Can adjust to and contribute to larger reces- sions with layos Works better with and contributes to fewer and smaller recessions by avoiding layos PRODUCT & FACTOR MARKETS Relationship Arms-lengh, market-oriented, and competitive Long-term relation based on commitment, trust, and loyalty Product Standardized (to foster competition) Customized to buyer or seller Curb to opportunism Exit and competition Voice, commitment, and trust CAPITAL MARKET Relationship Arms-lengh, market-oriented nance Long-term relational nance Time perspective Short-term since hard-to-monitor; human capital investments downplayed Long-term and patient to reap returns to human capital investments Debt/equity ratios Need low D/E ratio to provide exibility in face of unforgiving market Can have higher D/E ratios with patient rela- tionhp to nancial sources and with involved, more exible workers Low costs of equity Low costs since no sharing of income or control rights with workers Lower costs for internal equity since workers already share some income & control rights Enterprise Characteristic Low Road High Road 58 Appendix 2: Philosophical Underpinnings of PM e argument that Amartya Sen makes for successful development, claiming that there is more to it than simple economic growth (although this growth is by all means a part of the equation), can be shrunken down to the level of the corporation. 50 When we ask ourselves what is a successful business or corporation? the automatic answer is one that sustains economic growth. With this deeply entrenched assumption, suddenly it becomes very radical to argue that there is more to success than money. Even worse, when one references this argument, proponents of the economic gains argument (both on the global development and on the individual business level) automatically shoot it down, as if one were arguing to compromise nancial gain for some other metric of success. is is not the case, nor is it a complete impossibility. Happiness and having a voice are some qualities that have been valued by humans for longer than money has even existed, and although they cannot be measured as money can, there are ways of beginning to take them into account. What is radical about thinking of these? As it turns out, when brought into the model of a business, they have been shown to complement eorts at economic growth, either by maintaining the same level that would have otherwise been or by promoting higher growth. If nancial growth is not at stake, it seems the only thing that is at stake is the hierarchical power structure in which those at the top gain considerably more than those at the bottom. Restructuring this model and spreading power more equally is certainly the greatest obstacle in switching to a more pleasing model for all employees. As I understand it, the question of worker-participation in corporations is like a micro version of the question of whether to choose democracy or some more authoritarian form of government. Of course, when it comes to entire societies and nations, much more is at stake, but the universal practicality of including the voices of all those involved in and beneting from their society or job still holds. inking about the way power is organized, it seems almost impossible that those on top would ever cede any of their wealth, and arguments have certainly been made that these higher paid higher-ups have no moral obligation to do so. However, examples in life (outlined in this paper) have shown systems in which the economy is successful and the power of those on top is greatly diminished. is brings me to an argument made by G.A. Cohen, in his recent philosophy book Rescuing Justice and Equality, in response to Rawls argument for dierential incentives: In 1988 the ratio of top executive salaries to production worker wages was 6.5 to 1 in West Germany and 17.5 to 1 in the United States. Since it is not plausible to think that Germanys lesser inequality was a disincentive to productivity, since it is plausible to think that an ethos that was relatively friendly to equality protected Germany productivity in the face of relatively modest material incentives, we can conclude that the said ethos caused the worst paid to be better paid than they would have been under a dierent culture of reward. 51 When thinking of participative management in terms of economics, at least theoretically, it is arguably a better way of fully realizing capitalism than the prevailing capitalist structure in most of the world. is is because more equally distributed wages and more worker involvement in the actual production process leads to a free market-driven system, since the market, instead of the employer, determines wages. Even the most classical free-market economists have argued against monopolies, and in many ways, hierarchical businesses with huge wage dierentials can be interpreted as micro-monopolies, in which employers are controlling labor for personal gain. An economy run by the social market, which has been touted in Germany, is still very much a capitalist one, even though it appears strange to see a capitalist society with low levels of inequality and low wage dierentials. In many ways, this looks like a dierent, anti-capitalist model (especially when we compare it to other instances of high worker-involvement, such as in Argentina, which were treated by the press as anti-capitalist). However, as a 2009 BBC article stated, [o]fcourse there is a big dierence between the social market and socialism. 52 is is certainly quite a stretch from our current understanding of capitalism, yet when conceptualizing the German goal of social capitalism, it is important to remember that this is indeed a model of capitalism, not some other economic system. We see this in the mentioned quote by a worker from a prominent Argentine ERT: we are going to ght with everything to maintain the levels of production. 53 A whole book could be written on the philosophic underpinnings of a high worker-involvement structure, but what is most important to note here is that the Participative Management High Road model is both theoretically desirable and theoretically (and realistically) plausible. Appendix | Petersson | JGA 59 France presents itself to the artist and always has. Amidst the vast canon of the Louvres permanent collection, I caught a glimpse out the window, where the cityscape contextualized its importance in art history. Overlooking the Tuileries gardens (created in 1564 by Catherine de Medici) in Paris 1st District, the Louvre is a beacon of arts past and inspiration for its future. On this warm summer day, the monumental architecture of Paris blends together seamlessly into a greater representation of the city as a whole. Having felt the creative atmosphere in Paris, I caught a train to the South of France to seek out iconic artistic inspiration. I explored the small town of Aix en Provence, the home and primary inuence of painter Paul Czanne (1839-1906). His most famous series of landscapes are of Mount Saint Victoire, pictured here. Everyday, Czanne carried paints, canvas and rations to the mountainside. He died from pneumonia, caused from ceaseless ventures to the mountain. I hiked from a bus stop for an afternoon of solitude, wine, cheese and cigarette in hand, where I spent the day drawing under a tree in a vineyard. Ekphrasis Drew McKenzie Chaos and Cosmos: Madidi Park, Bolivia William Roberts Don Bruno, as the locals call him, has spoken to every plant in his garden. His old, wiry body can be seen, covered by nothing but a loincloth, roaming through tall sugar cane stalks spun with poroto vines as he furiously picks weeds. He smells the leaves of a palm and pauses while his gray eyes twitch back and forth. Spinning through the mental Rolodex of his extensive seed bank, he announces the legume that will provide the nitrogen that the plant has just requested. His farm sits on a 10-hectare plot at the edge of Madidi National Park, one of the worlds most diverse ecosystems. It is lled with over seventy nutritious, food- bearing trees including coee, citrus (for wine), cacao, mangoes, sugar, eight varieties of banana, beans, grains and corn. His collection of medicinal plants provides remedies for such ailments as rheumatism and swollen prostate and can be used to disinfect wounds and reduce fevers. A bright orange fruit that hangs from a purple ower helps children who have trouble learning to speak. He even once used the thick vines of the Ua de Gato that stands stoically in the middle of the garden to cure his friend of cancer. Bruno is an outstanding community organizer. He knows the nutritive needs of every plant that he lives with and takes pleasure in matching them with their suited counterparts. In return, the grateful plants take care of Bruno with bountiful harvests year round that ll his wooden dinner bowl without outside supplement. And, when I set up my tent in his garden and picked the rst weed from the foot of a lone corn stalk, I too became part of this ecosystem, invited to share all of its secrets. I rst saw Bruno arguing in French-accented Spanish with a bus driver over whether there was room for all of his construction supplies on top of the bus. His eyes turn silver when he is mad. Despite his accomplishments in innovative horticulture (he has written three published books on permaculture), Bruno has a pale emptiness inside of him, which often surfaces in his interactions with people. He has isolated himself in the jungle for nearly thirty years, living in solitude with the plants in an environment where his mind can function like his garden. He calls it Chaos and Cosmos: a functional, disorganized mania of harmonious balance. I think that it bothers him that the rest of the world sees the two ideas as incompatible. His inspiration comes from the delicate reciprocity of the plants and bugs in his garden, all living interspersed and interconnected. e banana trees shade the coee and tea. Yucca, pineapples and corn ll empty space, with peanuts and other legumes covering the soil, oering nitrogen and crowding out weeds. e system is bountiful and completely self- sustaining. As a farmer, he must do little more than harvest the ingredients that he needs for each meal. Agriculture is more than a profession; it is his worldview, his way of being. He lives intimately with the ora, waking every morning to the shadows of mangoes and oranges on his canvas tent. e diverse ecosystem supports both him and the crops. All distinction is lost between the interests of the plants and his self-interest. e wisdom of being in the presence of the trees brings the blue out from behind the clouds in his eyes. He is a modern day Dionysus, as his only income is from his delicious citrus wine and heirloom seeds. We took an all terrain bus early in the morning, over the at Antiplano and onto steep valley roads crossed with deep rivers, to the entrance of Madidi Park. ere, we loaded our gear and Brunos equipment onto the back of a hired pickup truck and sat on top, holding on through deep potholes and more river crossings. ere was a new moon that I would see wax every night until it was a full disk. Our path was lit by brilliant stars. Orion and Pleiades sparkle even in the Southern Hemisphere. It was nice to see old friends. Adjusting to life on the farm took some patience. Insect bites all over my body, back pain from long days in the eld and lack of bathrooms made me question my decision to come. On my second night, a furious windstorm sent me rolling in my tent, snapping a pole and smashing some instruments. I was humbled by the force of the elements and suddenly unconcerned by the scorpions and tarantulas that crept in the night. I was reminded that beginning something new is always dicult. Like starting a re: sometimes you must suer through smoke in your eyes in order to enjoy a warm dinner. e days at Brunos proved to be tranquil and constructive. Tasks varied from weeding to planting, 62 JGA | Chaos and Cosmos construction to cooking. I preferred working in the eld where I could acquaint myself with the plants by name and get my hands dirty. Some days I would ll seed bags with saplings, others I would spend hacking dead leaves o of banana palms with a machete. Work would end every day when the sun was at its highest, after which we would jump into the deep river to wash ourselves. When we dried o, lunch would be waiting on the table outside. Meals were delicious, simple concoctions of the variety of grains, vegetables and roots from the garden. We reserved eating meat for our Sundays o, as cooking a chicken entailed nding one, decapitating it, removing its feathers and roasting it all day over hot coals. e process of cooking and working the land was our closest relation to our community. Old recipes and agricultural wisdom, passed down through the generations from the Bolivian and other cultures represented by the international community on the farm, were shared as a testament to our heritage. e food system, on this small communal scale, was an integral aspect of our identity, our connection with the land and our ancestors. As the days went on I became more familiar with life on the farm. I began to recognize the fruit of each tree, the call of each bird and even the bites of each bug. I got to know the other workers as well, and what a wild bunch they were. ere was Mike, a ery kid from Utah with a bushy red beard that matched his spirit. He wrote songs about his bike trips across North America, and was thumbing his way back to the States with 150 bucks in his pocket. ere was Will, the singing sailor from Holland who woke up every morning with a beer can in his hand and never once left the construction site to enter the garden: I prefer to touch trees after theyre dead, thank you very much, he would explain. And his French girlfriend, who had a warrior soul and arms like tree branches. ere was Raul, the dreadlocked intellectual from Spain. Noah the Goof was taking time o from studying abroad in Chile. Andrew showed up wearing a Greenpeace Klearcut T-shirt; he had worked on the same campaign as me on the other side of the country. e young French couple, who claimed to be anarchists and were certainly in love, were so impressed by the valley that they decided on their second day to buy some land and raise their own crops. I woke up early the morning I was leaving and took one last swim in the river with Bruno before walking around camp with a guitar, waking everyone with a rendition of Leaving on a Jet Plane. We said sentimental goodbyes over a big pot of thick, black coee and traded gifts and words of appreciation. Bruno sent me o with a two-liter bottle of orange wine and a big kiss right on the lips. Youll come back, right? he insisted. Many times, I assured him. Bueno, and make sure you bring some cute California girls with you when you do! And with a grand promise to see each other again, in this life or the next, I strapped my possessions to my back and began my long walk back to civilization. e dirt road climbed over the surrounding hillsides, oering a bleak contrast to the ourishing life that I was leaving on the farm. Years of relentless logging have left the peripheries of the park infertile and barren as far as the roads will carry the trucks. e low grass can hardly cover the dry brown of the dirt hills, the timber companies having usurped the green from Eden. Despite Brunos most valiant eorts at conserving and reforesting the area, he will have little inuence once the mining and drilling companies catch wind of the abundant gold and oil deposits in the park. eir representatives will arrive in fancy cars, promising schools and hospitals that will never be delivered. e mosquito hums a pretty song in ight. e farm, however, will survive. I will sleep more soundly for the rest of my nights knowing that a slice of paradise is being well guarded. If the world should ood again, perhaps Brunos garden will be our ark. 63 Roberts | JGA Eleuthera Emma Young e site of memory: a place. e Pink House. Where lives converge, where time moves faster than the current and stands as still as a breezeless hot summer night. Here I left one part of my life and pickled another, an intermediate phase, that fermented and grew new life within itself. We bottled it like guava jelly, stored it in the sand and set it adrift at sea, a sealed map of memory. e clis, where we saw the bull sharks circling below us, 20 feet down. Up there on the limestone, with our parents, Cade and I were safe. e setting sun and crashing waves sent mystery through the air as the twelve foot sharks shoved their ns and noses out of the water towards us. Our parents held our hands as we all stood silent up there, watching this wild force below us churn up the dark Atlantic blue. e clis of Eleuthera Island are stunning. e backbone of a skeletal island, they have been beaten clean for years by hurricanes and astonishing waves, leaving them jagged and gnarly and lunar. Standing out on these brave clis against the Atlantic, I have often tried to connect with the incredible force I feel beneath my feet as water trickles through the limestone and circles again back into the ocean, turning white and cerulean. e ritual of absorbing the power of Whale Point. Out on those clis, facing the horizon, the wild seeps into every part of life. Naked power, a kind that has traveled from Africa and surges from the depths to move boulders across dry land, to send a wall of seawater fty feet into the air with no explanation and no apology on any given day. To build a house on the end of a tiny, jutting peninsula is to align with a vector of energy. Once, my father was ying in on a small prop-engine airplane that makes the trip down from Florida, when visibility became poor due to a Caribbean thunderstorm. Shaking in the air, the plane circled blindly as the pilot tried to coordinate the location of the islands tiny airport. Lightning was striking all around. As the plane dropped and jumped back up, the door to the cockpit swung open wide, and my father says that the ladies aboard took out rosaries and crossed themselves. Some made use of the vomit bags in front of them. He kept his eyes out the window. en, he says, a pointed roof appeared out of the gray. My house! he shouted. ats my house! Its at the end of Whale Point. e airport is due west! And so he was able to direct the pilot to a safe landing. at is the kind of story that can happen on an island like Eleuthera. e island itself is shaped like a mystery, its skinny, knobby points trickling down in a backwards-c shape, cupping the turquoise Carribean Sea directly across the half-mile-long sliver of mainland rock, on the other side of the deep and brooding Atlantic. is gentle water seems to reach no more than ten feet deep for miles and miles as it stretches towards Florida. It is as calm as glass, and you can see straight through the water, especially on calm days. Oftentimes when I am ying into North Eleuthera airport, I look for sharks or giant manta rays in the bay. My cousin claims to have seen an entire shipwreck from the air. e American painter Winslow Homer spent a good deal of his career depicting the Bahamian islands, and his works of Eleuthera are, not surprisingly, my favorites. He, too, seems to have been captivated by Glass Windows Bridge, a natural arch made of rock that stretches thirty feet and allows its passengers to essentially straddle these sister seas. To the north, the deep, midnight-colored Atlantic; southwards, the gemlike Caribbean. Humans did not create Glass Windows, though slaves from the pineapple plantations used to cross it from Gregory Town to the East in order to get fresh water in Upper Bogue, westward. What must they have thought about this striking example of balance in nature, of a more civilized wilderness? As with the rest of the Caribbean and Latin America, the Spanish and then the English colonized the Bahama islands as centers of export, bringing slaves from Africa and establishing large plantations. Eleuthera, in particular, was used for pineapple production from the early 18th century, with its peak in the mid-19th. e Dole Companys attention later shifted to Hawaii with its establishment as a state in the U.S. With the massive growth of the tourism industry and Bahamian independence in 1973, agriculture ceased to be the main economic feature of the Bahamas. Today, Eleuthera is lined with rolling elds of arable land, 64 JGA | Eleuthera empty silos now grown to their tops with weeds and vines. ! It has been years since my family went to Whale Point together. e past few times I have been, very frequently in the last two years, were all college trips with friends, my partner and my father. But, being there, I feel the passage of time and its beautiful malevolence tear at me as I go through every room of the house. Cades little, tiny hats. She had always had a big head, but how could these be so small? Sunglasses our parents had given us for Christmas. e driftwood curtain rods we had made the rst summer after we built the house; their same, thin white curtains hazily swaying in the breeze from the ceiling fan. Looking through the few pieces of clothing that my mom left in her armoire upstairs in the pink house, I felt as if I was sorting through memories, or the clothes of somebody who no longer exists. I caught myself saying, is was my moms, though, of course, it still is my moms; I called her to ask if she wanted me to bring these things back to Florida. e orange skirt with small Hawaiian gures surng across the fabric, a plain gray tee-shirt to wear on the boat I can picture it now, the full ensemble, her white baseball cap shining over sporty black sunglasses and her beautiful painted toenails in blue ip ops. A blue paisley spaghetti- strap dress, a red oral spaghetti-strap dress; a summer wardrobe. I wore her clothes, the last time I was there. We slept in their bed, omaz and I, and that rst night alone felt like we had become my parents. Upstairs in that huge room, surrounded by water on all sides, with every window open and the sound of waves crashing around us. It is an intense experience to live on Whale Point. Memory: a feeling of intense joy and sadness at once, of knowing that this had been our home, that we had made it together. I know its nuances (no glass in the upstairs shower window), its secrets (two roofs) and its smell (the most comforting hint of salt spray and mildew). is house was never nished completely, and, like many projects of my parents, perhaps never will be. But it is the absence of the glass in the window, that smell of mildew that I love; of knowing, this is a place where time is present, where nature comes in, like the ants seething into the Buenda familys home in One Hundred Years of Solitude. So much signicance in a gray tee-shirt. So much depending on those clothes resting within that cabinet, waiting for Mom to return and wear them again. Waiting for my childhood to commence again, to run on the pink sand beaches with my parents and make bonres at night. How I long for my mother wearing those simple sundresses on Bahamian afternoons. ! Whale Point. Whales. Cetaceans. Distant, imaginary Leviathans swimming o of those ragged clis. eir migration has stopped. Long ago, they were overshed. 65 Young | JGA Suering as always from insomnia, when I was young, crawling into my mothers side of the bed. Soothing me, she would say, imagine whales. A mother whale and a baby whale, swimming together in the comfort and safety of the deep. Singing to each other. I would, and still do, imagine their songs before drifting o to that other place of memory, where the subconscious pulls apart memories in order to re- member them, to put them back together. But those imaginary whales, both of my dreams and my waking life, have a large presence and great meaning for my family. Leviathan Light, my father named his lighthouse a large, cylindrical, shell-shaped studio he built overlooking the great clis and natural pool they have formed on the Atlantic side, up where we saw the sharks. e lighthouse, a crazy, beautiful project interrupted. Unlike his paintings, this site of creation is perpetually a work in progress. One day, he says, hell put a light in there. A beacon for the lost whales, calling them back to their migratory home. ose imaginary whales, soft, delicate, and so spiritual, so strong. Like so much of the Caribbean, they were taken for the use of others. But like my memories of childhood, they swim swiftly through the temperate waters. What must it have been like to immigrate to a tiny island? My great great grandmother came from Israel with her sister and her mother, who abandoned her when she fell in love with a black man. Youd never know, looking at me, that my grandfather was the descendent of Africans, and of Lucayan Indians, who came to the Caribbean after being chased through South America by the Caribs, an indigenous group now known for their supposed cannibalism. You might know, looking at me, that my grandmothers distant ancestors were Irish. Only recently did I learn of an incredible family story: that my grandmothers ancestors, sixteen generations back, were on the voyage of the Eleutherian Adventurers, an extremely well-known story in the Bahamas. ough I had believed my family rst went to Abaco, as history would have it, they rst shipwrecked o of Spanish Wells, in North Eleuthera, at Preachers Cave. eir plaque, dated 1648, is still amazingly there, telling of their survival until they were rescued by a search team of sailors from Harvard University in Boston. I had no idea. It is a staggering revelation. is is our DESTINY! my father writes me in an e-mail when I wrote to him, excitedly, nearly out of breath, that this was my familys history, that my family named the island Eleuthera, for freedom. So tting it is, that my father would end up painting the black gure. His watercolors, so vibrant, an unmatched realism with the medium, reect our larger family in their forms. rough my mother, he has claimed the Bahamas as his own, noting that my mothers ancestors shipwrecking in Eleuthera is part of our destiny one he cannot be separated from. His own family, coming from the United States South, traveling through states of racism from Georgia to Alabama, Texas, Hawaii, where my dad was the outsider, the unwanted, and back to Florida faced a reality we study in college today. In painting the black gure, my father paints this history; one that is larger than any of us, and yet contains pieces of him, of my mother, of me and my sister. We come from many places, and even Cade and I are only half-Bahamians. But this place, this site of memory, 66 holds a convergence of our lives. Here we spent summers, spent time o from school in Florida, but my parents kept us there every day; my dad in his paintings, mum in her accent and knowledge of the most nourishing type of cooking the meals that connect you to a place that is part of you. Entering the Pink House through the kitchen screen door: the familiar smell of a musty, painted house. Eleuthera ages as it is reborn. is little yellow kitchen, such a welcoming entrance to my youth the past and yet a place of active creation. Most of my favorite Bahamian memories involve food. Spending the day on the boat, pulling a conch right out of the water on a sandy beach, dicing it up, adding limes, sour orange, raw onions and tomatoes and eating the freshest conch salad in the world while the sun sets; the smell of my mothers Johnny Cake as it came out of the oven, getting us girls up for a day of exploration; waking up the morning after my cousins wedding a few years ago and enjoying boiled sh n grits with my whole family. Johnny Cake, a simple Afro-Caribbean bread - 2 cups our - 1 tablespoon baking powder - Salt - 4 tablespoons sugar - 1/2 stick of butter + 4 tablespoons oil - Water Combine the dry ingredients, press the butter into the our until it looks like peas, then stir in the oil. Add enough water until it gets the consistency of cake batter, but not quite as wet. Bake at 425 until brown (about 20-25 minutes). Mums accent. My dad called it cute when they met, and she said, Fuck o. A Bahamian girl who came to the States at sixteen to attend college; living in New York for a year and then coming back south, to study printing at Ringling School of Art before heading back to work for her fathers printing press in Freeport. at night, at some party, when my parents met, something changed for my dad, who met his muse. e next week, they saw each other in the laundry room, and my mum ended up doing dads laundry because he didnt know how. My parents, so young to marry, so beautiful in their art and ambitions, in their love of the Bahamas. ey waited eight years to have children, both of us conceived beneath my fathers painting table. One of their biggest projects, followed by constructing our house in Jupiter, Florida, in the State Park, where we were brought up in nature, then continued by the Pink House. e Pink House, where we havent gone back to visit together in nearly seven years, is dierent from our beautiful, comfortable home in Florida. e Pink House holds danger, holds adventure, holds a mysterious and deep type of art and nourishment. It is a house of celebration, of change the place where I rst got my period, where learning to drive, I ran over a dog with a car and yet it is a place that remains unchanged where Cade and I were best friends, before we returned to Florida to grow apart. e feeling is palpable, in the air of Cades bedroom, and our living room, out on the dock and along the swimming path to our favorite reef, that we are sisters and are forever connected to each other. Family takes work. It is not just a given; the way we have naturalized the idea of family and the nuclear unit. But my family is all of me. e Pink House, the clis, the sister seas, Preachers Cave; Eleuthera. A home that stands strong through hurricanes and oers protection from the sharks, but a connection to whales. A place we all loved together. 67 Young | JGA Environmental Refugee Status: International Reception of Climate Displacement Jacqueline Hall 68 JGA | Environmental Refugees In the past few decades, the world has become increasingly aware of anthropogenic harm to the environment that may signicantly alter and deteriorate our quality of life and necessitate serious remedial eorts. Environmental issues, including man-made and natural disasters, have driven people away from their communities throughout history. e projected eects of climate change have the potential to aggravate these kinds of disasters as well as raise a whole host of new problems that will force unprecedented numbers of people to leave their homes and seek new lives internally or internationally. ese problems will disproportionately aect the developing world which necessitating multilateral agreements to guarantee protection for those who can no longer sustain their lives in their current locations. Unfortunately, there is no legal protection for persons eeing their homes for environmental reasons. e international community of developed nations has put up a hostile front to extending refugee status to those aected by climate change. is reaction does not morally stand up to agreed upon values of human rights and rejects responsibility for transnational environmental damage. Environmental refugees is not an ocial term, but it is widely used and can be dened as, people who have been forced to leave their traditional habitat, temporarily or permanently, because of marked environmental disruption (natural and/or triggered by people) that jeopardized their existence and/or seriously aected their quality of life. 1 Temporary or reversible environmental damage could include natural disasters or industrial incidents, and long- term or irreversible change could include anything from dam construction to sea level rise. Another category of migrants unmentioned in the denition includes those who migrate to seek a better quality of life because their resource base has been depleted by causes like soil salination or deforestation. As stated, causes for migrations include ooding, drought, soil erosion, deforestation, earthquakes and toxic spills. e poster child consequence of climate change, however, is sea level rise. e Intergovernmental Panel on Climate Change forecasts nearly as much as a two feet rise in sea level in the next century due to the melting of glaciers and ice sheets and thermal expansion caused by rising temperatures. Half of the worlds population is crowded into coastal zones and about 10 million of those people are at constant risk of ooding. A one meter rise in sea level would uproot 20 million people in Bangladesh alone. 2 A rising sea level presents a very real threat, as it has the potential to destroy entire nations. In the Pacic, the Northern Group islands of the Cook Islands, and the many islands of Kiribati, Tokelau, Tuvalu, the Federated States of Micronesia and the Marshall Islands are set to disappear before the end of this century, and will become uninhabitable long before that. 3 ese nations will become uninhabitable because rising sea levels salinate the soil and destroy its capacity to grow food. Tuvalu has already experienced damaging oods and is seen as the nation most likely to sink due to sea level rise because, at its highest, it is only two meters above sea level. 4 Although there are only 11,000 Tuvaluans, their populations combined with the rest of the vulnerable small island nations represent a sizable group of people who will be forced to move because of climate change. ough the most publicized, sea level rise is only one of the problems caused by environmental damage and climate change. A United Nations survey predicts that a third of the worlds land is becoming infertile, and other studies foresee that 100 million of 135 million people living in areas of desertication will be displaced in the next 20 years. In Kazakhstan, the receding of the Aral Sea caused a 30-fold increase in disease amongst locals. Estimates vary, but the most commonly cited study, published in 1993 by Dr. Norman Myers, predicts that there will be 150 million environmental refugees by the middle of this century. In this estimate, he predicts 30 million refugees each from China and India, 15 million from Bangladesh, 14 million from Egypt, 10 million from other Delta areas, and one million from island states. In 2005, he updated this study to 200 million climate refugees by 2050. Bangladesh is amongst the especially high risk countries because it is so vulnerable to increasingly intense storms and oods, sea level rise causing salinization and river erosion. Additionally, it is one of the most densely populated nations in the world. 5 Another sizable demographic feeling pressure to migrate for environmental reasons is the rural poor, who are 69 Hall | JGA reliant on agriculture or other resource-based livelihoods for both income and subsistence. Internal migration in the developing world means many people will move to already resource-strained megacities, making them no less vulnerable than the refugees forced to leave their countries. When moving to cities, environmental refugees often end up in shantytowns and slums, where it is not only unhealthy and dangerous, but also dicult to nd employment. Slums are characterized by lack of social services and opportunity, and often violence related to the scarcity of resources. Over 90 percent of the residents of Korail, one of Dhakas biggest slums, never leave because they cannot aord to. 6 Internal migrants to cities face hardships in similar ways as those migrating across borders. ere are resource constraints, challenges to social cohesion, and limited infrastructure, which lead to increases in urban slums. 7 e political discussion regarding environmental refugees revolves most commonly around their lack of legal status. ey do not t within the UNs denition of a refugee, so there is no international or national legislation that explicitly recognizes or denes climate or environmental refugees and there is no governing body with a mandate to oer them protections. 8 A refugee is dened in the UN 1951 Convention Relating to the Status of Refugees as a person who, as a result of events occurring before 1 January 1951, e Protocol to the Refugee Convention in 1967 adapted this denition to remove the pre-1951 condition. Environmental refugees do not t into this denition. First, they are often still within their country of residence, but not necessarily by choice. Secondly, they do not usually fall under the category of those fearing persecution for reasons of race, nationality, religion, or membership of a particular social group or political opinion. It can be argued, though, that environmental degradation is a kind of persecution, as Andrew Simms explains in a letter to a member of the UN High Commission for Refugees (UNHCR). Simms writes, being forced to live in worsening poverty on land that without warning could ood or turn into dust [...] Whether deliberately or due to sins of omission, these consequences are the result of economic and political decisions. 10 However valid this argument, it is unlikely environmental refugees would be accepted under this rationale, and so they are categorically excluded from UN protection. Karen McNamara traces the origins of UN inaction through interviews with ambassadors and senior diplomats. Overall, there seems to be no lack of research on the topic and she nds that the term is certainly not unfamiliar. ere is, however, a distinct lack of any policy or potential to establish policy for the protection of environmental refugees. McNamara nds that a common view amongst interviewees is a negative reaction to the terminology. Environmental refugee is a contested term because it is seen as impossible to extract as an isolated condition. e term environmental does not adequately describe reasons for migration (more frequently cited reason are war or family connections), which is why this description receives little attention from UN or like-minded organizations that address refugee status and displacement. Environmental refugees are almost always moving for a combination of reasons, including social and political, but ecological and environmental research is suggesting that environmental triggers most signicantly inuence their migration decisions. is ambiguity does not justify dismissing the importance of environmental factors on these decisions. 11 Another response found in McNamaras interviews was, You do not take in people because they cant make a living somewhere. 12 is is indicative of the contemporary discussion surrounding immigration, which focuses on migrants potential economic utility or harm. National policies have revised immigration laws to this discussion, disadvantaging the lower skilled migrants, which happens to correlate with the type of people who are most vulnerable to climate related displacement. e UN Environment Programme (UNEP) had done some research on environmental refugees (they actually coined the term in 1985) but has shifted its focus to the impact of refugees and preventative strategies to protect the environment from refugee movements. e attitude of the UNEP has shifted because refugee protection is too sensitive a political issue to be included in their responsibilities. e UNCHR stands strictly by its mandate to protect refugees as dened by the Convention, and does not see environmental migrants as legal or legitimate refugees. 13 e language of the UNHCR further excludes certain people by describing such migration as being inherently voluntary. One likely reason for the UNHCRs strict stance is its lack of donor support and a tight budget, which forces it to prioritize. McNamara concludes that some of the hostility to the idea of protecting environmental refugees has emerged because of this prioritization; the United Nations has other, more demanding and higher publicized, issues to deal with, such as the Iraq war and sub-Saharan poverty. Additionally, McNamara notes a growing hostility towards current Convention-dened refugees. Refugee status in the post-war period was once highly respected, but over the years countries like the United States, the United Kingdom, Australia and Germany have moved towards a position 70 JGA | Environmental Refugees where they claim they are being inundated by illegitimate refugees. In this climate, a sympathetic approach from UN member states on extending refugee status to other displaced persons is unlikely. 14 McNamara explains this shift, stating, changes in attitude towards multilateralism are likely to be a consequence of fear and the increasingly xenophobic nature of domestic policies in the West. Fear from images of escalating numbers of environmental refugees has led governments to be convinced of the need to protect their state borders. 15 Another growing sentiment amongst many Western states is a move away from accepting responsibility for transnational environmental pollution, though some individual nations have taken action to protect climate refugees. Australia and New Zealand are two examples, in part because of their adjacency to vulnerable small island nations. In Australia, the Labour Party recognized some responsibility for environmental refugees by oering aid to those aected by sea level rise. e government has also established an international coalition to accept climate change refugees when a country becomes uninhabitable and provide assistance to preserve the cultural heritage of those who are evacuated. In response to the Tuvaluan governments request for help, New Zealand created the Pacic Access Category, allowing 75 residents from Tuvalu and Kiribati as well as 250 residents from Tonga to migrate to New Zealand each year. However, applicants must be between the ages of 18 and 45, have an acceptable oer of employment and meet a minimum English language requirement. 16 In Africa, refugee agreements were also reached that include climate migrants. e Accord of the Organization of African Unity (OAU) recognizes as grounds for asylum, external aggression, occupation, foreign domination, or events seriously disturbing public order. Environmentally displaced persons for reasons such as drought or other natural disasters were not intended to be included by the Accord but because the scope of this expanded denition is habitually applied to those for whom economic protection by the state is not forthcoming, a restrictive interpretation excluding victims of ecological and man-made disaster is by no means precluded. 17 ough these policies are a start, they are scattered and not inclusive enough. Even specic instances of natural disasters are not addressed in any international agreement that obligates the international community to provide relief. Overall, people in humanitarian need for environmental reasons are not well protected. National policies cannot be counted on because they are not cohesive enough and, as in the New Zealand agreement, can exclude migrants deemed to be undesirable, regardless of need. National policies are also subject to change with electoral patterns. e discussion of environmental refugees is largely aimed at the UN because it remains the only institution capable of multilaterally establishing human rights standards. Simms argues that if there is a lack of an ocial UN status for environmental refugees, they will be condemned by 71 Hall | JGA a global problem to a national economic and geographic lottery and to the patchwork availability of resources and the application of immigration policies. 18 Advocates argue that the denition of a refugee is grounded in human rights, which include the right to an adequate standard of living and access to food. e kind of suering associated with environmental degradation is clearly a violation of these rights. It can also be argued that because climate change is caused by humans, the state is obligated to protect its citizens from them. In the case that a state cannot protect its citizens, victims qualify for the international assistance given to refugees. 19 Although the future impact of climate change is foggy and speculative, it is clear that the world is facing an unprecedented prospect of seeing the land of several nations wiped out. is daunting fate cannot be faced with unclear policy regarding those aected by it. A lack of multilateral action could potentially dissolve faith in the UN entirely. David Corlett astutely sums up the questions the world faces as we head into this hazy situation: Does the possibility of hundreds of millions of people on the move in search of protection, some crossing international borders, force a reconceptualisation of the state as a territorially dened political entity related to a distinct nation? How can national belonging remain meaningful while there is the potential for some states to disappear o the face of the earth? 20 e UNs desire for a clear-cut denition of refugee is excluding a large group of highly vulnerable people. is term ought to be analyzed for eectiveness and adapted, as conditions and reasons for migration are too expansive to be conned to a narrow denition invented as a prescription for specic circumstances. It remains a right of states to exert power over those who inhabit their space, but climate change clearly indicates that states have the power to degrade and even destroy the geography of others. In this case, the responsibilities usually held by states to protect their citizens become international. e international communitys ability to protect and assist environmental refugees is heavily reliant on a states willingness to recognize them as both a political and a human problem. 21 e excuse that environmental is an ambiguous term by no means undermines the fact that people who migrate have powerful motivations that are heavily associated with environmental conditions. Additionally, internal migration should not be belittled; in terms of the urgency of aid needed, those migrating to cities and elsewhere within their countries face equal hardship breaking into established communities, seeking employment and obtaining increasingly scarce resources. Although it may be a more immediately eective strategy for vulnerable nations to form partnerships with potential host nations early, a UN agreement is the only chance at an eective solution. If the developed world cannot shake its disinclination towards accepting responsibility for environmental damage, the developing world will be further condemned to hardships far beyond the economic challenges they are already facing. Gender Inequality Spanning Cultures through Triabalization Tribal Afghanistan & Tribal American Mormons R pg 8-13 1 John L. Esposito & Dalia Mogahed. (2008). What do Muslim Women Want? An excerpt from the book Who Speaks for Islam? Gallup. Retrieved from 2 Jared Diamond. (1999) Guns, Germs and Steel. New York, NY: W.W. Norton & Company. 3 Frederic Engels. (2010). e origin of the family, private property and the state. General Books LLC. (Original work published 1876). 4 Eisla Sebastian. (2005). An anthropological view of bands, tribes, chiefdoms, and states. Associated Content. Retrieved from. associatedcontent.com/article/12144/an_anthropological_view_of_bands_tribes.html?cat=37 5 John H. Bodley. Anthropology and contemporary human problems. Retrieved from A15&lpg=PA15&dq=ancient++tribal+societies&source=bl&ots=PBy2OWvOQ&sig=FHHZuZNaPd8j4bgw8Xlbpt91Fq4&hl=en&ei=rk3gS4C8IsGq- lAfS2pnCCA&sa=X&oi=book_result&ct=result&resnum=9&ved=0CDAQ6AEwCA#v=onepage&q=ancient%20%20tribal%20societies&f=false 6 omas Hobbes. Leviathan. Retrieved from- Q4nPYeps6MC&printsec=frontcover&dq=Leviathan+hobbes&source=bl&ots=_vXu2DrF03&si g=KA3XxhQ_j6y2YsD3sdblaqFZsaU&hl=en&ei=RojkS4bXNoO88gb0hZxp&sa=X&oi=book _result&ct=result&resnum=1&ved=0CBwQ6AEwAA#v=onepage&q&f=false 7 Abigail Adams, John Adams) (2003). e letters of John and Abigail Adams. New York , NY Penguin Classics (original work published 1776). 8 National Womens Law Center. (2008). Falling short in every state: e wage gap and harsh economic realities for women persist. Retrieved from 9 R. Brian Ferguson & Neil L. Whitehead. (1993) War in the tribal zone: Expanding states and indigenous warfare. (1st ed.). Oxford: School of American Research. 10 Anthony Hyman. (2002) Nationalism in Afghanistan. Int. J. Middle East Studies. Retrieved from MES/MES34_02/S0020743802002088a.pdf&code=f53e306f64597cdce6bbfbf916a408e1 11 Tajfel, H. (1982). Social psychology of intergroup relations. Annual Review of Psychology., 33. Retrieved from 12 Donald M. Tayloy & Frances E. Aboud. (1973). Ethnic stereotypes:Is the concept necessary? Can. Psychol (14), 330-38) 13 14 Michael A. Hogg and Dominic Abrams. (2001) Intergroup relations: Essential readings. Philadelphia, PA: Psychology Press 15 Myron Rothbart, Solomon Fulero, Christine Jensen, John Howard, Pamela Birrell. (1978) From individual to group Impressions: Availability heuristics in stereotype formation. J. Exp. Soc. Psychol, 14. (237-55) 16 United States Census Bureau. (2000) Retrieved from 17 Jon Krakauer. (2003). Under the banner of heaven: A story of violent faith. New York, NY: Random House Inc. 18 Captain H. Christian Breede. (2008) A socioeconomic prole of Afghanistan. Canadian Army Journal. Retrieved from e=55 19 Afghanistan Independent Human Rights Commission. (2009). AIHRC annual report. Retrieved from Reports_eng/Annual_Rep/2009/Final%20AIHRC%20Annual%20Report%202009.pdf 20 UNICEF. (2009) UNICEF Afghanistan Statistics 2009. Retrieved from 21 e Association of Religion Data Archives (n.d.) Retrieved from 22 Louis Dupree. (1974) Afghanistan: Problems of a peasant-tribal society. New York: Praeger. 23 Peter R. Blood. (2001) Afghanistan: A country study. Washington: GPO for the Library of Congress. 24 Environics Research Group. (2007) 2007 survey of Afghans: Summary report. Retrieved from. afghanconictmonitor.org/Environics_2007_Survey_of_Afghans.pdf 25 Barnett Rubin. (2004). Crafting a constitution for Afghanistan. Journal of Democracy, 15. (3), 5-19. From Dirt to a Dream R pg 14-15 Source Material: Model T Car: Number of Cars in the US: American History: 1940 Car: Crossly Regis: U.S. Depatrtment of Transportation/ Motor Vehicle Registration: Interstate System: Society in the 1950s: Department pf Transportation Ocial Site: A Historical Perspective on American Roads: American History: US Industrilization: Ford Sierra RS Cosworth: Essays on Consumerism in Asia R pg 16-19 1 Xun Zhou, Eat, Drink and Sing, and Be Modern and Global: Food, Karaoke and Middle Class Consumers in China, in Christophe Jarelot and Peter van der Veer, eds., e Patterns of Middle Class Consumption in India and China (New Delhi: SAGE Publications, 2008), 170-185. Notes 72 2 Douglas B. Holt, Does Cultural Capital Structure American Consumption? in Juliet B. Schor and Douglas B. Holt, eds., e Consumer Society Reader (e New Press, 2000), 212-252. 3 at luxury item may be Made in China, American Public Media, February 2, 2009, pm_made_in_china/ 4 Allison Pugh, Longing and Belonging (University of California Press, 2009). 5 Zhou, 172. 6 Zhou, 174. 7 at luxury item may be Made in China, 8 Holt, 220. 9 Holt, 221. 10 A term used by Alison Pugh in her work, Longing and Belonging, to distinguish between two types of consumerist behaviors that parents use with their children. 11 William Mazzarella, Shoveling Smoke (Duke University Press, 2003). 12 Mazzarella, 5. 13 Mazzarella, 89. 14 James Watson, ed., Golden Arches East: McDonalds in East Asia (Stanford: Stanford University Press, 2006). 15 James Watson, Introduction: Transnationalism, Localization, and Fast Foods in East Asia, in James Watson, ed., Golden Arches East: McDonalds in East Asia (Stanford: Stanford University Press, 2006), 4. 16 Watson, 27. 17 David Y.H. Wu, McDonalds in Taipei: Hamburgers, Betel Nuts, and National Identity, in James Watson, ed., Golden Arches East: McDonalds in East Asia (Stanford: Stanford University Press, 2006), 110-135. 18 Wu, 115. 19 Wu, 120. 20 Stephanie Kaza, Penetrating the Tangle, in Stephanie Kaza, ed., Hooked!: Buddhist Writings on Greed, Desire, and the Urge to Consume (Boston: Shambhala Publications, 2005), 139-151. 21 ubten Chdrn, Marketing the Dharma, in Stephanie Kaza, ed., Hooked!: Buddhist Writings on Greed, Desire, and the Urge to Consume (Boston: Shambhala Publications, 2005), 63-75. 22 Chdrn, 66. 23 Chdrn, 67. 24 Bill McKibben, Deep Economy (Oxford: Oneworld Publications, 2007). 25 Tim Kasser, e High Price of Materialism (MIT Press, 2003). Both McKibben and Kasser discuss the eects of materialism on happiness, suggesting that an increased desire for material goods has a negative eect on peoples lives. Religion, National Identity and Education in the Islamic World: A Look at the Educational Systems of Egypt, Turkey and Saudi Arabia pg 21-25 1 Cook, Bradley James. Egypts National Education Debate. Comparative Education 36.4 (2000): 477-90. JSTOR. Web. 13 Dec. 2010. p477. 2 Fandy, Mamoun. Enriched Islam: e Muslim Crisis of Education. Survival 49.2 (2007): 77-98. Informaworld. Routledge. Web. 10 Dec. 2010. p79 3 Fandy, p79. 4 Education in Saudi Arabia. Washington, D.C.: Saudi Arabian Cultural Mission in the United States of America, 1991. Print. p2-3 5 Fandy, p82-83. 6 Cochran, Judith. Educational Roots of Political Crisis in Egypt. Lanham, MD: Lexington, 2008. Print. p96 See also Arab Republic of Egypt Education Sector Review: Progress and Priorities for the Future (In Two Volumes) Volume I: Main Report. Rep. no. 24905- EGT. Human Development Group Middle East and North Africa Region e World Bank, October 2002. Web. 16 Dec. 2010. p8 7 ED.gov. U.S. Department of Education. Web. 16 Dec. 2010. <>. See also Neill, Charlotte M. Islam in Egyptian Education: Grades K12. Religious Education 101.4 (Fall 2006): 481-503. ProQuest International Academic Research Library. Web. 10 Dec. 2010. 8 Yildiran, Guzver. An Overlook at the Turkish Educational System. Recent Perspectives on Turkish Education. Bloomington: Indiana University Turkish Studies Publications, 1997. 1-12. Print. p3 9 Nohl, Arnd-Michael, Arzu Akkoyunlu-Wigley, and Simon Wigley. Education in Turkey. Mnster: Waxmann, 2008. Print. p43. 10 Bosbait, Mohammed, and Rodney Wilson. Education, School to Work Transitions and Unemployment in Saudi Arabia. Middle Eastern Studies 41.4 (2005): 533-46. Informaworld. Web. 13 Dec. 2010. p533. Also See Figure 1, Indicators | Data. Data | e World Bank. Web. 16 Dec. 2010. <>. 11 Fandy, p77. 12 Cochran, Judith. Educational Roots of Political Crisis in Egypt. Lanham, MD: Lexington, 2008. Print. p67-69, 73. 13 Cochran, p76. 14 Cochran, p91. 15 Neill, Charlotte M. Islam in Egyptian Education: Grades K12. Religious Education 101.4 (Fall 2006): 481-503. ProQuest International Academic Research Library. Web. 10 Dec. 2010. 16 Fandy, Mamoun. Enriched Islam: e Muslim Crisis of Education. Survival 49.2 (2007): 77-98. Informaworld. Routledge. Web. 10 Dec. 2010. p81. 17 Fandy, p84. 18 Fandy, p83. 19 Cook, Bradley James. Egypts National Education Debate. Comparative Education 36.4 (2000): 477-90. JSTOR. Web. 13 Dec. 2010. p482. 20 Cook, p482. 21 Pink, Johanna. Nationalism, Religion and e Muslim-Christian Relationship: Teaching Ethics and Values in Egyptian Schools Egypt. CESNUR - Centro Studi Sulle Nuove Religioni - Center for Studies in New Religions. Web. 16 Dec. 2010. <>. 22 Kaplan, Sam. e Pedagogical State: Education and the Politics of National Culture in Post-1980 Turkey. Stanford, CA: Stanford UP, 2006. Print. p73-89. 23 Frey, James S. Turkey: a Study of the Educational System of Turkey and a Guide to the Academic Placement of Students from Turkey in United States 73 Contextualizing Genocide: An Examination of Complexities n Cambodia and Guatemala pg 28-32 1. Mahmood Mamdani, When Victims Become Killers: Colonialism, Nativism and the Genocide in Rwanda, Princeton: Princeton University Press, 2001, 7. 2. Mamdani. 3. Greg Grandin, e Blood of Guatemala: A History of Race and Nation, Duke University Press, 2000. 4. Luis Cardoza and Aragon, La Revolucin Guatemalteca, Guatemala: Editorial del Pensativo, 1994, 52. 5. Grandin, 199. 6. Grandin, 56. 7. Grandin, 233. 8. Shawn Crispin and Seth Meixner, Boiling Mad, Far Eastern Economic Review V.166 No. 6 (February 13, 2003) P.18, 166.6 (2003): 18. 9. William J. Duiker, Ho Chi Minh: A Life, New York: Hyperion, 2000, 439. 10. Henry Kamm, Cambodia: Report from a Stricken Land, New York: Arcade publishing, Inc., 1998, 75. 11. Kamm, 75. 12. Kenton Clymer, Cambodge, e Historian V. 70 No. 4 (Winter 2008) P. 813-14, 70.4 (2008): 813-14. 13. Kamm, 3. 14. Mahdev Mohan, Reconstituting the Un-Person: e Khmer Krom and the Khmer Rouge Tribunal, Singapore Year Book of International Law and Contibutors, 2010, 47. 15. Panh, Rithy. S21: e Khmer Rouge Death Killing Machine 2003. Film. 16. Dinah PoKempner, Cambodia at War, 68. 17. Grandin, 8. 18. Grandin, 140. 19. Daniel Wilkinson, Silence on the Mountain: Stories of Terror, Betrayal, and Forgetting in Guatemala, New York: Houghton Miin Company, 2002, 169. 20. Wilkinson, 169. 21. Wilkinson, 198. 22. PoKempner, 78. 22. Greg Grandin, 78. 23. Guatemala: Historical Memory, Genocide, and the Culture of Peace, 77. 24. Greg Grandin, 219. 25. Elizabeth Oglesby, Educating Citizens in Postwar 26. Mahdev Mohan, 44. 27. Rigoberta Menchu, I, Rigoberta Menchu: An Indian Woman in Guatemala, Ed. Elisabeth Burgos-Debray, Trans. Ann Wright, London: Verso, 1987. 28. Rigoberta Menchu, 14. 29. Rigoberta Menchu, 164. 30. Rigoberta Menchu, 209. 31. Momostengango, Holistic Healing: A Better Approach to Civil-War Recovery, e Economist October 14, 2004. Educational Institutions, 1972. Ann Arbor, Michigan: University Microlms International, 1979. Print. p10-12. 24 Frey, p12-13. 25 Kaplan, Sam. e Pedagogical State: Education and the Politics of National Culture in Post-1980 Turkey. Stanford, CA: Stanford UP, 2006. Print. p76-77 26 Kaplan, p78-89. 27 Tavernise, Sabrina. Youthful Voice Stirs Challenge to Secular Turks. e New York TImes. 14 Oct. 2008. Web. 10 Dec. 2010. 28 Education in Saudi Arabia. Washington, D.C.: Saudi Arabian Cultural Mission in the United States of America, 1991. Print. p6 29 Education in Saudi Arabia, p4. 30 Oliver, E. Eugene. Saudi Arabia: a Study of the Educational System of Saudi Arabia and a Guide to the Academic Placement of Students in Educational Institutions of the United States. Washington, D.C.: American Association of Collegiate Registrars and Admissions Ocers, 1987. Print. p4. 31 Bosbait, Mohammed, and Rodney Wilson. Education, School to Work Transitions and Unemployment in Saudi Arabia. Middle Eastern Studies 41.4 (2005): 533-46. Informaworld. Web. 13 Dec. 2010. p533. 32 Education in Saudi Arabia, p4. 33 Bosbait and Wilson, p533. 34 Education in Saudi Arabia, p6-7. 35 Fandy, p85. 36 Fandy., p86. 37 Fandy, p85. 38 See Figure 1. 39 Bosbait and Wilson, p533-46. 40 Bosbait, p534. 41 Fandy, p86. 42 Education in Saudi Arabia, p6-7. Hugo Chvez, Chavismo and Rethinking Latin American Populism pg 35-38 1 Kirk Hawkins, Populism in Venezuela: e Rise of Chavismo, ird World Quarterly 24.6 (Dec. 2003): 1137-160, JSTOR, Web, 18 Apr, 2010, 1145. 2 Hawkins, 1138. 3 Hawkins, 1138. 4 Carlos De La Torre, Populist Seduction in Latin America: the Ecuadorian Experience. Athens: Ohio University Center for International Studies, 2000, 4. 5 Hawkins, 1139. 6 Hawkins, 1139. 74 7 De La Torre, 10. 8 Bart Jones,Hugo!Hanover, New Hampshire: Steerforth, 2007, Print, 22. 9 Jones, 21. 10 Jones, 24-25. 11 Moises Nam, Paper Tigers and Minotaurs: e Politics of Venezuelas Economic Reforms, New York: Carnegie Endowment for International Peace, 1993, Print, 101. 12 Christian Parenti, Hugo Chvez and Petro Populism, e Nation, No. 14, 11 March 2005, 280. 13 Jon Lee Anderson, Fidels Heir: e Inuence of Hugo Chvez, e New Yorker, 23 June 2008, Print, 4. 14 Hawkins, 1151. 15 Hawkins, 1150. 16 Hawkins, 1150. 17 Hawkins, 1142. 18 Anderson, 4. 19 Erich Fromm,Escape from Freedom, New York: H. Holt, 1994, Print, 1. 20 Hawkins, 1138. Somalia and the Mixed Blessings of Anarchy pg 44-46 1 omas R. Yager, e Mineral Industry of Somalia, in US Geological Survey Minerals Yearbook (2004). 2 Jamil A. Mubarak, From Bad Policy to Chaos in Somalia (Westport: Praeger, 1996). 3 Consolidation in A Country Study: Somalia, Library of Congress, 27 July 2010 <>. 4 Jamil A. Mubarak, e Hidden Hand behind the Resilience of the Stateless Economy of Somalia, in World Development 25:12 (1997): 2028. 5 e Hidden Hand, 50. 6 Somalias Dicult Decade, in A Country Study: Somalia, Library of Congress, 27 July 2010 <>. 7 Bad Policy, 103. 8 e Hidden Hand, 2028. 9 Andre Le Sage, Stateless Justice in Somalia Formal and Informal Rule of Law Initiatives (Center for Humanitarian Dialogue, 2005): 20. 10 Foreign Relations, in A Country Study: Somalia, Library of Congress, 27 July 2010 <>. 11 Le Sage, 19. 12 Somalia during WWII, in A Country Study: Somalia, Library of Congress, 27 July 2010 <>. 13 P. Leeson, Better o Stateless: Somalia before and after Government Collapse, in Journal of Comparative Economics 35:4 (2007): 5-8. 14 Scientic Socialism to IMF-ism, in A Country Study: Somalia, Library of Congress, 27 July 2010 <>. 15 Tom Hewitt, Half a Century of Development, in Alan omas, Tim Allen, eds., Poverty and Development into the 21st Century (Oxford: Oxford University Press, 2000): 303. 16 Ken Menkhaus and Lou Ortmayer, Somalia: Misread Crises and Missed Opportunities, in Bruce W. Jentleson, ed., Preventative Diplomacy in the Post-Cold War World: Opportunities Missed, Opportunities Seized, and Lessons to be Learned (Maryland: Rowman and Littleeld, 1999). 17 Leeson, 9. 18 Foreign Military Assistance, in A Country Study: Somalia, Library of Congress, 27 July 2010 <>. 19 Le Sage, 21. 20 Bad Policy, 15. 21 Hassan Barise, BBC News | AFRICA | Somalis Cheer Black Hawk Down, in BBC News - Home (22 January 2002) < africa/1777435.stm>. 22 Bad Policy, 17. 23 Kenneth J. Menkhaus, Political Order in a Stateless Society. Current History 97 (1998): 220-24. 24 e Hidden Hand, 2035-2038. 25 Leeson, 10. 26 e Hidden Hand, 2027. 27 Le Sage, 23-24. 28 Andrew Cockburn, Somalia, A Failed State? in National Geographic Magazine <. html>. 29 BBC NEWS | Africa | Living in Somalias Anarchy, in BBC News - Home <>. 30 Peter Little, Somalia: Economy without State (Bloomington: Indiana University Press, 2003). 31 Leeson; 2, 10-16. 32 Kenneth J. Menkhaus, Somalia: State Collapse and the reat of Terrorism (Oxford: Oxford UP for the International Institute for Strategic Studies, 2004). 33 Leeson; 2, 10-16. 34 Kenneth J. Menkhaus, State Collapse in Somalia: Second oughts, inReview of African Political Economy30:97 (2003): 4. 35 Menkhaus, State Collapse. 36 Leeson, 10. 37 Leeson, 29-30. 38 Le Sage; 24-25, 30-31. 39 David Herbert, Whos Afraid of Somali Pirates, in National Journal (16 May 2009): 52-53 <>. 40 Peter Little, qtd. in Leeson, 10. 41 e Hidden Hand, 2038. 42 Menkhaus, State Collapse, 8-9. 43 Le Sage 32-38. 44 Tristan McConnell, Foreigners Are the Real Pirates, Says Former Somali Fisherman - Times Online, in e Times | UK News, World News and Opinion (12 June 2009) <>. 45 Herbert.omas R. Yager, e Mineral Industry of Somalia, in US Geological Survey Minerals Yearbook (2004). 75 Under the Inuence: Patterns of Dependency in Latin American Development pg 47-49 1 Fernando Henrique Cardoso and Enzo Faletti, Dependency and Development in Latin America (Berkeley: University of California Press, 1979). 2 Ibid., 25. 3 John Charles Chasteen, Born in Blood and Fire: A Concise History of Latin America (2nd ed., New York: W.W. Norton, 2006), 182. 4 Ibid., 182. 5 Juan Bautista Alberdi, Immigration as a Means of Progress, in Gabriella Nouzeilles and Graciela Montaldo, eds., e Argentina Reader (Durham: Duke Press, 2002). 6 Ibid., 95. 7 Ibid., 95. 8 Ibid., 96. 9 Chasteen, 182. 10 Albert O. Hirschman, e Political Economy of Import-Substituting Industrialization, in Quarterly Review of Economics (1968). 11 Ibid., 7-8. 12 Cardoso and Faletti, 23. 13 Hirschman, 13. 14 Ibid., 12. 15 Ibid., 32. 16 Cardoso and Faletti, 12. 17 John Williamson, What Washington Means by Policy Reform, in Latin American Adjustment: How Much Has Happened? (Washington: Institute for International Economics, 1990), par. 4. 18 Ibid., par. 6. 19 Ibid., par. 31. 20 Alberdi, 100. 21 David Harris and Diego Azzi, ALBA: Venezuelas answer to free trade: e Bolivarian Alternative for the Americas, in Occassional Paper no. 3 (Bangkok: Focus on the Global South, 2006), 3. Protecting Rights and Promoting Development: Lessons from Germany and Argentina in Participative Management pg 52-59 1 Casey Ichniowski et al. What Works at Work: Overview and Assessment, (original article published in 1996) in C. Ichniowski et al. e American Workplace: Skills, Compensation and Employee Involvement, Cambridge: Cambridge University Press, 2000 and Paul Osterman; omas Kochan. e mutual gains enterprise: forging a winning partnership among labor, management and government, Cambridge: Harvard Business School Press, 2006. 2 David McCarey, Sue Faerman and David Hart. e Appeal and Diculties of Participative Systems, Organization Science, 6:6 (November 1995): 603-627. 3 Joseph E. Stiglitz. Democratic Development as the Fruits of Labor. Keynote Address, Industrial Relations Research Association (IRRA), Boston: January 2000. 4 Tyson, David and Levine, DAndrea . Participation, Productivity, and the Firms Environment, 1990, quoted in Stiglitz, Democratic Development, 12. 5 One such study is: Soonhee Kim, Participative Management and Job Satisfaction: Lessons for Management Leadership. Public Administration Review, 62:2 (March 2002): 231-241. 6 Kim. 7 Kim. 8 McCarey et. al, e Appeal and Diculties of Participative Systems. is argument ts in the framework of G.A. Cohens philosophical arguments against dierential incentives, outlined in detail in Appendix 2. 9 Rebecca Page. Codetermination in Germany: A Beginners Guide, Arbeitspapier 33 (Germany: Hans-Bckler Stiftung Foundation, 2006), <http://> (accessed April 24, 2010). 10 Weimar Republic Constitution, in Page, Codetermination: A Beginners Guide, 6. 11 Weimar Republic Constitution. 12 Page, 6. 13 Hans Joachim-Mertens; Erich Schanze. e German Codetermination Act of 1976. Journal of Comparative Corporate Law and Securities Regulation, 2, (1979): 75. 14 Mertens and Schanze. 15 Page, 7. 16 Nathan Reich. Codetermination in Practice, Industrial and Labor Relations Review, 9:3 (April 1956):468. 17 William H. McPherson. Codetermination: Germanys Move toward a New Economy, Industrial and Labor Relations Review, 5:1 (October 1951): 20-32. 18 Otto Jacobi. Renewal of the Collective Bargaining System?, in eds. Walther Mller-Jentsch, Hansjrg Weitbrecht. e changing contours of German industrial relations. (Munich: Rainer Hampp Verlag, 2003): 15. 19 Jacobi. 20 MA Huselid and JT Delaney. e impact of human resource management practices on perceptions of organizational performance, Academy of Management, 39:4 (1996): 949. 21 Dr. Norbert Kluge, Head of the SEEUROPE Project Codetermination in Europe European Trade Union Institute for Research, Education, Health and Safety, Brussels published in Page, Codetermination in Germany: A Beginners Guide. 22 John Monks (General Secretary of European Trade Union Confederation), John Monks speech on 30th anniversary of the German 76 Environmental Refugee Status: nternational Reception of Climate Displacement pg 68-71 1 Richard Black, Geography and Refugees: Patterns and Processes of Change ( John Wiley and Sons Ltd., 1993). 2 Mark Townsend, Environmental Refugees in e Ecologist 32 (2002) 22-25. 3 Emma Brindal, Justice for Climate Refugees in Alternative Law Journal 32 (2007) 240-241. 4 David Corlett, Stormy Weather: e Challenge of Climate Change and Displacement (Sydney: University of New South Wales Press, 2008). 5 Joanna Kakissis, Environmental Refugees Unable to Return Home in e New York Times 4 January 2010, < world/asia/04migrants.html?scp=1&sq=environmental%20refugees%20unable%20to%20return%20home&st=cse>. 6 Kakissis, 1-3. 7 Mey Akashah, e Fight and Flight of Environmental Change in Environment Magazine 52 (2010) 6-7. 8 Brindal, 240-241. 9 Karen Elizabeth McNamara, Conceptualizing Discourses on Environmental Refugees at the United Nations in Population and Environment 29 (2007) 12-24. 10 Andrew Simms & Aziz Ahamed. Should the UN Actively Embrace the Concept of Environmental Refugees in e Ecologist 32 (2002) 18-21. 11 Akashah, 6-7. 12 Akashah, 6-7. 13 Akashah, 6-7. 14 Akashah, 6-7. 15 Akashah, 6-7. 16 Brindal, 240-241. 17 Black 18 Simms & Ahamed, 18-21. 19 Black 20 Corlett 21 Akashah, 6-7. Mittbestimmungsgesetz. Hans-Bckler Stiftung Foundation. Berlin: August 30, 2006. <> (accessed April 24, 2010)]. 23 Peter Ranis. Factories without Bosses: Argentinas Experience with Worker-Run Enterprises. Labor Studies in Working-Class Histories of the Americas, 3:1 (2002):14. 24 Capital Humano, La Nacin, 30 June 2002. <> (accessed April 15, 2010). 25 Un modelo viable para recuperar el empleo, La Nacin, 15 January 2003. <> (accessed April 15, 2010). 26 Julian Rebn; Ignacio Saavedra. Empresas Recuperadas. (Buenos Aires: Capital Intelectual, 2006). 27 Laura Vales. Fbricas recuperadas que aprendieron caminas solas, Pagina/12 20 January 2010. < elpais/1-118569-2009-01-20.html> (accessed April 16, 2010). 28 Ranis, Factories without Bosses, 17. 29 Jos Luis Coraggio. A path to the social economy in Argentina: worker takeovers of bankrupt companies in ed. Ash Amin. e Social Economy. London/New York: Zed Books, 2009), 145. 30 this is just another term used for ERTs, autogestion best translating to mean self-management. 31 La Nacin, 30 June 2002. 32 Ranis, Factories without Bosses]. 33 see Coraggio, 2009, Rebn, 2006 and Ranis, 2002. 34 Naomi Klein and Avi Lewis. Argentina: Where Jobless Run Factories, e Nation, 16 July 2007. < lewis> (accessed April 27, 2010)]. 35 see in bibliography, authors: Ranis, Klein and Lewis, Coraggio. 36 Karl Polanyi. e Great Transformation: e Political and Economic Origins of Our Time, (Boston: Beacon Press, originally published 1944, reprinted 2001). 37 Hall; Jones. Why Do Some Countries Produce So Much More Output Per Worker an Others? 38 Richard Locke; Monica Romis. Improving Work Conditions in a Global Supply Chain, MIT Sloan Management Review, 48:2 (Winter 2007): 54-62. 39 Osterman, Paul; Kochan, omas. e mutual gains enterprise: forging a winning partnership among labor, management and government, (Cambridge: Harvard Business School Press, 2006). 40 vamos a pelear con todo para mantener los niveles de produccin quoted in Laura Vales. Fbricas recuperadas que aprendieron caminas solas 41 Ichniowski et al., 2 42 Steve Rosenberg. Germanys orderly social market, BBC News, Berlin 19 January 2009. < correspondent/7837266.stm> (accessed April 30, 2010) 43 Sen, Amartya. Development as Freedom, New York: Anchor Books, 1995. 44 Mishel & Frankel, e State of Working Class America, 1988 quoted in G.A. Cohen Rescuing Justice and Equality: 143 45 Steve Rosenberg Germanys orderly social market BBC News, Berlin January 19, 2009 < correspondent/7837266.stm>]. 46 vamos a pelear con todo para mantener los niveles de produccin quoted in Laura Vales. Fbricas recuperadas que aprendieron caminas solas. 77 Jacqueline Hall Danny Herman IS FROM Washington, DC AND WILL GRADUATE IN May 2012 FROM NYU College of Arts and Sciences WITH A MAJOR IN Andrew Boston IS FROM Boulder, CO AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN Specicity and Universalism in Justice Julia Burnell IS FROM Ocean City, MD AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN Politics, Philosophy and Economics Zachary Caceres IS FROM Antigua, GT AND WILL GRADUATE IN May 2014 FROM NYU Gallatin WITH A CONCENTRATION IN Photography, art history, writing, lm and possibly marketing Jamie Denburg Darius Lerup IS FROM Topseld, MA AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Socioecological Urban Design and Planning IS FROM Hanover, NH AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Environmental and Metropolitain Policies for a Globalized World Olivia Jovine IS FROM Charleston, SC AND WILL GRADUATE IN May 2011 FROM NYU College of Arts and Sciences WITH A MAJOR IN Art History AND A MINOR IN Business Studies Drew McKenzie IS FROM Los Angeles, CA AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN Social and Psychological Analysis in/of Shakespeare Leigh Rome IS FROM Middletown, DE AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN The Broadcast Narrative Yasmin Ogale IS FROM New Hope, PA AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN Political Theater: An exploration of international politics, game theory & al-Qaeda Shana Oppenheim IS FROM Rhode Island AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Photography and Portuguese Emily Pederson IS FROM Old Chatham, NY AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN International Sustainable Development Paz Petersson IS FROM Minneapolis, MN AND WILL GRADUATE IN May 2011 FROM NYU College of Arts and Sciences WITH A MAJOR IN Environmental Studies AND MINORS IN Politics AND Spanish Ana Radolinski IS FROM Berkeley, CA AND WILL GRADUATE IN May 2012 FROM University of California, Davis WITH A MAJOR IN International Relations AND A CONCENTRATION IN Land and Energy Use in Latin America William Roberts IS FROM Denver, CO AND WILL GRADUATE IN May 2011 FROM NYU Steinhardt WITH A MAJOR IN Communications AND A CONCENTRATION IN Film and Politics Mitchell Weaver IS FROM Miami, FL AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN Image Construction and Representation Patricia Guarch Wise IS FROM Larchmont, NY AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Law as a Means to Sustainable Development in Africa Contributor Bios IS FROM Berkeley, CA AND GRADUATED IN January 2011 FROM NYU Gallatin WITH A CONCENTRATION IN Philosophy of education AND A MINOR IN Psychology 78 NOTE e articles that appear in the NYU Gallatin Journal of Global Aairs ( JGA) represent the views of a wide- ranging group of students and scholars. ey in no way reect the views of NYU, the Gallatin School of Individualized Study or the JGA. While all reasonable precautions have been taken by the authors and editors to ensure the quality of work, the JGA makes no representations or warranties as to the accuracy or completeness of material within. While we may not agree with all of the observations and diagnoses of our writers, we support their pursuit of serious university-level academic research and the fruits it yields. We hope that the thoughts and arguments found in this journal serve as a stimulus for further debate and discussion. Staff Bios IS FROM Oakland, CA AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN International Conict and the Middle East Jenna King Brill IS FROM Dallas, TX AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Anthropology of Latin America Maggie Carter IS FROM Bethesda, MD AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN International Development through Time and Space Laura Esposito IS FROM Sacramento, CA AND WILL GRADUATE IN December 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Reconstruction of American Journalism Amanda Holpuch IS FROM Mankato, MN AND WILL GRADUATE IN January 2013 FROM NYU Gallatin WITH A CONCENTRATION IN Public Policy and International Development Sarah Zapiler IS FROM Jenison, MI AND HOPES TO GRADUATE IN May 2014 FROM NYU Gallatin WITH A CONCENTRATION IN Violence in Religion, Public Policy and Creative Non-Fiction Writing AND FROM NYU Wagner WITH A Masters of Public Administration IS FROM Jupiter, FL AND WILL GRADUATE IN May 2012 FROM NYU Gallatin WITH A CONCENTRATION IN Food Anthropology and Writing IS FROM Denver, CO AND WILL GRADUATE IN May 2011 FROM NYU Gallatin WITH A CONCENTRATION IN The science, philosophy, art and love of Language Mary McCullough Colleen Veldt Emma Young 79 Journal of Global Affairs NYU GALLATIN SCHOOL OF INDIVIDUALIZED STUDY Volume 6 2010 - 2011
https://www.scribd.com/document/69965285/JGA-Spring-2011-Journal
CC-MAIN-2019-35
refinedweb
50,124
50.26
2 minutes Hiding junk code using IDA scripting what is Junk ? A malware writer can create a malware program and then by inserting junk code into it he can create 100 unique malware with the same functionality. And when you use encryption and runtime packaging, it makes it more difficult for an anti-virus scan engine to detect matching patterns in the malware code. Some Antivirus software uses sandboxing techniques to detect malicious functions in an obfuscated programs. But we should also understand that new malware is intelligent enough to detect a sandbox environment and they can change the behavior during runtime. when i open malware file into IDA its show’s me a tiny size of data and large size of instructions, code and data sections i am sure at this point that this malware in packed and having a multiple junks inside the instructions, so when i open the graph view i notice that in code there are multiple mov al instructions in this code so properly it’s hard to hide all junk instructions manually, so we can use an IDA script to hide all unusual instruction Junk codes so far mov al instruction moves into al that’s a lower bit of the register, I never seen this type of calls in a row because you would just be replacing the byte that you moved in the last call makes no sense, safe side we are hiding only more than 4 mov al instructions in a row import idautils import idc hides = [] in_junk = 0 curr_pos = 0 junk_len = 0 for seg_ea in idautils.Segments(): for head in idautils.Heads(seg_ea, idc.SegEnd(seg_ea)): if idc.isCode(idc.GetFlags(head)): mnem = idc.GetMnem(head) end_junk = False if mnem == 'mov': op1 = idc.GetOpnd(head, 0) if op1 == 'al': junk_len += 1 if in_junk == 0: curr_pos = head in_junk = 1 else: end_junk = True else : end_junk = True if end_junk: if in_junk == 1 : in_junk = 0 if junk_len > 4: len_junk_block = 2 * junk_len hides.append([curr_pos,len_junk_block]) curr_pos = 0 junk_len = 0 for h in hides: if h[1] > 1: idc.DelHiddenArea(h[0]) idc.HideArea(h[0],h[0]+h[1],'','','',0xEEFFFF) the script is going through all the sections and checks whether it contains mov al instructions or if he found more than 4 mov instructions its hide that junk code. run script: - shortcut alt + F7 -> select script - file -> script file… -> select script as we can see script hide all the move al instructions. malware sample: The Beginner’s Guide to IDAPython:
https://robon.space/posts/2021/05/hiding-junk-code-using-ida-scripting/
CC-MAIN-2022-40
refinedweb
417
62.41
After upgrading to gcc 4.5.0 from 3.3.4, some of my floating point code fails. Searched for and could not find a matching bug. It boils down to this very simple example: #include <stdio.h> #define MY_PI 3.14159265358979323846 int main() { double z = MY_PI; puts(z == MY_PI ? "==" : "!="); return 0; } If this is compiled "gcc -o bug -Wall bug.c" it works: there is equality. Doesn't matter if optimization is used or not (-g, -O, -O2 all give same results). But if compiled with -ansi or -std=c99, then the equality fails, again regardless of optimization!! The preprocessed code looks as expected: int main() { double z = 3.14159265358979323846; puts(z == 3.14159265358979323846 ? "==" : "!="); return 0; } Cannot see how this is correct behavior since the exact same expression was used to initialize the variable and to test for equality. Do not see anything in my ANSI/ISO C reference that sheds any light. I can work around this by using actual double constants instead of preprocessor expressions ("double my_pi_2 = MY_PI_2" and setting/testing with my_pi_2, etc), but this should work as is! pr323? As a general rule: never compare floating points for equality, use abs(a-b)<epsilon. As an even more general rule, remember to always specify your target: in this case, for example, I can't reproduce at all the behavior on x86_64 -m64, only with -m32. *** This bug has been marked as a duplicate of 323 *** *** This bug has been marked as a duplicate of 323 ***. Thanks Jakub. Subject: Re: Floating point comparison failure Thanks everyone. I usually do fuzzy floating-point comparison, except in certain special circumstances. I will switch to using double constants; I'm trying for a code that is maximally portable, so having to worry about what exact compiler switches to use is anathema. And might I add: you people are super-fast! I'm very impressed.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45691
CC-MAIN-2020-29
refinedweb
315
67.55
In our last article ‘Refactoring Towards Seams in C++’ (appeared in issue 108), we described how we can break dependencies in legacy code by applying seams with the help of our engineered refactorings. Once we have managed to apply seams, our code is not relying on fixed dependencies anymore, but instead asks for collaborators through dependency injection. Not only has our design greatly improved, but we are now also able to write unit tests for our code. Sometimes it is impractical or impossible to exercise our code with real objects. If a real object supplies non-deterministic results, is slow or contains states that are difficult to create, then we might want to use mock objects to test our objects in isolation. In this article we present how we can mock objects by creating a small but useful mock object library that makes use of the new language features of C++11. How to mock objects To start with an example, consider the system under test (SUT) Trader shown in Listing 1. Trader has a fixed relationship to Nasdaq which makes it hard to test in isolation because its operations require network calls which we do want to avoid when we run our unit tests. Nasdaq is therefore a good candidate to be replaced with a mock object. One of the many possibilities in C++ to inject dependencies from outside is to extract a template parameter and to inject the dependency at compile time making use of parametric polymorphism. We therefore call this seam type compile seam. After applying the refactoring extract template parameter, the code results as shown in Listing 2. This code has a seam because we now have an enabling point: the place where the template class TraderT is instantiated. Note that we create a typedef which instantiates the template with the concrete type that has been used before applying the refactoring (here through the use of a default template parameter). This has the advantage that we do not break existing code that still wants to use Nasdaq. We now give a complete example of how we think mocking objects should be done in C++ and explain the internals of our approach in the subsequent sections of this article. We apply the classic unit test work flow proposed by the xUnit pattern [Meszaros07] in Listing 3: setup, exercise, verify and teardown (whereas the latter is not necessary here). We use the vector allCalls to register all function calls the SUT makes on the injected local class MockExchange. It needs to be defined static because of the shortcomings local classes still have with C++11. We create the vector initially with a size of one. Index 0 is reserved for calls of static member functions on the mock object. Note that every mock object has a mock ID which is used to access the calls made by the SUT on a specific instance of the mock object class. In the registrations of the function calls, we use this to store the call for the corresponding mock object instance. Also note the usage of C++11’s new initialiser lists for specifying our expectations. At the end of our example, we assert the calls made with the index 1 (we only have one instance of MockExchange) with our expectations. We think it is worthwhile to have the code for the mock object in the unit test without hiding it behind DSL’s built up of macros as other mock object libraries do. This yields more transparency and exploits the full power of the host language when the library does not provide a desired feature. Furthermore, we circumvent the numerous problems that come with the application of macros. In the classic mock object approach the unit test does not exercise any assertions. This is entirely handled by the mock object which – when called during SUT execution – compares the actual arguments received with the expected arguments using equality assertions and fails the test if they do not match. We have decided against this common approach and exercise the assertions in the unit test itself because we want to be independent of the underlying unit testing framework. We therefore do not assert for equality in the mock object member functions, but instead compare the string traces in the unit test. Also note that our comparisons are order-sensitive and therefore we use strict mock objects [Meszaros07]. How to record function calls An important part of a mock object implementation is the recognition of the function calls the SUT makes on the mock object while a unit test runs. Beside the sequence and number of calls, we are also often interested in their argument values. We therefore have to store these facts to be able to later compare the calls with the users expectations. We use an abstraction named call for this purpose which represents a call of a function. Its basic functionality is shown in Listing 4. A function call consists of the signature of the function and its argument values. Because we have to allow arguments of any type, we use a template parameter for the arguments in the constructor of call. Due to the fact that we do not want to restrict the number of arguments, we use a variadic template parameter pack. The constructor of record to recursively process the arguments of the function call. record(Head const&, Tail const&) is used as the recursion step whereas record() handles the basic case of the recursion. Note the use of template parameter unpacking in the sizeof call to separate the argument values with commas and for the recursive call in record. std::string object to store the function signature and the argument values. This is used to remember the values of any possible argument type and to give the user as much information as possible when a comparison fails. Also note the typedef calls which we use to store the calls on an instance of a mock object class. Requirements on function parameter types To store the argument values in a string, we expect that types used for the function arguments implement a corresponding operator(ostream&, Type). To prevent cryptic compiler errors if this is not the case, we use some template meta programming tricks taken from the Boost exception library. The interested reader might want to have a look at the file is_output_streamable.hpp in a recent Boost library version to see how this works. This is done in the function toStream which delegates the work of using the stream output operator in case it is defined and otherwise writing a message into the stream to inform the user about the missing operator. template<typename T> std::ostream& toStream(std::ostream& os, T const& t) { selectbuiltinshiftif<T, isoutputstreamable<T>::value> out(os); return out(t); } Specifying expectations with initialiser lists When unit testing our objects, we want to compare a list of function calls against our expectations. We use initialiser lists for specifying expectations the SUT has to fulfil. Note that C++ always allowed initialisation of plain old data (POD) types and arrays with initialiser lists, i.e., to give a list of arguments in curly brackets. But it was not possible in the old standard to use initialiser lists with regular (non-POD) classes. This has changed with C++11 where we are now able to instantiate regular classes with initialiser lists. This can be seen here with our calls vector. calls expected = { {"foo(int i)", 42}, {"bar(char c)", 'x'}, {"foo(std::string s, double d)", "mockator", 3.1415} }; In order to make comparisons work between the actual executed calls of the SUT on the mock object and our expectations, we have to provide an equality operator for call. operator== just delegates the work to the equality operator of std::string to compare the traced function call. To allow unit testing frameworks to print a string representation of the object under consideration if a comparison fails, we also provide a stream operator for call. bool operator==(call const& lhs, call const& rhs) { return lhs.trace == rhs.trace; } std::ostream& operator«(std::ostream& os, call const& c) { return os « c.trace; } Another important thing to explain is the function reserveNextCallId applied in Listing 3. This function is used to initialise the ID of the mock object and to add another call vector to the allCalls vector which collects all calls made on all instances of the mock object class. Its implementation is: size_t reserveNextCallId (std::vector<calls> &allCalls) { size_t counter = allCalls.size(); allCalls.pushback(calls{}); return counter; } Reference implementation Based on the mock object library discussed in this article, we have implemented Mockator. Mockator is a plug-in for the Eclipse C/C++ Development Tooling (CDT) platform including a header-only C++ based mock object library. The library also supports order-independent comparisons, the use of regular expressions in the expectations, nice string representations for easier comparisons of STL containers when used as function arguments and C++03 beside C++11. Because common mock object libraries often lack good IDE support, we implemented a plug-in for Eclipse CDT that – beside its support for seams presented in the foregoing article –recognises missing member functions the SUT calls on the mock object and is able to generate them including the presented call registrations. It is able to generate code for both C++ standards and not only supports the common mock objects based on inheritance, but also ones based on parametric polymorphism. We recognised that it is often beneficial to just mock a single function instead of extracting an interface or a template parameter for classes. Therefore, we also implemented mocking of functions. Additionally, we provide various convenience functions to make working with mock objects easier like moving them to a namespace (useful if the unit test gets too big because of the mock object code and to share mock objects between unit tests), converting fake to mock objects, toggling the call recording on a member function level and recognising inconsistent expectations. The interested reader can download Mockator and give it a try. It is available as an alpha version under [Rüegg12]. References [Feathers04] Working Effectively With Legacy Code, Michael C. Feathers 2004 [ISO/IEC11] Working Draft, Standard for Programming Language C++,, February 2011 [Meszaros07] Gerard Meszaros, Unit Test Patterns: Refactoring Test Code, Addison-Wesley 2007 [Rüegg12] Michael Rüegg, ‘Mockator’, available from, 2012
https://accu.org/index.php/journals/1908
CC-MAIN-2017-34
refinedweb
1,733
50.16
CC to mips folks. > If something like this or your replacment does go forward, > then I think that test is better inside the "if (!page->mapping)" > below. Admittedly that adds even more mm-dependence here (relying > on a zero page to have NULL page->mapping); but isn't page_to_pfn() > one of those functions which is trivial on many configs but expensive > on some? Better call it only in the rare case that it's needed. > > Though wouldn't it be even better not to use is_zero_pfn() at all? > That was convenient in mm/memory.c because it had the pfn or pte right > at hand, but here a traditional (page == ZERO_PAGE(address)) would be > more efficient. > > Which would save having to move is_zero_pfn() from mm/memory.c > to include/linux/mm.h - I'd prefer to keep it private if we can. > But for completeness, this would involve resurrecting the 2.6.19 > MIPS move_pte(), which makes sure mremap() move doesn't interfere > with our assumptions. Something like > > ; > } > > in arch/mips/include/asm/pgtable.h. I agree with resurrecting mips move_pte. At least your patch passed my cross compile test :) Ralf, can you please review following patch? ====================================================== Subject: [PATCH] mips,mm: Reinstate move_pte optimization From: Hugh Dickins <hugh.dickins@tiscali.co.uk> About three years ago, we removed mips specific move_pte by commit 701dfbc1cb (mm: mremap correct rmap accounting). because it is only small optimization and it has bug. However new zero-page thing doesn't have such problem and behavior consistency of mremap have worth a bit. This patch reinstate it. Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: Nick Piggin <npiggin@suse.de> Cc: Carsten Otte <cotte@de.ibm.com> --- arch/mips/include/asm/pgtable.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 1854336..6ad2f73 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h @@ -387,6 +387,14 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, remap_pfn_range(vma, vaddr, pfn, size, prot) #endif +; +} + #include <asm-generic/pgtable.h> /* -- 1.6.5.2
http://www.linux-mips.org/archives/linux-mips/2010-01/msg00057.html
CC-MAIN-2015-14
refinedweb
383
61.73
By: Charlie Calvert Abstract: The first of a series, this article gives an overview of Web Services, Axis and Tomcat. This article contains an overview of Web Services in JBuilder. The next article in the series describes a simple Wizard based technology for building Web Services. The third article in the series includes a short description of how to use your Web Service in the Borland Enterprise Server (BES). This article begins with a relatively lengthy overview of Web Services, SOAP and Tomcat. Future articles will cover the technology in more depth. If you are anxious to get started, or if you feel you already understand Web Services, then you can skip the overview and jump right to the technical bits. For the purposes of this article, Web Services can be thought of as means for one process to call the methods or functions of another process across the Internet. More generally, Web Services can be thought of as reusable, loosely coupled, software components that are deployed on a network or on the World Wide Web. Because they are loosely coupled, Web Services can be linked one to another dynamically at run time, and need not be linked at design time. After a Web Service has been created and deployed, someone else can come along after the fact and link to the service dynamically. There are security measures that can be put in place to prevent this, but it is technically possible to allow anyone to access your Web Services. The key point, however, is simply that individual Web Service components can be freely linked together in multiple ways that were not even considered at design time. Web Services are not a unique or new type of technology. Other similar technologies include RMI, DCOM, CORBA, XML-RPC, EJB and RPC. Each of these technologies have certain unique traits that set them apart from the others. However, Web Services are not fundamentally different from preceding technologies such as CORBA or RPC. Web Services are, however, very different from CGI, Java ServerPages, or Servlets. These three latter technologies generate HTML to be shown in a Browser, while Web Services allow you to call methods in a class, to pass parameters to a method, and to see the return values from a method call. More particularly, Web Services are designed to create discreet objects which can be combined and reused in multiple ways depending on the needs of an application developer. Even more abstractly, Web Services can be described simply as a means of enabling interprocess communication across the Internet. CGI, Java SeverPages, and Servlets, on the other hand, are meant primarily as a means of generating HTML. Web Services differ from RMI, DCOM, CORBA, and RPC in that they are specifically designed to work with an XML based technology called SOAP. The great advantage of an XML based technology is that it need not be language or platform specific. This gives the technology a good deal of flexibility. Not all the technologies we are discussing are as flexible as Web Services. DCOM, for instance, is (for the most part) a Windows specific technology. RPC, on the other hand, is a fairly flexible technology. It is, for instance, platform neutral. Though usually associated with the C programming language, there are RPC bindings for many different languages. RPC does not, however, have good support for objects. RMI was traditionally a Java only solution, but it has recently been expanded to interact with CORBA. As you will learn in the next paragraph, CORBA is a very flexible and powerful solution. The combination of RMI and CORBA is interesting, primarily because RMI is so easy to use, and CORBA is so flexible. There is, however, a strong binding between Java and RMI. There is nothing inherent in Web Services that sets it apart from CORBA. Both sets of tools are neither language nor platform specific. Both tools are inherently object-oriented, and both tools have a number of high level services for sharing and discovering objects. There are open source implementations of both CORBA and Web Service protocols, so money is not necessarily an issue when choosing between them. There are many adherents of Web Services who claim that their XML based protocol is inherently simpler than CORBA. This may indeed be the case, but both protocols are large enough to benefit from the use of high level tools that hide their inherent complexity. Since there are powerful tools available for both CORBA and Web Services, the complexity of specific implementation details is not necessarily as important as it might seem at first. If there is an advantage that Web Services have over CORBA, it would be the wide degree of acceptance that this new technology has generated. In particular, the Microsoft Corporation has thrown its weight behind their version of Web Services. The Microsoft marketing team has the power to convince developers that Web Services are the wave of the future. Microsoft marketing, combined with a huge effort by the open source community, has helped generate many tools and much enthusiasm for SOAP and Web Services. The presence of so many good open source tools, and the enthusiasm of the Web Services community, are probably the best reasons to use Web Services rather than some other technology such as CORBA or RPC. I should add that there is probably nothing that you can do with tools like CORBA or Web Services that you could not do with the raw TCP/IP or HTTP protocols. However, it would take considerably more work to achieve the same goals if one dropped down to a low level protocol such as TCP/IP or HTTP. In summary, Web Services are a protocol based on XML that allow developers to promote loose coupling by calling the methods of an object that resides on a remote machine. It is one of many different protocols for achieving this goal. Reasons to use this technology include the fact that it is language and platform independent, and that it is a widely accepted technology with a lot of enthusiasm behind it. It would certainly be a good thing if the development community decided to standardize on Web Services. However, the advantage would lie primarily in the act of standardization itself, and not in any particular feature of Web Services. There are a number of different ways to create Web Services, and a number of different tools that you can use to help speed the process. In this series of articles, I will begin by working with the Axis SOAP implementation, which is part of the Apache Web Services project. Axis is a tool that helps to automate one of the more complicated steps in the development of a Web Service. SOAP is a standardized technology for describing the XML that gets sent between two processes that want to communicate across a network. The developers of SOAP describe their tools as follows: "SOAP Version 1.2 (SOAP) is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment." This is technically correct, but so generalized as to be hard for beginners to parse. SOAP can indeed be used in many different contexts. For the purposes of this article, however, SOAP can be thought of as protocol for allowing one class to remotely call the methods found in another class. The classes are often separated by both process and machine boundaries. SOAP "marshals" the data passed as parameters or return values during a method call. Marshaling the data involves defining a transmission protocol that allows you to pass parameters and return values in a platform and language neutral manner. This is where XML comes into play. When used in a non-technical context, the word marshal has several different meanings. The primary meaning usually has to do with arranging troops for a military parade or maneuver. It can, however, also refer to the act of escorting or ushering someone to a destination. It should not be hard to see why developers found such a word to be an apt metaphor for the act of transporting data from one machine to another. In many introductions to Web Services, the writer would now show you a specific example of how XML is used to marshal the data necessary for a function or method call. However, I'm going to make a point of not showing it to you in order to emphasize the fact that such matters are simply internal plumbing that you need not, and should not, concern yourself with when using Web Services. Each of the protocols we have been discussing have their own technologies for marshalling data across machine or process boundaries. Becoming an expert in all of them would be a daunting task. One should not need to know the specific details of how a method call is made in CORBA, a Web Service, or in RMI, any more than one should have to know how a function or method call is made in Java, C++, or Pascal. This is not to say that such information is not useful at times, but it should not be necessary information critical to the performance of your task. In particular, most introductory courses in Java, C++ or Pascal don't begin by discussing the details of how a CDECL or Pascal function call works. By the same measure one need not know the details of how Web Services marshal data. XML-RPC is very similar to SOAP. The primary difference lies in the fact that XML-RPC aims to makes the syntax for creating procedures calls as simple as possible, while SOAP aims to resolve all possible issues that might come up between clients that want to communicate over a distributed computing environment. In particular, SOAP makes extensive use of namespaces, and has well defined types, while XML-RPC has a more sparse protocol that is less well defined. XML-RPC has the advantage of being simple, and things that are simple usually work better than things that are complex. I would suggest, however, that XML-RPC is not necessarily as appealing a choice as it might at first seem. The tools for creating Web Services are now so advanced that the need to simplify the protocol is not particularly strong. In future articles, I will show you how to create Web Services without using AXIS. However, for now, this open source tool offers a simple, well tested, and powerful solution to a complex problem. Axis ships with JBuilder, so you will not need to install it. Before we begin exploring the specifics about how Web Services work, there is a need to discuss one more technology. You have learned that Axis is an implementation of the SOAP protocol. Axis is designed to run inside a container. In the examples I will show you, that container is Tomcat. Tomcat is a tool originally create to support Java Servlets and JavaServer Pages. These latter technologies play a support role in Java's implementation of Web Services. Axis can work with any valid Servlet container, but it is frequently teamed with Tomcat. If you put Tomcat and Axis together, then you have platform that can support Web Services. Tomcat is the official reference implementation for JSP and Servlet containers. When other venders want to create a JSP or Servlet container, Sun offers Tomcat as an example of how these containers ought to behave. Other containers may be more powerful in terms of performance, but Tomcat is the gold standard when it comes to defining how such tools ought to behave. (In saying this, I do not mean to imply that Tomcat cannot be used in a production environment.) I like to think of Tomcat as fitting into a hierarchy of web based server side tools. A simple Web Server such as Apache or IIS is meant primarily to serve up HTML pages and to handle CGI based programs. A Servlet and JSP container is more powerful in that it adds additional features such as the ability to keep objects in memory, and even to compile code on the fly under certain circumstances. When combined with Axis or another SOAP implementation, Tomcat can support Web Services. One step further up the hierarchy from a tool like Tomcat are the full blown Application Servers such as the open source tool JBOSS, or those developed by big companies. Examples of these latter tools include the Borland Enterprise Server, The IBM WebSphere Application Server, or the BEA Web Logic Server. These tools generally do everything that Tomcat does, and then more. In particular, they provide load balancing, fault tolerance, transactions, resource pooling, caching, process management, etc. You can think of these tools as a superset of what is offered by a web server or by a tool like Tomcat. In fact, some of them come with a copy of the Aphache Web Server, Axis and Tomcat. In a very rough analogy, you can think of an Application Server being related to a tool like Tomcat in much the way a Swiss Army Knife is related to a normal pocket knife. The lines I have drawn here between web servers, servlet containers, and application servers should be considered to be a bit fuzzy around the edges. For instance, web servers typically add at least a few features found in the other tools, and vice versa. But I think it helps to have sense of what each of these tools can do. The main point to get from this section, however, is that Java Web Services of the kind we will be exploring are based on two large, complicated technologies: Axis and Tomcat. Both tools need to be installed on the server side before you can use the kind of Java Web Services that I am about to show you. Fortunately, JBuilder includes both Tomcat and Axis. These tools should be set up automatically during the JBuilder install. The next article in this series will explain how to set up these tools if you want to work from the command line without the aid of JBuilder. This is the first in a multi-part series on creating Web Services. The second part will describe a simple process for creating a Web Service, and the third part describes how to deploy the Web Service in the Borland Enterprise Server. Server Response from: SC1
http://edn.embarcadero.com/article/31871
crawl-002
refinedweb
2,400
60.14
7 Reasons to Choose the Yii 2 FrameworkBy Matthew Beaumont Late last year, SitePoint published an article highlighting the top PHP frameworks. Tied for the number four spot was the Yii (pronounced Yee) Framework. At that time the latest version of the framework available was 1.1.14. Recently, Yii 2.0 was made available, so you can begin to use it in production. While we did cover it recently when it was still in RC status, it just reached full release status, and we feel like it’s time to revisit the topic with some reasons for choosing it over alternatives. 1. Easy to Install For web developers, time is money, and no one wants to spend their precious time on a complicated installation and configuration process. Installation is handled using Composer. If you want a description of the installation process, Sitepoint recently published a great article here. I tend to favor using the basic application template, even when my site has a separate front- and backend component. Instead, I opt to use a Module for the backend portion of my sites. (Yii Modules are best described as mini-applications which reside inside your main application). Note: Many of the directory references in later examples use the directory structure from the simple template. 2. Utilizes Modern Technologies Yii is a pure OOP framework, and takes advantage of some of PHP’s more advanced features, including late static binding, SPL classes and interfaces, and anonymous functions. All classes are namespaced, which allows you to take advantage of their PSR-4 compliant autoloader. That means that including Yii’s HTML helper class is as simple as: use yii\helpers\Html; Yii also allows you to define aliases to help simplify your namespaces. In the above example, that use statement will load a class definition which is located by default in the directory /vendor/yiisoft/yii2/helpers. This alias is defined in the BaseYii class on line 79: public static $aliases = ['@yii' => __DIR__]; The framework itself is installed using Composer, as are its extensions. Even the process of publishing extensions is as easy as creating your own composer.json, hosting your code at Github, and listing your extension on Packagist. 3. Highly Extensible Yii is like a suit that looks great off of the rack, but is also very easy to tailor to fit your needs. Virtually every component of the framework is extensible. A simple example is the addition of a unique body ID to your views. (In case you’re interested in knowing why you might want to do this, take a look at this article). First, I would create a file in my app\components directory with the name View.php, and add the following: namespace app\components; class View extends yii\web\View { public $bodyId; /* Yii allows you to add magic getter methods by prefacing method names with "get" */ public function getBodyIdAttribute() { return ($this->bodyId != '') ? 'id="' . $this->bodyId . '"' : ''; } } Then, in my main layout file ( app\views\layouts\main.php), I would add the following to the body tag of my HTML: <body <?=$this->BodyIdAttribute?>> And finally, I would add the following to my main configuration file to let Yii know to use my extended View class instead of its own default: return [ // ... 'components' => [ // ... 'view' => [ 'class' => 'app\components\View' ] ] ]; 4. Encourages Testing Yii is tightly integrated with Codeception. Codeception is a great PHP testing framework that helps simplify the process of creating unit, functional and acceptance tests for your application. Because you ARE writing automated tests for all your applications, right? The Codeception extension makes it simple to configure your application during testing. Simply edit the provided /tests/_config.php file to configure your test application. For example: return [ 'components' => [ 'mail' => [ 'useFileTransport' => true, ], 'urlManager' => [ 'showScriptName' => true, ], 'db' => [ 'dsn' => 'mysql:host=localhost;dbname=mysqldb_test', ], ], ]; Using this configuration, the following would happen: - Any emails sent during your functional and acceptance tests would be written to a file instead of being sent. - The URLs in your tests would take on the format index.php/controller/actionrather than /controller/action - Your tests would use your test database, rather than your production database. A special module for the Yii Framework also exists within Codeception. It adds several methods to the TestGuy class, which help you work with Active Record (Yii’s ORM) during functional tests. For instance, if you wanted to see if your registration form successfully created a new User with the username “testuser”, you could do the following: $I->amOnPage('register'); $I->fillField('username', 'testuser'); $I->fillField('password', 'qwerty'); $I->click('Register'); $I->seeRecord('app\models\User', array('name' => 'testuser')); 5. Simplifies Security Security is a crucial part of any web application, and fortunately Yii has some great features to help ease your mind. Yii comes with a Security application component that exposes several methods to help assist in creating a more secure application. Some of the more useful methods are: - generatePasswordHash: Generates a secure hash from a password and a random salt. This method makes a random salt for you, and then creates a hash from the supplied string using PHP’s crypt function. - validatePassword: This is the companion function to generatePasswordHash, and allows you to check whether the user supplied password matches your stored hash. - generateRandomKey: Allows you to create a random string of any length Yii automatically checks for a valid CSRF token on all unsafe HTTP request methods (PUT, POST, DELETE), and will generate and output a token when you use the ActiveForm::begin() method to create your opening form tag. This feature can be disabled by editing your main configuration file to include the following: return [ 'components' => [ 'request' => [ 'enableCsrfValidation' => false, ] ]; In order to protect against XSS, Yii provides another helper class called HtmlPurifier. This class has a single static method named process, and will filter your output using the popular filter library of the same name. Yii also includes ready-to-use classes for user authentication and authorization. Authorization is broken into two types: ACF (Access Control Filters) and RBAC (Role-Based Access Control). The simpler of the two is ACF, and is implemented by adding the following to the behaviors method of your controller: use yii\filters\AccessControl; class DefaultController extends Controller { // ... public function behaviors() { return [ // ... 'class' => AccessControl::className(), 'only' => ['create', 'login', 'view'], 'rules' => [ [ 'allow' => true, 'actions' => ['login', 'view'], 'roles' => ['?'] ], [ 'allow' => true, 'actions' => ['create'], 'roles' => ['@'] ] ] ]; } // ... } The preceding code tells DefaultControllerto allow guest users to access the login and view actions, but not the create action. ( ? is an alias for anonymous users, and @ refers to authenticated users). RBAC is a more powerful method of specifying which users can perform specific actions throughout your application. It involves creating roles for your users, defining permissions for your app, and then enabling those permissions for their intended roles. You could use this method if you wanted to create a Moderator role, and allow all users assigned to this role to approve articles. You can also define rules using RBAC, which allow you, under specific conditions, to grant access to certain aspects of your application. For instance, you could create a rule that allows users to edit their own articles, but not those created by others. 6. Shorten Development Time Most projects involve a certain amount of repetitive tasks that no one wants to waste time with. Yii gives us a few tools to help you spend less time on those tasks, and more time customizing your application to suit your clients’ needs. One of the most powerful of these tools is called “Gii”. Gii is a web-based code scaffolding tool, which allows you to quickly create code templates for: - Models - Controllers - Forms - Modules - Extensions - CRUD controller actions and views Gii is highly configurable. You can set it to only load in certain environments. Simply edit your web configuration file as follows: if (YII_ENV_DEV) { // ... $config['modules']['gii'] = [ 'class' => 'yii\gii\Module', 'allowedIPs' => ['127.0.0.1', '::1'] ] } This ensures that Gii will only load when the Yii environment variable is set to development, and that it will only load when accessed via localhost. Now let’s take a look at the model generator: The table name uses a typeahead widget to try to guess which table your model is associated with, and all fields have a rollover tooltip to remind you how to fill them out. You can preview code before you ask Gii to generate it, and all the code templates are completely customizable. There are also several command-line tools available to help create code templates for database migrations, message translations (I18N) and database fixtures for your automated tests. For instance, you can create a new database migration file with this command: yii migrate/create create_user_table This will create a new migration template in {appdir}/migrations that looks something like this: <?php use yii\db\Schema; class m140924_153425_create_user_table extends \yii\db\Migration { public function up() { } public function down() { echo "m140924_153425_create_user_table cannot be reverted.\n"; return false; } } So let’s say I wanted to add a few columns to this table. I would simply add the following to the up method: public function up() { $this->createTable('user', [ 'id' => Schema::TYPE_PK, 'username' => Schema::TYPE_STRING . ' NOT NULL', 'password_hash' => Schema:: TYPE_STRING . ' NOT NULL' ], null); } And then to make sure I can reverse the migration, I would edit the down method: public function down() { $this->dropTable('user'); } Creating the table would simply involve running a command on the command line: ./yii migrate and to remove the table: ./yii migrate/down 7. Easy to Tune for Better Performance Everybody knows that a slow website creates disgruntled users, so Yii provides you with several tools to help you squeeze more speed out of your application. All Yii’s cache components extend from yii/caching/Cache, which allows you to choose whichever caching system you want while using a common API. You can even register multiple cache components simultaneously. Yii currently supports database and file system caching, as well as APC, Memcache, Redis, WinCache, XCache and Zend Data Cache. By default, if you’re using Active Record then Yii runs an extra query to determine the schema of the table(s) involved in generating your model. You can set the application to cache these schema by editing your main configuration file as follows: return [ // ... 'components' => [ // ... 'db' => [ // ... 'enableSchemaCache' => true, 'schemaCacheDuration' => 3600, 'schemaCache' => 'cache', ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], ], ]; Finally, Yii has a command line tool to facilitate the minification of frontend assets. Simply run the following command to generate a configuration template: ./yii asset/template config.php Then edit the configuration to specify which tools you want to you perform your minification (e.g. Closure Compiler, YUI Compressor, or UglifyJS). The generated configuration template will look like this: <?php return [ 'jsCompressor' => 'java -jar compiler.jar --js {from} --js_output_file {to}', 'cssCompressor' => 'java -jar yuicompressor.jar --type css {from} -o {to}', 'bundles' => [ // 'yii\web\YiiAsset', // 'yii\web\JqueryAsset', ], 'targets' => [ 'app\config\AllAsset' => [ 'basePath' => 'path/to/web', 'baseUrl' => '', 'js' => 'js/all-{hash}.js', 'css' => 'css/all-{hash}.css', ], ], 'assetManager' => [ 'basePath' => __DIR__, 'baseUrl' => '', ], ]; Next, run this console command in order to perform the compression. yii asset config.php /app/assets_compressed.php And finally, edit your web application configuration file to use the compressed assets. 'components' => [ // ... 'assetManager' => [ 'bundles' => require '/app/assets_compressed.php' ] ] Note: You will have to download and install these external tools manually. Conclusion Like any good framework, Yii helps you create modern web applications quickly, and make sure they perform well. It pushes you to create secure and testable sites by doing a lot of the heavy lifting for you. You can easily use most of its features exactly as they are provided, or you can modify each one to suit your needs. I really encourage you to check it out for your next web project! Have you tried Yii 2? Will you? Let us know! - emadgh - Matthew Beaumont - emadgh - Husni Mansour - Joe - Anton - decemvre - Wade Shuler - Laravel is bloated and Slow - DanBangWTFRajib - Hari K T - Vitor Silva - Matthew Beaumont - Vitor Silva - Matthew Beaumont - Hari K T - Matthew Beaumont - Hari K T - Nazim - Chris O’Connell - Bill Keck - Hari K T - DanBangWTFRajib - Guest - Hari K T - Abhinandan - Bill Keck - Abhinandan - Bill Keck - Paris Qian Sen - Chris Tiearney - Sworoop Mahapatra - Hari K T - Peter Petermann - Matthew Beaumont - Piyush - Paris Qian Sen - Peter Petermann - Paris Qian Sen - Guest - Rasmus Schultz - Bsienn - Anonymous - SenG - Christoffer Niska - Charles Hand - SenG - gutterboy - Wade Shuler - gutterboy - Petr Vnenk - SenG - Wade Shuler - A$AP Mayonnaise {cracka} - Nick Weber - Ehsan Gazar - jennifermorrison - Mārtiņš Briedis - Avinash - Wade Shuler - Mario Rubios
https://www.sitepoint.com/7-reasons-choose-yii-2-framework/
CC-MAIN-2017-22
refinedweb
2,081
53.41
Details - AboutFull stack web developer based in London - SkillsASP.NET, C#, TypeScript etc... - LocationLondon Joined devRant on 4/21/2016 Join devRant Pipeless API From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More - require() from requirejs, I can't believe the monoliths I used to write as a newbie. I think I've actually dropped a few IQ points as my code has been spectacularly simple since. - Inspired by devRant, sent this to a person with a new Apple Watch: "Hi there, what ar....[read more]" Moohaha1 - !rant Suggestion: Polls? Either user supplied or put up like the weekly rant. I think it'd be fun/interesting with all these captive devs. Perhaps earned every 500++ or so to avoid spam. - - How many developers does it take to change a lightbulb? One, because developers are sensible and rational people.5 - Writing volumes of pure magic code in that weird state between tired and super tired. Sleeping pills + redbull? Wk172 - - Developers in need 2016 appeal. With just one recommendation of an IDE with syntax highlighting, you can change the life of a needy developer. Together we can bring an end to semicolon hunting. Let's stop the madness now.6 - - So it looks like the Britain is leaving the EU. Who the fuck are these people in my country? Feel sick right now. - Developer skill #906: Tactical Sleep. "Sure, I'll build you a landing page for your email campaign ...... For 10am tomorrow? ....... But it's 4:30pm....... Director says so?..... (Silent fml)" Ask me earlier douchebags. - There once was a dev who was a believer, that the best IDE was Dreamweaver! He argued with zest, That drag and drop was best; So I murdered him to death with a cleaver.10 - [TestClass] public class DayTest { [TestMethod] public void Init_WowEnthusiasmPlusMeeting_fml() { // Arrange Day monday = new Day( Math.Ceiling(Chrizzle.Mojo), (List<Task>)Board.GetStories() ); int startingTaskCount = monday.Tasks.Count(); monday.AddMeeting(new Meeting(duration: 7.5)); // Act monday.Init(); // Assert fml Assert.IsTrue( monday.Tasks.Count() == startingTaskCount && Chrizzle.Mojo == 0 ); } } // Unreachable code detected - Spent this week working React into one of my projects. Works fine but I don't see Any real productivity gains over modular typescript with a good js view engine. Does it get better?3 - So I recently made myself do a quiet madman chuckle to my IDE when I found I was implementing an Interface I'd created with the method signature GetLinking() misspelled as GetLionking() Anyone else catch themselves doing the private office weirdo laugh?2 - - - - When you introduce support for MVC projects into a webforms application you've been working with for 4 years and it takes about 3 hours. #whydidinotdothis4yearsago - I love my job as a developer, I think it's the one of the world's most most fulfilling occupations but I procrastinate with personal projects (even paid ones). Is this a problem for anyone else, and how do you beat this?6 -
https://devrant.com/users/chrizzle
CC-MAIN-2021-10
refinedweb
501
68.77
JBoss.orgCommunity Documentation 7.6. Teiid supports SQL for issuing queries and for defining view transformations; see also Procedure Language for how SQL is used in virtual procedures and update procedures. Teiid provides nearly all of the functionality of SQL-92 DML. SQL-99 and later features are constantly being added based upon community need. The following does not attempt to cover SQL exhaustively, but rather highlights SQL's usage within Teiid. See the grammar for the exact form of SQL accepted by Teiid.. When a table specification contains a dot resolving will allow for the match of a partial name against any number of the end segments in the name. e.g. a table with the fully-qualified name vdbname."sourcescema.sourcetable" would match the partial name sourcetable.. Teiid's reserved words include the standard SQL 2003 Foundation, SQL/MED, and SQL/XML reserved words, as well as Teiid specific words such as BIGINTEGER, BIGDECIMAL, or MAKEDEP. See the Appendix A, BNF for SQL Grammar TOKENS section for all reserved words. They will appear as 'SMALLINT: "smallint"' where the quoted string is the actual lexical form. Identifiers,: Integer values will be assigned an integral data type big enough to hold the value (integer, long, or biginteger). Floating point values will always be parsed as a double. The keyword 'null' is used to represent an absent or unknown value and is inherently untyped. In many cases, a null literal value will be assigned an implied type based on context. For example, in the function '5 + null', the null value will be assigned the type 'integer' to match the type of the value '5'. A null literal used in the SELECT clause of a query with no implied context will be assigned to type 'string'. Some examples of simple literal values are: ‘abc’ ‘isn’’t true’ - use an extra single tick to escape a tick in a string with single ticks 5 -37.75e01 - scientific notation 100.0 - parsed as double true false '\u0027' - unicode character Aggregate functions take sets of values from a group produced by an explicit or implicit GROUP BY and return a single scalar value computed from the group. Teiid supports the following aggregate functions: COUNT(*) – count the number of values (including nulls and duplicates) in a group COUNT(x) – count the number of values (excluding nulls) in a group SUM(x) – sum of the values (excluding nulls) in a group AVG(x) – average of the values (excluding nulls) in a group MIN(x) – minimum value in a group (excluding null) MAX(x) – maximum value in a group (excluding null) ANY(x)/SOME(x) – returns TRUE if any value in the group is TRUE (excluding null) EVERY(x) – returns TRUE if every value in the group is TRUE (excluding null) VAR_POP(x) – biased variance (excluding null) logically equals (sum(x^2) - sum(x)^2/count(x))/count(x); returns a double; null if count = 0 VAR_SAMP(x) – sample variance (excluding null) logically equals (sum(x^2) - sum(x)^2/count(x))/(count(x) - 1); returns a double; null if count < 2 STDDEV_POP(x) – standard deviation (excluding null) logically equals SQRT(VAR_POP(x)) STDDEV_SAMP(x) – sample standar deviation (excluding null) logically equals SQRT(VAR_SAMP(x)) TEXTAGG(FOR (expression [as name], ... [DELIMITER char] [QUOTE char] [HEADER] [ENCODING id] [ORDER BY ...]) – CSV text aggregation of all expressions in each row of a group. When DELIMITER is not specified, by default comma(,) is used as delimiter. Double quotes(") is the default quote character. Use QUOTE to specify a differnt value. All non-null values will be quoted. If HEADER is specified, the result contains the header row as the first line - the header line will be present even if there are no rows in a group. This aggregation returns a blob. XMLAGG(xml_expr [ORDER BY ...]) – xml concatination of all xml expressions in a group (excluding null). The ORDER BY clause cannot reference alias names or use positional ordering. Syntax Rules: Some aggregate functions may contain a keyword 'DISTINCT' before the expression, indicating that duplicate expression values should be ignored. DISTINCT is not allowed in COUNT(*) and is not meaningful in MIN or MAX (result would be unchanged), so it can be used in COUNT, SUM, and AVG. Aggregate functions cannot be used in FROM, GROUP BY, or WHERE clauses without an intervening query expression. Aggregate functions cannot be nested within another aggregate function without an intervening query expression. Aggregate functions may be nested inside other functions. Any aggregate function may take an optional FILTER clasue of the form aggregrate function to be applied to a subset of the result set, without the need for a GROUP BY clause. A window function is similar to an aggregate function, but requires the use of an OVER clause or window specification. Usage: aggregate|ranking OVER ([PARTION BY expression [, expression]*] [ORDER BY ...]) aggregate can be any Section 1.2.3, “Aggregate Functions”. Ranking can be one of ROW_NUMBER(), RANK(), DENSE_RANK(). Syntax Rules: Window functions can only appear in the SELECT and ORDER BY clauses of a query expression. Window functions cannot be nested in one another. Partitioning and order by expressions cannot contain subqueries or outer references. The ranking (ROW_NUMBER, RANK, DENSE_RANK) functions require the use of the window specification ORDER BY clause. An XMLAGG ORDER BY clause cannot be used when windowed. The window specification ORDER BY clause cannot reference alias names or use positional ordering. Windowed aggregates may not use DISTINCT if the window specification is ordered. ROW_NUMBER() – functional the same as COUNT(*) with the same window specification. Assigns a number to each row in a partition starting at 1. RANK() – Assigns a number to each unique ordering value within each partition starting at 1, such that the next rank is equal to the count of prior rows. DENSE_RANK() – Assigns a number to each unique ordering value within each partition starting at 1, such that the next rank is sequential. Window functions are logically processed just before creating the output from the SELECT clause. Window functions can use nested aggregates if a GROUP BY clause is present. The is no guarenteed affect on the output ordering from the presense. Example 1.1. Example Windowed Results: CASE <expr> ( WHEN <expr> THEN <expr>)+ [ELSE expr] END CASE ( WHEN <criteria> THEN <expr>)+ [ELSE expr] END. Criteria may be: Predicates that evaluate to true or false Logical criteria that combines criteria (AND, OR, NOT) A value expression with type boolean Usage: criteria AND|OR criteria NOT criteria (criteria) expression (=|<>|!=|<|>|<=|>=) (expression|((ANY|ALL|SOME) subquery)) expression [NOT] IS NULL expression [NOT] IN (expression[,expression]*)|subquery expression [NOT] LIKE pattern [ESCAPE char] Matches the string expression against the given string pattern. The pattern may contain % to match any number of characters and _ to match any single character. The escape character can be used to escape the match characters % and _. expression [NOT] SIMILAR TO pattern [ESCAPE char] SIMILAR TO is a cross between LIKE and standard regular expression syntax. % and _ are still used, rather than .* and . respectively. Teiid does not exhaustively validate SIMILAR TO pattern values. Rather the pattern is converted to an equivalent regular expression. Care should be taken not to rely on general regular expression features when using SIMILAR TO. If additional features are needed, then LIKE_REGEX should be used. Usage of a non-literal pattern is discouraged as pushdown support is limited. expression [NOT] LIKE_REGEX pattern LIKE_REGEX allows for standard regular expression syntax to be used for matching. This differs from SIMILAR TO and LIKE in that the escape character is no longer used (\ is already the standard escape mechansim in regular expressions and % and _ have no special meaning. The runtime engine uses the JRE implementation of regular expressions - see the java.util.regex.Pattern class for details. Teiid does not exhaustively validate LIKE_REGEX pattern values. It is possible to use JRE only regular expression features that are not specified by the SQL specification. Additional not all sources support the same regular expression flavor or extensions. Care should be taken in pushdown situations to ensure that the pattern used will have same meaning in Teiid and across all applicable sources. EXISTS(subquery) expression [NOT] BETWEEN minExpression AND maxExpression Teiid converts BETWEEN into the equivalent form expression >= minExpression AND expression <= maxExpression expression Where expression has type boolean. Syntax Rules: The precedence ordering from lowest to highest is comparison, NOT, AND, OR Criteria nested by parenthesis will be logically evaluated prior to evaluating the parent criteria. Some examples of valid criteria are: (balance > 2500.0) 100*(50 - x)/(25 - y) > z concat(areaCode,concat('-',phone)) LIKE '314%1' Null values represent an unknown value. Comparison with a null value will evaluate to 'unknown', which can never be true even if 'not' is used. There are 4 basic commands for manipulating data in SQL, corresponding to the CRUD create, read, update, and delete operations: INSERT, SELECT, UPDATE, and DELETE. In addition, procedures can be executed using the EXECUTE command or through a procedural relational command. The SELECT command is used to retrieve records any number of relations. A SELECT command has a number of clauses: [(LIMIT ...) | ([OFFSET ...] [FETCH ...])]. The explicit table syntax TABLE x may be used as a shortcut for SELECT * FROM x. The INSERT command is used to add a record to a table. Example Syntax INSERT INTO table (column,...) VALUES (value,...) INSERT INTO table (column,...) query The UPDATE command is used to modify records in a table. The operation may result in 1 or more records being updated, or in no records being updated if none match the criteria. Example Syntax UPDATE table SET (column=value,...) [WHERE criteria] The DELETE command is used to remove records from a table. The operation may result in 1 or more records being deleted, or in no records being deleted if none match the criteria. Example Syntax DELETE FROM table [WHERE criteria] The EXECUTE command is used to execute a procedure, such as a virtual procedure or a stored procedure. Procedures may have zero or more scalar input parameters. The return value from a procedure is a result set, the same as is returned from a SELECT. Note that EXEC or CALL can be used as a short form of this command. Example Syntax EXECUTE proc() EXECUTE proc(value, ...) EXECUTE proc(name1=>value1,name4=>param4, ...) - named parameter syntax. If the procedure does not return a result set, the values from the RETURN, OUT, and IN_OUT parameters will be returned as a single row when used as an inline view query.. The usage of 'in' or join criteria can result in the procedure being executed multiple times. None of issues listed in the syntax rules above exist if a nested table reference is used. Teiid supports the UNION, UNION ALL, INTERSECT, EXCEPT set operation as a way of combining the results of query expressions. Usage: queryExpression (UNION|INTERSECT|EXCEPT) [ALL] queryExpression [ORDER BY...] Syntax Rules: The output columns will be named by the output columns of the first set operation branch. Each SELECT must have the same number of output columns and compatible data types for each relative column. Data type conversion will be performed if data types are inconsistent and implicit conversions exist. If UNION, INTERSECT, or EXCEPT is specified without all, then the output columns must be comparable types. INTERSECT ALL, and EXCEPT ALL are currently not supported. A subquery is a SQL query embedded within another SQL query. The query containing the subquery is the outer query. Supported subquery types: Scalar subquery - a subquery that returns only a single column with a single value. Scalar subqueries are a type of expression and can be used where single valued expressions are expected. Correlated subquery - a subquery that contains a column reference to from the outer query. Uncorrelated subquery - a subquery that contains no references to the outer sub-query. Subqueries in the FROM clause of the outer query (also known as "inline views") can return any number of rows and columns. This type of subquery must always be given an alias. An inline view is nearly identical to a traditional view. See also Section 2.1, “WITH Clause”. Example 1.2. Example Subquery in FROM Clause (Inline View) SELECT a FROM (SELECT Y.b, Y.c FROM Y WHERE Y.d = ‘3’) AS X WHERE a = X.c AND b = X.b Subqueries are supported in quantified criteria, the EXISTS predicate, the IN predicate, and as Section 1.2.6, “Scalar subqueries”. Example 1.3. Example Subquery in WHERE Using EXISTS SELECT a FROM X WHERE EXISTS (SELECT 1 FROM Y WHERE c=X.a) Example 1.4. Example Quantified Comparison Subqueries SELECT a FROM X WHERE a >= ANY (SELECT b FROM Y WHERE c=3) SELECT a FROM X WHERE a < SOME (SELECT b FROM Y WHERE c=4) SELECT a FROM X WHERE a = ALL (SELECT b FROM Y WHERE c=2) See also Section 14.3, “Subquery optimization”. This section describes the clauses that are used in the various SQL commands described in the previous section. Nearly all these features follow standard SQL syntax and functionality, so any SQL reference can be used for more information. Teiid supports non-recursive common table expressions via the WITH clause. With clause items may be referenced as tables in subsequent with clause items and in the main query. The WITH clause can be thought of as providing query scoped temporary tables. Usage: WITH name [(column, ...)] AS (query expression) .... SQL queries that start with the SELECT keyword and are often referred to as "SELECT statements". Teiid supports most of the standard SQL query constructs. Usage: SELECT [DISTINCT|ALL] ((expression [[AS] name])|(group identifier.STAR))*|STAR ... Syntax Rules: Aliased expressions are only used as the output column names and in the ORDER BY clause. They cannot be used in other clauses of the query. DISTINCT may only be specified if the SELECT symbols are comparable. The FROM clause specifies the target table(s) for SELECT, UPDATE, and DELETE statements. Example Syntax: FROM table [[AS] alias] FROM table1 [INNER|LEFT OUTER|RIGHT OUTER|FULL OUTER] JOIN table2 ON join-criteria FROM table1 CROSS JOIN table2 FROM (subquery) [AS] alias FROM TABLE(subquery) [AS] alias FROM table1 JOIN /*+ MAKEDEP */ table2 ON join-criteria FROM table1 JOIN /*+ MAKENOTDEP */ table2 ON join-criteria FROM /*+ MAKEIND */ table1 JOIN table2 ON join-criteria FROM /*+ NO_UNNEST */ vw1 JOIN table2 ON join-criteria FROM table1 left outer join /*+ optional */ table2 ON join-criteria FROM TEXTTABLE... FROM XMLTABLE... FROM ARRAYTABLE... FROM (SELECT ... MAKEIND, MAKEDEP, and MAKENOTDEP are hints used to control dependent join behavior. They should only be used in situations where the optimizer does not choose the most optimal plan based upon query structure, metadata, and costing information. The hints may appear in a comment that proceeds the from clause. The hints can be specified against any from clause, not just a named table. NO_UNNEST can be specified against a subquery from clause or view to instruct the planner to not merge the nested SQL in the surrounding query - also known as view flattening. This hint only applies to Teiid planning and is not passed to source queries. NO_UNNEST may appear in a comment that proceeds the from clause. Nested tables may appear in the FROM clause with the TABLE keyword. They are an alternative to using a view with normal join semantics. The columns projected from the command contained in the nested table may be used just as any of the other FROM clause projected columns in join criteria, the where clause, etc. A nested table may have correlated references to preceeding FROM clause column references as long as INNER and LEFT OUTER joins are used. This is especially useful in cases where then nested expression is a procedure or function call. Valid example: select * from t1, TABLE(call proc(t1.x)) t2 Invalid example, since t1 appears after the nested table in the from clause: select * from TABLE(call proc(t1.x)) t2, t1 The usage of a correlated nested table may result in multiple executions of the table expression - once for each correlated row. The TEXTTABLE funciton processes character input to produce tabular ouptut. It supports both fixed and delimited file format parsing. The function itself defines what columns it projects. The TEXTTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries. Usage: TEXTTABLE(expression COLUMNS <COLUMN>, ... [NO ROW DELIMITER] [DELIMITER char] [(QUOTE|ESCAPE) char] [HEADER [integer]] [SKIP integer]) AS name COLUMN := name datatype [WIDTH integer [NO TRIM]] Parameters expression - the text content to process, which should be convertable to CLOB. NO ROW DELIMITER indicates that fixed parsing should not assume the presense of newline row delimiters. DELIMITER sets the field delimiter character to use. Defaults to ','. QUOTE sets the quote, or qualifier, character used to wrap field values. Defaults to '"'. ESCAPE sets the escape character to use if no quoting character is in use. This is used in situations where the delimiter or new line characters are escaped with a preceding character, e.g. \, HEADER specifies the text line number (counting every new line) on which the column names occur. All lines prior to the header will be skipped. If HEADER is specified, then the header line will be used to determine the TEXTTABLE column position by case-insensitive name matching. This is especially useful in situations where only a subset of the columns are needed. If the HEADER value is not specified, it defaults to 1. If HEADER is not specified, then columns are expected to match positionally with the text contents. SKIP specifies the number of text lines (counting every new line) to skip before parsing the contents. HEADER may still be specified with SKP. WIDTH indicates the fixed-width length of a column in characters - not bytes. The CR NL newline value counts as a single character. NO TRIM specifies that the text value should not be trimmed of all leading and trailing white space. Syntax Rules: If width is specified for one column it must be specified for all columns and be a non-negative integer. If width is specified, then fixed width parsing is used and ESCAPE, QUOTE, and HEADER should not be specified. If width is not specified, then NO ROW DELIMITER cannot be used. The columns names must be not contain duplicates. Examples Use of the HEADER parameter, returns 1 row ['b']: SELECT * FROM TEXTTABLE(UNESCAPE('col1,col2,col3\na,b,c') COLUMNS col2 string HEADER) x Use of fixed width, returns 2 rows ['a', 'b', 'c'], ['d', 'e', 'f']: SELECT * FROM TEXTTABLE(UNESCAPE('abc\ndef') COLUMNS col1 string width 1, col2 string width 1, col3 string width 1) x Use of fixed width without a row delimiter, returns 3 rows ['a'], ['b'], ['c']: SELECT * FROM TEXTTABLE('abc' COLUMNS col1 string width 1 NO ROW DELIMITER) x Use of ESCAPE parameter, returns 1 row ['a,', 'b']: SELECT * FROM TEXTTABLE('a:,,b' COLUMNS col1 string, col2 string ESCAPE ':') x As a nested table: SELECT x.* FROM t, TEXTTABLE(t.clobcolumn COLUMNS first string, second date SKIP 1) x The XMLTABLE funciton uses XQuery to produce tabular ouptut. The XMLTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries. XMLTABLE is part of the SQL/XML 2006 specification. Usage: XMLTABLE([<NSP>,] xquery-expression [<PASSING>] [COLUMNS <COLUMN>, ... )] AS name COLUMN := name (FOR ORDINALITY | (datatype [DEFAULT expression] [PATH string])) See XMLELEMENT for the definition of NSP - XMLNAMESPACES. See XMLQUERY for the definition of PASSING. See also Section 14.4, “XQuery Optimization” be not contain duplicates. The ARRAYTABLE funciton processes an array input to produce tabular ouptut. The function itself defines what columns it projects. The ARRAYTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries. Usage: ARRAYTABLE(expression COLUMNS <COLUMN>, ...) AS name COLUMN := name datatype Parameters expression - the array to process, which should be a java.sql.Array or java array value. Syntax Rules: The columns names must be not contain duplicates. Examples As a nested table: select x.* from (call source.invokeMDX('some query')) r, arraytable(r.tuple COLUMNS first string, second bigdecimal) x ARRAYTABLE is effectively a shortcut for using the Section 6.11.1, “array_get” function in a nested table. For example "ARRAYGET(val COLUMNS col1 string, col2 integer) AS X" is the same as "TABLE(SELECT cast(array_get(val, 1) AS string) AS col1, cast(array_get(val, 2) AS integer) AS col2) AS X". The WHERE clause defines the criteria to limit the records affected by SELECT, UPDATE, and DELETE statements. The GROUP BY clause denotes that rows should be grouped according to the specified expression values. One row will be returned for each group, after optionally filtering those aggregate rows based on a HAVING clause. The general form of the GROUP BY is: GROUP BY expression (,expression)* Syntax Rules: Column references in the group by clause must by to unaliased output columns. Expressions used in the group by must appear in the select clause. Column references and expessions in the select clause. The ORDER BY clause specifies how records should be sorted. The options are ASC (ascending) and DESC (descending). Usage: ORDER BY expression [ASC|DESC] [NULLS (FIRST|LAST)], .... The use of positional ordering is no longer supported by the ANSI SQL standard and is a deprecated feature in Teiid. It is preferable to use alias names in the order by clause. The LIMIT clause specifies a limit on the number of records returned from the SELECT command. An optional offset (the number of rows to skip) can be specified. The LIMIT clause can also be specfied using the SQL 2008 OFFSET/FETCH FIRST clauses. If an ORDER BY is also specified, it will be applied before the OFFSET/LIMIT are applied. If an ORDER BY is not specified there is generally no guarantee what subset of rows will be returned. Usage: LIMIT [offset,] limit [OFFSET offset ROW|ROWS] [FETCH FIRST|NEXT [limit] ROW|ROWS ONLY Syntax Rules: The limit/offset expressions must be a non-negative integer or a parameter reference (?). An offset of 0 is ignored. A limit of 0 will return no rows. The terms FIRST/NEXT are interchangable as well as ROW/ROWS. The limit clause may take an optional preceeding NON_STRICT hint to indicate that push operations should not be inhibited even if the results will not be consistent with the logical application of the limit. The hint is only needed on unordered limits, e.g. "SELECT * FROM VW /*+ NON_STRICT */ LIMIT 2". Examples: LIMIT 100 - returns the first 100 records (rows 1-100) LIMIT 500, 100 - skips 500 records and returns the next 100 records (rows 501-600) OFFSET 500 ROWS - skips 500 records OFFSET 500 ROWS FETCH NEXT 100 ROWS ONLY - skips 500 records and returns the next 100 records (rows 501-600) FETCH FIRST ROW ONLY - returns only the first record Usage of the INTO Clause for inserting into a table has been been deprecated. An INSERT with a query command should be used instead. When the into clause is specified with a SELECT, the results of the query are inserted into the specified table. This is often used to insert records into a temporary table. The INTO clause immediately precedes the FROM clause. Usage: INTO table FROM .... The OPTION keyword denotes options the user can pass in with the command. These options are Teiid-specific and not covered by any SQL specification. Usage: OPTION option, (option)* Supported options: MAKED. Previous versions of Teiid accepted the PLANONLY, DEBUG, and SHOWPLAN option arguments. These are no longer accepted in the OPTION clause. Please see the Client Developers Guide for replacements to those options. Teiid supports a subset of DDL to, create/drop temporary tables and to manipulate procedure and view definitions at runtime. It is not currently possible to arbitrarily drop/create non-temporary metadata entries. A MetadataRepository must be configured to make a non-temporary metadata update persistent. See the Developers Guide Runtime Metadata Updates section for more. Teiid supports creating temporary,or "temp", tables. Temp tables are dynamically created, but are treated as any other physical table. Temp tables can be defined implicitly by referencing them in a INSERT statement or explicitly with a CREATE TABLE statement. Implicitly created temp tables must have a name that starts with '#'. Creation syntax: Explicit: CREATE LOCAL TEMPORARY TABLE x (column type [NOT NULL], ... [PRIMARY KEY (column, ...)]) Implicit: INSERT INTO #x (column, ...) VALUES (value, ...) If #x doen't exist, it will be defined using the given column names and types from the value expressions. Implicit: INSERT INTO #x [(column, ...)] select c1, c2 from t If #x doesn't exist, it will be defined using the target column names (in not supplied, the column names will match the derived column names from the query), and the types from the query derived columns. Use the SERIAL data type to specify a NOT NULL and auto-incrementing INTEGER column. The starting value of a SERIAL column is 1. Drop syntax: DROP TABLE x Primary Key Support All key columns must be comparable. Use of a primary key creates a clustered index that supports search improvements for comparison, in, like, and order by. Null is an allowable primary key value, but there must be only 1 row that has an all null key. Limitations: With the CREATE TABLE syntax only basic table definition (column name and type information) and an optional primary key are supported. The "ON COMMIT" clause is not supported in the CREATE TABLE statement. "drop behavior" option is not supported in the drop statement. Only local temporary tables are supported. This implies that the scope of temp table will be either to the session or the block of a virtual procedure that creates it. Session level temp tables are not fail-over safe. Temp tables support a READ_UNCOMMITED transaction isolation level. There are no locking mechanisms available to support higher isolation levels and the result of a rollback may be inconsistent across multiple transactions. If concurrent transactions are not associated with the same local temporary table or session, then the transaction isolation level is effectively SERIALIZABLE. If you want full constency with local temporary tables, then only use a connection with 1 transaction at a time. This mode of operation is ensured by connection pooling that tracking connections by transaction. Lob values (xml, clob, blob) are tracked by reference rather than by value in a temporary table. Lob values from external sources that are inserted in a temporary table may become unreadable when the associated statement or connection is closed. The following example is a series of statements that loads a temporary table with data from 2 sources, and with a manually inserted record, and then uses that temp table in a subsequent query. ... CREATE LOCAL TEMPORARY TABLE TEMP (a integer, b integer, c integer); SELECT * INTO temp FROM Src1; SELECT * INTO temp FROM Src2; INSERT INTO temp VALUES (1,2,3); SELECT a,b,c FROM Src3, temp WHERE Src3.a = temp.b; ... See virtual procedures for more on temp table usage. Usage: ALTER VIEW name AS queryExpression Syntax Rules: The alter query expression may be prefixed with a cache hint for materialized view definitions. The hint will take effect the next time the materialized view table is loaded. Usage: ALTER PROCEDURE name AS block Syntax Rules: The alter block should not include 'CREATE VIRTUAL PROCEDURE' The alter block may be prefixed with a cache hint for cached procedures. Usage: CREATE TRIGGER ON name INSTEAD OF INSERT|UPDATE|DELETE AS FOR EACH ROW block Syntax Rules: The target, name, must be an updatable view. An INSTEAD OF TRIGGER must not yet exist for the given event. Triggers are not yet true schema objects. They are scoped only to their view and have no name. Limitations: There is no corresponding drop operation. See Section 3.5, “Alter Trigger” for enabling/disabling an existing trigger. Usage: ALTER TRIGGER ON name INSTEAD OF INSERT|UPDATE|DELETE (AS FOR EACH ROW block) | (ENABLED|DISABLED) Syntax Rules: The target, name, must be an updatable view. Triggers are not yet true schema objects. They are scoped only to their view and have no name. An Section 8.3, “Update Procedures” must already exist for the given trigger event. If the default inherent update is choosen in Teiid Designer, any SQL associated with update (shown in a greyed out text box) is not part of the VDB and cannot be enabled with an alter trigger statement. Complex XML documents can be dynamically constructed by Teiid using XML Document Models. A document model is generally created from a schema. The document model is bound to relevant SQL statements through mapping classes. See the Designer guide for more on creating document models. XML documents may also created via XQuery with the XMLQuery function or with various other SQL/XML functions. Querying XML documents is similar to querying relational tables. An idiomatic SQL variant with special scalar functions gives control over which parts of a given document to return. A valid XML SELECT Command against a document model is of the form SELECT ... FROM ... [WHERE ...] [ORDER BY ...] . The use of any other SELECT command clause is not allowed. The fully qualified name for an XML element is: "model"."document name".[path to element]."element name" . The fully qualified name for an attribute is: "model"."document name".[path to element]."element name".[@]"attribute name" Partially qualified names for elements and attributes can be used as long as the partial name is unique. Specifies the document to generate. Document names resemble other virtual groups - "model"."document name". Syntax Rules: The from may only contain one unary clause specifying the desired document. The select clause determines which parts of the XML document are generated for output. Example Syntax: select * from model.doc select model.doc.root.parent.element.* from model.doc select element, element1.@attribute from model.doc Syntax Rules: SELECT * and SELECT "xml" are equivalent and specify that every element and attribute of the document should be output. The SELECT clause of an XML Query may only contain *, "xml", or element and attribute references from the specified document. Any other expressions are not allowed. If the SELECT clause contains an element or attribute reference (other than * or "xml") then only the specified elements, attributes, and their ancestor elements will be in the generated document. element.* specifies that the element, it's attribute, and all child content should be output. The where clause specifies how to filter content from the generated document based upon values contained in the underlying mapping classes. Most predicates are valid in an XML SELECT Command, however combining value references from different parts of the document may not always be allowed. Criteria is logically applied to a context which is directly related to a mapping class. Starting with the root mapping class, there is a root context that describes all of the top level repeated elements that will be in the output document. Criteria applied to the root or any other context will change the related mapping class query to apply the affects of the criteria, which can include checking values from any of the descendant mapping classes. Example Syntax: select element, element1.@attribute from model.doc where element1.@attribute = 1 select element, element1.@attribute from model.doc where context(element1, element1.@attribute) = 1 Syntax Rules: Each criteria conjunct must refer to a single context and can be criteria that applies to a mapping class, contain a rowlimit function, or contain rowlimitexception function. Criteria that applies to a mapping class is associated to that mapping class via the context function. The absence of a context function implies the criteria applies to the root context. At a given context the criteria can span multiple mapping classes provided that all mapping classes involved are either parents of the context, the context itself, or a descendant of the context. Implied root context user criteria against a document model with sibling root mapping classes is not generally semantically correct. It is applied as if each of the conjuncts is applied to only a single root mapping class. This behavior is the same as prior releases but may be fixed in a future release. XML SELECT Command functions are resemble scalar functions, but act as hints in the WHERE clause. These functions are only valid in an XML SELECT Command. CONTEXT(arg1, arg2) Select the context for the containing conjunct. Syntax Rules: Context functions apply to the whole conjunct. The first argument must be an element or attribute reference from the mapping class whose context the criteria conjunct will apply to. The second parameter is the return value for the function. ROWLIMIT(arg) Limits the rows processed for the given context. Syntax Rules: The first argument must be an element or attribute reference from the mapping class whose context the row limit applies. The rowlimit function must be used in equality comparison criteria with the right hand expression equal to an positive integer number or rows to limit. Only one row limit or row limit exception may apply to a given context. Limits the rows processed for the given context and throws an exception if the given number of rows is exceeded. ROWLIMITEXCEPTION(arg) Syntax Rules: The first argument must be an element or attribute reference from the mapping class whose context the row limit exception applies. The rowlimitexception function must be used in equality comparison criteria with the right hand expression equal to an positive integer number or rows to limit. Only one row limit or row limit exception may apply to a given context. The XML SELECT Command ORDER BY Clause specifies ordering for the referenced mapping class queries. Syntax Rules: Each order by item must be an element or attribute reference tied a output value from a mapping class. The order or the order by items is the relative order they will be applied to their respective mapping classes. Document generation starts with the root mapping class and proceeds iteratively and hierarchically over all of the child mapping classes. This can result in a large number of query executions. For example if a document has a root mapping class with 3 child mapping classes. Then for each row selected by the root mapping class after the application of the root context criteria, each of the child mapping classes queries will also be executed. By default XML generated by XML documents are not checked for correctness vs. the relevant schema. It is possible that the mapping class queries, the usage of specific SELECT or WHERE clause values will generated a document that is not valid with respect to the schema. See document validation on how to ensure correctness. Sibling or cousin elements defined by the same mapping class that do not have a common parent in that mapping class will be treated as independent mapping classes during planning and execution. This allows for a more document centric approach to applying criteria and order bys to mapping classes. Teiid supports a core set of runtime types. Runtime types can be different than semantic types defined in type fields at design time. The runtime type can also be specified at design time or it will be automatically chosen as the closest base type to the semantic type.. When Teiid detects that an explicit conversion can not be applied implicitly in criteria, the criteria will be treated as false. For example: SELECT * FROM my.table WHERE created_by = ‘not a date’ Given that created_by is typed as date, rather than converting 'not a date' to a date value, the criteria will remain as a string comparison and therefore be false. Explicit conversions that are not allowed between two types will result in an exception before execution. Allowed explicit conversions may still fail during processing if the runtime values are not actually convertable. The Teiid conversions of float/double/bigdecimal/timestamp to string rely on the JDBC/Java defined output formats. Pushdown behavior attempts to mimic these results, but may vary depending upon the actual source type and conversion logic. Care should be taken to not assume the string form in criteria or other places where a variation may cause different results. Teiid automatically converts string literals within a SQL statement to their implied types. This typically occurs in a criteria comparison where an expression with a different datatype is compared to a literal string: SELECT * FROM my.table WHERE created_by = ‘2003-01-02’ Here if the created_by column has the datatype of date, Teiid automatically converts the string literal to a date datatype as well. Teiid can automatically convert literal strings and numeric type values to Boolean values as follows: Teiid can implicitly convert properly formatted literal strings to their associated date-related datatypes as follows: The formats above are those expected by the JDBC date types. To use other formats see the functions PARSEDATE , PARSETIME , PARSETIMESTAMP . Teiid provides an extensive set of built-in scalar functions. See also SQL Support and Datatypes . In addition, Teiid provides the capability for user defined functions or UDFs. See the Developers Guide for adding UDFs. Once added UDFs may be called just like any other function. key value pair table and access it through a scalar function. This caching accelerates response time to queries that use the lookup tables, known in business terminology as lookup tables or code tables. LOOKUP(codeTable, returnColumn, keyColumn, keyValue) In the lookup table codeTable, find the row where keyColumn has the value keyValue and return the associated returnColumn value or null if no matching key is found. codeTable must be a string literal that is the fully-qualified name of the target table. returnColumn and key Column must also be string literals of just the relevant column names. The keyValue can be any expression that must match the datatype of the keyColumn. The return datatype matches that of returnColumn. Example 6.1. Country Code Lookup lookup('ISOCountryCodes', 'CountryName', 'CountryCode', 'US') A ISOCountryCodes table used to translate country name to ISO codes. One column, CountryName, represents a key column. A second column, CountryCode, would represent the ISO code of the country. Hence, a query to this lookup table would provide a CountryName, shown above as 'US',. The Teiid System unloads these cached lookup tables when you stop and restart the Teiid System. Thus, you should not use this function for data that is subject to updates. Instead, you can use it against static data that does not change over time. See the Caching Guide for more on the caching aspects of the lookup function. The keyColumn is expected to contain unique values. If the column contains duplicate values, an exception will be thrown. System functions provide access to information in the Teiid system from within a query. Retrieve a string from the command payload or null if no command payload was specified. The command payload is set by the TeiidStatement.setPayload method on the Teiid JDBC API extensions on a per-query basis. COMMANDPAYLOAD([key]) If the key parameter is provided, the command payload object is cast to a java.util.Properties object and the corresponding property value for the key is returned. If the key is not specified the return value is the command payload object toString value. key, return value are strings Retrieve a system environment property. ENV(key) The only key specific to the current session is 'sessionid'. However the preferred mechanism for getting the session id is with the session_id() function. To prevent untrusted access to system properties, this function is not enabled by default. The ENV function may be enabled via the allowEnvFunction property in the <jboss-install>/server/<profile>/deploy/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml file. key, return value are strings Retrieve the string form of the current session id. SESSION_ID() return value is string. XML functions provide functionality for working with XML data." Example 6.2. Sample JSON to XML for jsonToXml('person', x) JSON: { "firstName" : "John" , "children" : [ "Randy", "Judy" ] } XML: <?xml version="1.0" ?><person><firstName>John</firstName><children>Randy</children><children>Judy<children></person> Example 6.3. Sample JSON to XML for jsonToXml('person', x) with a root array. JSON: [{ "firstName" : "George" }, { "firstName" : "Jerry" }] XML (Notice there is an extra "person" wrapping element to keep the XML well-formed): <?xml version="1.0" ?><person><person><firstName>George</firstName></person><person><firstName>Jerry</firstName></person></person> Returns an xml comment. XMLCOMMENT(comment) Comment is a string. Return value is xml. Returns an XML with the concatination of the given xml types. XMLCONCAT(content [, content]*) Content is xml. Return value is xml. If a value is null, it will be ignored. If all values are null, null is returned. Returns an XML element with the given name and content. XMLELEMENT([NAME] name [, <NSP>] [, <ATTR>][, content]*) ATTR:=XMLATTRIBUTES(exp [AS name] [, exp [AS name]]*) NSP:=XMLNAMESPACES((uri AS prefix | DEFAULT uri | NO DEFAULT))+ If the content value is of a type other than xml, it will be escaped when added to the parent element. Null content values are ignored. Whitespace in XML or the string values of the content is preserved, but no whitespace is added between content values. XMLNAMESPACES is used provide namespace information. NO DEFAULT is equivalent to defining the default namespace to the null uri - xmlns="". Only one DEFAULT or NO DEFAULT namespace item may be specified. The namespace prefixes xmlns and xml are reserved. If a attribute name is not supplied, the expression must be a column reference, in which case the attribute name will be the column name. Null attribute values are ignored. Name, prefix are identifiers. uri is a string literal. content can be any type. Return value is xml. The return value is valid for use in places where a document is expected. Example 6.4. XMLELEMENT of mixed values with an xml_value of <doc/>, XMLELEMENT(NAME "elem", 1, '<2/>', xml_value) Returns: <elem>1<2/><doc/><elem/> Returns an concatination of XML elements for each content item. XMLFOREST(content [AS name] [, <NSP>] [, content [AS name]]*) See XMLELEMENT for the definition of NSP - XMLNAMESPACES. Name is an identifier. Content can be any type. Return value is xml. If a name is not supplied for a content item, the expression must be a column reference, in which case the element name will be a partially escaped version of the column name. Returns an XML type representation of the string value expression. XMLPARSE((DOCUMENT|CONTENT) expr [WELLFORMED]) expr in {string, clob, blob}. Return value is xml. If DOCIMENT is specfied then the expression must have a single root element and may or may not contain an XML declaration. If WELLFORMED is specified then validation is skipped; this is especially useful for CLOB and BLOB known to already be valid. Returns an xml processing instruction. XMLPI([NAME] name [, content]) Name is an identifier. Content is a string. Return value is xml. Returns the XML result from evaluating the given xquery. XMLQUERY([<NSP>] xquery [<PASSING>] [(NULL|EMPTY) ON EMPTY]] PASSING:=PASSING exp [AS name] [, exp [AS name]]* See XMLELEMENT for the definition of NSP - XMLNAMESPACES. Namespaces may also be directly declared in the xquery prolog. The optional PASSING clause is used to provide the context item, which does not have a name, and named global variable values. If the xquery uses a context item and none is provided, then an exception will be raised. Only one context item may be specified and should be an XML type. All non-context non-XML passing values will be converted to an appropriate XML type. The ON EMPTY clause is used to specify the result when the evaluted sequence is empty. EMPTY ON EMPTY, the default, returns an empty XML result. NULL ON EMPTY returns a null result. xquery in string. Return value is xml. XMLQUERY is part of the SQL/XML 2006 specification. See also Section 14.4, “XQuery Optimization” Returns a character type representation of the xml expression. XMLSERIALIZE([(DOCUMENT|CONTENT)] xml [AS datatype]) Return value mathces datatype. Only a character type (string, varchar, clob) may be specified as the datatype. CONTENT is the default. If DOCUMENT is specified and the xml is not a valid document or fragment, then an exception is raised. Applies an XSL stylesheet to the given document. XSLTRANSFORM(doc, xsl) Doc, xsl in {string, clob, xml}. Return value is a clob. If either argument is null, the result is null. Applies the XPATH expression to the document and returns a string value for the first matching result. XPATHVALUE(doc, xpath) Doc and xpath in {string, clob, xml}. Return value is a string. Matching a non-text node will still produce a string result, which includes all descendent text nodes. Example 6.5. Sample xpathValue Ignoring Namespaces XML value: <?xml version="1.0" ?><ns1:return xmlns:Hello<x> World</x></return> Function: xpathValue(value, '/*[local-name()="return"]) Results in 'Hello World' See also Section 6.9.8, “XMLQUERY” Security functions provide the ability to interact with the security system. Whether the current caller has the Teiid data role roleName. hasRole([roleType,] roleName) roleName must be a string, the return type is boolean. The two argument form is provided for backwards compatibility. roleType is a string and must be 'data'. Role names are case-sensitive and only match Teiid Chapter 10, Data Roles. JAAS roles/groups names are not valid for this function - unless there is corresponding data role with the same name. Other functions. Retuns the object value at a given array index. array_get(array, index) array is the object type, index must be an integer, and the return type is object. 1-based indexing is used. The actual array value should be a java.sql.Array or java array type. An exception will be thrown if the array value is the wrong type of the index is out of bounds. Returns the length for a given array array_length(array) array is the object type, and the return type is integer. The actual array value should be a java.sql.Array or java array type. An exception will be thrown if the array value is the wrong type.. User Deterministic - the function will return the same result for the given inputs for the same user. This includes the hasRole and user functions. User deterministic functions are evaluated by the engine as soon as all input values are known, which may occur as soon as the rewrite phase. If a user deterministic function is evaluated during the creation of a prepared processing plan, then the resulting plan will be cached only for the user. Session Deterministic - the function will return the same result for the given inputs under the same user session. This category includes the env function.). Any view may be marked as updatable. In many circumstances the view definition may allow the view to be inherently updatable without the need to manually define handing of INSERT/UPDATE/DELETE operations. An inherently updatable view cannot be defined with a query that has: A set operation (INTERSECT, EXCEPT, UNION). SELECT DISTINCT Aggregation (aggregate functions, GROUP BY, HAVING) A LIMIT clause A UNION ALL can define an inherently updatable view only if each of the UNION branches is itself inherently updatable. A view defined by a UNION ALL can support inherent INSERTs if it is a Section 14.2.8, “Partitioned Union” and the INSERT specifies values that belong to a single partition. Any view column that is not mapped directly to a column is not updatable and cannot be targeted by an UPDATE set clause or be an INSERT column. If a view is defined by a join query or has a WITH clause it may still be inherently updatable. However in these situations there are further restrictions and the resulting query plan may execute multiple statements. For a non-simple query to be updatable, it is required: An INSERT/UPDATE can only modify a single Section 7.1, “Key-preserved Table”. To allow DELETE operations there must be only a single Section 7.1, “Key-preserved Table”. If the default handling is not available or you wish to have an alternative implementation of an INSERT/UPDATE/DELETE, then you may use Section 8.3, “Update Procedures” to define procedures to handle the respective operations.. Teiid supports a procedural language for defining virtual procedures . These are similar to stored procedures in relational database management systems. You can use this language to define the transformation logic for decomposing INSERT, UPDATE, and DELETE commands against views; these are known as update procedures . A command statement executes a SQL command , such as SELECT, INSERT, UPDATE, DELETE, or EXECUTE, against one or more data sources. Example 8.1. Example Command Statements SELECT * FROM MySchema.MyTable WHERE ColA > 100; INSERT INTO MySchema.MyTable (ColA,ColB) VALUES (50, 'hi'); EXECUTE command statements may access IN/OUT, OUT, and RETURN parameters. To access the return value the statement will have the form var = EXEC proc.... To access OUT or IN/OUT values named parameter syntax must be used. For example, EXEC proc(in_param=>'1', out_param=>var) will assign the value of the out parameter to the variable var. It is expected that the datatype of parameter will be implicitly convertable to the datatype of the variable. Dynamic SQL allows for the execution of an arbitrary SQL command in a virtual procedure. Dynamic SQL is useful in situations where the exact command form is not known prior to execution. Usage: EXECUTE STRING <expression> [AS <variable> <type> [, <variable> <type>]* [INTO <variable>]] [USING <variable>=<expression> [,<variable>=<expression>]*] [UPDATE <literal>] Syntax Rules: The "AS" clause is used to define the projected symbols names and types returned by the executed SQL string. The "AS" clause symbols will be matched positionally with the symbols returned by the executed SQL string. Non-convertible types or too few columns returned by the executed SQL string will result in an error. The "INTO" clause will project the dynamic SQL into the specified temp table. With the "INTO" clause specified, the dynamic command will actually execute a statement that behaves like an INSERT with a QUERY EXPRESSION. If the dynamic SQL command creates a temporary table with the "INTO" clause, then the "AS" clause is required to define the table’s metadata. The "USING" clause allows the dynamic SQL string to contain variable references that are bound at runtime to specified values. This allows for some independence of the SQL string from the surrounding procedure variable names and input names. In the dynamic command "USING" clause, each variable is specified by short name only. However in the dynamic SQL the "USING" variable must be fully qualified to "UVAR.". The "USING" clause is only for values that will be used in the dynamic SQL as legal expressions. It is not possible to use the "USING" clause to replace table names, keywords, etc. This makes using symbols equivalent in power to normal bind (?) expressions in prepared statements. The "USING" clause helps reduce the amount of string manipulation needed. If a reference is made to a USING symbol in the SQL string that is not bound to a value in the "USING" clause, an exception will occur. The "UPDATE" clause is used to specify the updating model count. Accepted values are (0,1,*). 0 is the default value if the clause is not specified. Example 8.2. Example Dynamic SQL ... /* Typically complex criteria would be formed based upon inputs to the procedure. In this simple example the criteria is references the using clause to isolate the SQL string from referencing a value from the procedure directly */ DECLARE string criteria = 'Customer.Accounts.Last = DVARS.LastName'; /* Now we create the desired SQL string */ DECLARE string sql_string = 'SELECT ID, First || ‘‘ ‘‘ || Last AS Name, Birthdate FROM Customer.Accounts WHERE ' || criteria; /* The execution of the SQL string will create the #temp table with the columns (ID, Name, Birthdate). Note that we also have the USING clause to bind a value to LastName, which is referenced in the criteria. */ EXECUTE STRING sql_string AS ID integer, Name string, Birthdate date INTO #temp USING LastName='some name'; /* The temp table can now be used with the values from the Dynamic SQL */ loop on (SELCT ID from #temp) as myCursor ... Here is an example showing a more complex approach to building criteria for the dynamic SQL string. In short, the virtual procedure AccountAccess.GetAccounts has inputs ID, LastName, and bday. If a value is specified for ID it will be the only value used in the dynamic SQL criteria. Otherwise if a value is specified for LastName the procedure will detect if the value is a search string. If bday is specified in addition to LastName, it will be used to form compound criteria with LastName. Example 8.3. Example Dynamic SQL with USING clause and dynamically built criteria string ... DECLARE string crit = null; IF (AccountAccess.GetAccounts.ID IS NOT NULL) crit = ‘(Customer.Accounts.ID = DVARS.ID)’; ELSE IF (AccountAccess.GetAccounts.LastName IS NOT NULL) BEGIN IF (AccountAccess.GetAccounts.LastName == ‘%’) ERROR "Last name cannot be %"; ELSE IF (LOCATE(‘%’, AccountAccess.GetAccounts.LastName) < 0) crit = ‘(Customer.Accounts.Last = DVARS.LastName)’; ELSE crit = ‘(Customer.Accounts.Last LIKE DVARS.LastName)’; IF (AccountAccess.GetAccounts.bday IS NOT NULL) crit = ‘(‘ || crit || ‘ and (Customer.Accounts.Birthdate = DVARS.BirthDay))’; END ELSE ERROR "ID or LastName must be specified."; EXECUTE STRING ‘SELECT ID, First || ‘‘ ‘‘ || Last AS Name, Birthdate FROM Customer.Accounts WHERE ’ || crit USING ID=AccountAccess.GetAccounts.ID, LastName=AccountAccess.GetAccounts.LastName, BirthDay=AccountAccess.GetAccounts.Bday; ... Known Limitations and Work-Arounds The use of dynamic SQL command results in an assignment statement requires the use of a temp table. Example 8.4. Example Assignment EXECUTE STRING <expression> AS x string INTO #temp; DECLARE string VARIABLES.RESULT = (SELECT x FROM #temp); The construction of appropriate criteria will be cumbersome if parts of the criteria are not present. For example if "criteria" were already NULL, then the following example results in "criteria" remaining NULL. Example 8.5. Example Dangerous NULL handling ... criteria = ‘(‘ || criteria || ‘ and (Customer.Accounts.Birthdate = DVARS.BirthDay))’; The preferred approach is for the user to ensure the criteria is not NULL prior its usage. If this is not possible, a good approach is to specify a default as shown in the following example. Example 8.6. Example NULL handling ... criteria = ‘(‘ || nvl(criteria, ‘(1 = 1)’) || ‘ and (Customer.Accounts.Birthdate = DVARS.BirthDay))’; If the dynamic SQL is an UPDATE, DELETE, or INSERT command, and the user needs to specify the "AS" clause (which would be the case if the number of rows effected needs to be retrieved). The user will still need to provide a name and type for the return column if the into clause is specified. Example 8.7. Example with AS and INTO clauses /* This name does not need to match the expected update command symbol "count". */ EXECUTE STRING <expression> AS x integer INTO #temp; Unless used in other parts of the procedure, tables in the dynamic command will not be seen as sources in the Designer. When using the "AS" clause only the type information will be available to the Designer. ResultSet columns generated from the "AS" clause then will have a default set of properties for length, precision, etc. A declaration statement declares a variable and its type. After you declare a variable, you can use it in that block within the procedure and any sub-blocks. A variable is initialized to null by default, but can also be assigned the value of an expression as part of the declaration statement. Usage: DECLARE <type> [VARIABLES.]<name> [= <expression>]; Example Syntax declare integer x; declare string VARIABLES.myvar = 'value'; Syntax Rules: You cannot redeclare a variable with a duplicate name in a sub-block The VARIABLES group is always implied even if it is not specified. The assignment value follows the same rules as for an Assignment Statement. An assignment statement assigns a value to a variable by either evaluating an expression. Usage: <variable reference> = <expression>; Example Syntax myString = 'Thank you'; VARIABLES.x = (SELECT Column1 FROM MySchema.MyTable); VARIABLES.ROWCOUNT integer variable will contain the numbers of rows affected by the last insert/update/delete command statement executed. Inserts that are processed by dynamic sql with an into clause will also update the ROWCOUNT. Example 8.8. Sample Usage ... UPDATE FOO SET X = 1 WHERE Y = 2; DECLARE INTEGER UPDATED = VARIABLES.ROWCOUNT; ... A compound statement or block logically groups a series of statements. Temporary tables and variables created in a compound statement are local only to that block are destroyed when exiting the block. Usage: [label :] BEGIN [[NOT] ATOMIC] statement* END When a block is expected by a IF, LOOP, WHILE, etc. a single statement is also accepted by the parser. Even though the block BEGIN/END are not expected, the statement will execute as if wrapped in a BEGIN/END pair. Syntax Rules IF NOT ATOMIC or no ATOMIC clause is specificed, the block will be executed non-atomically. IF ATOMIC the block must execute atomically. If a transaction is already associated with the thread, no aditional action will be taken - savepoints and/or sub-transactions are not currrently used. Otherwise a transaction will be associated with the execution of the block. The label must not be the same as any other label used in statements containing this one. An IF statement evaluates a condition and executes either one of two statements depending on the result. You can nest IF statements to create complex branching logic. A dependent ELSE statement will execute its statement only if the IF statement evaluates to false. Usage: IF (criteria) block [ELSE block] END Example 8.9. Example If Statement IF ( var1 = 'North America') BEGIN ...statement... END ELSE BEGIN ...statement... END NULL values should be considered in the criteria of an IF statement. IS NULL criteria can be used to detect the presense of a NULL value. A LOOP statement is an iterative control construct that is used to cursor through a result set. Usage: [label :] LOOP ON <select statement> AS <cursorname> block Syntax Rules The label must not be the same as any other label used in statements containing this one. A WHILE statement is an iterative control construct that is used to execute a block repeatedly whenever a specified condition is met. Usage: [label :] WHILE <criteria> block Syntax Rules The label must not be the same as any other label used in statements containing this one. A CONTINUE statement is used inside a LOOP or WHILE construct to continue with the next loop by skipping over the rest of the statements in the loop. It must be used inside a LOOP or WHILE statement. Usage: CONTINUE [label]; Syntax Rules If the label is specified, it must exist on a containing LOOP or WHILE statement. If no label is specified, the statement will affect the closest containing LOOP or WHILE statement. A BREAK statement is used inside a LOOP or WHILE construct to break from the loop. It must be used inside a LOOP or WHILE statement. Usage: BREAK [label]; Syntax Rules If the label is specified, it must exist on a containing LOOP or WHILE statement. If no label is specified, the statement will affect the closest containing LOOP or WHILE statement. A LEAVE statement is used inside a compound, LOOP, or WHILE construct to leave to the specified level. Usage: LEAVE label; Syntax Rules The label must exist on a containing compound statement, LOOP, or WHILE statement. An ERROR statement declares that the procedure has entered an error state and should abort. This statement will also roll back the current transaction, if one exists. Any valid expression can be specified after the ERROR keyword. Usage: ERROR message; Example 8.10. Example Error Statement ERROR 'Invalid input value: ' || nvl(Acct.GetBalance.AcctID, 'null'); Virtual procedures are defined using the Teiid procedural language. A virtual procedure has zero or more input parameters, and a result set return type. Virtual procedures support the ability to execute queries and other SQL commands, define temporary tables, add data to temporary tables, walk through result sets, use loops, and use conditional logic. Usage: CREATE VIRTUAL PROCEDURE block The CREATE VIRTUAL PROCEDURE line demarcates the beginning of the procedure. Within the body of the procedure, any valid statement may be used. There is no explict cursoring or return statement, rather the last command statement executed in the procedure that returns a result set will be returned as the result. The output of that statement must match the expected result set and parameters of the procedure. Virtual procedures can take zero or more IN/INOUT parameters and may also have any number of OUT parameters and an optional RETURN parameter. Each input has the following information that is used during runtime processing: Name - The name of the input parameter Datatype - The design-time type of the input parameter Default value - The default value if the input parameter is not specified Nullable - NO_NULLS, NULLABLE, NULLABLE_UNKNOWN; parameter is optional if nullable, and is not required to be listed when using named parameter syntax You reference a parameter in a virtual procedure by using the fully-qualified name of the param (or less if unambiguous). For example, MySchema.MyProc.Param1. Example 8.11. Example of Referencing an Input Parameter and Assigning an Out Parameter for 'GetBalance' Procedure CREATE VIRTUAL PROCEDURE BEGIN MySchema.GetBalance.RetVal = UPPER(MySchema.GetBalance.AcctID); SELECT Balance FROM MySchema.Accts WHERE MySchema.Accts.AccountID = MySchema.GetBalance.AcctID; END If an INOUT parameter is not assigned any value in a procedure it will remain the value it was assigned for input. Any OUT/RETURN parameter not assigned a value will remain the as the default NULL value. The INOUT/OUT/RETURN output values are validated against the NOT NULL metadata of the parameter. This example is a LOOP that walks through a cursored table and uses CONTINUE and BREAK. Example 8.12. Virtual Procedure Using LOOP, CONTINUE, BREAK CREATE VIRTUAL PROCEDURE BEGIN DECLARE double total; DECLARE integer transactions; LOOP ON (SELECT amt, type FROM CashTxnTable) AS txncursor BEGIN IF(txncursor.type <> 'Sale') BEGIN CONTINUE; END ELSE BEGIN total = (total + txncursor.amt); transactions = (transactions + 1); IF(transactions = 100) BEGIN BREAK; END END END SELECT total, (total / transactions) AS avg_transaction; END This example is uses conditional logic to determine which of two SELECT statements to execute. Example 8.13. Virtual Procedure with Conditional SELECT CREATE VIRTUAL PROCEDURE BEGIN DECLARE string VARIABLES.SORTDIRECTION; VARIABLES.SORTDIRECTION = PartsVirtual.OrderedQtyProc.SORTMODE; IF ( ucase(VARIABLES.SORTDIRECTION) = 'ASC' ) BEGIN SELECT * FROM PartsVirtual.SupplierInfo WHERE QUANTITY > PartsVirtual.OrderedQtyProc.QTYIN ORDER BY PartsVirtual.SupplierInfo.PART_ID; END ELSE BEGIN SELECT * FROM PartsVirtual.SupplierInfo WHERE QUANTITY > PartsVirtual.OrderedQtyProc.QTYIN ORDER BY PartsVirtual.SupplierInfo.PART_ID DESC; END END You execute procedures using the SQL EXECUTE command. If the procedure has defined inputs, you specify those in a sequential list, or using "name=value" syntax. You must use the name of the input parameter, scoped by the full procedure name if the parameter name is ambiguous in the context of other columns or variables in the procedure. A virtual procedure call will return a result set just like any SELECT, so you can use this in many places you can use a SELECT. Typically you'll use the following syntax: SELECT * FROM (EXEC ...) AS x Views are abstractions above physical sources. They typically union or join information from multiple tables, often from multiple data sources or other views. Teiid can perform update operations against views. Update commands - INSERT, UPDATE, or DELETE - against a view require logic to define how the tables and views integrated by the view are affected by each type of command. This transformation logic is invoked when an update command is issued against a view. Update procedures define the logic for how a user's update command against a view should be decomposed into the individual commands to be executed against the underlying physical sources. Similar to virtual procedures , update procedures have the ability to execute queries or other commands, define temporary tables, add data to temporary tables, walk through result sets, use loops, and use conditional logic. The user application submits the SQL command through one of SOAP, JDBC, or ODBC. The view this SQL command is executed against is detected. The correct procedure is chosen depending upon whether the command is an INSERT, UPDATE, or DELETE. The procedure is executed. The procedure itself can contain SQL commands of its own which can be of different types than the command submitted by the user application that invoked the procedure. Commands, as described in the procedure, are issued to the individual physical data sources or other views. A value representing the number of rows changed is returned to the calling application. A FOR EACH ROW procedure will evaluate its block for each row of the view affected by the update statement. For UPDATE and DELETE statements this will be every row that passes the WHERE condition. For INSERT statements there will be 1 new row for each set of values from the VALUES or query expression. The rows updated is reported as this number regardless of the affect of the underlying procedure logic. Teiid FOR EACH ROW update procedures function like INSTEAD OF triggers in traditional databases. There may only be 1 FOR EACH ROW procedure for each INSERT, UPDATE, or DELETE operation against a view. FOR EACH ROW update procedures can also be used to emulate BEFORE/AFTER each row triggers while still retaining the ability to perform an inherent update. This BEFORE/AFTER trigger behavior with an inherent update can be achieved by creating an additional updatable view over the target view with update proceudres of the form: FOR EACH ROW BEGIN ATOMIC --before row logic --default insert/update/delete against the target view INSERT INTO VW (c1, c2, c3) VALUES (NEW.c1, NEW.c2, NEW.c3); --after row logic END Usage: FOR EACH ROW BEGIN ATOMIC ... END The BEGIN and END keywords are used to denote block boundaries. Within the body of the procedure, any valid statement may be used. The use of the atomic keyword is currently optional for backward compatibility, but unlike a normal block, the default for instead of triggers is atomic. You can use a number of special variables when defining your update procedure. Every attribute in the view whose UPDATE and INSERT transformations you are defining has an equivalent variable named NEW. the old value. In an INSERT procedure, the default value of these variables is the default value of the virtual table attributes. See CHANGING Variables for distinguishing defaults from passed values. Every attribute in the view whose UPDATE and DELETE transformations you are defining has an equivalent variable named OLD.<column_name> When a DELETE or UPDATE command is executed against the view, these variables are initialized to the current values of the row being deleted or updated respectively.. A CHANGING variable is commonly used to differentiate between a default insert value and one specified in the user query. For example, for a view with columns A, B, C: For example, for a view with columns A, B, C: Example 8.14. Sample DELETE Procedure FOR EACH ROW BEGIN DELETE FROM X WHERE Y = OLD.A; DELETE FROM Z WHERE Y = OLD.A; // cascade the delete END Example 8.15. Sample UPDATE Procedure FOR EACH ROW BEGIN IF (CHANGING.B) BEGIN UPDATE Z SET Y = NEW.B WHERE Y = OLD.B; END END Update procedures defined by "CREATE PROCEDURE ..." have been deprecated. The TRANSLATE CRITERIA mechanism and associated logic is typically not adequite to correctly define an updatable view. Usage: CREATE PROCEDURE BEGIN ... END The CREATE PROCEDURE line demarcates the beginning of the procedure. The BEGIN and END keywords are used to denote block boundaries. Within the body of the procedure, any valid statement may be used. You can use a number of special variables when defining your update procedure. Every attribute in the view whose UPDATE and INSERT transformations you are defining has an equivalent variable named INPUTS. null. In an INSERT procedure, the default value of these variables is the default value of the virtual table attributes, based on their defined types. See CHANGING Variables for distinguishing defaults from passed values. In prior release of Teiid INPUT was also accepted as the quailifer for an input variable. As of Teidd 7, INPUT is a reserved word, so INPUTS is the preferred qualifier. Similar to INPUT Variables,. For example, for a view with columns A, B, C: Teiid returns the value of the integer VARIABLES.ROWS_UPDATED variable as a response to an update command executed against the view. Your procedure must set the value that returns when an application executes an update command against the view, which triggers invocation of the update procedure. For example, if an UPDATE command is issued that affects 5 records, the ROWS_UPDATED should be set appropriately so that the user will receive '5' for the count of records affected. Example 8.16. Sample Usage ... UPDATE FOO SET X = 1 WHERE TRANSLATE CRITERIA; VARIABLES.ROWS_UPDATED = VARIABLES.ROWCOUNT; ... You can use a number of special SQL clauses when defining UPDATE or DELETE procedures. These make it easier to do variable substitutions in WHERE clauses or to check on the change state of variables without using a lot of conditional logic. HAS CRITERIA has been deprecated. An alternative approach to update procedures will be introduced in a subsequent version. You can use the HAS CRITERIA clause to check whether the user’s command has a particular kind of criteria on a particular set of attributes. This clause evaluates to either true or false. You can use it anywhere you can use a criteria within a procedure. Usage: HAS [criteria operator] CRITERIA [ON (column list)] Syntax Rules The criteria operator, can be one of =, <, >, <=, >=, <>, LIKE, IS NULL, or IN. If the ON clause is present, HAS CRITERIA will return true only if criteria was present on all of the specified columns. The columns in a HAS CRITERIA ON clause always refer to view columns. Each unoptimized conjunct of the user criteria is evaluated against the criteria selector. If any conjunct matches then HAS CRITERIA evaluates to TRUE. The use of OR or NOT will prevent contained predicates from matching the criteria selector. Some samples of the HAS CRITERIA clause: The HAS CRITERIA predicate is most commonly used in an IF clause, to determine if the user issued a particular form of command and to respond appropriately. TRANSLATE CRITERIA has been deprecated. An alternative approach to update procedures will be introduced in a subsequent version. You can use the TRANSLATE CRITERIA clause to convert the criteria from the user application’s SQL command into the form required to interact with the target source or view tables. The TRANSLATE CRITERIA statement uses the SELECT transformation to infer the column mapping. This clause evaluates to a translated criteria that is evaluated in the context of a command. You can use these mappings either to replace the default mappings generated from the SELECT transformation or to specify a reverse expression when a virtual column is defined by an expression. Usage: TRANSLATE [criteria operator] CRITERIA [ON (column list)] [WITH (mapping list)] If there is no user criteria, then the translated criteria is always treated as TRUE. Syntax Rules The criteria operator, can be one of =, <, >, <=, >=, <>, LIKE, IS NULL, or IN. If the ON clause is present, TRANSLATE CRITERIA will only form criteria using the specified columns. The columns in a TRANSLATE CRITERIA ON clause always refer to view columns. The WITH clause always has items with form <elem> = <expression> where the left hand side must refer to a view column. If the WITH clause or a specific mapping is not specified, then a mapping is created based on the SELECT clause of the SELECT transformation (the view column gets mapped to expression in SELECT clause at same position). Each unoptimized conjunct of the user criteria is translated using the criteria selector. If a conjunct does not match the selector, it will not be translated - which effectively treats the conjunct as TRUE. The use of OR or NOT will prevent contained predicates from matching the criteria selector. Some samples of TRANSLATE CRITERIA: Teiid utilizes XA transactions for participating in global transactions and for demarcating its local and command scoped transactions. JBoss Transactions is used by Teiid as its transaction manager. See this documentation for the advanced features provided by JBoss Transactions. The default transaction isolation level for Teiid is READ_COMMITTED. Since user level commands may execute multiple source commands, users can specify the AutoCommitTxn execution property to control the transactional behavior of a user command when not in a local or global transaction. The concept of command safety with respect to a transaction is determined by Teiid based upon command type, the transaction isolation level, and available metadata. A wrapping transaction is not needed if: If a user command is fully pushed to the source. If the user command is a SELECT (including XML) and the transaction isolation is not REPEATABLE_READ nor SERIALIABLE. If the user command is a stored procedure and the transaction isolation is not REPEATABLE_READ nor SERIALIABLE and the updating model count is zero. The update count may be set on all procedures as part of the procedure metadata in the model. The term "updating model count" refers to the number of times any model is updated during the execution of a command. It is used to determine whether a transaction, of any scope, is required to safely execute the, org.teiid.jdbc.TeiidDat. JBoss AS". Teiid Designer creates "local" data source by default which is not optimal for the XA transactions. Teiid would like this to be creating a XA data sources, however with current limitations with DTP that feature is currently not available. To create XA data source, look in JBoss AS . Data roles, also called entitlements, are sets of permissions defined per VDB that dictate data access (create, read, update, delete). Data roles use a fine-grained permission system that Teiid will enforce at runtime and provide audit log entries for access violations (see that Admin and Developers Guide for more on Audit Logging).. When using Teiid Designer, you may then go further and modify the imported metadata at a granular level to remove specific columns, mark tables as non-updatable, etc. If data roles is enabled and data roles are defined in a VDB, then access permissions will be enforced by the Teiid Server. The use of data roles may be disabled system wide via the <jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml file, by setting the property useDataRoles to false in the configuration section of the RuntimeEngineDeployer. Unlike previous versions of Teiid data roles will only be checked if present in a VDB. A VDB deployed without data roles is open for use by any authenticated user. CREATE, READ, UPDATE, DELETE (CRUD) permissions can be set for any resource path in a VDB. A resource path can be as specific as the fully qualified name of a column or as general a top level model (schema) name. Permissions granted to a particular path apply to it and any resource paths that share the same partial name. For example, granting read to "model" will also grant read to "model.table", "model.table.column", etc. Allowing or denying a particular action is determined by searching for permissions from the most to least specific resource paths. The first permission found with a specific allow or deny will be used. Thus it is possible to set very general permissions at high-level resource path names and to override only as necessary at more specific resource paths. Permission grants are only needed for resources that a role needs access to. Permissions are also only applied to the columns/tables/procedures in the user query - not to every resource accessed transitively through view and procedure definitions. It is important therefore to ensure that permission grants are applied consistently across models that access the same resources. Unlike previous versions of Teiid, non-visible models are accessible by user queries. To restrict user access at a model level, at least one data role should be created to enable data role checking. In turn that role can be mapped to any authenticated user and should not grant permissions to models that should be inaccessable. Permissions are not applicable to the SYS and pg_catalog schemas. These metadata reporting schemas are always accessible regardless of the user. The SYSADMIN schema however may need permissions as applicable. To process a SELECT statement or a stored procedure execution, the user account requires the following access rights: READ - on the Table(s) being accessed or the procedure being called. READ - on every column referenced. To process an INSERT statement, the user account requires the following access rights: CREATE - on the Table being inserted into. CREATE - on every column being inserted on that Table. To process an UPDATE statement, the user account requires the following access rights: UPDATE - on the Table being updated. UPDATE - on every column being updated on that Table. READ - on every column referenced in the criteria. To process a DELETE statement, the user account requires the following access rights: DELETE - on the Table being deleted. READ - on every column referenced in the criteria. To process a EXEC/CALL statement, the user account requires the following access rights: EXECUTE (or READ) - on the Procedure being executed. To process any function, the user account requires the following access rights: EXECUTE (or READ) - on the Function being called. For backwards compatibility RuntimeEngineDeployer.allowFunctionCallsByDefault located in the <jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml file in the RuntimeEngineDeployer section defaults to true. This means that to actually require permissions for functions, you need to set this property to false. To process any ALTER or CREATE TRIGGER statement, the user account requires the following access rights: ALTER - on the view or procedure that is effected. INSTEAD OF Triggers (update procedures) are not yet treated as full schema objects and are instead treated as attributes of the view. Each Teiid data role can be mapped to any number of container roles or any authenticated user. You may control role membership through whatever system the Teiid security domain login modules are associated with. The kit includes example files for use with the UsersRolesLoginModule - see teiid-security-roles.properties. It is possible for a user to have any number of container roles, which in turn imply a subset of Teiid data roles. Each applicable Teiid data role contributes cumulatively to the permissions of the user. No one role supercedes or negates the permissions of the other data roles. Data roles are defined inside the vdb.xml file (inside the .vdb Zip archive under META-INF/vdb.xml) if you used Designer. The "vdb.xml" file is checked against the schema file vdb-deployer.xsd, which can be found in the kit under teiid-docs/schema. This example will show a sample "vdb.xml" file with few simple data roles. For example, if a VDB defines a table "TableA" in schema "modelName" with columns (column1, column2) - note that the column types do not matter. And we wish to define three roles "RoleA", "RoleB", "RoleC" with following permissions: RoleA has permissions to read, write access to TableA, but can not delete. RoleB has no permissions that allow access to TableA RoleC has permissions that only allow read access to TableA.column1 Example 10.1. vdb.xml defining RoleA, RoleB, and RoleC <?xml version="1.0" encoding="UTF-8"?> <vdb name="sample" version="1"> <model name="modelName"> <source name="source-name" translator- </model> <data-role <description>Allow all, except Delete</description> <permission> <resource-name>modelName.TableA</resource-name> <allow-create>true</allow-create> <allow-read>true</allow-read> <allow-update>true</allow-update> </permission> <mapped-role-name>role1</mapped-role-name> </data-role> <data-role <description>Allow read only</description> <permission> <resource-name>modelName.TableA</resource-name> <allow-read>true</allow-read> </permission> <permission> <resource-name>modelName.TableA.colum2</resource-name> <allow-read>false</allow-read> </permission> <mapped-role-name>role2</mapped-role-name> </data-role> </vdb> The above XML defined two data roles, "RoleA" which allows everything except delete on the table, "RoleC" that allows only read operation on the table. Since Teiid uses deny by default, there is no explicit data-role entry needed for "RoleB". Note that explicit column permissions are not needed for RoleA, since the parent resource path, modelName.TableA, permissions still apply. RoleC however must explicitly disallow read to column2. The "mapped-role-name" defines the container JAAS roles that are assigned the data role. For assigning roles to your users in the JBoss AS, check out the instructions for the selected Login Module. Check the "Admin Guide" for configuring Login Modules. You may also choose to allow any authenticated user to have a data role by setting the any-authenticated attribute value to true on data-role element. The "allow-create-temporary-tables" data-role boolean attribute is used to explicitly enable or disable temporary table usage for the role. If it is left unspecified, then the value will be determined by the configuration setting allowCreateTemporaryTablesByDefault located in the <jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml file in the RuntimeEngineDeployer section. The hasRole system function will return true if the current user has the given data role. The hasRole function can be used in procedure or view definitions to allow for a more dynamic application of security - which allows for things such as value masking or row level security. The built-in SYS and SYSADMIN schemas provide metadata tables and procedures against the current VDB. This table supplies information about the currently connected virtual database, of which there is always exactly one (in the context of a connection). This table supplies information about all the schemas in the virtual database, including the system schema itself (System). This table supplies information about all the groups (tables, views, documents, etc) in the virtual database. This table supplies information about all the materailized views in the virtual database. This table supplies information about all the elements (columns, tags, attributes, etc) in the virtual database. This table supplies information about the procedures in the virtual database. The OID column is guranteed to be unique/consistent only for given version running instance of a VDB. If a different version of the VDB is deployed, these IDs are not guranteed to be the same or unique across both versions of the VDB. Dynamic VDB OIDs are not cluster safe. Returns a resultset with a single column, schema, containing the schemas as clobs. SYS.getXMLSchemas(document in string) returns schema string Log a message to the underlying logging system. SYSADMIN.logMsg(logged RETURN boolean, level IN string, context IN string, msg IN object) Returns true if the message was logged. level can be one of the log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. level defaults to 'DEBUG' and context defaults to 'org.teiid.PROCESSOR' Example 11.1. Example logMsg CALL SYSADMIN.logMsg(msg=>'some debug', context=>'org.something') This will log the message 'some debug' at the default level DEBUG to the context org.something. Tests if logging is enabled at the given level and context. SYSADMIN.isLoggable(loggable RETURN boolean, level IN string, context IN string) Returns true if logging is enabled. level can be one of the log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. level defaults to 'DEBUG' and context defaults to 'org.teiid.PROCESSOR' Example 11.2. Example isLoggable IF ((CALL SYSADMIN.isLoggable(context=>'org.something')) BEGIN DECLARE STRING msg; // logic to build the message ... CALL SYSADMIN.logMsg(msg=>msg, context=>'org.something') END Returns integer RowsUpdated. -1 indicates a load is in progress, otherwise the cardinality of the table is returned. See the Caching Guide for more. SYSADMIN.refreshMatView(RowsUpdated return integer, ViewName in string, Invalidate in boolean) Returns integer RowsUpdated. -1 indicates the materialized table is currently invalid. 0 indicates that the specified row did not exist in the live data query or in the materialized table. See the Caching Guide for more. SYSADMIN.refreshMatViewRow(RowsUpdated return integer, ViewName in string, Key in object) A MetadataRepository must be configured to make a non-temporary metadata update persistent. See the Developers Guide Runtime Metadata Updates section for more. Set statistics for the given table. SYSADMIN.setTableStats(TableName in string, Cardinality in integer) Set statistics for the given column. SYSADMIN.setColumnStats(TableName in string, ColumnName in string, DistinctCount in integer, NullCount in integer, Max in string, Min in string) All stat values are nullable. Passing a null stat value will leave corresponding metadata value unchanged. Set an extension metadata property for the given record. Extension metadata is typically used by Chapter 13, Translators. SYSADMIN.setProperty(OldValue return clob, Uid in string, Name in string, Value in clob) Setting a value to null will remove the property. Example 11.3. Example Property Set CALL SYSADMIN.setProperty(uid=>(SELECT uid FROM TABLES WHERE name='tab'), name=>'some name', value=>'some value') This will set the property 'some name'='some value' on table tab. The use of this procedure will not trigger replanning of associated prepared plans. A VDB or virtual database definition is contained in an XML file. For .vdb archive files created in the design tool, this file is embedded in the archive and most field can be updated through tooling. The XML schema for this file can be found in the teiid-docs/schema directory. Example 12.1. Example VDB XML <vdb name="${vdb-name}" version="${vdb-version}"> <!-- VDB properties --> <property name="UseConnectorMetadata" value="..." /> ... <!-- define a model fragment for each data source --> <model name="${model-name}"> <property name="..." value="..." /> ... <source name="${source-name}" translator- ... </model> <!-- create translator instances that override default properties --> <translator name="${translator-name}" type="${translator-type}" /> <property name="..." value="..." /> ... </translator> </vdb> Attributes name The name of the VDB. The VDB name referenced through the driver or datasource during the connection time. version The version of the VDB (should be an positive integer). This determines the deployed directory location (see Name), and provides an explicit versioning mechanism to the VDB name. Property Elements UseConnectorMetadata Setting to use connector supplied metadata. Can be "true" or "cached". "true" will obtain metadata once for every launch of Teiid. "cached" will save a file containing the metadata into the directory PROFILE/data/teiid. Attributes name The name of the model is used as a top level schema name for all of the metadata imported from the connector. The name should be unique among all Models in the VDB and should not contain the '.' character. version The version of the VDB (should be an positive integer). This determines the deployed directory location (see Name), and provides an explicit versioning mechanism to the VDB name. Source Element name The name of the source to use for this model. This can be any name you like, but will typically be the same as the model name. Having a name different than the model name is only useful in multi-source scenarios. translator-name The name or type of the Teiid Translator to use. Possible values include the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.) and translators defined in the translators section. connection-jndi-name The JNDI name of this source's connection factory. There should be a corresponding "-ds.xml" file that defines the connection factory in the JBoss AS. Check out the deploying VDB dependencies section for info. You also need to deploy these connection factories before you can deploy the VDB. Property Elements importer.<propertyname> Property to be used by the connector importer for the model for purposes importing metadata. See possible property name/values in the Translator specific section. Note that using these properties you can narrow or widen the data elements available for integration. Attributes name The name of the the Translator. Referenced by the source element. type The base type of the Translator. Can be one of the built-in types (ws, file, ldap, oracle, sqlserver, db2, derby, etc.). Property Elements Set a value that overrides a translator default property. See possible property name/values in the Translator specific section. Teiid integration is available via a "Dynamic VDB" without the need for Teiid Designer tooling. While this mode of operation does not yet allow for the creation of view layers, the underlying sources can still be queried as if they are a single source. See the kit's "teiid-example/dynamicvdb-*" for working examples. To build a dynamic VDB, you'll need to create a file. The XML file captures information about the VDB, the sources it integrate, and preferences for importing metadata. SOME-NAME-vdb.xml VDB name pattern must adhere to "-vdb.xml" for the Teiid VDB deployer to recognize this file as a dynamic VDB. my-vdb.xml: (The vdb-deployer.xml schema for this file is available in the schema folder under the docs with the Teiid distribution.) Multi-source models can be used to quickly access data in multiple sources with homogeneous metadata. When you have multiple instances of data that are using identical schema (horizontal sharding), Teiid can help you aggregate data across all the instances, using "multi-source" models. In this scenario, instead of creating/importing a model for every data source, user needs to define one source model that represents the schema and configure multiple data "sources" underneath it. During runtime, when a query issued against this model, the query engine analyzes the information and gathers the required data from all the sources configured and aggregates the results and provides in a single result set. Since all sources utilize the same physical metadata, this feature is most appropriate for accessing the same source type with multiple instances. To mark a model as multi-source, the user needs to supply property called supports-multi-source-bindings, in the "vdb.xml" file. Also, the user needs to define multiple sources. Here is code example showing dynamic vdb with single model with multiple sources defined. <vdb name="vdbname" version="1"> <model visible="true" type="PHYSICAL" name="Customers" path="/Test/Customers.xmi"> <property name="supports-multi-source-bindings"> In the above example, the VDB defined has single model called Customers, that has multiple sources ( chicago, newyork, and la) that define different instances of data. Every time a model is marked as "multi-source", the runtime engine adds a additional column called "SOURCE_NAME" to every table in that model. This column maps to the source's name from the XML. In the above XML code that would be chicago, la, newyork. This allows queries like the following: select * from table where SOURCE_NAME = 'newyork' update table column=value where SOURCE_NAME='chicago' delete from table where column = x and SOURCE_NAME='la' insert into table (column, SOURCE_NAME) VALUES ('value', 'newyork') Note that when user do not supply the "SOURCE_NAME" in the criteria, the command applies to all the sources. If SOURCE_NAME supplied, the query is executed only aginst the source specified. Another useful feature along with this feature is "partial results" to skip unavailable sources if they are down. More complex partitioning scenarios, such as heterogeneous sources or list partitioning will require the use of a Section 14.2.8, “Partitioned Union”. Currently the tooling support for managing the multi-source. If you would like to use "SOURCE_NAME" in your transformations to control which sources are accessed or updated, you would manually need to add this extra column on your view table in the Designer. This column will not be automatically added on the source table, when you import the medata from source. It is important to understand that a column or IN procedure parameter named source_name in multi-source mode will always be treated as the explicit form of the multi-source source_name column and will no longer be treated as an actual physical column or procedure parameter. A multi-source SELECT may use the source_name column anywhere a column reference is allowed. As a final stage of planning, a source query will be generated against each source and each instance of the source_name column replaced by the appropriate value. If the resulting query still needs executed, it is sent to the source. If the WHERE clause evaluates to always false, then the query is pruned from the result. All results are then unioned together and returned as the full result. A multi-source INSERT may use the source_name column as an insert target column to specify which source should be targeted by the INSERT. Only a INSERT using the VALUES clause is supported and the source_name column value must be a literal. If the source_name column is not part of the INSERT column, then the INSERT will be issued against every source. The sum of the update counts will be returned as the resultant update count. A multi-source delete functions just like SELECT, however it is not possible to use the source_name column as a target column in the change set. Any other usage of the source_name column will be the appropriate value for each source. If the WHERE clause evaluates to always false, then no update will be issued to the source. The sum of the update counts will be returned as the resultant update count. A multi-source delete functions just like SELECT. Any usage of the source_name column will be the appropriate value for each source. If the WHERE clause evaluates to always false, then no delete will be issued to the source. The sum of the update counts will be returned as the resultant update count. A physical stored procedures requires the manual addition of a string source_name parameter to allow for specifying which source the procedure is executed on. If the source_name parameter is not added or if named parameters are used and the source_name parameter is allowed to default to a null value, then the procedure will be executed on each source and the results unioned together. It is not possible to execute procedures that required to return IN/OUT, OUT, or RETURN parameters values on more than 1 source at a time. The. The TCA is not the same as the JCA, the JavaEE Connector Architecture, although the TCA is designed for use with JCA resource adapters. The import capabilities of Teiid Translators is currently only used in dynamic VDBs and not by the Teiid Designer.. Only a subset of the supports metadata can be set through execution properties. If more control is needed, please consult the Teiid Developers Guide. There are no base importer settings. The file translator, known by the type name file, exposes stored procedures to leverage file system resources exposed by the file resource adapter. It will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formated data. Retrieve all files as BLOBs with an optional extension at the given path. call getFiles('path/*.ext') If the extension path is specified, then it will filter all of the file in the directory referenced by the base path. If the extension pattern is not specified and the path is a directory, then all files in the directory will be returned. Otherwise the single file referenced will be returned. If the path doesn't exist, then no results will be returned if ExceptionIfFileNotFound is false, otherwise an exception will be raised. Retrieve all files as CLOB(s) with the an optional extension at the given path. call getTextFiles('path/*.ext') All the same files a getFiles will be retrieved, the only difference is that the results will be CLOB values using the encoding execution property as the character set. Save the CLOB, BLOB, or XML value to given path call saveFile('path', value) The path should reference a new file location or an existing file to overwrite completely. The JDBC translator bridges between SQL semantic and data type difference between Teiid and a target RDBMS. Teiid has a range of specific translators that target the most popular open source and proprietary databases. Type names: jdbc-ansi - declares support for most SQL constructs supported by Teiid, except for row limit/offset and EXCEPT/INTERCECT. Translates source SQL into ANSI compliant syntax. This translator should be used when another more specific type is not available. jdbc-simple - same as jdbc-ansi, except disables support for function, UNION, and aggregate pushdown. access - for use with Microsoft Access 2003 or later. db2 - for use with DB2 8 or later. derby - for use with Derby 10.1 or later. h2 - for use with H2 version 1.1 or later. hive - For use with Hive database based on Hadoop. Hive is a data warehousing infrastructure based on the Hadoop. Hadoop provides massive scale out and fault tolerance capabilities for data storage and processing (using the map-reduce programming paradigm) on commodity hardware. Hive has limited support for data types as it supports integer varients, boolean, float, double and string. It is does not have native support for time based types, xml or LOBs. These limitations are reflected in the translator capabilities. The view table can use these types, however the tranformation would need to specify the necessary transformations. Note that in those situations, the evaluations will be done in Teiid engine. Another limitation Hive has is, it only supports EQUI join, so using any other joins types on its source tables will result in in-effiecient queries. Currently there is no tooling support for metadata import from Hive in Designer. To write criteria based on partitioned columns, they can be modeled on source table, but do not include in selection columns. hsql - for use with HSQLDB 1.7 or later. ingres - for use with Ingres 2006 or later. ingres93 - for use with Ingres 9.3 or later. intersystems-cache - for use with Intersystems Cache Object database (only relational aspect of it) informix - for use with any version. metamatrix - for use with MetaMatrix 5.5.0 or later.. mysql/mysql5 - for use with MySQL version 4.x and 5 or later respectively. The MySQL Translators expect the database or session to be using ANSI mode. If the database is not using ANSI mode, an initialization query should be used on the pool to set ANSI mode: set SESSION sql_mode = 'ANSI' oracle - for use with Oracle 9i or later. Sequences may be used with the Oracle translator. A sequence may be modeled as a table with a name in source of DUAL and columns with the name in source set to <sequencesequence name>.[nextval|currentval]. You can use a sequence as the default value for insert columns by setting the column to autoincrement and the name in source to <element name>:SEQUENCE=<sequence name>.<sequence value>. A rownum column can also added to any Oracle physical table to support the rownum pseudo-column. A rownum colum should have a name in source of rownum. These rownum columns do not have the same semantics as the Oracle rownum construct so care must be taken in their usage. Oracle specific execution properties: OracleSuppliedDriver - indicates that the Oracle supplied driver (typically prefixed by ojdbc) is being used. Defaults to true. Set to false when using DataDirect or other Oracle JDBC drivers. postgresql - for use with 8.0 or later clients and 7.1 or later server. sqlserver - for use with SQL Server 2000 or later. A SQL Server JDBC driver version 2.0 or later (or compatible e.g. JTDS 1.2 or later) should be used. sybase - for use with Sybase version 12.5 or later. teiid - for use with Teiid 6.0 or later. teradata - for use with Teradata V2R5.1 or later. The default import settings will crawl all available metadata. This import process is time consuming and full metadata import is not needed in most situations. Most commonly you'll want to limit import by schemaPattern and tableTypes. Example importer settings to only import tables and views from my-schema. ... <property name="importer.tableTypes" value="TABLE,VIEW"/> <property name="importer.schemaPattern" value="my-schema"/> ... Usage of a JDBC source is straight-forward. Using Teiid SQL, the source may be queried as if the tables and procedures were local to the Teiid system. Both physical tables and procedures may optionally have native queries associated with them. No validation of the native query is performed, it is simply used in a straight-forward manner to generate the source SQL. For a physical table setting the teiid:native-query extension metadata to the desired query string will have Teiid execute the native query as an inline view in the source query. This feature should only be used against sources that support inline views. For example on a physical table y with nameInSource=x and teiid:native-query extension metadata to a desired query string with the added ability to positionally reference IN parameters. A parameter reference has the form $integer, e.g. $1. Note that 1 based indexing is used and that only IN parameters may be referenced. Dollar-sign integer is reserved in physical procedure native queries. To use a $integer directly, it must be escaped with another $, e.g. $$1. By default bind values will be used for parameter values. In some situations you may wish to bind values directly into the resulting SQL. The teiid. The LDAP translator, known by the type name ldap, exposes an LDAP directory tree relationally with pushdown support for filtering via criteria. This is typically coupled with the LDAP resource adapter. There are no import settings for the ldap translator; it also does not provide metadata. String columns with a default value of "multivalued-concat" will concatinate all attribute values together in alphabetical order using a ? delimiter. If a multivalued attribute does not have a default value of "multivalued-concat", then any value may be returned. The Loopback translator, known by the type name loopback, provides a quick testing solution. It supports all SQL constructs and returns default results, with configurable behavior. There are no import settings for the Loopback translator; it also does not provide metadata - it should be used as a testing stub. The Salesforce translator, known by the type name salesforce supports the SELECT, DELETE, INSERT and UPDATE operations against a Salesforce.com account. It is designed for use with the Teiid Salesforce resource adapter. The Salesforce translator can import metadata, but does not currently have import settings.. SELECT sum(Reports) FROM Supervisor where Division = 'customer support'; Neither Salesforce nor the Salesforce Connector support the sum() scalar function, but they do support CompareCriteriaEquals, so the query that is passed to Salesforce by the connector will be transformed to this query. SELECT Reports FROM Supervisor where Division = 'customer support'; The sum() scalar>); *The Salesforce API DELETE call is not expressed in SQL, but the above is an SQL equivalent expression. It's useful to be aware of unsupported capabilities, in order to avoid fetching large data sets from Salesforce and making you queries as performant as possible. See all Supported Capabilities.'; The Salesforce connector supports the calling the queryAll operation from the Salesforce API. The queryAll operation is equivalent to the query operation with the exception that it returns data about all current and deleted objects behavior. The following are the the connector capabilities supported by the Salesforce Connector. These SQL constructs will be pushed down to Salesforce. SELECT command INSERT Command UPDATE Command DELETE Command CompareCriteriaEquals InCriteria LikeCriteria - Supported for String fields only. RowLimit AggregatesCountStar NotCriteria OrCriteria CompareCriteriaOrdered OuterJoins with join criteria KEY The Web Services translator, known by the type name ws, exposes stored procedures for calling web services backed by a Teiid WS resource adapter. It will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formated data. Setting the proper binding value on the translator is recommended as it removes the need for callers to pass an explict value. If your service is actually uses SOAP11, but the binding used SOAP12 you will receive execution failures. There are ws importer settings, but it does provide metadata for dynamic VDBs. The WS translator exposes low level procedures for accessing web services. See also the ws-weather example in the kit. Invoke allows for multiple binding, or protocol modes, including HTTP, SOAP11, and SOAP12. Procedure invoke(binding in STRING, action in STRING, request in XML, endpoint in STRING) returns XML The binding may be one of null (to use the default) HTTP, SOAP11, or SOAP12. Action with a SOAP binding indicates the SOAPAction value. Action with a HTTP binding indicates the HTTP method (GET, POST, etc.), which defaults to POST. A null value for the binding(binding=>'HTTP', action=>'GET') The request XML should be a valid XML document or root element. invokeHttp can return the byte contents of an HTTP(S) call. Procedure invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, contentType out STRING) returns BLOB Action indicates the HTTP method (GET, POST, etc.), which defaults to POST. A null valueHttp(action=>'GET') The request can be one of SQLXML, STRING, BLOB, or CLOB. The request will be sent as the POST payload in byte form. For STRING/CLOB values this will default to the UTF-8 encoding. To control the byte encoding, see the to_bytes function. The OLAP Services translator, known by the type name olap, exposes stored procedures for calling analysis sevices backed by a OLAP server using MDX query lanaguage.. The olap translator exposes one low level procedure for accessing olap services. invokeMdx returns a resultset of the tuples as array values. Procedure invokeMdx(mdx in STRING) returns resultset (tuple object) The mdx parameter is a MDX query to be executed on the OLAP server. The results of the query will be returned such that each row on the row axis will be packed into an array value that will first contain each hierarcy member name on the row axis then each measure value from the column axis. The use of Chapter 10, Data Roles should be considered to prevent arbitrary MDX from being submitted to the invokeMDX procedure. The resource adapter for this translator provided through data source in JBoss AS, Refer to Admin Guide for "JDBC Data Sources" configuration section. Two sample -ds.xml files provided for accessing OLAP servers in teiid-examples section. One is Mondrian specific, when Mondrian server is deloyed in the same JBoss AS as Teiid (mondrian-ds.xml). To access any other OLAP servers using XMLA interface, the data source for them can be created using them example template olap-xmla-ds.xml.. When the query engine receives an incoming SQL query it performs the following operations: Parsing - validate syntax and convert to internal form Resolving - link all identifiers to metadata and functions to the function library Validating - validate SQL semantics based on metadata references and type signatures Rewriting - rewrite SQL to simplify expressions and criteria Logical plan optimization - the rewritten canonical SQL is converted into a logical plan for in-depth optimization. The Teiid optimizer is predominantly rule-based. Based upon the query structure and hints a certain rule set will be applied. These rules may trigger in turn trigger the execution of more rules. Within several rules, Teiid also takes advantage of costing information. The logical plan optimization steps can be seen by using SHOWPLAN DEBUG clause and are described in the query planner section. Processing plan conversion - the logic plan is converted into an executable form where the nodes are representative of basic processing operations. The final processing plan is displayed as the query plan . The logical query plan is a tree of operations used to transform data in source tables to the expected result set. In the tree, data flows from the bottom (tables) to the top (output). The primary logical operations are select (select or filter rows based on a criteria), project (project or compute column values), join , source (retrieve data from a table), sort (ORDER BY), duplicate removal (SELECT DISTINCT), group (GROUP BY), and union (UNION). For example, consider the following query that retrieves all engineering employees born since 1970. Example 14.1. Example query SELECT e.title, e.lastname FROM Employees AS e JOIN Departments AS d ON e.dept_id = d.dept_id WHERE year(e.birthday) >= 1970 AND d.dept_name = 'Engineering' Logically, the data from the Employees and Departments tables are retrieved, then joined, then filtered as specified, and finally the output columns are projected. The canonical query plan thus looks like this: Data flows from the tables at the bottom upwards through the join, through the select, and finally through the project to produce the final results. The data passed between each node is logically a result set with columns and rows. Of course, this is what happens logically , not how the plan is actually executed. Starting from this initial plan, the query planner performs transformations on the query plan tree to produce an equivalent plan that retrieves the same results faster. Both a federated query planner and a relational database planner deal with the same concepts and many of the same plan transformations. In this example, the criteria on the Departments and Employees tables will be pushed down the tree to filter the results as early as possible. In both cases, the goal is to retrieve the query results in the fastest possible time. However, the relational database planner does this primarily by optimizing the access paths in pulling data from storage. In contrast, a federated query planner is less concerned about storage access because it is typically pushing that burden to the data source. The most important consideration for a federated query planner is minimizing data transfer. Section 14.2.1, “Access Patterns”, hints, and costing information. Teiid supports hints to control dependent join behavior: MAKEIND - indicates that the clause should be the independent side of a depedent join. MAKEDEP - indicates that the clause should be the dependent side of a join. MAKENOTDEP - prevents the clause from being the dependent side of a join. Theses can be placed in either the OPTION clause or directly in the FROM clause . As long as all Section 14.2.1, “Access Patterns” can be met, the MAKEIND, MAKEDEP, and MAKENOTDEP hints override any use of costing information. MAKENOTDEP supersedes the other hints. The MAKEDEP/MAKEIND hint should only be used if the proper query plan is not chosen by default. You should ensure that your costing information is representative of the actual source cardinality. An inappropriate MAKEDEP/MAKEIND hint can force an inefficient join structure and may result in many source queries. The engine will for IN clauses Teiid ensures that each pushdown query only projects the symbols required for processing the user query. This is especially helpful when querying through large intermediate view layers. Partial aggregate pushdown allows for grouping operations above multi-source joins and unions to be decomposed so that some of the grouping and aggregate functions may be pushed down to the sources. The optional join hint indicates. Example 14.2. Example Optional Join Hint select a.column1, b.column2 from a, /*+ optional */ b WHERE a.key = b.key Example 14.3. Example ANSI Optional Join Hint. Example 14.4. Example Briding Table. Example 14.5. Example Unnecessary Optional Join Hint select a.column1, b.column2 from a LEFT OUTER JOIN /*+optional*/ b ON a.key = b.key A simple "SELECT COUNT(*) FROM VIEW" against a view where all join tables are marked as optional will not return a meaningful result.. For example the view definition "select 1 as x, y from foo union all select z, a from foo1 where z in (2, 3)" would be considered partitioned on column x, since the first branch can only be the value 1 and the second branch can only be the values 2 or 3. Note that more advanced or explicit partition could be considered in the future. The concept of a partitioned union is used for performing partition-wise joins, in Chapter 7, Updatable Views, and Section 14.2.6, “Partial Aggregate Pushdown”.. Section 14.3, “Subquery optimization” EXISTS subqueries are typically rewrite to "SELECT 1 FROM ..." to prevent unnecessary evaluation of SELECT expressions. Quantified compare SOME subqueries are always turned into an equivalent IN prediate or comparison against an aggregate value. e.g. col > SOME (select col1 from table) would become col > (select min(col1) from table) Uncorrelated EXISTs and scalar subquery that are not pushed to the source can be preevaluated prior to source command formation. Correlated subqueries used in DETELEs or UPDATEs that are not pushed as part of the corresponding DELETE/UPDATE will cause Teiid to perform row-by-row compensating processing. This will only happen if the affected table has a primary key. If it does not, then an exception will be thrown. WHERE or HAVING clause IN and EXISTs predicates can take the MJ (merge join), DJ (dependent join), or NO_UNNEST (no unnest) hints appearing just before the subquery. The MJ hint directs the optimizer to use a traditional, semijoin, or antisemijoin merge join if possible. The DJ is the same as the MJ hint, but additional directs the optimizer to use the subquery as the independent side of a dependent join if possible. The NO_UNNEST hint, which supercedes the other hints, will direct the optimizer to leave the subquery in place. Example 14.6. Merge Join Hint Usage SELECT col1 from tbl where col2 IN /*+ MJ */ (SELECT col1 FROM tbl2) Example 14.7. Dependent Join Hint Usage SELECT col1 from tbl where col2 IN /*+ DJ */ (SELECT col1 FROM tbl2) Example 14.8. No Unnest Hint Usage SELECT col1 from tbl where col2 IN /*+ NO_UNNEST */ (SELECT col1 FROM tbl2) The system property org.teiid.subqueryUnnestDefault controls whether the optimizer will by default unnest subqueries. The default is false. If true, then most non-negated WHERE or HAVING clause non-negated EXISTS or IN subquery predicates can be converted to a traditional merge join or as antijoin or semijoin variants. WHERE clause EXISTs and IN predicates that can be rewriten to a traditional join with the semantics of the semi-join can preserved if the system property org.teiid.subqueryUnnestDefault is set to true or the subquery has a MJ hint. EXISTs and scalar subqueries that are not pushed down, and not converted to merge joins, are implicitly limited to 1 and 2 result rows respectively. Conversion of subquery predicates to nested loop joins is not yet available.. Example 14.9. Streaming Eligible XMLQUERY XMLQUERY('/*:root/*:child' PASSING doc) Rather than loading the entire doc in-memory as a DOM tree, each child element will be independently added to the result. Example 14.10. Streaming Ineligible XMLQUERY XMLQUERY('//child' PASSING doc) The use of the descendent. Example 14.11. Streaming Eligible XMLTABLE. Example 14.12. Streaming Ineligible XMLTABLE XMLTABLE('/*:root/*:child' PASSING doc COLUMNS sibling_attr string PATH '../other_child/@attr') The reference of an element outside of the child subtree in the sibling_attr path prevents the streaming optimization from being used, but document projection can still be performed. Teiid provides the capability to obtain "partial results" in the event of data source unavailability or failure. This is especially useful when unioning information from multiple sources, or when doing a left outer join, where you are 'appending' columns to a master record but still want the record if the extra information is not available. A source is considered to be 'unavailable' if the connection factory associated with the source issues an exception in response to a query. The exception will be propagated to the query processor, where it will become a warning on the statement. See the Client Guide for more on Partial Results Mode and SQLWarnings. When integrating information using a federated query planner, it is useful to be able to view the query plans that are created, to better understand how information is being accessed and processed, and to troubleshoot problems. A query plan is a set of instructions created by a query engine for executing a command submitted by a user or application. The purpose of the query plan is to execute the user's query in as efficient a way as possible. You can get a query plan any time you execute a command. The SQL options available are as follows: SHOWPLAN [ON|DEBUG]- Returns the plan or the plan and the full planner debug log. With the above options, the query plan is available from the Statement object by casting to the org.teiid.jdbc.TeiidStatement interface. Example 14.13. Retrieving a Query Plan statement.execute("set showplan on"); ResultSet rs = statement.executeQuery("select ..."); TeiidStatement tstatement = statement.unwrap(TeiidStatement.class); PlanNode queryPlan = tstatement.getPlanDescription(); System.out.println(queryPlan); The query plan is made available automatically in several of Teiid's tools. Once a query plan has been obtained you will most commonly be looking for: Source pushdown -- what parts of the query that got pushed to each source Join ordering Join algorithm used - merge or nested loop. Presence of federated optimizations, such as dependent joins. Join criteria type mismatches. All of these issues presented above will be present subsections of the plan that are specific to relational queries. If you are executing a procedure or generating an XML document, the overall query plan will contain additional information related the surrounding procedural execution. A query plan consists of a set of nodes organized in a tree structure. As with the above example, you will typically be interested in analyzing the textual form of the plan. In a procedural context the ordering of child nodes implies the order of execution. In most other situation, child nodes may be executed in any order even in parallel. Only in specific optimizations, such as dependent join, will the children of a join execute serially. Relational plans represent the actually processing plan that is composed of nodes that are the basic building blocks of logical relational operations. Physical relational plans differ from logical relational plans in that they will contain additional operations and execution specifics that were chosen by the optimizer. The nodes for a relational query plan are: Access - Access a source. A source query is sent to the connection factory associated with the source. [For a dependent join, this node is called Dependent Select.] Project - Defines the columns returned from the node. This does not alter the number of records returned. [When there is a subquery in the Select clause, this node is called Dependent Project.] Project Into - Like a normal project, but outputs rows into a target table. Select - Select is a criteria evaluation filter node (WHERE / HAVING). [When there is a subquery in the criteria, this node is called Dependent Select.] Join - Defines the join type, join criteria, and join strategy (merge or nested loop). Union - There are no properties for this node, it just passes rows through from it's children Sort - Defines the columns to sort on, the sort direction for each column, and whether to remove duplicates or not. Dup Removal - Same properties as for Sort, but the removeDups property is set to true Group - Groups sets of rows into groups and evaluates aggregate functions. Null - A node that produces no rows. Usually replaces a Select node where the criteria is always false (and whatever tree is underneath). There are no properties for this node. Plan Execution - Executes another sub plan. Limit - Returns a specified number of rows, then stops processing. Also processes an offset if present. Teiid user and transformation queries can contain a meta source hint that can provide additional information to source queries. The source hint has the form /*+ sh(:'arg') source-name:'arg1' ... */ and is expected to appear after the query keyword, e.g. "SELECT /*+ sh:'general hint' my-oracle:'oracle hint' */. The sh arg is optional and is passed to all source queries via the ExecutionContext.getGeneralHint method. See the Developer's Guide for more onThe additional args should have source-name that matches the source name assigned to the translator in the VDB. If the source-name matches the hint value will be supplied via the ExecutionContext.getSourceHint method. See the Developer's Guide for more on using an ExecutionContext. Each of the arg values has the form of a string literal - it must be surrounded in single quotes and a single quote can be escaped with another signle quote. Only the Oracle translator does anything with source hints by default. The Oracle translator will use either the source hint or the general hint (in that order) if available to form an Oracle hint enclosed in /*+ ... */. Source hints in views will not be passed to the source if the view is used as a pushdown subquery, is joined, or is in a set operation. For each sub-command in the user command an appropriate kind of sub-planner is used (relational, XML, procedure, etc). Each planner has three primary phases: Generate canonical plan Optimization Plan to process converter - converts plan data structure into a processing form The GenerateCanonical class generates the initial (or “canonical” plan). This plan is based on the typical logical order that a SQL query gets executed. A SQL select query has the following possible clauses (all but SELECT are optional): SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT. These clauses are logically executed in the following order: FROM (read and join all data from tables) WHERE (filter rows) GROUP BY (group rows into collapsed rows) HAVING (filter grouped rows) SELECT (evaluate expressions and return only requested columns) INTO ORDER BY (sort rows) LIMIT (limit result set to a certain range of results) These clauses translate into the following types of planning nodes: FROM: Source node for each from clause item, Join node (if >1 table) WHERE: Select node GROUP BY: Group node HAVING: Select node SELECT: Project node and DupRemoval node (for SELECT DISTINCT) INTO: Project node with a SOURCE Node ORDER BY: Sort node LIMIT: Limit node UNION, EXCEPT, INTERSECT: SetOp Node There is also a Null Node that can be created as the result of rewrite or planning optimizations. It represents a node that produces no rows its transformations. For example, if there are no view layers, then RuleMergeVirtual, plan nodes in contrast typical have fixed properties, and only allow for binary operations - due to algorithmic limitations. Below are some of the rules included in the planner: RuleRemoveSorts - removes sort nodes that do not have an effect on the result. This most common when a view has an non-limited ORDER BY. RulePlaceAccess - insert an Access node above every physical Source node. The source node represents a table typically. An access node represents the point at which everything below the access node gets pushed to the source. Later rules focus on either pushing stuff under the access or pulling the access node up the tree to move more work down to the data sources. This rule is also responsible for placing Section 14.2.1, “Access Patterns”. RulePushSelectCriteria - pushes select criteria down through unions, joins, and views into the source below the access node. In most cases movement down the tree is good as this will filter rows earlier in the plan. We currently do not undo the decisions made by PushSelectCriteria. However in situations where criteria cannot be evaluated by the source, this can lead to sub optimal plans. One of the most important optimization related to pushing criteria, is how the criteria will be pushed trough join. Consider the following plan tree that represents a subtree of the plan for the query "select ... from A inner join b on (A.x = B.x) where A.y = 3" SELECT (B.y = 3) | JOIN - Inner Join on (A.x = B.x / \ SRC (A) SRC (B) Note: SELECT nodes represent criteria, and SRC stands for SOURCE.. This will be true regardless of which version of Teiid is used. RulePushNonJoinCriteria - this rule will push criteria out of an on clause if it is not necessary for the correctness of the join. RuleRaiseNull - this rule will raise null nodes to their highest possible point. Raising a null node removes the need to consider any part of the old plan that was below the null node. RuleMergeVirtual - merges view layers together. View layers are connected by nesting canonical plans under source leaf nodes of the parent plan. Each canonical plan is also sometimes referred to as a “query frame”. RuleMergeVirtual attempts to merge child frames into the parent frame. The merge involves renaming any symbols in the lower frame that overlap with symbols in the upper frame. It also involves merging the join information together. RuleRemoveOptionalJoins - removes optional join nodes form the plan tree as soon as possible so that planning will be more optimal. RulePlanJoins - this rule attempts to find an optimal ordering of the joins performed in the plan, while ensuring that Section 14.2.1, 6 or less join sources and is heuristically driven by join selectivity for 7 or more sources. RuleCopyCriteria -). RuleCleanCriteria - this rule cleans up criteria after all the other rules. RuleMergeCriteria - looks for adjacent criteria nodes and merges them together. It looks for adjacent identical conjuncts and removes duplicates. RuleRaiseAccess - this rule attempts to raise the Access nodes as far up the plan as possible. This is mostly done by looking at the source’s capabilities and determining whether the operations can be achieved in the source or not. RuleChooseDependent -. RuleChooseJoinStrategy - Determines the base join strategy. Currently this is a decision as to whether to use a merge join rather than the default strategy, which is a nested loop join. Ideally the choice of a hash join would also be evaluated here. Also costing should be used to determine the strategy cost. RuleDecomposeJoin - this rule perfomrs a partition-wise join optimization on joins of Section 14.2.8, . RuleCollapseSource - this rule removes all nodes below an Access node and collapses them into an equivalent query that is placed in the Access node. RuleAssignOutputElements - this rule walks top down through every node and calculates the output columns for each node. Columns that are not needed are dropped at every node. This is done by keeping track of both the columns needed to feed the parent node and also keeping track of columns that are “created” at a certain node. RuleValidateWhereAll - this rule validates a rarely used model option. RuleAccessPatternValidation - validates that all access patterns have been satisfied. RulePushLimit - pushes limit and offset information as far as possible in the plan. The procedure planner is fairly simple. It converts the statements in the procedure into instructions in a program that will be run during processing. This is mostly a 1-to-1 mapping and very little optimization is performed.. VM or Process – a JBossAS. (the default max open files is 64).. Chapter 12, VDBs section for more on setting the query-timeout VDB property. See the Admin Guide for more on modifying the file to set default query timeout for all queries. Section 14.2.3, “Dependent Joins”..
http://docs.jboss.org/teiid/7.6.0.Final/reference/en-US/html_single/
CC-MAIN-2015-40
refinedweb
21,150
56.35
From: Gennaro Prota (gennaro_prota_at_[hidden]) Date: 2006-09-14 11:44:00 On Thu, 14 Sep 2006 07:00:26 -0400, David Abrahams <dave_at_[hidden]> wrote: >Gennaro Prota <gennaro_prota_at_[hidden]> writes: > >> On Wed, 13 Sep 2006 22:00:09 +0200, Thorsten Ottosen >> <thorsten.ottosen_at_[hidden]> wrote: >> >>>What is the problem with an unnamed namespace in a header anyway? Is it >>>illegal according to the standard? >> >> Thorsten, this is not addressed to you, but I find shameful that so >> many boosters don't know this C++ 101. > >Now, now, Genny. I don't recall anyone ever talking about the problem >until I raised it a year or two ago. And here's the ego I was talking about. You may feel like the first man who brought the light on all us, but that light is common advice for any comp.lang.c++.moderated regular. I guess I learned the facts from Francis Glassborow at least four years ago; and several modern books mention the problem: I'm sure about Sutter/Alexandrescu but there are others, I just don't have time to check. In any case I can't see any post in this thread which gives the correct explanation (it seems that my newsreader have missed some message though --probably one between Arkadiy's and yours). And I really want to clarify that Thorsten attitude is absolutely ok: he is asking what the problem is. What's wrong is the attitude of those who think they know the reason without realizing they do not. -- [ Gennaro Prota. C++ developer, Library designer. ] [ For Hire ] Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2006/09/110114.php
CC-MAIN-2020-50
refinedweb
285
73.27
Section 8.5 Introduction to Threads Like people, computers can multitask. That is, they can be working on several different tasks at the same time. A computer that has just a single central processing unit can't literally do two things at the same time, any more than a person can, but it can still switch its attention back and forth among several tasks. Furthermore, it is increasingly common for computers to have more than one processing unit, and such computers can literally work on several tasks simultaneously. It is likely that from now on, most of the increase in computing power will come from adding additional processors to computers rather than from increasing the speed of individual processors. To use the full power of these multiprocessing computers, a programmer must do parallel programming, which means writing a program as a set of several tasks that can be executed simultaneously. Even on a single-processor computer, parallel programming techniques can be useful, since some problems can be tackled most naturally by breaking the solution into a set of simultaneous tasks that cooperate to solve the problem. In Java, a single task is called a thread. The term "thread" refers to a "thread of control" or "thread of execution," meaning a sequence of instructions that are executed one after another -- the thread extends through time, connecting each instruction to the next. In a multithreaded program, there can be many threads of control, weaving through time in parallel and forming the complete fabric of the program. (Ok, enough with the metaphor, already!) Every Java program has at least one thread; when the Java virtual machine runs your program, it creates a thread that is responsible for executing the main routine of the program. This main thread can in turn create other threads that can continue even after the main thread has terminated. In a GUI program, there is at least one additional thread, which is responsible for handling events and drawing components on the screen. This GUI thread is created when the first window is opened. So in fact, you have already done parallel programming! When a main routine opens a window, both the main thread and the GUI thread can continue to run in parallel. Of course, parallel programming can be used in much more interesting ways. Unfortunately, parallel programming is even more difficult than ordinary, single-threaded programming. When several threads are working together on a problem, a whole new category of errors is possible. This just means that techniques for writing correct and robust programs are even more important for parallel programming than they are for normal programming. (That's one excuse for having this section in this chapter -- another is that we will need threads at several points in future chapters, and I didn't have another place in the book where the topic fits more naturally.) Since threads are a difficult topic, you will probably not fully understand everything in this section the first time through the material. Your understanding should improve as you encounter more examples of threads in future sections. 8.5.1 Creating and Running Threads In Java, a thread is represented by an object belonging to the class java.lang.Thread (or to a subclass of this class). The purpose of a Thread object is to execute a single method. The method is executed in its own thread of control, which can run in parallel with other threads. When the execution of the method is finished, either because the method terminates normally or because of an uncaught exception, the thread stops running. Once this happens, there is no way to restart the thread or to use the same Thread object to start another thread. There are two ways to program a thread. One is to create a subclass of Thread and to define the method public void run() in the subclass. This run() method defines the task that will be performed by the thread; that is, when the thread is started, it is the run() method that will be executed in the thread. For example, here is a simple, and rather useless, class that defines a thread that does nothing but print a message on standard output: public class NamedThread extends Thread { private String name; // The name of this thread. public NamedThread(String name) { // Constructor gives name to thread. this.name = name; } public void run() { // The run method prints a message to standard output. System.out.println("Greetings from thread '" + name + "'!"); } } To use a NamedThread, you must of course create an object belonging to this class. For example, NamedThread greetings = new NamedThread("Fred"); However, creating the object does not automatically start the thread running. To do that, you must call the start() method in the thread object. For the example, this would be done with the statement greetings.start(); The purpose of the start() method is to create a new thread of control that will execute the Thread object's run() method. The new thread runs in parallel with the thread in which the start() method was called, along with any other threads that already existed. This means that the code in the run() method will execute at the same time as the statements that follow the call to greetings.start(). Consider this code segment: NamedThread greetings = new NamedThread("Fred"); greetings.start(); System.out.println("Thread has been started."); After greetings.start() is executed, there are two threads. One of them will print "Thread has been started." while the other one wants to print "Greetings from thread 'Fred'!". It is important to note that these messages can be printed in either order. The two threads run simultaneously and will compete for access to standard output, so that they can print their messages. Whichever thread happens to be the first to get access will be the first to print its message. In a normal, single-threaded program, things happen in a definite, predictable order from beginning to end. In a multi-threaded program, there is a fundamental indeterminancy. You can't be sure what order things will happen in. This indeterminacy is what makes parallel programming so difficult! Note that calling greetings.start() is very different from calling greetings.run(). Calling greetings.run() will execute the run() method in the same thread, rather than creating a new thread. This means that all the work of the run() will be done before the computer moves on to the statement that follows the call to greetings.run() in the program. There is no parallelism and no indeterminacy. I mentioned that there are two ways to program a thread. The first way was to define a subclass of Thread. The second is to define a class that implements the interface java.lang.Runnable. The Runnable interface defines a single method, public void run(). An object that implements the Runnable interface can be passed as a parameter to the constructor of an object of type Thread. When that thread's start method is called, the thread will execute the run() method in the Runnable object. For example, as an alternative to the NamedThread class, we could define the class: public class NamedRunnable implements Runnable { private String name; // The name of this thread. public NamedRunnable(String name) { // Constructor gives name to object. this.name = name; } public void run() { // The run method prints a message to standard output. System.out.println("Greetings from thread '" + name +"'!"); } } To use this version of the class, we would create a NamedRunnable object and use that object to create an object of type Thread: NamedRunnable greetings = new NamedRunnable("Fred"); Thread greetingsThread = new Thread(greetings); greetingsThread.start(); Finally, I'll note that it is sometimes convenient to define a thread using an anonymous inner class (Subsection 5.7.3). For example: Thread greetingsFromFred = new Thread() { public void run() { System.out.println("Greetings from Fred!"); } }; greetingsFromFred.start(); To help you understand how multiple threads are executed in parallel, we consider the sample program ThreadTest1.java. This program creates several threads. Each thread performs exactly the same task. The task is to count the number of integers less than 1000000 that are prime. (The particular task that is done is not important for our purposes here.) On my computer, this task takes a little more than one second of processing time. The threads that perform this task are defined by the following static nested class: /** * When a thread belonging to this class is run it will count the * number of primes between 2 and 1000000. It will print the result * to standard output, along with its ID number and the elapsed * time between the start and the end of the computation. */ private static class CountPrimesThread extends Thread { int id; // An id number for this thread; specified in the constructor. public CountPrimesThread(int id) { this.id = id; } public void run() { long startTime = System.currentTimeMillis(); int count = countPrimes(2,1000000); // Counts the primes. long elapsedTime = System.currentTimeMillis() - startTime; System.out.println("Thread " + id + " counted " + count + " primes in " + (elapsedTime/1000.0) + " seconds."); } } The main program asks the user how many threads to run, and then creates and starts the specified number of threads: public static void main(String[] args) { int numberOfThreads = 0; while (numberOfThreads < 1 || numberOfThreads > 25) { System.out.print("How many threads do you want to use (1 to 25) ? "); numberOfThreads = TextIO.getlnInt(); if (numberOfThreads < 1 || numberOfThreads > 25) System.out.println("Please enter a number between 1 and 25 !"); } System.out.println("\nCreating " + numberOfThreads + " prime counting threads..."); CountPrimesThread[] worker = new CountPrimesThread[numberOfThreads]; for (int i = 0; i < numberOfThreads; i++) worker[i] = new CountPrimesThread( i ); for (int i = 0; i < numberOfThreads; i++) worker[i].start(); System.out.println("Threads have been created and started."); } Here is an applet that simulates the program. Try running the program for various numbers of threads. In particular, you should at least try it with one thread and with two threads: When I ran the program with one thread, it took 1.18 seconds for my computer to do the computation. When I ran it using six threads, the output was: Creating 6 prime counting threads... Threads have been created and started. Thread 1 counted 78498 primes in 6.706 seconds. Thread 4 counted 78498 primes in 6.693 seconds. Thread 0 counted 78498 primes in 6.838 seconds. Thread 2 counted 78498 primes in 6.825 seconds. Thread 3 counted 78498 primes in 6.893 seconds. Thread 5 counted 78498 primes in 6.859 seconds. The second line was printed immediately after the first. At this point, the main program has ended but the six threads continue to run. After a pause of about seven seconds, all six threads completed at about the same time. The order in which the threads complete is not the same as the order in which they were started, and the order is indeterminate. That is, if the program is run again, the order in which the threads complete will probably be different. On my computer, six threads take about six times longer than one thread. This is because my computer has only one processor. Six threads, all doing the same task, take six times as much processing as one thread. With only one processor to do the work, the total elapsed time for six threads is about six times longer than the time for one thread. On a computer with two processors, the computer can work on two tasks at the same time, and six threads might complete in as little as three times the time it takes for one thread. On a computer with six or more processors, six threads might take no more time than a single thread. Because of overhead and other reasons, the actual speedup will probably be smaller than this analysis indicates, but on a multiprocessor machine, you should see a definite speedup. What happens when you run the program on your own computer? How many processors do you have? Whenever there are more threads to be run than there are processors to run them, the computer divides its attention among all the runnable threads by switching rapidly from one thread to another. That is, each processor runs one thread for a while then switches to another thread and runs that one for a while, and so on. Typically, these "context switches" occur about 100 times or more per second. The result is that the computer makes progress on all the tasks, and it looks to the user as if all the tasks are being executed simultaneously. This is why in the sample program, in which each thread has the same amount of work to do, all the threads complete at about the same time: Over any time period longer than a fraction of a second, the computer's time is divided approximately equally among all the threads. When you do parallel programming in order to spread the work among several processors, you might want to take into account the number of available processors. You might, for example, want to create one thread for each processor. In Java, you can find out the number of processors by calling the function Runtime.getRuntime().availableProcessors() which returns an int giving the number of processors that are available to the Java Virtual Machine. In some cases, this might be less than the actual number of processors in the computer. 8.5.2 Operations on Threads The Thread class includes several useful methods in addition to the start() method that was discussed above. I will mention just a few of them. If thrd is an object of type Thread, then the boolean-valued function thrd.isAlive() can be used to test whether or not the thread is alive. A thread is "alive" between the time it is started and the time when it terminates. After the thread has terminated it is said to be "dead". (The rather gruesome metaphor is also used when we refer to "killing" or "aborting" a thread.) The static method Thread.sleep(milliseconds) causes the thread that executes this method to "sleep" for the specified number of milliseconds. A sleeping thread is still alive, but it is not running. While a thread is sleeping, the computer will work on any other runnable threads (or on other programs). Thread.sleep() can be used to insert a pause in the execution of a thread. The sleep method can throw an exception of type InterruptedException, which is an exception class that requires mandatory exception handling (see Subsection 8.3.4). In practice, this means that the sleep method is usually used in a try..catch statement that catches the potential InterruptedException: try { Thread.sleep(lengthOfPause); } catch (InterruptedException e) { } One thread can interrupt another thread to wake it up when it is sleeping or paused for some other reason. A Thread, thrd, can be interrupted by calling its method thrd.interrupt(), but you are not likely to do this until you start writing rather advanced applications, and you are not likely to need to do anything in response to an InterruptedException (except to catch it). It's unfortunate that you have to worry about it at all, but that's the way that mandatory exception handling works. Sometimes, it's necessary for one thread to wait for anther thread to die. This is done with the join() method from the Thread class. Suppose that thrd is a Thread. Then, if another thread calls thrd.join(), that other thread will go to sleep until thrd terminates. If thrd is already dead when thrd.join() is called, then it simply has no effect -- the thread that called thrd.join() proceeds immediately. The method join() can throw an InterruptedException, which must be handled. As an example, the following code starts several threads, waits for them all to terminate, and then outputs the elapsed time: CountPrimesThread[] worker = new CountPrimesThread[numberOfThreads]; long startTime = System.currentTimeMillis(); for (int i = 0; i < numberOfThreads; i++) { worker[i] = new CountPrimesThread(); worker[i].start(); } for (int i = 0; i < numberOfThreads; i++) { try { worker[i].join(); // Sleep until worker[i] has terminated. } catch (InterruptedException e) { } } // At this point, all the worker threads have terminated. long elapsedTime = System.currentTimeMillis() - startTime; System.out.println("Elapsed time: " + (elapsedTime/1000.0) + " seconds."); An observant reader will note that this code assumes that no InterruptedException will occur. To be absolutely sure that the thread worker[i] has terminated in an environment where InterruptedExceptions are possible, you would have to do something like: while (worker[i].isAlive()) { try { worker[i].join(); } catch (InterruptedException e) { } } 8.5.3 Mutual Exclusion with "synchronized" Programming several threads to carry out independent tasks is easy. The real difficulty arises when threads have to interact in some way. One way that threads interact is by sharing resources. When two threads need access to the same resource, such as a variable or a window on the screen, some care must be taken that they don't try to use the same resource at the same time. Otherwise, the situation could be something like this: Imagine several cooks sharing the use of just one measuring cup, and imagine that Cook A fills the measuring cup with milk, only to have Cook B grab the cup before Cook A has a chance to empty the milk into his bowl. There has to be some way for Cook A to claim exclusive rights to the cup while he performs the two operations: Add-Milk-To-Cup and Empty-Cup-Into-Bowl. Something similar happens with threads, even with something as simple as adding one to a counter. The statement count = count + 1; is actually a sequence of three operations: Step 1. Get the value of count Step 2. Add 1 to the value. Step 3. Store the new value in count Suppose that several threads perform these three steps. Remember that it's possible for two threads to run at the same time, and even if there is only one processor, it's possible for that processor to switch from one thread to another at any point. Suppose that while one thread is between Step 2 and Step 3, another thread starts executing the same sequence of steps. Since the first thread has not yet stored the new value in count, the second thread reads the old value of count and adds one to that old value. After both threads have executed Step 3, the value of count has gone up only by 1 instead of by 2! This type of problem is called a race condition. This occurs when one thread is in the middle of a multi-step operation, and another thread changes some value or condition that the first thread is depending upon. (The first thread is "in a race" to complete all the steps before it is interrupted by another thread.) Another example of a race condition can occur in an if statement. Suppose the following statement, which is meant to avoid a division-by-zero error is executed by a thread: if ( A != 0 ) B = C / A; If the variable A is shared by several threads, and if nothing is done to guard against the race condition, then it is possible that a second thread will change the value of A to zero between the time that the first thread checks the condition A != 0 and the time that it does the division. This means that the thread ends up dividing by zero, even though it just checked that A was not zero! To fix the problem of race conditions, there has to be some way for a thread to get exclusive access to a shared resource. This is not a trivial thing to implement, but Java provides a high level and relatively easy-to-use approach to exclusive access. It's done with synchronized methods and with the synchronized statement. These are used to protect shared resources by making sure that only one thread at a time will try to access the resource. Synchronization in Java actually provides only mutual exclusion, which means that exclusive access to a resource is only guaranteed if every thread that needs access to that resource uses synchronization. Synchronization is like a cook leaving a note that says, "I'm using the measuring cup." This will get the cook exclusive access to the cup -- but only if all the cooks agree to check the note before trying to grab the cup. Because this is a difficult topic, I will start with a simple example. Suppose that we want to avoid the race condition that occurs when several threads all want to add 1 to a counter. We can do this by defining a class to represent the counter and by using synchronized methods in that class: public class ThreadSafeCounter { private int count = 0; // The value of the counter. synchronized public void increment() { count = count + 1; } synchronized public int getValue() { return count; } } If tsc is of type ThreadSafeCounter, then any thread can call tsc.increment() to add 1 to the counter in a completely safe way. The fact that tsc.increment() is synchronized means that only one thread can be in this method at a time; once a thread starts executing this method, it is guaranteed that it will finish executing it without having another thread change the value of tsc.count in the meantime. There is no possibility of a race condition. Note that the guarantee depends on the fact that count is a private variable. This forces all access to tsc.count to occur in the synchronized methods that are provided by the class. If count were public, it would be possible for a thread to bypass the synchronization by, for example, saying tsc.count++. This could change the value of count while another thread is in the middle of the tsc.increment(). Synchronization does not guarantee exclusive access; it only guarantees mutual exclusion among all the threads that are properly synchronized. The ThreadSafeCounter class does not prevent all possible race conditions that might arise when using a counter. Consider the if statement: if ( tsc.getValue() == 0 ) doSomething(); where doSomething() is some method that requires the value of the counter to be zero. There is still a race condition here, which occurs if a second thread increments the counter between the time the first thread tests tsc.getValue() == 0 and the time it executes doSomething(). The first thread needs exclusive access to the counter during the execution of the whole if statement. (The synchronization in the ThreadSafeCounter class only gives it exclusive access during the time it is evaluating tsc.getValue().) We can solve the race condition by putting the if statement in a synchronized statement: synchronized(tsc) { if ( tsc.getValue() == 0 ) doSomething(); } Note that the synchronized statement takes an object -- tsc in this case -- as a kind of parameter. The syntax of the synchronized statement is: synchronized( object ) { statements } In Java, mutual exclusion is always associated with an object; we say that the synchronization is "on" that object. For example, the if statement above is "synchronized on tsc." A synchronized instance method, such as those in the class ThreadSafeCounter, is synchronized on the object that contains the instance method. In fact, adding the synchronized modifier to the definition of an instance method is pretty much equivalent to putting the body of the method in a synchronized statement, synchronized(this) {...}. It is also possible to have synchronized static methods; a synchronized static method is synchronized on a special class object that represents the class that contains the static method. The real rule of synchronization in Java is: Two threads cannot be synchronized on the same object at the same time; that is, they cannot simultaneously be executing code segments that are synchronized on that object. If one thread is synchronized on an object, and a second thread tries to synchronize on the same object, the second thread is forced to wait until the first thread has finished with the object. This is implemented using something called a lock. Every object has a lock, and that lock can be "held" by only one thread at a time. To enter a synchronized statement or synchronized method, a thread must obtain the associated object's lock. If the lock is available, then the thread obtains the lock and immediately begins executing the synchronized code. It releases the lock after it finishes executing the synchronized code. If Thread A tries to obtain a lock that is already held by Thread B, then Thread A has to wait until Thread B releases the lock. In fact, Thread A will go to sleep, and will not be awoken until the lock becomes available. As a simple example of shared resources, we return to the prime-counting problem. Suppose that we want to count all the primes in a given range of integers, and suppose that we want to divide the work up among several threads. Each thread will be assigned part of the range of integers and will count the primes in its assigned range. At the end of its computation, the thread has to add its count to the overall total number of primes found. The variable that represents the total is shared by all the threads. If each thread just says total = total + count; then there is a (small) chance that two threads will try to do this at the same time and that the final total will be wrong. To prevent this race condition, access to total has to be synchronized. My program uses a synchronized method to add the counts to the total: synchronized private static void addToTotal(int x) { total = total + x; System.out.println(total + " primes found so far."); } The source code for the program can be found in ThreadTest2.java. This program counts the primes in the range 3000001 to 6000000. (The numbers are rather arbitrary.) The main() routine in this program creates between 1 and 5 threads and assigns part of the job to each thread. It then waits for all the threads to finish, using the join() method as described above, and reports the total elapsed time. If you run the program on a multiprocessor computer, it should take less time for the program to run when you use more than one thread. Here is an applet that simulates the program: Synchronization can help to prevent race conditions, but it introduces the possibility of another type of error, deadlock. A deadlock occurs when a thread waits forever for a resource that it will never get. In the kitchen, a deadlock might occur if two very simple-minded cooks both want to measure a cup of milk at the same time. The first cook grabs the measuring cup, while the second cook grabs the milk. The first cook needs the milk, but can't find it because the second cook has it. The second cook needs the measuring cup, but can't find it because the first cook has it. Neither cook can continue and nothing more gets done. This is deadlock. Exactly the same thing can happen in a program, for example if there are two threads (like the two cooks) both of which need to obtain locks on the same two objects (like the milk and the measuring cup) before they can proceed. Deadlocks can easily occur, unless great care is taken to avoid them. Fortunately, we won't be looking at any examples that require locks on more than one object, so we will avoid that source of deadlock. 8.5.4 Wait and Notify Threads can interact with each other in other ways besides sharing resources. For example, one thread might produce some sort of result that is needed by another thread. This imposes some restriction on the order in which the threads can do their computations. If the second thread gets to the point where it needs the result from the first thread, it might have to stop and wait for the result to be produced. Since the second thread can't continue, it might as well go to sleep. But then there has to be some way to notify the second thread when the result is ready, so that it can wake up and continue its computation. Java, of course, has a way to do this kind of waiting and notification: It has wait() and notify() methods that are defined as instance methods in class Object and so can be used with any object. The reason why wait() and notify() should be associated with objects is not obvious, so don't worry about it at this point. It does, at least, make it possible to direct different notifications to a different recipients, depending on which object's notify() method is called. The general idea is that when a thread calls a wait() method in some object, that thread goes to sleep until the notify() method in the same object is called. It will have to be called, obviously, by another thread, since the thread that called wait() is sleeping. A typical pattern is that Thread A calls wait() when it needs a result from Thread B, but that result is not yet available. When Thread B has the result ready, it calls notify(), which will wake Thread A up so that it can use the result. It is not an error to call notify() when no one is waiting; it just has no effect. To implement this, Thread A will execute code simlar to the following, where obj is some object: if ( resultIsAvailable() == false ) obj.wait(); // wait for noification that the result is available useTheResult(); while Thread B does something like: generateTheResult(); obj.notify(); // send out a notification that the result is available Now, there is a really nasty race condition in this code. The two threads might execute their code in the following order: 1. Thread A checks resultIsAvailable() and finds that the result is not ready, so it decides to execute the obj.wait() statement, but before it does, 2. Thread B finishes generating the result and calls obj.notify() 3. Thread A calls obj.wait() to wait for notification that the result is ready. In Step 3, Thread A is waiting for a notification that will never come, because notify() has already been called. This is a kind of deadlock that can leave Thread A waiting forever. Obviously, we need some kind of synchronization. The solution is to enclose both Thread A's code and Thread B's code in synchronized statements, and it is very natural to synchronize on the same object, obj, that is used for the calls to wait() and notify(). In fact, since synchronization is almost always needed when wait() and notify() are used, Java makes it an absolute requirement. In Java, a thread can legally call obj.wait() or obj.notify() only if that thread holds the synchronization lock associated with the object obj. If it does not hold that lock, then an exception is thrown. (The exception is of type IllegalMonitorStateException, which does not require mandatory handling and which is typically not caught.) One further complication is that the wait() method can throw an InterruptedException and so should be called in a try statement that handles the exception. To make things more definite, lets consider a producer/consumer problem where one thread produces a result that is consumed by another thread. Assume that there is a shared variable named sharedResult that is used to transfer the result from the producer to the consumer. When the result is ready, the producer sets the variable to a non-null value. The producer can check whether the result is ready by testing whether the value of sharedResult is null. We will use a variable named lock for synchronization. The the code for the producer thread could have the form: makeResult = generateTheResult(); // Not synchronized! synchronized(lock) { sharedResult = makeResult; lock.notify(); } while the consumer would execute code such as: synchronized(lock) { while ( sharedResult == null ) { try { lock.wait(); } catch (InterruptedException e) { } } useResult = sharedResult; } useTheResult(useResult); // Not synchronized! The calls to generateTheResult() and useTheResult() are not synchronized, which allows them to run in parallel with other threads that might also synchronize on lock. Since sharedResult is a shared variable, all references to sharedResult should be synchronized, so the references to sharedResult must be inside the synchronized statements. The goal is to do as little as possible (but not less) in synchronized code segments. If you are uncommonly alert, you might notice something funny: lock.wait() does not finish until lock.notify() is executed, but since both of these methods are called in synchronized statements that synchronize on the same object, shouldn't it be impossible for both methods to be running at the same time? In fact, lock.wait() is a special case: When the consumer thread calls lock.wait(), it gives up the lock that it holds on the synchronization object, lock. This gives the producer thread a chance to execute the synchronized(lock) block that contains the lock.notify() statement. After the producer thread exits from this block, the lock is returned to the consumer thread so that it can continue. The producer/consumer pattern can be generalized and made more useful without making it any more complex. In the general case, multiple results are produced by one or more producer threads and are consumed by one or more consumer threads. Instead of having just one sharedResult object, we keep a list of objects that have been produced but not yet consumed. Producer threads add objects to this list. Consumer threads remove objects from this list. The only time when a thread is blocked from running is when a consumer thread tries to get a result from the list, and no results are available. It is easy to encapsulate the whole producer/consumer pattern in a class (where I assume that there is a class ResultType that represents the result objects): /** * An object of type ProducerConsumer represents a list of results * that are available for processing. Results are added to the list * by calling the produce method and are remove by calling consume. * If no result is available when consume is called, the method will * not return until a result becomes available. */ private static class ProducerConsumer { private ArrayList<ResultType> items = new ArrayList<ResultType>(); // This ArrayList holds results that have been produced and are waiting // to be consumed. See Subsection 7.3.3 for information on ArrayList. public void produce(ResultType item) { synchronized(items) { items.add(item); // Add item to the list of results. items.notify(); // Notify any thread waiting in consume() method. } } public ResultType consume() { ResultType item; synchronized(items) { // If no results are available, wait for notification from produce(). while (items.size() == 0) { try { items.wait(); } catch (InterruptedException e) { } } // At this point, we know that at least one result is available. item = items.remove(0); } return item; } } For an example of a program that uses a ProducerConsumer class, see ThreadTest3.java. This program performs the same task as ThreadTest2.java, but the threads communicate using the producer/consumer pattern instead of with a shared variable. Going back to our kitchen analogy for a moment, consider a restaurant with several waiters and several cooks. If we look at the flow of customer orders into the kitchen, the waiters "produce" the orders and leave them in a pile. The orders are "consumed" by the cooks; whenever a cook needs a new order to work on, she picks one up from the pile. The pile of orders, or course, plays the role of the list of result objects in the producer/consumer pattern. Note that the only time that a cook has to wait is when she needs a new order to work on, and there are no orders in the pile. The cook must wait until one of the waiters places an order in the pile. We can complete the analogy by imagining that the waiter rings a bell when he places the order in the pile -- ringing the bell is like calling the notify() method to notify the cooks that an order is available. A final note on notify: It is possible for several threads to be waiting for notification. A call to obj.notify() will wake only one of the threads that is waiting on obj. If you want to wake all threads that are waiting on obj, you can call obj.notifyAll(). And a final note on wait: There is an another version of wait() that takes a number of milliseconds as a parameter. A thread that calls obj.wait(milliseconds) will wait only up to the specified number of milliseconds for a notification. If a notification doesn't occur during that period, the thread will wake up and continue without the notification. In practice, this feature is most often used to let a waiting thread wake periodically while it is waiting in order to perform some periodic task, such as causing a message "Waiting for computation to finish" to blink. 8.5.5 Volatile Variables And a final note on communication among threads: In general, threads communicate by sharing variables and accessing those variables in synchronized methods or synchronized statements. However, synchronization is fairly expensive computationally, and excessive use of it should be avoided. So in some cases, it can make sense for threads to refer to shared variables without synchronizing their access to those variables. However, a subtle problem arises when the value of a shared variable is set is one thread and used in another. Because of the way that threads are implemented in Java, the second thread might not see the changed value of the variable immediately. That is, it is possible that a thread will continue to see the old value of the shared variable for some time after the value of the variable has been changed by another thread. This is because threads are allowed to cache shared data. That is, each thread can keep its own local copy of the shared data. When one thread changes the value of a shared variable, the local copies in the caches of other threads are not immediately changed, so the other threads continue to see the old value. When a synchronized method or statement is entered, threads are forced to update their caches to the most current values of the variables in the cache. So, using shared variables in synchronized code is always safe. It is still possible to use a shared variable outside of synchronized code, but in that case, the variable must be declared to be volatile. The volatile keyword is a modifier that can be added to a variable declaration, as in private volatile int count; If a variable is declared to be volatile, no thread will keep a local copy of that variable in its cache. Instead, the thread will always use the official, main copy of the variable. This means that any change made to the variable will immediately be available to all threads. This makes it safe for threads to refer to volatile shared variables even outside of synchronized code. (Remember, though, that synchronization is still the only way to prevent race conditions.) When the volatile modifier is applied to an object variable, only the variable itself is declared to be volatile, not the contents of the object that the variable points to. For this reason, volatile is generally only used for variables of simple types such as primitive types and enumerated types. A typical example of using volatile variables is to send a signal from one thread to another that tells the second thread to terminate. The two threads would share a variable volatile boolean terminate = false; The run method of the second thread would check the value of terminate frequently and end when the value of terminate becomes true: public void run() { while (true) { if (terminate) return; . . // Do some work . } } This thread will run until some other thread sets the value of terminate to true. Something like this is really the only clean way for one thread to cause another thread to die. (By the way, you might be wondering why threads should use local data caches in the first place, since it seems to complicate things unnecessarily. Caching is allowed because of the structure of multiprocessing computers. In many multiprocessing computers, each processor has some local memory that is directly connected to the processor. A thread's cache is stored in the local memory of the processor on which the thread is running. Access to this local memory is much faster than access to other memory, so it is more efficient for a thread to use a local copy of a shared variable rather than some "master copy" that is stored in non-local memory.)
http://math.hws.edu/javanotes/c8/s5.html
crawl-001
refinedweb
6,789
62.78
The last spec in the meals-by-month Haml spec is: it "should include recipe titles in the menu items"Recipes are included in meal items (or anywhere in the text of meals and recipes) in a wiki format: [recipe:2009/05/23/lemon_dressing]Specifying how this will work: it "should include recipe titles in the menu items" doIn that example, I add a menu item that contains a wiki recipe link. After rendering the template, I expect that the title of that recipe will be included in the menu section of the output. assigns[:meals]['rows'][0]['value'][0]["menu"] = [" Salad with [recipe:2009/05/23/lemon_dressing] "] render("/views/meal_by_month.haml") response.should have_selector(".menu", :content => "Salad with Lemon Dressing") end That spec has no chance of working right now because I have yet to even supply the recipe with the appropriate title. I need to figure out how I am going to supply that to the template. Them's implementation details, so let's have a look at how the rest of the wikifying code is implemented so far: def wiki(original)Hey, what's that text = (original || '').dup text.gsub!(/\b(\d+)F/, "\\1° F") text.gsub!(/\[kid:(\w+)\]/m) { |kid| kid_nicknames[$1] } text.gsub!(/\[recipe:(\S+)\]/m) { |r| recipe_link($1) } RedCloth.new(text).to_html end recipe_linkline in there? That looks exactly like what I wanted to implement. Turns out, I already did implement it: def recipe_link(permalink)Weird that I forgot doing that. It seems that implementing and re-implementing this application over-and-over may be finally catching up with me. recipe = JSON.parse(RestClient.get("#{_db}/#{permalink}")) %Q|<a href="/recipes/#{recipe['_id']}">#{recipe['title']}</a>| end At any rate, if I stub out that RestClient call to return a recipe with a title, this spec may already be working! The spec with the RestClient stub: it "should include recipe titles in the menu items" doThat assigns[:meals]['rows'][0]['value'][0]["menu"] = [" Salad with [recipe:2009/05/23/lemon_dressing] "] self.stub!(:_db).and_return("") RestClient. stub!(:get). and_return('{"title":"Lemon Dressing"}') render("/views/meal_by_month.haml") response.should have_selector(".menu", :content => "Salad with Lemon Dressing") end :_dbstub is another implementation detail, mostly owing to the way that I implemented my Sinatra / RSpec setup. With those two additions, the spec passes. Nice! No new code and I have the last meals-by-month Haml spec passing. Since I did not have to add new code, but I do recall a use case that I overlooked in the original implementation, it can't hurt to do so now, while I am in the code already. Recipe wiki text of the form [recipe:2009/05/23/lemon_dressing Salad Dressing]should contain the supplied text, "Salad Dressing". The example describing this behavior: it "should wikify recipe URIs, using supplied text for the link" doI implement that with a non-greedy RegExp match (so that other text doesn't accidentally get slurped in): RestClient.stub!(:get). and_return('{"_id":"id-123","title":"Title"}') wiki("[recipe:id-123 Different Title]"). should have_selector("a", :href => "/recipes/id-123", :content => "Different Title") end text.gsub!(/\[recipe:(\S+)\s(.+?)\]/m) { |r| recipe_link($1, $2) }That changes the arity of recipe_link. So that it works with or without the title, I update the recipe_link helper thusly: def recipe_link(permalink, title=nil)So now I am ready to move on back out to the Cucumber scenario. Tomorrow. recipe = JSON.parse(RestClient.get("#{_db}/#{permalink}")) %Q|<a href="/recipes/#{recipe['_id']}">#{title || recipe['title']}</a>| end
https://japhr.blogspot.com/2009/05/i-already-did-that.html
CC-MAIN-2018-05
refinedweb
588
54.12
19738/saving-a-string-in-python-associated-with-an-api I am writing a bit of code which calls an API and grabs the latest Bitcoin Nonce data. I have managed to do this fine, however now I want to be able to save the first nonce value found as a string such as Nonce1 and then recall the API every few seconds till I get another Nonce value and name it Nonce2 for example? Is this possible? My code is down bellow. from __future__ import print_function import blocktrail client = blocktrail.APIClient(api_key="x", api_secret="x", network="BTC", testnet=False) address = client.address('x') latest_block = client.block_latest() nonce = latest_block['nonce'] print(nonce) noncestr = str(nonce) A very simple-minded solution: import time nonce = "some string" while True: latest_nonce = client.block_latest()['nonce'] if latest_nonce != nonce: nonce = latest_nonce time.sleep(2) You can create a list and add your nonces to it: nonces = [] nonces.append(yournonce) Then you can access them like so: nonces[noncenum] You could use a while loop and time.sleep to get a new nonce every few seconds. By default, the docs are at your ...READ MORE The peers communicate among them through the ...READ MORE Every Blockchain has a separate administration. So, it ...READ MORE You are using it correctly. require is intended to ...READ MORE Convert the recipes into JSON objects. x = ...READ MORE What is the argument utxos int the ...READ MORE This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE This was a bug. They've fixed it. ...READ MORE http.client.HTTPSConnection accepts hostname, not a url. conn = http.client.HTTPSConnection("api.korbit.co.kr", ...READ MORE Just remove the json_encode call, and it should work: $resp ...READ MORE OR
https://www.edureka.co/community/19738/saving-a-string-in-python-associated-with-an-api?show=19758
CC-MAIN-2019-35
refinedweb
293
70.8
I have an array of objects that I'm trying to sort by multiple criteria. Most of the comparisons are just by doing <=> sort_by teams.sort_by { |item| [item.points, item.goal_dif, item.goals] } a_beat_b(teamA, teamB) Array.sort sort_by teams.sort ( |a,b| [a.points, a.goals_dif, a.goals] <=> [b.points, b.goals_dif, b.goals]) a_beats_b I tried using Array.sort, but it's extremely slow compared to sort_byfor those first few This is because sort calls the given block several times. Here's an example to show what's going on under the hood: (sorting "apple", "pear" and "fig" by length) def length(str) puts "calculating #{str.inspect}.length" str.length end array = %w{apple pear fig} array.sort { |a, b| length(a) <=> length(b) } #=> ["fig", "pear", "apple"] Output from our length method: calculating "apple".length calculating "pear".length calculating "apple".length calculating "fig".length calculating "pear".length calculating "fig".length As you can see, length is called multiple times during the sort. Imagine that these are database queries. sort_by on the other hand calls the block once for each element, building an internal mapping: array.sort_by { |a| length(a) } #=> ["fig", "pear", "apple"] Output: calculating "apple".length calculating "pear".length calculating "fig".length For expensive operations (like database queries), this is much faster. But it's also less flexible – you can't dynamically compare a and b any more. You can however store the results of your (expensive) operation, for example by using a hash: (this is called memoization) hash = Hash.new { |h, k| h[k] = length(k) } And use the hash within sort: array.sort { |a, b| hash[a] <=> hash[b] } # calculating "apple".length # calculating "pear".length # calculating "fig".length #=> ["fig", "pear", "apple"] After the sort, our hash looks like this: hash #=> {"apple"=>5, "pear"=>4, "fig"=>3} Applied to your code, something like this should work: hash = Hash.new { |h, k| h[k] = [k.points, k.goal_dif, k.goals] } teams.sort { |a, b| hash[a] == hash[b] ? a_beats_b(i, j) : hash[a] <=> hash[b] }
https://codedump.io/share/6TsRlx50NFWL/1/ruby-array-sort-2-different-ways
CC-MAIN-2018-26
refinedweb
337
71.51
How would one go about finding if two 2D line segments intersect? I know how to do it on paper, but I'm totally baffled how to do it in code. Any suggestions? Printable View How would one go about finding if two 2D line segments intersect? I know how to do it on paper, but I'm totally baffled how to do it in code. Any suggestions? Two lines of code can't intersect, it would drive the compiler nuts. Are you talking about graphical programming or are you just asking how to code the equation to see if two lines intersect? If you're talking about the latter, then simply write a program that accepts ( or figures out ) the slopes of both lines, and if they aren't parallel and they are both straight, then they intersect. Yeah, I guess it would. I totally ran into that one. If this isn't a joke that I don't understand then I'd say you don't understand his question.If this isn't a joke that I don't understand then I'd say you don't understand his question.Quote: Originally Posted by Prelude He's asking how to write code to figure out if two lines on a Cartesian plane intersect. ... atleast I think that's what he's asking. >If this isn't a joke that I don't understand then I'd say you don't understand his question. I guess it's a joke that you don't understand then. ;) Yeah, I figured that much from his reply. ;) Morally, I should tell you to get off your lazy ass and do some research, but since your a fellow celt and I'm feeling lazy myself this morning so here ya go :DMorally, I should tell you to get off your lazy ass and do some research, but since your a fellow celt and I'm feeling lazy myself this morning so here ya go :DQuote: Originally Posted by Highland Laddie it's slightly bastardised from existing code so you'll need to make it work properly (i.e. put it in a fucntion or something), but it should get you startedit's slightly bastardised from existing code so you'll need to make it work properly (i.e. put it in a fucntion or something), but it should get you startedCode: // need to calc line functions for both lines // line func : y = a * x + b // so for line (x1, y1) (x2, y2) // (y2 - y1) (y2 - y1) // a = --------- b = y1 - --------- * x1 // (x2 - x1) (x2 - x1) // calc vals for line from centre to joystick pos int denominator = x2- x1; if (0 == denominator) { // oops divide by zero // should happen for the target line return; } float joyA = (float)((y2 - y1) / (float)denominator); float joyB = y1 - joyA * x1; // calc vals for poly lines int lineDenominator = x2 - x1; if (0 != lineDenominator) { float lineA = (float)((y2 - y1) / (float)lineDenominator); float lineB = y1 - lineA * (float)x1; // intersection point is calculated as // (b2 - b1) (b2 - b1) // xi = --------- yi = a1 * --------- + b1 // (a1 - a2) (a1 - a2) float solvedDenominator = joyA - lineA; if (0.0001f < std::fabs(solvedDenominator)) { float flSolvedX = (lineB - joyB) / solvedDenominator; int solvedX = (int)flSolvedX; int solvedY = (int)(joyA * flSolvedX + joyB); if (solvedX > min(x1, x2) && solvedX < max(x1, x2) && solvedY > min(y1, y2) && solvedY < max(y1, y2)) { int interX = solvedX; int interY = solvedY; } } } By standard, the variables in slope-intercept is Y = mX + B. :) I stumbled upon another way a while back. Its a good deal simpler, and it does indeed work. I've modified this so that it is not dependent on my game.I've modified this so that it is not dependent on my game.Code: struct vertex { float x,z; }; bool intersect (vertex v1, vertex v2, vertex p1, vertex p2); bool counter_clockwise(vertex p1, vertex p2, vertex p3); /*Call this function with your four points *v1,v2 are vertices of one line *p1,p2 are vertices of the other */ bool intersect (vertex v1, vertex v2, vertex p1, vertex p2) { if (counter_clockwise(p1,p2,v1)!=counter_clockwise(p1,p2,v2) && counter_clockwise(v1,v2,p1)!=counter_clockwise(v1,v2,p2)) { return 1; //The lines of collided } else { return 0; } } bool counter_clockwise(vertex p1,vertex p2,vertex p3) { return ((p2.z-p1.z)*(p3.x-p2.x)<(p3.z-p2.z)*(p2.x-p1.x)); } It should work, and does compile correctly (assuming no Copy/Paste errors). This code has been reformatted to fit your web browser :) true, but I think it might still work :ptrue, but I think it might still work :pQuote: Originally Posted by SlyMaelstrom Maybe not. As you know, simple inproper uses of variables, be it used in comments, code, or what have you, have a tendency to drive obviously highly intelligent things like home PCs to insanity. Which is the reason that so many PCs have been murdering their end users in thie sleep, lately. It doesn't fit mine. :)It doesn't fit mine. :)Quote: Originally Posted by CrazyNorman Be sure to use your right margin, it's a magical thing. :) Well, I think I got something figured out. I have yet to test it and debug it, but I'll get around to it later. Anyways, heres the code. Code: // Get the slope of the lines double slope1 = End.Y - Start.Y / End.X - Start.X; double slope2 = otherLine.End.Y - otherLine.Start.Y / otherLine.End.X - otherLine.Start.X; // Get the Y - intercepts of the line double yInt1 = slope1 * Start.X - Start.Y; double yInt2 = slope2 * otherLine.Start.X - otherLine.Start.Y; // Return false if the lines are paralell if (slope1 == slope2) { return false; } // Calculate the intersection point double intersectionX = (yInt2 - yInt1) / (slope1 - slope2); double intersectionY = slope1 * intersectionX + yInt1; // Check if the two line segments intersect if (intersectionX < Start.X || intersectionY > Start.Y || intersectionX > End.X || intersectionY < End.Y) { return false; } else { return true; } you need to check these lines for division by zeroyou need to check these lines for division by zeroQuote: Originally Posted by Highland Laddie
http://cboard.cprogramming.com/cplusplus-programming/70848-line-intersection-printable-thread.html
CC-MAIN-2016-07
refinedweb
1,002
60.35
Here is the configuration. Private network and domain (foo.bar). 2 file servers running 2K8R2 (file1.foo.bar and file2.foo.bar). Created a share on each server (\\file1\share and \\file2\share). Setup DFS on the domain and created a namespace (\\foo.bar). Created a folder (dfsshare) in DFS with 2 targets (\\file1\share and \\file2\share). Created the replication group and everything works except... foo.bar file1.foo.bar file2.foo.bar \\file1\share and \\file2\share \\foo.bar dfsshare \\file1\share \\file2\share During testing (Win 7 SP1 x64 client) if I copy a large file (230MB) to the DFS share (\\foo.bar\dfsshare) I get the following error: \\foo.bar\dfsshare Error 0x8007003B: An unexpected network error occured. If I copy the same file directly to one of the file servers (\\file1\share) I don't get the error and the file replicates to the other file server and shows up in the DFS share. No error when copying small files to the DFS share. I found hotfix 983620 but that hotfix was included in SP1 for Windows 7. hotfix 983620 UPDATE: Narrowed it down to ~41MB file size. Above that and I get the error. Below that and it works fine. Also, network is a LAN (no routers between me and the servers) running 1000Base T. UPDATE2: Also verified that Windows XP SP3 machines work fine so this is limited to the Windows 7 SP1 boxes. UPDATE3: Configured the same way on our dev network and it works. Move the workstation to an OU that blocks all the DISA GPOs and it was still broke. Turned off DFS replication and it works. Turned DFS replication back on and it continued to work (very confused at this point). Put the workstation back in the proper OU and it broke again. This means it must be one of the DISA settings being applied by the GPOs. Moved the workstation back to the blocking OU and it remains broke until I turn off replication. UPDATE4: Going through all the GPOs and we found out which one it was. It's a GPO that sets up 802.1x which seams very strange. We started googling DFS replication and 802.1x and found the real culprit. Not sure how the interaction of the 802.1x and the real culprit causes the problem (maybe someone can answer that). Anyway, if someone else answers with the correct culprit, or better yet, can explain why the interaction to the 802.1x GPO would cause the problem, I'll award the rep. After the bounty is expired I'll put the answer in here. SOLUTION: It turns out the problem was McAfee on the workstation. We had do disable "scan network drives". Once we did this everything worked. This error only occurs when you have 802.1x configured and the DFS share is set to replicate. We now have an exception from security since the network shares are being scanned on the server. There were no errors in the windows logs or on the ePO server. Answering my own question in the hopes it will help others. It turns out that the combination of having 802.1x configured (through GPO) and having McAfee ePO configured to scan network drives when uploading large files to a DFS share that is also being replicated will cause this error. Not sure if McAfee knows but we are trying to open a ticket with them. We got around this by disabling the scan network drives setting in ePO and this was ok with security because we have McAfee on the file servers. By posting your answer, you agree to the privacy policy and terms of service. asked 3 years ago viewed 5441 times active 1 year ago
http://serverfault.com/questions/292784/error-0x8007003b-copying-large-files-to-dfs-share
CC-MAIN-2014-42
refinedweb
629
76.62
Type: Posts; User: Lars_V_J { return... I've been looking for at way to ask EF about the max length of columns to avoid truncation errors. I found these two articles:... My customer complains that a webapp shows a blank page (also when he tries "View Html" in the browser when he leaves the webapp for some hours. Any idea what could cause that? What is the best/easiest way to encrypt a connection string in the app.config file? MS has a lot of articles on this, but I'm not sure which is the easiest and which is the best etc. What do... I get the errors: Error 1 Error 10027: The XML namespace for the conceptual model's Schema element is not supported on this project's target framework... Thank you for your fast reply. Sorry about the formatting. I did make the member functions public, only not in the example above. I wonder if MS requires the interface functions to be in the...
http://forums.codeguru.com/search.php?s=041c03700bc90331a88a97c765ad8ed3&searchid=6123891
CC-MAIN-2015-06
refinedweb
166
83.36
[Date Index] [Thread Index] [Author Index] Re: Re : Re: Interpolation Hi, >. I think the easiest way to achieve what you need is to create the symbols you save in a specific context, that is put a Begin["notebook1`"] at the beginning of notebook 1 and corresponding lines to the other notebooks. The Save then should save the variables as notebook1`abcd and notebook2`abcd respectively. When loading the saved files, you of course need to refer to the variables with the full long name, that is notebook1`abcd and notebook2`abcd. Another possibility to achieve what you want is to switch namespaces when you _load_ the files. Then you do not even need to recreate the saved files that you allready have. This would be something along the lines: Begin["n1`"] Get["tmpfile1"] End[] Begin["n2`"] Get["tmpfile2"] End[] (*example: compare two results: *) n1`abcd == n2`abcd I have not tested any of the suggestions but am very positive that you can get things running this way, still you might need to experiment a little to get it work. hth, albert
http://forums.wolfram.com/mathgroup/archive/2007/Apr/msg00461.html
CC-MAIN-2016-30
refinedweb
181
63.73
Hi There is a problem in the RadTreeView. When you rename a node, and the name is longer then the tree’s container width, the tree shakes. Please try renamning a node with a long name with many ‘a’. Then rename again the same way, move to a node that has children and the tree will start shaking. Thanks Lior Aloni 5 Answers, 1 is accepted Thank you for contacting us. Please excuse me if I do not understand you. What kind of shaking you are observing and what kind of action is causing it? We found two features that are a bit related to the described scenario - actually the whole tree is moving left-right when: - Focusing items wider the tree itself. This is because we are trying to show maximum of the currently focused item. - In edit mode the caret is going out the border of the tree. In fact there are two ways to realize the edit mode: - Initializing the editor to be wide enough to embed its content without scrolling (our implementation). In this case the tree should scroll in order to show the caret. - The maximum width of the editor should not exceed the width of the tree. In this case the text should scroll inside the editor. If we misunderstood the context of your post please drop us a line Regards, Ivan the Telerik team Watch a video on how to optimize your support resource searches and check out more tips on the blogs. Follow the status of features or bugs in PITS and vote for them to affect their priority. Hi Thank you for the reply. The first scenario you presented is the case. The whole tree moves right left without stopping when the item is wider than the tree itself. How can I disable this feature? Regards Lior It looks strange the "tree moves without stopping". We prepared and attached here a sample app to test it at your side. Could you please test its behavior? If you have your example that reproduces the case could you send it to us for further investigation. Looking forward for your reply. Best wishes, Ivan. <Window x:Class="WpfApplication1.Window1" xmlns="" xmlns:x="" xmlns:xcdg="" xmlns:loc="clr-namespace:WpfApplication1" xmlns: <Grid> <Telerik:RadTreeView <Telerik:RadTreeViewItem>a</Telerik:RadTreeViewItem> <Telerik:RadTreeViewItem>b</Telerik:RadTreeViewItem> <Telerik:RadTreeViewItem>c</Telerik:RadTreeViewItem> <Telerik:RadTreeViewItem>d</Telerik:RadTreeViewItem> </Telerik:RadTreeView> </Grid> </Window> Reproduction steps: 1) Expand all nodes (so now you have 8 rows) 2) Stand on row 2 (‘a’) 3) Press F2 4) Type ‘aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa’ 5) Press Enter 6) Do steps 2-4 again 7) Stand on row 3 8) Stree starts shaking Even in the sample you attached I managed to reprodue it I followed your instructions and I was not able to reproduce it. Could you please have a look at the attached video file as it shows my steps trying to reproduce the issue. Let me know if I am doing anything wrong. Best wishes, Kiril Stanoev.
https://www.telerik.com/forums/tree-shake
CC-MAIN-2022-40
refinedweb
502
72.46
I have a custom alert action that I wrote using the manual on the documentation: I need to import a Python module (boto3) into my action's script. How can I do that? Where and how do I install the module? Hi eden881, you can download the module directory or use a python egg of the module, place it in the bin directory of your app (assuming you created your alert action in a seperate app) and use import boto3 at top of your script. That should import the module if all module dependencies are fulfilled. import boto3 Hope this helps ... cheers, MuS View solution in original post Thank you! It worked well.
https://community.splunk.com/t5/Alerting/Use-a-Python-module-in-a-custom-alert-action/m-p/470369
CC-MAIN-2021-21
refinedweb
113
74.19
A RouteHandler for IHttpHandlers This code has been incorporated into a new RouteMagic library I wrote which includes Source Code on CodePlex.com as well as a NuGet package! I saw a bug on Connect today in which someone offers the suggestion that the PageRouteHandler (new in ASP.NET 4) should handle IHttpHandler as well as Page. I don’t really agree with the suggestion because while a Page is an IHttpHandler, an IHttpHandler is not a Page. What I this person really wants is a new handler specifically for http handlers. Let’s give it the tongue twisting name: IHttpHandlerRouteHandler. Unfortunately, it’s too late to add this for ASP.NET 4, but it turns out such a thing is trivially easy to write. In fact, here it is. public class HttpHandlerRouteHandler<THandler> : IRouteHandler where THandler : IHttpHandler, new() { public IHttpHandler GetHttpHandler(RequestContext requestContext) { return new THandler(); } } Of course, by itself it’s not all that useful. We need extension methods to make it really easy to register routes for http handlers. I wrote a set of those, but will only post two examples here on my blog. To get the full set download the sample project at the very end of this post. public static class HttpHandlerExtensions { public static void MapHttpHandler<THandler>(this RouteCollection routes, string url) where THandler : IHttpHandler, new() { routes.MapHttpHandler<THandler>(null, url, null, null); } //... public static void MapHttpHandler<THandler>(this RouteCollection routes, string name, string url, object defaults, object constraints) where THandler : IHttpHandler, new() { var route = new Route(url, new HttpHandlerRouteHandler<THandler>()); route.Defaults = new RouteValueDictionary(defaults); route.Constraints = new RouteValueDictionary(constraints); routes.Add(name, route); } } This now allows me to register a route which is handled by an IHttpHandler very easily. In this case, I’m registering a route that will use my SimpleHttpHandler to handle any two segment URL. public static void RegisterRoutes(RouteCollection routes) { routes.MapHttpHandler<SampleHttpHandler>("{foo}/{bar}"); } And here’s the code for SampleHttpHandler for completeness. All it does is print out the route values. public class SampleHttpHandler : IHttpHandler { public bool IsReusable { get { return false; } } public void ProcessRequest(HttpContext context) { var routeValues = context.Request.RequestContext.RouteData.Values; string message = "I saw foo='{0}' and bar='{1}'"; message = string.Format(message, routeValues["foo"], routeValues["bar"]); context.Response.Write(message); } } When I make a request for /testing/yo I’ll see the message I saw foo=’testing’ and bar=’yo’ in my browser. Very cool. Limitation One limitation here is that my http handler has to have a parameterless constructor. That’s not really that bad of a limitation since to register an HTTP Handler in the old way you had to make sure that the handler had an empty constructor. However, this code that I wrote for this blog post is based on code that I added to Subtext. In that code, I am passing an IKernel (I’m using Ninject) to my HttpRouteHandler. That way, my route handler will use Ninject to instantiate the http handler and thus my http handlers aren’t required to have a parameterless constructor. Try it out! The RouteMagic solution includes a sample project that demonstrates all this. 18 responses
http://haacked.com/archive/2009/11/04/routehandler-for-http-handlers.aspx/
CC-MAIN-2021-31
refinedweb
525
57.77
/* Fundamental definitions for GNU Emacs Lisp interpreter.. */ /* Declare the prototype for a general external function. */ #if defined (PROTOTYPES) || defined (WINDOWSNT) #define P_(proto) proto #else #define P_(proto) () #endif #if 0 /* Define this temporarily to hunt a bug. If defined, the size of strings is redundantly recorded in sdata structures so that it can be compared to the sizes recorded in Lisp strings. */ #define GC_CHECK_STRING_BYTES 1 #endif /* 0*/ /* These are default choices for the types to use. */ #ifdef _LP64 #ifndef EMACS_INT #define EMACS_INT long #define BITS_PER_EMACS_INT BITS_PER_LONG #endif #ifndef EMACS_UINT #define EMACS_UINT unsigned long #endif #else /* not _LP64 */ #ifndef EMACS_INT #define EMACS_INT int #define BITS_PER_EMACS_INT BITS_PER_INT #endif #ifndef EMACS_UINT #define EMACS_UINT unsigned int #endif #endif /* Extra internal type checking? */ extern int suppress_checking; extern void die P_((const char *, const char *, int)); #ifdef ENABLE_CHECKING #define CHECK(check,msg) ((check || suppress_checking \ ? (void) 0 \ : die (msg, __FILE__, __LINE__)), \ 0) /* Let's get some compile-time checking too. */ #undef NO_UNION_TYPE #else /* Produce same side effects and result, but don't complain. */ #define CHECK(check,msg) ((check),0) /* Used for making sure that Emacs is compilable in all configurations. */ #ifdef USE_LISP_UNION_TYPE #undef NO_UNION_TYPE #endif /* Define an Emacs version of "assert", since some system ones are flaky. */ #ifndef ENABLE_CHECKING #define eassert(X) (void) 0 #else /* ENABLE_CHECKING */ #if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__) #define eassert(cond) CHECK(cond,"assertion failed: " #cond) #else #define eassert(cond) CHECK(cond,"assertion failed") #endif #endif /* ENABLE_CHECKING */ /*, Lisp_Float, /* This is not a type code. It is for range checking. */ Lisp_Type_Limit }; /* This is the set of data types (BITS_PER_EMACS_INT - 4) #endif #ifndef GCTYPEBITS #define GCTYPEBITS 3 #endif #ifndef NO_UNION_TYPE #ifndef WORDS_BIG_ENDIAN /* Definition of Lisp_Object for little-endian machines. */ typedef union Lisp_Object { /* Used for comparing two Lisp_Objects; also, positive integers can be accessed fast this way. */ EMACS_INT i; struct { EMACS_INT val : VALBITS; EMACS_INT type : GCTYPEBITS + 1; } s; struct { EMACS_UINT val : VALBITS; EMACS_INT type : GCTYPEBITS + 1; } u; struct { EMACS_UINT val : VALBITS; enum Lisp_Type type : GCTYPEBITS; /* The markbit is not really part of the value of a Lisp_Object, and is always zero except during garbage collection. */ EMACS_UINT markbit : 1; } gu; } Lisp_Object; #else /* If WORDS_BIG_ENDIAN */ typedef union Lisp_Object { /* Used for comparing two Lisp_Objects; EMACS_INT type : GCTYPEBITS+1; EMACS_INT val : VALBITS; EMACS_INT type : GCTYPEBITS+1; EMACS_UINT val : VALBITS; } u; struct { /* The markbit is not really part of the value of a Lisp_Object, and is always zero except during garbage collection. */ EMACS_UINT markbit : 1; enum Lisp_Type type : GCTYPEBITS; EMACS_UINT val : VALBITS; #endif /* WORDS_BIG_ENDIAN */ #ifdef __GNUC__ static __inline__ Lisp_Object LISP_MAKE_RVALUE (Lisp_Object o) { return o; } #else #define LISP_MAKE_RVALUE(o) (o) /* XXX - keeps arg as rvalue. */ #endif #endif /* NO_UNION_TYPE */ /* If union type is not wanted, define Lisp_Object as just a number. */ #ifdef NO_UNION_TYPE #define Lisp_Object EMACS_INT #define LISP_MAKE_RVALUE(o) (0+(o)) #endif /* NO_UNION_TYPE */ #ifndef VALMASK #define VALMASK ((((EMACS_INT) 1)<<VALBITS) - 1) ((EMACS_INT) ((EMACS_UINT) #if 0 /* This is used to make the value of PSEUDOVECTOR_FLAG available to GDB. It doesn't work on OS Alpha. Moved to a variable in emacsize) ((EMACS_INT) (((a) << (BITS_PER_EMACS_INT - VALBITS)) \ >> (BITS_PER_EMACS_INT - VALBITS))) #endif /* Extract the value as an unsigned integer. This is a basis for extracting it as a pointer to a structure in storage. */ #ifndef XUINT #define XUINT(a) ((EMACS_UINT) ((a) & VALMASK)) #endif #ifndef XPNTR #ifdef HAVE_SHM /* In this representation, data is found in two widely separated segments. */ extern size_EMACS_INT - VALBITS)) \ >> (BITS_PER_EMACS_INT - VALBITS)) #else #define XINT(a) ((a).s.val) #endif /* EXPLICIT_SIGN_EXTEND */ #define XUINT(a) ((a).u.val) #define XPNTR(a) ((a).u.val) #define XSET(var, vartype, ptr) \ (((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype)))) #if __GNUC__ >= 2 && defined (__OPTIMIZE__) #define make_number(N) \ (__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; })) #else */ /* Largest and smallest representable fixnum values. These are the C values. */ #define MOST_NEGATIVE_FIXNUM - ((EMACS_INT) 1 << (VALBITS - 1)) #define MOST_POSITIVE_FIXNUM (((EMACS_INT) 1 << (VALBITS - 1)) - 1) /* Value is non-zero if C integer I doesn't fit into a Lisp fixnum. */ #define FIXNUM_OVERFLOW_P(i) \ ((EMACS_INT)(i) > MOST_POSITIVE_FIXNUM \ || (EMACS_INT) (i) < MOST_NEGATIVE_FIXNUM) /* Extract a value or address from a Lisp_Object. */ #define XCONS(a) (eassert (GC_CONSP(a)),(struct Lisp_Cons *) XPNTR(a)) #define XVECTOR(a) (eassert (GC_VECTORLIKEP(a)),(struct Lisp_Vector *) XPNTR(a)) #define XSTRING(a) (eassert (GC_STRINGP(a)),(struct Lisp_String *) XPNTR(a)) #define XSYMBOL(a) (eassert (GC_SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a)) #define XFLOAT(a) (eassert (GC_FLOATP) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a)) #define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a)) #define XSUBR(a) (eassert (GC_SUBRP(a)),(struct Lisp_Subr *) XPNTR(a)) #define XBUFFER(a) (eassert (GC_BUFFERP)) /* Convenience macros for dealing with Lisp arrays. */ #define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX] #define ASET(ARRAY, IDX, VAL) (AREF ((ARRAY), (IDX)) = (VAL)) #define ASIZE(ARRAY) XVECTOR ((ARRAY))->size /* guarantee. */ union { struct interval *interval; Lisp_Object obj; } up; unsigned int up_obj : 1; /* The remaining components are `properties' of the interval. The first four are duplicates for things which can be on the list, for purposes of speed. */ unsigned int write_protect : 1; /* Non-zero means can't modify. */ unsigned int visible : 1; /* Zero means don't display. */ unsigned int front_sticky : 1; /* Non-zero means text inserted just before this interval goes into it. */ unsigned int rear_sticky : 1; /*) \ { if (!STRINGP ((x)) && !BUFFERP ((x))) \ x = wrong_type_argument (Qbuffer_or_string_p, (x)); } /*. */ /* The _AS_LVALUE macros shouldn't be used outside of the minimal set of code that has to know what a cons cell looks like. Other code not part of the basic lisp implementation should assume that the car and cdr fields are not accessible as lvalues. (What if we want to switch to a copying collector someday? Cached cons cell field addresses may be invalidated at arbitrary points.) */ #ifdef HIDE_LISP_IMPLEMENTATION #define XCAR_AS_LVALUE(c) (XCONS ((c))->car_) #define XCDR_AS_LVALUE(c) (XCONS ((c))->cdr_) #define XCAR_AS_LVALUE(c) (XCONS ((c))->car) #define XCDR_AS_LVALUE(c) (XCONS ((c))->cdr) /* Okay, we're not quite ready to turn this on yet. A few files still need to be updated and tested. */ #undef LISP_MAKE_RVALUE #define LISP_MAKE_RVALUE(x) (x) /* Use these from normal code. */ #define XCAR(c) LISP_MAKE_RVALUE(XCAR_AS_LVALUE(c)) #define XCDR(c) LISP_MAKE_RVALUE(XCDR_AS_LVALUE(c)) /* Use these to set the fields of a cons cell. Note that both arguments may refer to the same object, so 'n' should not be read after 'c' is first modified. Also, neither argument should be evaluated more than once; side effects are especially common in the second argument. */ #define XSETCAR(c,n) (XCAR_AS_LVALUE(c) = (n)) #define XSETCDR(c,n) (XCDR_AS_LVALUE(c) = (n)) /* For performance: Fast storage of positive integers into the fields of a cons cell. See above caveats. */ #define XSETCARFASTINT(c,n) XSETFASTINT(XCAR_AS_LVALUE(c),(n)) #define XSETCDRFASTINT(c,n) XSETFASTINT(XCDR_AS_LVALUE(c),(n)) /*))) /* Nonzero if STR is a multibyte string. */ #define STRING_MULTIBYTE(STR) \ (XSTRING (STR)->size_byte >= 0) /* Return the length in bytes of STR. */ #ifdef GC_CHECK_STRING_BYTES struct Lisp_String; extern int string_bytes P_ ((struct Lisp_String *)); #define STRING_BYTES(S) string_bytes ((S)) #else /* not GC_CHECK_STRING_BYTES */ #define STRING_BYTES(STR) \ ((STR)->size_byte < 0 ? (STR)->size : (STR)->size_byte) #endif /* not GC_CHECK_STRING_BYTES */ /* Set the length in bytes of STR. */ #define SET_STRING_BYTES(STR, SIZE) ((STR)->size_byte = (SIZE)) /* In a string or vector, the sign bit of the `size' is the gc mark bit */ struct Lisp_String { EMACS_INT size; EMACS_INT size_byte; INTERVAL intervals; /* text properties in this string */ unsigned char *data; /*; }; /*********************************************************************** Symbols ***********************************************************************/ /* Interned state of a symbol. */ enum symbol_interned { SYMBOL_UNINTERNED = 0, SYMBOL_INTERNED = 1, SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2 }; /* In a symbol, the markbit of the plist is used as the gc mark bit */ struct Lisp_Symbol { /* Non-zero means symbol serves as a variable alias. The symbol holding the real value is found in the value slot. */ unsigned indirect_variable : 1; /* Non-zero means symbol is constant, i.e. changing its value should signal an error. */ unsigned constant : 1; /* Interned state of the symbol. This is an enumerator from enum symbol_interned. */ unsigned interned : 2; /* The symbol's name. This should become a Lisp_Object some day; there's no need for the Lisp_String pointer nowadays. */ struct Lisp_String *name; /* Value of the symbol or Qunbound if unbound. If this symbol is a defvaralias, `value' contains the symbol for which it is an alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get and set a symbol's value, to take defvaralias into account. */ Lisp_Object value; /* Function value of the symbol or Qunbound if not fboundp. */ Lisp_Object function; /* The symbol's property list. */ Lisp_Object plist; /* Next symbol in obarray bucket, if the symbol is interned. */ struct Lisp_Symbol *next; }; /* Value is non-zero if SYM is an interned symbol. */ #define SYMBOL_INTERNED_P(sym) \ (XSYMBOL (sym)->interned != SYMBOL_UNINTERNED) /* Value is non-zero if SYM is interned in initial_obarray. */ #define SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P(sym) \ (XSYMBOL (sym)->interned == SYMBOL_INTERNED_IN_INITIAL_OBARRAY) /* Value is non-zero if symbol is considered a constant, i.e. its value cannot be changed (there is an exception for keyword symbols, whose value can be set to the keyword symbol itself). */ #define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant /* Value is the value of SYM, with defvaralias taken into account. */ #define SYMBOL_VALUE(sym) \ (XSYMBOL (sym)->indirect_variable \ ? XSYMBOL (indirect_variable (sym))->value \ : XSYMBOL (sym)->value) /* Set SYM's value to VAL, taking defvaralias into account. */ #define SET_SYMBOL_VALUE(sym, val) \ do { \ if (XSYMBOL (sym)->indirect_variable) \ XSYMBOL (indirect_variable ((sym)))->value = (val); \ else \ XSYMBOL (sym)->value = (val); \ } while (0) /***********************************************************************; /* struct Lisp_Buffer_Local_Value is used in a symbol value cell when the symbol has buffer-local or frame-local bindings. (Exception: some buffer-local variables are built-in, with their values stored in the buffer structure itself. They are handled differently, using struct Lisp_Buffer_Objfwd.) The `realvalue' slot holds the variable's current value, or a forwarding pointer to where that value is kept. This value is the one that corresponds to the loaded binding. To read or set the variable, you must first make sure the right binding is loaded; then you can access the value in (or through) `realvalue'. `buffer' and `frame' are the buffer and frame for which the loaded binding was found. If those have changed, to make sure the right binding is loaded it is necessary to find which binding goes with the current buffer and selected frame, then load it. To load it, first unload the previous binding, then copy the value of the new binding into `realvalue' (or through it). Also update LOADED-BINDING to point to the newly loaded binding. Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value both use this kind of structure. With the former, merely setting the variable creates a local binding for the current buffer. With the latter, setting the variable does not do that; only make-local-variable does that. */ struct Lisp_Buffer_Local_Value { int type : 16; /* = Lisp_Misc_Buffer_Local_Value or Lisp_Misc_Some_Buffer_Local_Value */ int spacer : 13; /* 1 means this variable is allowed to have frame-local bindings, so check for them when looking for the proper binding. */ unsigned int check_frame : 1; /* 1 means that the binding now loaded was found as a local binding for the buffer in the `buffer' slot. */ unsigned int found_for_buffer : 1; /* 1 means that the binding now loaded was found as a local binding for the frame in the `frame' slot. */ unsigned int found_for_frame : 1; Lisp_Object realvalue; /* The buffer and frame for which the loaded binding was found. */ Lisp_Object buffer, frame; /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE). LOADED-BINDING is the binding now loaded. It is a cons cell whose cdr is the binding's value. The cons cell may be an element of a buffer's local-variable alist, or an element of a frame's parameter alist, or it may be this cons cell. DEFAULT-VALUE is the variable's default value, seen when the current buffer and selected frame do not have their own bindings for the variable. When the default binding is loaded, LOADED-BINDING is actually this very cons cell; thus, its car points to itself. */ Lisp_Object cdr; /* In an overlay object, the mark bit of the plist is used as the GC mark. START and END are markers in the overlay's buffer, and PLIST is the overlay's property list. */ struct Lisp_Overlay {
https://emba.gnu.org/emacs/emacs/-/blame/dd4acaa57fef06912786795ac50137ec23509f92/src/lisp.h
CC-MAIN-2022-27
refinedweb
1,956
54.73
Hello! My game has three levels, and i have a code that changes from level 1 to level 2 after killing 5 enemies. In the second level, the level should change to the third one after killing 10 enemies. I want to use the same script, but the public variables are not showing in the inspector so i can't change it. Thanks in advance for the help. This code is attached to an empty game object: public class enemyCount : MonoBehaviour { public static int enemiesCount = 5; void Update (){ print("Enemy Count is " + enemiesCount); if(enemiesCount <= 0) { Debug.Log("Level 2!!!"); Application.LoadLevel ("level2"); } } } And this is attached to the bullet script: private void OnCollisionEnter (Collision collision){ if (collision.transform.tag == "Enemy") { Destroy (collision.gameObject); gameObject.SetActive (false); Destroy (this.gameObject); } if (collision.gameObject.tag == "Enemy") { enemyCount.enemiesCount --; } } Answer by Bunny83 · Nov 14, 2017 at 02:42 AM You can't use static variables if they should be editable in the inspector. The Inspector can only show variables that belong to this instance of the class. Static variables do not belong to a certain instance. They only exist once in the whole application. You may want to simply use a "targetKillCount" variable which you use to initialize your static variable in Start. I also would recommend to not use Update for this. It's way better to use a method which is called when you actually decrease the enemy count. You can check if you reached the target there. public class EnemyCount : MonoBehaviour { public static int enemiesCount; private static string nextLevel; public int targetCount; // set this in the inspector public string nextLevelName; // set the name of the next level in the inspector void Start() { enemiesCount = targetCount; nextLevel = nextLevelName; } public static void DecreaseCount() { enemiesCount--; print("Enemy Count is " + enemiesCount); if(enemiesCount <= 0) { Debug.Log("Load level: " + nextLevel); Application.LoadLevel (nextLevel); } } } In your other script you would use this instead: if (collision.gameObject.tag == "Enemy") { enemyCount.DecreaseCount(); } Thank you, now i understand what my mistake was but i don't know why i get this error (sorry i'm new to Unity): An object reference is required to access non-static member `enemyCount.nextLevelName' Of course ^^ $$anonymous$$y mistake. Since the "DecreaseCount" method is a static method it can not use any non static variables. So we would need add also a static string variable (just like the "enemiesCount" variable) and initialize it inside Start with the non-static one. I'll edit my answer. Sorry for the. How to trigger a collider to enable after a camera is inside of it. 1 Answer Scene problem - missing Unityengine and MonoBehaviour 0 Answers How to load a scene with GameFlow on button click ? ( XR RIG / Oculus Quest ) 0 Answers .As u can see in the image it loads ThemeSelection scenes but doesnot show anything 0 Answers Everytime when i start at level 3 or higher after completing it it goes back to level 2 how do i fix this? 1 Answer EnterpriseSocial Q&A
https://answers.unity.com/questions/1432128/use-same-script-in-different-scenes-to-change-leve.html
CC-MAIN-2022-21
refinedweb
500
57.06
Issue resolved, lack of planning and lack of attention to detail were the culprits. ------------------------------------- I am just learning micropython on the pyboard. I have a rowing machine and i am building a new computer for it to give me some of the data that the cheap one it came with does not have, namely strokes/minute. there is a simple switch on the machine that registers when the seat goes back and forth so I am simulating that with the built in usr switch on the pyboard. I found some code on line that i am trying to repurpose. The problem i am having is that once I press the button it increments the counter but then it seems to stop. I am sure the code looks a mess but I am trying to work out the basics before I refactor it. output is as follows Code: Select all from machine import Pin, Timer from pyb import delay import micropython micropython.alloc_emergency_exception_buf(100) #counter to be incremented each time a stroke is detected stroke_count = 0 def on_pressed(timer): global stroke_count stroke_count += 1 def debounce(pin): # Start or replace a timer for 200ms, and trigger on_pressed. stroke_calc_timer.init(mode=Timer.ONE_SHOT, period=50, callback=on_pressed) def calc_stroke_enable(timer): print("calc_stroke reached") global calc_stroke calc_stroke = True # Register a new hardware timer. # create a timer that will tell the sytem it is time to calcualte the # stroke count stroke_calc_timer = Timer(-1) # initialise it stroke_calc_timer.init(mode=Timer.PERIODIC, period=5000, callback=calc_stroke_enable) #10 second timer tenSecond_timer = Timer(-1) #flag to alert main that the time interval is up to so calculate stroke rate calc_stroke = False # Setup the button input pin with a pull-up resistor. button = Pin('X17', Pin.IN, Pin.PULL_UP) # Register an interrupt on rising button input. button.irq(debounce, Pin.IRQ_RISING) def main(): global calc_stroke global stroke_count if calc_stroke == True: print("count is true") print("strokes " + str(stroke_count)) calculated_stroke = stroke_count * 6 stroke_count = 0 # reset for next interval calc_stroke = False # reset to wait for another 10s print("calculated stroke = " + str(calculated_stroke)) while True: main() delay(50) As soon as i press the button the output stops. Code: Select all icroPython v1.12-537-gecd782631 on 2020-06-15; PYBv1.1 with STM32F405RG Type "help()" for more information. >>> MPY: sync filesystems MPY: soft reboot calc_stroke reached count is true strokes 0 calculated stroke = 0 calc_stroke reached count is true strokes 0 calculated stroke = 0 Is there something that has to be done after the interrupt happens to pass control back to the main program or am I fundamentally misunderstanding how the interrupts and timers should be used? Thank you for any assistance. Alan
https://forum.micropython.org/viewtopic.php?p=48547
CC-MAIN-2021-04
refinedweb
441
59.53
Why is copying a shuffled list much slower? Copying a shuffled range(10**6) list ten times takes me about 0.18 seconds: (these are five runs) 0.175597017661 0.173731403198 0.178601711594 0.180330912952 0.180811964451 Copying the unshuffled list ten times takes me about 0.05 seconds: 0.058402235973 0.0505464636856 0.0509734306934 0.0526022752744 0.0513324916184 Here's my testing code: from timeit import timeit import random a = range(10**6) random.shuffle(a) # Remove this for the second test. a = list(a) # Just an attempt to "normalize" the list. for _ in range(5): print timeit(lambda: list(a), number=10) I also tried copying with a[:], the results were similar (i.e., big speed difference) Why the big speed difference? I know and understand the speed difference in the famous Why is it faster to process a sorted array than an unsorted array? example, but here my processing has no decisions. It's just blindly copying the references inside the list, no? I'm using Python 2.7.12 on Windows 10. Edit: Tried Python 3.5.2 as well now, the results were almost the same (shuffled consistently around 0.17 seconds, unshuffled consistently around 0.05 seconds). Here's the code for that: a = list(range(10**6)) random.shuffle(a) a = list(a) for _ in range(5): print(timeit(lambda: list(a), number=10)) The interesting bit is that it depends on the order in which the integers are first created. For example instead of shuffle create a random sequence with random.randint: from timeit import timeit import random a = [random.randint(0, 10**6) for _ in range(10**6)] for _ in range(5): print(timeit(lambda: list(a), number=10)) This is as fast as copying your list(range(10**6)) (first and fast example). However when you shuffle - then your integers aren't in the order they were first created anymore, that's what makes it slow. A quick intermezzo: - All Python objects are on the heap, so every object is a pointer. - Copying a list is a shallow operation. - However Python uses reference counting so when an object is put in a new container it's reference count must be incremented ( Py_INCREFin list_slice), so Python really needs to go to where the object is. It can't just copy the reference. So when you copy your list you get each item of that list and put it "as is" in the new list. When your next item was created shortly after the current one there is a good chance (no guarantee!) that it's saved next to it on the heap. Let's assume that whenever your computer loads an item in the cache it also loads the x next-in-memory items (cache locality). Then your computer can perform the reference count increment for x+1 items on the same cache! With the shuffled sequence it still loads the next-in-memory items but these aren't the ones next-in-list. So it can't perform the reference-count increment without "really" looking for the next item. TL;DR: The actual speed depends on what happened before the copy: in what order were these items created and in what order are these in the list. You can verify this by looking at the id: CPython implementation detail: This is the address of the object in memory. a = list(range(10**6, 10**6+100)) for item in a: print(id(item)) Just to show a short excerpt: 1496489995888 1496489995920 # +32 1496489995952 # +32 1496489995984 # +32 1496489996016 # +32 1496489996048 # +32 1496489996080 # +32 1496489996112 1496489996144 1496489996176 1496489996208 1496489996240 1496507297840 1496507297872 1496507297904 1496507297936 1496507297968 1496507298000 1496507298032 1496507298064 1496507298096 1496507298128 1496507298160 1496507298192 So these objects are really "next to each other on the heap". With shuffle they aren't: import random a = list(range(10**6, 100+10**6)) random.shuffle(a) last = None for item in a: if last is not None: print('diff', id(item) - id(last)) last = item Which shows these are not really next to each other in memory: diff 736 diff -64 diff -17291008 diff -128 diff 288 diff -224 diff 17292032 diff -1312 diff 1088 diff -17292384 diff 17291072 diff 608 diff -17290848 diff 17289856 diff 928 diff -672 diff 864 diff -17290816 diff -128 diff -96 diff 17291552 diff -192 diff 96 diff -17291904 diff 17291680 diff -1152 diff 896 diff -17290528 diff 17290816 diff -992 diff 448 Important note: I haven't thought this up myself. Most of the informations can be found in the blogpost of Ricky Stewart. This answer is based on the "official" CPython implementation of Python. The details in other implementations (Jython, PyPy, IronPython, ...) may be different. Thanks @JörgWMittag for pointing this out. ★ Back to homepage or read more recommendations:★ Back to homepage or read more recommendations: From: stackoverflow.com/q/42107442
https://python-decompiler.com/article/2017-02/why-is-copying-a-shuffled-list-much-slower
CC-MAIN-2019-26
refinedweb
815
72.56
And, in other architetures besides Intel (like ARM) these functions are different. Here the 3 isCrossing() in ARM Cortex-A53 using vfp3-d16: isCrossing: ldm r0, {r0, r3} lsr r3, r3, #31 ... And, in other architetures besides Intel (like ARM) these functions are different. Here the 3 isCrossing() in ARM Cortex-A53 using vfp3-d16: isCrossing: ldm r0, {r0, r3} lsr r3, r3, #31 ... The second tip is ok (droping a !), but the third is a little bit different, since uses two floating point comparisons. Notice signbit simply isolates the sign bit without any comparison... The... NOT a correction, just a little bit of improvement. Instead of: bool isCrossing(float *pair) { return pair[0] < 0 && pair[1] >= 0 || pair[0] > 0 && pair[1] <= 0; } Well...... leopoldo100, when you say "very simple" it means from a user point of view. Video players aren't "simple", even when using some library (like ffmpeg's libav*). Yep... Try to compile the same code for i386 (or x86, as you called) and you'll get: section .text _multiplyByTwo: fld QWORD [esp+4] fadd st, st(0) ret section .rdata Unless you are compiling your code without any optimizations enabled, the compiler will use the stack to store local variables only if needed. In general, for optimized code, the compiler uses... Notice you can use getline() [POSIX] to get a line of any size (dynamically allocated), strtok() to isolate "pieces" of the line and strtoul() to try to convert strings from octal to unsigned long... Another small thing... In the comments you said: "Write a function that reads data from standard input until EOF is found and returns the sum of the base-8 numbers found into the input." So,... XOR has 3 basic uses: To invert bits based in a mask; To get the result of different bits in both operands or as a caryless add. This kind of code is a trick to swap values without using a temporary... UNICODE encoding is a 31 bits value corresponding to a single character. The trailing 16 bits correspond to a character in a "plane" the upper 16 bits. Actually planes 0, 1, 2, 3, 14, 15 and 16 are... Easier if you check only if the next value is greater than the previous (or vice-versa). Didn't you mean how to get the PID of the process dispatching the signal? Because the PID of the process "calling" the handler will be the same as the process which the handler was registered by... Didn't you mean how to get the PID of the process dispatching the signal? Because the PID of the process "calling" the handler will be the same as the process which the handler was registered by... As Salem said... break your code in small portions. Here's my implementation with comments for your study: // cobalt.c // // Compile and link: // // $ gcc -O2 -o cobalt cobalt.c # add -lm if... Here's a brief explanation about 'floating point' based on Salem's correct comments on the subject above. "Precision" is the number of significative digits (in this case, BITS) of a... %[^...] means the same as %s but excludes those characters (in your case from '0' to '9' and '-'). Another thing: scanf() returns EOF only if any of the conversions can't be done and if you reach... Since + has higher precedence than <<, (1U << i + 1) is correct, no parentesis needed. I could agree that writing (1U << (i + 1)) makes the expression clearer, but the previous isn't wrong. In my example code here's some ways to avoid using goto in this fragment: if ( scanf ( "%lf%c + %lf = %lf", &a, &y, &b, &c ) != 4 ) { invalid_input: puts ( "Invalid input!" ); ... As John says, for beginners, yes... goto should be avoided, even for experienced programmers, but it isn't always 'bad'. And. yes... I do know what I am talking about. Why not? Just because Dijkstra told you so? And fflush(stdout) is there not because scanf(), but because stdout is line buffered. Not all c libraries garantees the flushing of the buffer just... scanf() returns the number of convertions made. You should test if a is zero before trying to use it as a divisor. %lf in printf() has a different meaning than on scanf(). You don't need... If your compiler/c standard library is POSIX:2008 compliant you can use getline() function, which will allocate the buffer for the line for you: char *line; size_t size; // Need this for... Start? Where is YOUR code? Avoid using system(). Since you are using Windows, use the Console API do clear the screen: #include <windows.h> ... void clearscreen(void) { HANDLE hConsole; COORD coord = {0, 0}; ... Are you sure? The final value must be 8.6805553436279296875 in single precision (8.68055555556 cannot be represented in any floating point precision).
https://cboard.cprogramming.com/search.php?s=f6fae79b0012dd88f7b87790da6534ec&searchid=6283640
CC-MAIN-2021-04
refinedweb
802
75.4
How can I have a Browser based WASM Application build & use TWO separate browser windows, not Browser Tabs? The main & 1st HTML Window is the Application. When the user has entered all his information & the results computed, the WASM/HTML needs to launch a 2nd HTML page for a Report of the results. The Report WASM needs to use the computational results to build the Report HTML page. A user can then save the Report as an HTML page or use the browser’s ability to save as a PDF Report. When done with the Report, the user will frequently go back to the same Application with all his data still on display, perhaps change one or more things to generate comparison Reports. The Application saves the user data & the computed results in a file, say Data.pas, which both HTML/WASM’s need to have access to. I probably need the Report/WASM to close the Report Window & update Data.pas for the Application so it will know the Report is done. If the Report Window & thus it’s WASM is not closed, what happens if the Application launches the Report HTML/WASM again? Does my world go to hell? Were it a perfect world, I’d like it to be ONE WASM application able to build, & support 2 different HTML pages. Maybe using separate namespaces but both using a Data namespace for the shared data? In RemObjects Talk I see references to “Report Builder.” Is that an option, easy to use, & run in a browser based WASM Application? Google does not present anything for “RemObjecsts WASM Report Builder.” An HTML Report page is not hard for me to build including adding an image.
https://talk.remobjects.com/t/two-browser-windows-built-controlled-with-one-browser-based-wasm-application/21984
CC-MAIN-2020-24
refinedweb
285
72.87
Whenever I’m scrolling through pictures I’ve taken, it seem like they are in sections – here’s when I was near the beach, he’s the park, the night sky and fireworks. I thought if you visualised the way that the dominant colors changed, patterns would emerge. I found the perfect layout for this, the sunflower layout, and then did nothing about it for… a long time. I claim the craziness of work and life. Also, I knew nothing about color, and had no idea how I would go about extracting the dominant color from an image. But I did some research and figured it out, the trick was working with hues rather than RGB values. And voila, here is another way to see the story of my trip to North Korea. Maybe the main thing I can see from this experiment is that I don’t take as colorful photos as I like to imagine I do. Also, that I took a lot of photos in North Korea (the major bottleneck to my blog posts about it). So I put together another collection of images – almost everything I’ve taken since mid-June aside from in North Korea, including the shipwreck, my trips to Tasmania, Queenstown (skiing!), Hong Kong, Tokyo and photos I’d taken around Sydney and visualised that with the result below. This is where I discovered that it doesn’t work well with panoramas (I had recently discovered the panorama feature on my iPhone and had taken a few, typically at 5-7MB in size) which threw an exception, because it was out of Java heap space. I’d need to make the code more efficient to process panoramas – for now, I just left them out. I’d like to add more to it, maybe clicking on an element in the layout could bring up the photo, with only the dominant color (with some tolerance) exposed. Maybe animate it with the image that’s being processed displayed alongside. I’d love to pull in my most recent pictures on Twitter and display them this way. I think, how many images are needed to create something cool looking may make that prohibitive, though. For now, I’m happy that I’ve got something working. Processing one image like this doesn’t take a noticeable amount of time, however this first (NK) one is made from 1048 images, and 2.26GB of data. On my 13″ Macbook pro… it takes a while. Note – I made an HSBColor class that just holds hue, saturation, and brightness. Source Code import java.io.File; import processing.core.PApplet; import processing.core.PImage; @SuppressWarnings("serial") public class SunflowerImages extends PApplet { private static String filePath = "../data/nkimages/"; private String[] fileNames; static final int hueRange = 320; private static final int radius = 9; private static final int scale = 7; private static final double goldenangle = Math.PI * (3 - Math.sqrt(5)); private static final int wh = 500; public void setup() { size(wh, wh); background(0); noLoop(); colorMode(HSB, hueRange - 1); // Read in images. File dir = new File(filePath); fileNames = dir.list(); } public void draw() { int n = 0; double a = 0; for (String file : fileNames) { PImage img = loadImage(filePath + file); if (img == null) { continue; } print("processing image: " + file + "\n"); double h = Math.sqrt(n)*scale; double x = wh/2 + Math.sin(a) * h; double y = wh/2 + Math.cos(a) * h; stroke(100); HSBColor color = extractColorFromImage(img); fill(color.h, color.s, color.b); ellipse((float) x, (float) y, radius, radius); a+=goldenangle; n++; } } private HSBColor extractColorFromImage(PImage img) {); } } One thought on “Visualising A Photo Series” hmm, maybe you could line up all the colours in your image into an array — convert to CieLAB — make a 2d array by (a,b) — and then from there try to get at the “principal components” of the colours in your images. second variation — convert to HSV space — find the principal hues (eg by clustering) in your frame — and increase the saturation if it’s too boring
https://cate.blog/2013/09/02/visualising-a-photo-series/
CC-MAIN-2019-35
refinedweb
667
62.68