text:
int main(){
  srand(time(NULL)); // prng MUST be seeded here, and nowhere else

  printf("  ___ ___  ___ _____ ___ ___   _   ___  \n");
  printf(" / __| _ \\/ _ \\_   _|_ _| _ ) /_\\ |   \\ \n");
  printf(" \\__ \\  _/ (_) || |  | || _ \\/ _ \\| |) |\n");
  printf(" |___/_|  \\___/ |_| |___|___/_/ \\_\\___/ \n");
  printf("                                        \n");
  printf(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \n");

  printf("Let's add some songs.\n");
  add_song_node(make_song_node("Maybe"                                               ,"Enrique Iglesias"));
  add_song_node(make_song_node("Troublesome Waters"                                  ,"Johnny Cash"));
  add_song_node(make_song_node("I Wanna Be Your Lover"                               ,"La Bionda"));
  add_song_node(make_song_node("Welcome To The Jungle"                               ,"Guns N' Roses"));
  add_song_node(make_song_node("Lose Yourself"                                       ,"Eminem"));
  add_song_node(make_song_node("All Rise"                                            ,"Wovenwar"));
  add_song_node(make_song_node("Things I Didn't Say"                                 ,"Adam Lambert"));
  add_song_node(make_song_node("Wheel of Fortune"                                    ,"Ace of Base"));
  add_song_node(make_song_node("If I'm"                                              ,"Sea Oleena"));
  add_song_node(make_song_node("My Songs Know What You Did In The Dark"              ,"Fall Out Boy"));
  add_song_node(make_song_node("Steppin' out with My Baby"                           ,"Tony Bennett"));
  add_song_node(make_song_node("Paradise by the Dashboard Light"                     ,"Meat Loaf"));
  add_song_node(make_song_node("Hymn For The Weekend"                                ,"Coldplay"));
  add_song_node(make_song_node("We Will Rock You"                                    ,"Queen"));
  add_song_node(make_song_node("Let Love Hold You Now"                               ,"Jamie Lawson"));
  add_song_node(make_song_node("We Didn't Start the Fire"                            ,"Billy Joel"));
  add_song_node(make_song_node("Best Mistake"                                        ,"Ariana Grande"));
  add_song_node(make_song_node("Say Something"                                       ,"A Great Big World"));
  add_song_node(make_song_node("Mammas, Don't Let Your Babies Grow Up to Be Cowboys" ,"Waylon Jennings"));
  add_song_node(make_song_node("Rock Of The Bells"                                   ,"Matthew Rodgers"));
  add_song_node(make_song_node("Underdog"                                            ,"Imagine Dragons"));
  add_song_node(make_song_node("Really Don't Care"                                   ,"Demi Lovato"));
  add_song_node(make_song_node("Sandy in the Rain"                                   ,"The Lost American JazzBook"));
  add_song_node(make_song_node("Love Me Harder"                                      ,"Ariana Grande"));
  add_song_node(make_song_node("Bohemian Rhapsody"                                   ,"Queen"));
  add_song_node(make_song_node("Together Forever"                                    ,"Rick Astley"));
  add_song_node(make_song_node("A Guy Walks into a Bar"                              ,"Tyler Farr"));
  add_song_node(make_song_node("One Man Can Change The World"                        ,"Big Sean"));
  add_song_node(make_song_node("Slammin' Mannequin"                                  ,"Starchild & The New Romantic"));
  add_song_node(make_song_node("You Spin Me Round"                                   ,"Jessica Simpson"));
  add_song_node(make_song_node("Dreamer"                                             ,"Europe"));
  add_song_node(make_song_node("Georgy Porgy"                                        ,"Toto"));
  add_song_node(make_song_node("Nostalgic"                                           ,"Kelly Clarkson"));
  add_song_node(make_song_node("Rock and Roll, Hoochie Koo"                          ,"Rick Derringer"));
  add_song_node(make_song_node("Eugene Onegin, Act III: \"Polonaise\""               ,"Leonard Slatkin"));
  add_song_node(make_song_node("Me & The Rhythm"                                     ,"Selena Gomez"));
  add_song_node(make_song_node("Calico"                                              ,"Widowspeak"));
  add_song_node(make_song_node("Lay Me Down In Dixie"                                ,"Johnny Cash"));
  add_song_node(make_song_node("Without the Love"                                    ,"Demi Lovato"));
  add_song_node(make_song_node("Down Home Boys"                                      ,"Cole Swindell"));
  add_song_node(make_song_node("The Violet Hour"                                     ,"The Civil Wars"));
  add_song_node(make_song_node("She's Not You"                                       ,"Elvis Presley"));
  add_song_node(make_song_node("Eye of the Needle"                                   ,"Sia"));
  add_song_node(make_song_node("Remember That"                                       ,"Jessica Simpson"));
  add_song_node(make_song_node("Dragonfly"                                           ,"Johnny Star"));
  add_song_node(make_song_node("Pamela"                                              ,"Toto"));
  add_song_node(make_song_node("Ordinary"                                            ,"The Alpine Treeline"));
  add_song_node(make_song_node("Shine On You Crazy Diamond"                          ,"Pink Floyd"));
  add_song_node(make_song_node("Any Way You Want It"                                 ,"Journey"));
  add_song_node(make_song_node("Camouflage"                                          ,"Selena Gomez"));
  add_song_node(make_song_node("Pushing Me Away"                                     ,"Linkin Park"));
  add_song_node(make_song_node("Never Been Hurt"                                     ,"Demi Lovato"));
  add_song_node(make_song_node("Nocturnes, Op. 9: No. 1 in B-Flat Minor"             ,"Arthur Rubinstein"));
  add_song_node(make_song_node("Sharp Dressed Man"                                   ,"ZZ Top"));
  add_song_node(make_song_node("This Is How We Do"                                   ,"Katy Perry"));
  add_song_node(make_song_node("International Smile"                                 ,"Katy Perry"));
  add_song_node(make_song_node("Adagio for Strings from the String Quartet, Op. 11"  ,"Leonard Bernstein"));
  add_song_node(make_song_node("Symphony No. 7 in A Major, Op. 92: II. Allegretto"   ,"Leonard Bernstein"));
  add_song_node(make_song_node("Hold the Line"                                       ,"Toto"));
  add_song_node(make_song_node("Resist and Bite"                                     ,"Sabaton"));
  add_song_node(make_song_node("Lotto"                                               ,"Charlie Wilson"));
  add_song_node(make_song_node("Royal Garden Blues"                                  ,"Count Basie & His All American Rhythm Section"));
  add_song_node(make_song_node("Neon Lights"                                         ,"Demi Lovato"));
  add_song_node(make_song_node("The Veldt"                                           ,"deadmau5"));
  add_song_node(make_song_node("Return to Sender"                                    ,"Elvis Presley"));
  add_song_node(make_song_node("Escape"                                              ,"Enrique Iglesias"));
  add_song_node(make_song_node("Good Luck Charm"                                     ,"Elvis Presley"));
  add_song_node(make_song_node("So Near, So Far"                                     ,"Miles Davis"));
  add_song_node(make_song_node("Good Goes The Bye"                                   ,"Kelly Clarkson"));
  add_song_node(make_song_node("My Sweet Summer"                                     ,"Dirty Heads"));
  add_song_node(make_song_node("Shouldn't Come Back"                                 ,"Demi Lovato"));
  add_song_node(make_song_node("Till the World Ends"                                 ,"Britney Spears"));
  add_song_node(make_song_node("Can't Fight This Feeling"                            ,"REO Speedwagon"));
  add_song_node(make_song_node("Fire Starter"                                        ,"Demi Lovato"));
  add_song_node(make_song_node("Rock And Roll Dreams Come Through"                   ,"Meat Loaf"));
  add_song_node(make_song_node("Beaten in Lips"                                      ,"Beartooth"));
  add_song_node(make_song_node("I Knew You Were Trouble"                             ,"Taylor Swift"));
  add_song_node(make_song_node("Concerto No. 21 in C Major, K. 467: Andante"         ,"Alicia De Larrocha"));
  add_song_node(make_song_node("Girl with the Red Balloon"                           ,"The Civil Wars"));
  add_song_node(make_song_node("Be With You"                                         ,"Enrique Iglesias"));
  add_song_node(make_song_node("Shine on Harvest Moon"                               ,"Count Basie, His Instrumentalists & His Rhythm"));
  add_song_node(make_song_node("Layla"                                               ,"Derek & The Dominos"));
  add_song_node(make_song_node("We Are Young"                                        ,"Fun."));
  add_song_node(make_song_node("Raspberry Beret"                                     ,"Prince & The Revolution"));
  add_song_node(make_song_node("Something That We're Not"                            ,"Demi Lovato"));
  add_song_node(make_song_node("Overdose"                                            ,"Little Daylight"));
  add_song_node(make_song_node("Hop up My Ladies"                                    ,"Elizabeth Mitchell"));
  add_song_node(make_song_node("Hotel California"                                    ,"Eagles"));
  add_song_node(make_song_node("The Final Countdown"                                 ,"Europe"));
  add_song_node(make_song_node("No Way Out"                                          ,"Bullet For My Valentine"));
  add_song_node(make_song_node("Love Story"                                          ,"Taylor Swift"));
  add_song_node(make_song_node("Clarinet Concerto in A Major, K. 622: Adagio"        ,"Richard Stoltzman"));
  add_song_node(make_song_node("There Might Be Coffee"                               ,"deadmau5"));
  add_song_node(make_song_node("Szymanowski"                                         ,"Volodja Balzalorsky"));
  add_song_node(make_song_node("These Boots Are Made for Walkin'"                    ,"Jessica Simpson"));
  add_song_node(make_song_node("You Want a Battle?"                                  ,"Bullet For My Valentine"));
  add_song_node(make_song_node("City That You Love"                                  ,"Aaron R. Smith"));
  add_song_node(make_song_node("No More Mr. Nice Guy"                                ,"Alice Cooper"));
  add_song_node(make_song_node("Yellow Ticket"                                       ,"Matthew Rodgers"));
  add_song_node(make_song_node("Symphony No. 40 in G Minor, K. 550: Molto Allegro"   ,"James Levine"));
  add_song_node(make_song_node("Who Needs Pictures"                                  ,"Brad Paisley"));
  add_song_node(make_song_node("When You Were Mine"                                  ,"Cyndi Lauper"));
  add_song_node(make_song_node("Underneath the Tree"                                 ,"Kelly Clarkson"));
  add_song_node(make_song_node("Survivors"                                           ,"Selena Gomez"));
  add_song_node(make_song_node("Poison"                                              ,"Alice Cooper"));
  add_song_node(make_song_node("Red Lights"                                          ,"Tiësto"));
  add_song_node(make_song_node("Pure Imagination"                                    ,"Josh Groban"));
  add_song_node(make_song_node("Dance The Night Away"                                ,"David Banner"));
  add_song_node(make_song_node("Holding Out For A Hero"                              ,"Ella Mae Bowen"));
  add_song_node(make_song_node("Can't Get Away from a Good Time"                     ,"Logan Mize"));
  add_song_node(make_song_node("We Never Said Goodbye"                               ,"Dionne Warwick"));
  add_song_node(make_song_node("4 Carats"                                            ,"Kelly Clarkson"));
  add_song_node(make_song_node("The Entertainer"                                     ,"Dick Hyman"));
  add_song_node(make_song_node("Hold It Against Me"                                  ,"Britney Spears"));
  add_song_node(make_song_node("Deja Vu"                                             ,"Dionne Warwick"));
  add_song_node(make_song_node("Crying In the Chapel"                                ,"Elvis Presley"));
  add_song_node(make_song_node("Bleeding Out"                                        ,"Imagine Dragons"));
  add_song_node(make_song_node("You Are My Sunshine"                                 ,"Norman Blake"));
  add_song_node(make_song_node("Hey Now"                                             ,"Cyndi Lauper"));
  add_song_node(make_song_node("Oogie Boogie's Song"                                 ,"Ken Page"));
  add_song_node(make_song_node("Far Side Banks of Jordan"                            ,"Johnny Cash"));
  add_song_node(make_song_node("Peer Gynt, Op. 23: Morning Mood"                     ,"Esa-Pekka Salonen"));
  add_song_node(make_song_node("When I Was Your Man"                                 ,"Bruno Mars"));
  add_song_node(make_song_node("Umbrella"                                            ,"Jean Rohe"));
  add_song_node(make_song_node("I'm Not Sorry"                                       ,"Celeste Buckingham"));
  add_song_node(make_song_node("Black Crow"                                          ,"Blackbird And The Storm"));
  add_song_node(make_song_node("Beyond the Veil"                                     ,"Lindsey Stirling"));
  add_song_node(make_song_node("Cherry Bomb"                                         ,"The Runaways"));
  add_song_node(make_song_node("Like A Boy"                                          ,"Ciara"));
  add_song_node(make_song_node("You're Still a Mystery"                              ,"Bleachers"));
  add_song_node(make_song_node("Crying in the Chapel"                                ,"Elvis Presley"));
  add_song_node(make_song_node("Imagine"                                             ,"John Lennon"));
  add_song_node(make_song_node("Down Home Country Blues"                             ,"Bradley West"));
  add_song_node(make_song_node("Superstition"                                        ,"Stevie Wonder"));
  add_song_node(make_song_node("The sound of silence"                                ,"Paul Simon and Art Garfunkel"));
  add_song_node(make_song_node("Tom's Diner"                                         ,"Suzanne Vega"));
  add_song_node(make_song_node("September"                                           ,"Earth, Wind & Fire"));
  add_song_node(make_song_node("Radioactive"                                         ,"Imagine Dragons"));
  add_song_node(make_song_node("Hallelujah"                                          ,"Jeff Buckley"));
  add_song_node(make_song_node("Thank You"                                           ,"Sly & The Family Stone"));
  add_song_node(make_song_node("Something About December"                            ,"Christina Perri"));
  add_song_node(make_song_node("Teenage Dream"                                       ,"Katy Perry"));
  add_song_node(make_song_node("The Hills"                                           ,"The Weeknd"));
  add_song_node(make_song_node("Ain't No Mountain High Enough"                       ,"Marvin Gaye"));
  add_song_node(make_song_node("Kommander's Car"                                     ,"Katy Carr"));
  add_song_node(make_song_node("This Is Halloween"                                   ,"Marilyn Manson"));
  add_song_node(make_song_node("In The Jailhouse Now"                                ,"Harley Allen"));
  add_song_node(make_song_node("Let Your Tears Fall"                                 ,"Kelly Clarkson"));
  add_song_node(make_song_node("No More Guns"                                        ,"Mr Benn"));
  add_song_node(make_song_node("Legendary Lovers"                                    ,"Katy Perry"));
  add_song_node(make_song_node("I Understand"                                        ,"Sophie Koh"));
  add_song_node(make_song_node("Raised by a Good Time"                               ,"Steven Lee Olsen"));
  add_song_node(make_song_node("We like to Party"                                    ,"Vengaboys"));
  add_song_node(make_song_node("Push It"                                             ,"Salt-N-Pepa"));
  add_song_node(make_song_node("Total Eclipse of the Heart"                          ,"Bonnie Tyler"));
  add_song_node(make_song_node("Loin d'ici"                                          ,"ZoË"));
  add_song_node(make_song_node("Fortunate Son"                                       ,"Creedence Clearwater Revival"));
  add_song_node(make_song_node("Can't Help Falling In Love"                          ,"Elvis Presley"));
  add_song_node(make_song_node("Ghost Town"                                          ,"Adam Lambert"));
  add_song_node(make_song_node("Mississippi Queen"                                   ,"Mountain"));
  add_song_node(make_song_node("Gimme Sympathy"                                      ,"Metric"));
  add_song_node(make_song_node("Stan"                                                ,"Eminem"));
  add_song_node(make_song_node("Come Together"                                       ,"Echosmith"));
  add_song_node(make_song_node("Like A Rose"                                         ,"Ashley Monroe"));
  add_song_node(make_song_node("Rock the Night"                                      ,"Europe"));
  add_song_node(make_song_node("(Don't Fear) The Reaper"                             ,"Blue Oyster Cult"));
  add_song_node(make_song_node("Crimson Wave"                                        ,"Tacocat"));
  add_song_node(make_song_node("I Don't Want To Lose Her"                            ,"Rick Astley"));
  add_song_node(make_song_node("Wonderful Things"                                    ,"Ryan Corn"));
  add_song_node(make_song_node("Raining Sunshine"                                    ,"Miranda Cosgrove"));
  add_song_node(make_song_node("Raindrops Keep Falling on My Head"                   ,"B.J. Thomas"));
  add_song_node(make_song_node("True Colors"                                         ,"Cyndi Lauper"));
  add_song_node(make_song_node("Santa's Got A Choo Choo Train"                       ,"Blake Shelton"));
  add_song_node(make_song_node("Hope You Get Lonely Tonight"                         ,"Cole Swindell"));
  add_song_node(make_song_node("Summertime"                                          ,"Miles Davis"));
  add_song_node(make_song_node("Fall"                                                ,"Miles Davis"));
  add_song_node(make_song_node("Cactus In the Valley"                                ,"Lights"));
  add_song_node(make_song_node("Never Gonna Give You Up"                             ,"Rick Astley"));
  add_song_node(make_song_node("I Can't Make You Love Me"                            ,"Bonnie Raitt"));
  add_song_node(make_song_node("Blue"                                                ,"Dance Fever"));
  add_song_node(make_song_node("Whip It"                                             ,"Devo"));
  add_song_node(make_song_node("Please Mr. Kennedy"                                  ,"Justin Timberlake"));
  add_song_node(make_song_node("Rockstar"                                            ,"A Great Big World"));
  add_song_node(make_song_node("Big Rock Candy Mountain"                             ,"Harry McClintock"));
  add_song_node(make_song_node("Roar"                                                ,"Katy Perry"));
  add_song_node(make_song_node("Luka"                                                ,"Suzanne Vega"));
  add_song_node(make_song_node("Do Lightbikes Run On Lightfuel?"                     ,"Josh Zimmerman"));
  add_song_node(make_song_node("Africa"                                              ,"Toto"));
  add_song_node(make_song_node("Demons"                                              ,"Imagine Dragons"));
  add_song_node(make_song_node("Stacy's Mom"                                         ,"Fountains Of Wayne"));
  add_song_node(make_song_node("Flare Gun"                                           ,"In Tall Buildings"));
  add_song_node(make_song_node("Go"                                                  ,"The Chemical Brothers"));
  add_song_node(make_song_node("Escape (The Piña Colada Song)"                       ,"Rupert Holmes"));
  add_song_node(make_song_node("One More Time"                                       ,"Daft Punk"));
  add_song_node(make_song_node("See You Again (feat. Charlie Puth)"                  ,"Wiz Khalifa"));
  add_song_node(make_song_node("Tip Of My Tongue"                                    ,"The Civil Wars"));
  add_song_node(make_song_node("Without Me"                                          ,"Eminem"));
  add_song_node(make_song_node("Time After Time"                                     ,"Cyndi Lauper"));
  add_song_node(make_song_node("Stronger (Explicit)"                                 ,"Kanye West"));
  add_song_node(make_song_node("Scarborough Fair / Canticle"                         ,"Simon & Garfunkel"));
  add_song_node(make_song_node("Piano Man"                                           ,"Billy Joel"));
  add_song_node(make_song_node("sweet home alabama"                                  ,"lynyrd skynyrd"));
  add_song_node(make_song_node("Do You Believe In Magic"                             ,"The Lovin' Spoonful"));

  printf("\n\n\n\n\nTake a look at all these songs!\n");
  print_library();

  printf("\n\n\n\n\nGreat, let's search for some songs.\n");
  printf("Good: %p\n", song_search("Whip It", "Devo"));
  printf("Good: %p\n", song_search("Santa's Got A Choo Choo Train", "Blake Shelton"));
  printf("Bad:  %p\n", song_search("not a title", "not an artist"));

  printf("\n\n\n\n\nHow about some artists?\n");
  printf("Good: %p\n", artist_search("Jeff Buckley"));
  printf("Good: %p\n", artist_search("Pink Floyd"));
  printf("Bad:  %p\n", artist_search("not an artist"));

  printf("\n\n\n\n\nGive me all the artists beginning with 'P'!\n");
  print_letter('P');

  printf("\n\n\n\n\nBut wait, does it work for 'p'?\n");
  print_letter('p');

  printf("\n\n\n\n\nAll the songs by a specific artist?\n");
  print_artists_songs("Rick Astley");
  print_artists_songs("Selena Gomez");
  print_artists_songs("not an artist");

  printf("\n\n\n\n\nPlay me 10 random songs.\n");
  shuffle(10);

  printf("\n\n\n\n\nLet's delete a few songs.\n");
  delete_song(song_search("One Man Can Change The World"                       ,"Big Sean"));
  delete_song(song_search("Slammin' Mannequin"                                 ,"Starchild & The New Romantic"));
  delete_song(song_search("You Spin Me Round"                                  ,"Jessica Simpson"));
  delete_song(song_search("Dreamer"                                            ,"Europe"));
  delete_song(song_search("Georgy Porgy"                                       ,"Toto"));
  delete_song(song_search("Nostalgic"                                          ,"Kelly Clarkson"));
  delete_song(song_search("Rock and Roll, Hoochie Koo"                         ,"Rick Derringer"));
  delete_song(song_search("Eugene Onegin, Act III: \"Polonaise\""              ,"Leonard Slatkin"));
  delete_song(song_search("Me & The Rhythm"                                    ,"Selena Gomez"));
  delete_song(song_search("Calico"                                             ,"Widowspeak"));
  delete_song(song_search("Lay Me Down In Dixie"                               ,"Johnny Cash"));
  delete_song(song_search("Without the Love"                                   ,"Demi Lovato"));
  delete_song(song_search("Down Home Boys"                                     ,"Cole Swindell"));
  delete_song(song_search("The Violet Hour"                                    ,"The Civil Wars"));
  delete_song(song_search("She's Not You"                                      ,"Elvis Presley"));
  delete_song(song_search("Eye of the Needle"                                  ,"Sia"));
  delete_song(song_search("Remember That"                                      ,"Jessica Simpson"));
  delete_song(song_search("Dragonfly"                                          ,"Johnny Star"));
  delete_song(song_search("Pamela"                                             ,"Toto"));
  delete_song(song_search("Ordinary"                                           ,"The Alpine Treeline"));
  delete_song(song_search("Shine On You Crazy Diamond"                         ,"Pink Floyd"));
  delete_song(song_search("Any Way You Want It"                                ,"Journey"));
  delete_song(song_search("Camouflage"                                         ,"Selena Gomez"));
  delete_song(song_search("Pushing Me Away"                                    ,"Linkin Park"));
  delete_song(song_search("Never Been Hurt"                                    ,"Demi Lovato"));
  delete_song(song_search("Nocturnes, Op. 9: No. 1 in B-Flat Minor"            ,"Arthur Rubinstein"));
  delete_song(song_search("Sharp Dressed Man"                                  ,"ZZ Top"));
  delete_song(song_search("This Is How We Do"                                  ,"Katy Perry"));
  delete_song(song_search("International Smile"                                ,"Katy Perry"));
  delete_song(song_search("Adagio for Strings from the String Quartet, Op. 11" ,"Leonard Bernstein"));
  delete_song(song_search("Symphony No. 7 in A Major, Op. 92: II. Allegretto"  ,"Leonard Bernstein"));
  delete_song(song_search("Hold the Line"                                      ,"Toto"));
  delete_song(song_search("Resist and Bite"                                    ,"Sabaton"));
  delete_song(song_search("Lotto"                                              ,"Charlie Wilson"));
  delete_song(song_search("Royal Garden Blues"                                 ,"Count Basie & His All American Rhythm Section"));
  delete_song(song_search("Neon Lights"                                        ,"Demi Lovato"));
  delete_song(song_search("The Veldt"                                          ,"deadmau5"));
  delete_song(song_search("Return to Sender"                                   ,"Elvis Presley"));
  delete_song(song_search("Escape"                                             ,"Enrique Iglesias"));
  delete_song(song_search("Good Luck Charm"                                    ,"Elvis Presley"));
  delete_song(song_search("So Near, So Far"                                    ,"Miles Davis"));
  delete_song(song_search("Good Goes The Bye"                                  ,"Kelly Clarkson"));
  delete_song(song_search("My Sweet Summer"                                    ,"Dirty Heads"));
  delete_song(song_search("Shouldn't Come Back"                                ,"Demi Lovato"));
  delete_song(song_search("Till the World Ends"                                ,"Britney Spears"));
  delete_song(song_search("Can't Fight This Feeling"                           ,"REO Speedwagon"));
  delete_song(song_search("Fire Starter"                                       ,"Demi Lovato"));
  delete_song(song_search("Rock And Roll Dreams Come Through"                  ,"Meat Loaf"));
  delete_song(song_search("Beaten in Lips"                                     ,"Beartooth"));
  delete_song(song_search("I Knew You Were Trouble"                            ,"Taylor Swift"));
  delete_song(song_search("Concerto No. 21 in C Major, K. 467: Andante"        ,"Alicia De Larrocha"));
  delete_song(song_search("Girl with the Red Balloon"                          ,"The Civil Wars"));
  delete_song(song_search("Be With You"                                        ,"Enrique Iglesias"));
  delete_song(song_search("Shine on Harvest Moon"                              ,"Count Basie, His Instrumentalists & His Rhythm"));
  delete_song(song_search("Layla"                                              ,"Derek & The Dominos"));
  delete_song(song_search("We Are Young"                                       ,"Fun."));
  delete_song(song_search("Raspberry Beret"                                    ,"Prince & The Revolution"));
  delete_song(song_search("Something That We're Not"                           ,"Demi Lovato"));
  delete_song(song_search("Overdose"                                           ,"Little Daylight"));
  delete_song(song_search("Hop up My Ladies"                                   ,"Elizabeth Mitchell"));
  delete_song(song_search("Hotel California"                                   ,"Eagles"));
  delete_song(song_search("The Final Countdown"                                ,"Europe"));
  delete_song(song_search("No Way Out"                                         ,"Bullet For My Valentine"));
  delete_song(song_search("Love Story"                                         ,"Taylor Swift"));
  delete_song(song_search("Clarinet Concerto in A Major, K. 622: Adagio"       ,"Richard Stoltzman"));
  delete_song(song_search("There Might Be Coffee"                              ,"deadmau5"));
  delete_song(song_search("Szymanowski"                                        ,"Volodja Balzalorsky"));
  delete_song(song_search("These Boots Are Made for Walkin'"                   ,"Jessica Simpson"));
  delete_song(song_search("You Want a Battle?"                                 ,"Bullet For My Valentine"));
  delete_song(song_search("City That You Love"                                 ,"Aaron R. Smith"));
  delete_song(song_search("No More Mr. Nice Guy"                               ,"Alice Cooper"));
  delete_song(song_search("Yellow Ticket"                                      ,"Matthew Rodgers"));
  delete_song(song_search("Symphony No. 40 in G Minor, K. 550: Molto Allegro"  ,"James Levine"));
  delete_song(song_search("Who Needs Pictures"                                 ,"Brad Paisley"));
  delete_song(song_search("When You Were Mine"                                 ,"Cyndi Lauper"));
  delete_song(song_search("Underneath the Tree"                                ,"Kelly Clarkson"));
  delete_song(song_search("Survivors"                                          ,"Selena Gomez"));
  delete_song(song_search("Poison"                                             ,"Alice Cooper"));
  delete_song(song_search("Red Lights"                                         ,"Tiësto"));
  delete_song(song_search("Pure Imagination"                                   ,"Josh Groban"));
  delete_song(song_search("Dance The Night Away"                               ,"David Banner"));
  delete_song(song_search("Holding Out For A Hero"                             ,"Ella Mae Bowen"));
  delete_song(song_search("Can't Get Away from a Good Time"                    ,"Logan Mize"));
  delete_song(song_search("We Never Said Goodbye"                              ,"Dionne Warwick"));
  delete_song(song_search("4 Carats"                                           ,"Kelly Clarkson"));
  delete_song(song_search("The Entertainer"                                    ,"Dick Hyman"));
  delete_song(song_search("Hold It Against Me"                                 ,"Britney Spears"));
  delete_song(song_search("Deja Vu"                                            ,"Dionne Warwick"));
  delete_song(song_search("Crying In the Chapel"                               ,"Elvis Presley"));
  delete_song(song_search("Bleeding Out"                                       ,"Imagine Dragons"));
  delete_song(song_search("You Are My Sunshine"                                ,"Norman Blake"));
  delete_song(song_search("Hey Now"                                            ,"Cyndi Lauper"));
  delete_song(song_search("Oogie Boogie's Song"                                ,"Ken Page"));
  delete_song(song_search("Far Side Banks of Jordan"                           ,"Johnny Cash"));
  delete_song(song_search("Peer Gynt, Op. 23: Morning Mood"                    ,"Esa-Pekka Salonen"));
  delete_song(song_search("When I Was Your Man"                                ,"Bruno Mars"));
  delete_song(song_search("Umbrella"                                           ,"Jean Rohe"));
  delete_song(song_search("I'm Not Sorry"                                      ,"Celeste Buckingham"));
  delete_song(song_search("Black Crow"                                         ,"Blackbird And The Storm"));
  delete_song(song_search("Beyond the Veil"                                    ,"Lindsey Stirling"));
  delete_song(song_search("Cherry Bomb"                                        ,"The Runaways"));
  delete_song(song_search("Like A Boy"                                         ,"Ciara"));
  delete_song(song_search("You're Still a Mystery"                             ,"Bleachers"));
  delete_song(song_search("Crying in the Chapel"                               ,"Elvis Presley"));
  delete_song(song_search("Imagine"                                            ,"John Lennon"));
  delete_song(song_search("Down Home Country Blues"                            ,"Bradley West"));
  delete_song(song_search("Superstition"                                       ,"Stevie Wonder"));
  delete_song(song_search("The sound of silence"                               ,"Paul Simon and Art Garfunkel"));
  delete_song(song_search("Tom's Diner"                                        ,"Suzanne Vega"));

  printf("\n\n\n\n\nThat was fun. Goodbye!\n");
  clear_all();
}


text:
(function(){
  var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
  // The base IClass implementation (does nothing)

  IClass = function(){};
  IClass.init = function(){
	if (this.className) {
	  	var className = this.className.replace(/\w+/g,function(word){
			return word.charAt(0).toUpperCase()+word.substr(1).toLowerCase();
		}).replace(/_|-/g,'');
		window[className] = this;
		var i;
	}
  }
  // Create a new IClass that inherits from this class
  IClass.extend = function(className, klass, proto) {
    if(typeof className != 'string'){
        proto = klass;
        klass = className;
        className = null;
    }
    if(!proto){
        proto = klass;
        klass = null;
    }
    var _super_class = this;
    var _super = this.prototype;
    // Instantiate a base class (but only create the instance,
    // don't run the init constructor)
    initializing = true;
    var prototype = new this();
    initializing = false;
    // Copy the properties over onto the new prototype
    for (var name in proto) {
      // Check if we're overwriting an existing function
      prototype[name] = typeof proto[name] == "function" &&
        typeof _super[name] == "function" && fnTest.test(proto[name]) ?
        (function(name, fn){
          return function() {
            var tmp = this._super;

            // Add a new ._super() method that is the same method
            // but on the super-class
            this._super = _super[name];

            // The method only need to be bound temporarily, so we
            // remove it when we're done executing
            var ret = fn.apply(this, arguments);
            this._super = tmp;

            return ret;
          };
        })(name, proto[name]) :
        proto[name];
    }
    // The dummy class constructor
    function IClass() {
      // All construction is actually done in the init method
      if ( !initializing && this.init )
        this.init.apply(this, arguments);
    }
    // Populate our constructed prototype object
    IClass.prototype = prototype;
    IClass.prototype.IClass = IClass;
    IClass.prototype.superclass = _super_class;
    // Enforce the constructor to be what we expect
    IClass.constructor = IClass;
    // And make this class extendable

    for(var name in this){
        if(this.hasOwnProperty(name) && name != 'prototype'){
            IClass[name] = this[name];
        }
    }

    for (var name in klass) {
      IClass[name] = typeof klass[name] == "function" &&
        typeof IClass[name] == "function" && fnTest.test(klass[name]) ?
        (function(name, fn){
          return function() {
            var tmp = this._super;
            this._super = _super_class[name];
            var ret = fn.apply(this, arguments);
            this._super = tmp;
            return ret;
          };
        })(name, klass[name]) :
        klass[name];
	};
    IClass.extend = arguments.callee;
    if(className) IClass.className = className;

    if(IClass.init) IClass.init(IClass);
    if(_super_class.extended) _super_class.extended(IClass)

    return IClass;
  };
})();

redpajama_set_name: RedPajamaGithub


text:
class InstallLtree < ActiveRecord::Migration
  def up
    execute('CREATE EXTENSION ltree')
  end

  def down
    execute('DROP EXTENSION ltree')
  end
end


text:
package org.custommonkey.xmlunit;

import java.io.File;

import junit.framework.TestCase;

import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;

/**
 * JUnit test for NodeDescriptor
 */
public class test_NodeDescriptor extends TestCase {
    private StringBuffer stringBuffer;
    private Document aDocument;
    private NodeDetail nodeDetail;

    public void testAppendDocumentDetail() throws Exception {
        nodeDetail = new NodeDetail("", aDocument, "/");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<" + NodeDescriptor.DOCUMENT_NODE_DESCRIPTION
                     + "<...>> at /", stringBuffer.toString());
    }

    public void testAppendAttributeDetail() throws Exception {
        String attrName = "attrName";
        String attrValue = "attrValue";
        Attr attr = aDocument.createAttribute(attrName);
        attr.setValue(attrValue);
        String tagName = "elemTag";
        Element element = aDocument.createElement(tagName);
        element.setAttributeNode(attr);
        nodeDetail = new NodeDetail("", attr, "/elemTag");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<" + tagName + " "
                     + attrName + "=\"" + attrValue + "\"...> at /elemTag", stringBuffer.toString());
    }

    public void testAppendElementDetail() throws Exception {
        String tagName = "elemTag";
        Element element = aDocument.createElement(tagName);
        nodeDetail = new NodeDetail("", element, "/elemTag");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<" + tagName + "...> at /elemTag", stringBuffer.toString());
    }

    public void testAppendTextDetail() throws Exception {
        String textString = "some text";
        Text text = aDocument.createTextNode(textString);
        String tagName = "elemTag";
        Element element = aDocument.createElement(tagName);
        element.appendChild(text);
        nodeDetail = new NodeDetail("", text, "/elemTag/text()");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<" + tagName + " ...>" + textString
                     + "</" + tagName + "> at /elemTag/text()", stringBuffer.toString());
    }

    public void testAppendProcessingInstructionDetail() throws Exception {
        String target = "PItarget";
        String data = "PIdata";
        Node processingInstruction = aDocument.createProcessingInstruction(target, data);
        nodeDetail = new NodeDetail("", processingInstruction, "/processing-instruction()");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<?" + target + " " + data + "?> at /processing-instruction()",
                     stringBuffer.toString());
    }

    public void testAppendCommentDetail() throws Exception {
        String comments = "This is a comment";
        Node comment = aDocument.createComment(comments);
        nodeDetail = new NodeDetail("", comment, "/comment()");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<!--" + comments + "--> at /comment()", stringBuffer.toString());
    }

    public void testAppendCDataDetail() throws Exception {
        String cData = "<>& etc";
        Node cDataNote = aDocument.createCDATASection(cData);
        nodeDetail = new NodeDetail("", cDataNote, "/text()");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals("<![CDATA[" + cData + "]]> at /text()", stringBuffer.toString());
    }

    public void testAppendDocTypeDetail() throws Exception {
        File dtdA = File.createTempFile(getName() + "A", "dtd");
        dtdA.deleteOnExit();
        String systemOnlyDTD = "<!DOCTYPE blah SYSTEM \"" + dtdA.toURL().toExternalForm() + "\">";
        String someContent = "<blah>ignored</blah>";
        String xmlWithExternalDTD = systemOnlyDTD + someContent;

        aDocument = XMLUnit.buildControlDocument(xmlWithExternalDTD);
        Node doctypeA = aDocument.getDoctype();
        nodeDetail = new NodeDetail("", doctypeA, "/");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals(systemOnlyDTD + " at /", stringBuffer.toString());

        stringBuffer = new StringBuffer();
        File dtdB = File.createTempFile(getName() + "B", "dtd");
        dtdB.deleteOnExit();
        String publicDTD = "<!DOCTYPE web-app "
            + "PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN\" "
            + "\"" + dtdB.toURL().toExternalForm() + "\">";
        String someOtherContent = "<web-app><!--ignore me--></web-app>";
        String xmlWithPublicDTD = publicDTD + someOtherContent;

        Document bDocument = XMLUnit.buildControlDocument(xmlWithPublicDTD);
        Node doctypeB = bDocument.getDoctype();
        nodeDetail = new NodeDetail("", doctypeB, "/");
        NodeDescriptor.appendNodeDetail(stringBuffer, nodeDetail);
        assertEquals(publicDTD + " at /", stringBuffer.toString());
    }

    public void setUp() throws Exception {
        aDocument = XMLUnit.newControlParser().newDocument();
        stringBuffer = new StringBuffer();
    }

    /**
     * Constructor for test_NodeDescriptor.
     * @param name
     */
    public test_NodeDescriptor(String name) {
        super(name);
    }

}


text:
package org.craftedsw.tripservicekata;

import java.util.ArrayList;
import java.util.List;

import org.craftedsw.tripservicekata.exception.UserNotLoggedInException;
import org.craftedsw.tripservicekata.trip.Trip;
import org.craftedsw.tripservicekata.trip.TripDAO;
import org.craftedsw.tripservicekata.user.User;
import org.craftedsw.tripservicekata.user.UserSession;

public class TripService_Original {

	public List<Trip> getTripsByUser(User user) throws UserNotLoggedInException {
		List<Trip> tripList = new ArrayList<Trip>();
		User loggedUser = UserSession.getInstance().getLoggedUser();
		boolean isFriend = false;
		if (loggedUser != null) {
			for (User friend : user.getFriends()) {
				if (friend.equals(loggedUser)) {
					isFriend = true;
					break;
				}
			}
			if (isFriend) {
				tripList = TripDAO.findTripsByUser(user);
			}
			return tripList;
		} else {
			throw new UserNotLoggedInException();
		}
	}

}


text:
<?php
namespace Bunny\Protocol;

use Bunny\Constants;

class MethodQueueDeleteOkFrame extends MethodFrame
{

    /** @var int */
    public $messageCount;

    public function __construct()
    {
        parent::__construct(Constants::CLASS_QUEUE, Constants::METHOD_QUEUE_DELETE_OK);
    }

}


text:
Client
======

Prerequisites
-------------

Install PlatformIO Core by following [the
instructions](https://docs.platformio.org/en/latest//core/installation.html).
This will take care of downloading everything else.

Configuration
-------------

You need to create a directory `data/` and copy the file
`config/prikmeter.example.json` to `data/prikmeter.json`, then edit it
according to your settings (WiFi network name and password, server hostname and
certificate, and your account's authentication token). Remove the comments.

To get your server's certificate fingerprint, a command like this might be
useful:

    $ true | openssl s_client -connect upload.your-prikmeter-server.example.com:443 \
           | openssl x509 -noout -fingerprint

Upload the configuration to the device:

    $ pio run -t uploadfs

Building and running
--------------------

Use `pio` to drive the build and upload process, using the commands from
[PlatformIO](https://docs.platformio.org/en/latest//core/userguide/index.html);
type `pio -h` to get the full list. The commonly used ones:

    $ pio check           # run cppcheck static analysis
    $ pio run             # build
    $ pio run -t upload   # build and upload
    $ pio device monitor  # monitor serial output
    $ pio run -t clean    # remove build outputs

Unit testing
------------

To run unit tests on the local machine (needs GCC):

    $ pio test -t native

Debugging
---------

For debugging and testing without an actual smart meter connected, the
following arguments can be added to the `pio` command line:

* `READ_FROM_SERIAL=1` reads the telegram input from the serial port, instead
  of the P1 port.
* `PRINT_TELEGRAM=1` prints telegram bytes verbatim to the serial port (among
  the other debugging info).
* `DONT_SEND_TELEGRAM=1` skips uploading the telegram.


text:
using System.Data;
using NUnit.Framework;

namespace SequelocityDotNet.Tests.SqlServer.DatabaseCommandExtensionsTests
{
    [TestFixture]
    public class ExecuteToObjectTests
    {
        public class SuperHero
        {
            public long SuperHeroId;
            public string SuperHeroName;
        }

        [Test]
        public void Should_Return_A_Type_Of_T()
        {
            // Arrange
            const string sql = @"
CREATE TABLE #SuperHero
(
    SuperHeroId     INT             NOT NULL    IDENTITY(1,1)   PRIMARY KEY,
    SuperHeroName	NVARCHAR(120)   NOT NULL
);

INSERT INTO #SuperHero ( SuperHeroName )
VALUES ( 'Superman' );

INSERT INTO #SuperHero ( SuperHeroName )
VALUES ( 'Batman' );

SELECT  SuperHeroId,
        SuperHeroName
FROM    #SuperHero;
";

            // Act
            var superHero = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString )
                .SetCommandText( sql )
                .ExecuteToObject<SuperHero>();

            // Assert
            Assert.NotNull( superHero );
            Assert.That( superHero.SuperHeroId == 1 );
            Assert.That( superHero.SuperHeroName == "Superman" );
        }

        [Test]
        public void Should_Null_The_DbCommand_By_Default()
        {
            // Arrange
            const string sql = @"
CREATE TABLE #SuperHero
(
    SuperHeroId     INT             NOT NULL    IDENTITY(1,1)   PRIMARY KEY,
    SuperHeroName	NVARCHAR(120)   NOT NULL
);

INSERT INTO #SuperHero ( SuperHeroName )
VALUES ( 'Superman' );

INSERT INTO #SuperHero ( SuperHeroName )
VALUES ( 'Batman' );

SELECT  SuperHeroId,
        SuperHeroName
FROM    #SuperHero;
";
            var databaseCommand = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString )
                .SetCommandText( sql );

            // Act
            databaseCommand.ExecuteToObject<SuperHero>();

            // Assert
            Assert.IsNull( databaseCommand.DbCommand );
        }

        [Test]
        public void Should_Keep_The_Database_Connection_Open_If_keepConnectionOpen_Parameter_Was_True()
        {
            // Arrange
            const string sql = @"
CREATE TABLE #SuperHero
(
    SuperHeroId     INT             NOT NULL    IDENTITY(1,1)   PRIMARY KEY,
    SuperHeroName	NVARCHAR(120)   NOT NULL
);

INSERT INTO #SuperHero ( SuperHeroName )
VALUES ( 'Superman' );

INSERT INTO #SuperHero ( SuperHeroName )
VALUES ( 'Batman' );

SELECT  SuperHeroId,
        SuperHeroName
FROM    #SuperHero;
";
            var databaseCommand = Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString )
                .SetCommandText( sql );

            // Act
            databaseCommand.ExecuteToObject<SuperHero>( true );

            // Assert
            Assert.That( databaseCommand.DbCommand.Connection.State == ConnectionState.Open );

            // Cleanup
            databaseCommand.Dispose();
        }

        [Test]
        public void Should_Call_The_DatabaseCommandPreExecuteEventHandler()
        {
            // Arrange
            bool wasPreExecuteEventHandlerCalled = false;

            Sequelocity.ConfigurationSettings.EventHandlers.DatabaseCommandPreExecuteEventHandlers.Add( command => wasPreExecuteEventHandlerCalled = true );

            // Act
            Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString )
                .SetCommandText( "SELECT 1 as SuperHeroId, 'Superman' as SuperHeroName" )
                .ExecuteToObject<SuperHero>();

            // Assert
            Assert.IsTrue( wasPreExecuteEventHandlerCalled );
        }

        [Test]
        public void Should_Call_The_DatabaseCommandPostExecuteEventHandler()
        {
            // Arrange
            bool wasPostExecuteEventHandlerCalled = false;

            Sequelocity.ConfigurationSettings.EventHandlers.DatabaseCommandPostExecuteEventHandlers.Add( command => wasPostExecuteEventHandlerCalled = true );

            // Act
            Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString )
                .SetCommandText( "SELECT 1 as SuperHeroId, 'Superman' as SuperHeroName" )
                .ExecuteToObject<SuperHero>();

            // Assert
            Assert.IsTrue( wasPostExecuteEventHandlerCalled );
        }

        [Test]
        public void Should_Call_The_DatabaseCommandUnhandledExceptionEventHandler()
        {
            // Arrange
            bool wasUnhandledExceptionEventHandlerCalled = false;

            Sequelocity.ConfigurationSettings.EventHandlers.DatabaseCommandUnhandledExceptionEventHandlers.Add( ( exception, command ) =>
            {
                wasUnhandledExceptionEventHandlerCalled = true;
            } );

            // Act
            TestDelegate action = () => Sequelocity.GetDatabaseCommand( ConnectionStringsNames.SqlServerConnectionString )
                .SetCommandText( "asdf;lkj" )
                .ExecuteToObject<SuperHero>();

            // Assert
            Assert.Throws<System.Data.SqlClient.SqlException>( action );
            Assert.IsTrue( wasUnhandledExceptionEventHandlerCalled );
        }
    }
}


text:
Rundeck Cookbook
================

This is a Chef cookbook to install [Rundeck](http://rundeck.org/), an
orchestration and administration tool.

Quick Start
-----------

The fastest way to get started is to set the following node attributes:

* `node['rundeck']['cli_password']` – Password for CLI tools user.
* `node['rundeck']['admin_password']` – Password for default admin user.
* `node['rundeck']['ssh_key']` – SSH private key to log in to target servers.

Then add the following to your node's run list:

* `recipe[rundeck]`

**WARNING**: This type of setup is dangerously insecure if you are using
chef-server/client. See the [Recipes section](#default) for more information
about using the default recipe. See the [Example section](#example) for an
alternative usage that is more secure.

Requirements
------------

### Cookbooks

The following cookbooks are required:

* apt
* java
* poise
* runit
* yum

### OS

The following platforms are supported and tested:

* Ubuntu 12.04
* CentOS 6.5

### Chef

This cookbook requires Chef 11 or higher.

Attributes
----------

* `node['rundeck']['version']` – Version of Rundeck to install. *(default: latest)*
* `node['rundeck']['launcher_url']` – Download URL if using the JAR launcher installation method. *(default: https://s3.amazonaws.com/download.rundeck.org/jar/rundeck-launcher-%{version}.jar)*
* `node['rundeck']['path']` – Base path for Rundeck data. *(default: /var/lib/rundeck)*
* `node['rundeck']['config_path']` – Path for Rundeck configuration. *(default: /etc/rundeck)*
* `node['rundeck']['log_path']` – Path for Rundeck log files. *(default: /var/log/rundeck)*
* `node['rundeck']['user']` – User to run Rundeck as. *(default: rundeck)*
* `node['rundeck']['group']` – Group to run Rundeck as. *(default: rundeck)*
* `node['rundeck']['jvm_options']` – Extra options to pass to the JVM.
* `node['rundeck']['node_name']` – Name for the initial Rundeck node. *(default: node.name)*
* `node['rundeck']['port']` – HTTP port for Rundeck. *(default: 4440)*
* `node['rundeck']['public_rss']` – Enable unauthenticated access to RSS feeds. *(default: false)*
* `node['rundeck']['logging_level']` – Default logging level for jobs. *(default: INFO)*
* `node['rundeck']['ssh_user']` – Username Rundeck will SSH to remote servers as. *(default: rundeck)*

### Email settings

* `node['rundeck']['email']['hostname']` – SMTP hostname. *(default: localhost)*
* `node['rundeck']['email']['port']` – SMTP port. *(default: 25)*
* `node['rundeck']['email']['username']` – SMTP username.
* `node['rundeck']['email']['password']` – SMTP password.

### Proxy settings

These settings are used to customize how Rundeck generates links. This is useful
both if you have a DNS name for your Rundeck server and if you are using some
kind of reverse proxy server.

* `node['rundeck']['external_hostname']` – Hostname to use when creating links. *(default: localhost)*
* `node['rundeck']['external_port']` – Port to use when creating links. *(default: node['rundeck']['port'])*
* `node['rundeck']['external_scheme']` – Scheme to use when creating links. Set to HTTPS if you are using a TLS proxy. *(default: http)*

### Insecure settings

Three attributes are provided to set passwords/keys for the default recipe. As
mentioned above, using these can be insecure with chef-server as all node
attributes are visible to all nodes and users in Chef. It is highly recommended
you do not use these, as a wrapper cookbook with a better secrets store is much
safer:

* `node['rundeck']['cli_password']` – CLI user password. *(default: password)*
* `node['rundeck']['admin_password']` – Default admin user password.
* `node['rundeck']['ssh_key']` – SSH private key.

Recipes
-------

### default

The default recipe (`recipe[rundeck]`) installs and configures a Rundeck server
and optionally creates a single admin user. As noted above, you are highly
encouraged to not use this recipe directly, in favor of making a wrapper
cookbook and using the underlying resources yourself. This is because the recipe
is configured using node attributes, and in a chef-server/client setup this is
insecure. If you are using chef-solo, this recipe is believed to be safe at this
time.

To use the recipe, `node['rundeck']['cli_password']` and
`node['rundeck']['ssh_key']` are required. `node['rundeck']['admin_password']`
is optional, if present an admin user named `admin` will be created with the
provided password.

Resources
---------

### rundeck

The `rundeck` resource installs and configures a Rundeck server.

```ruby
rundeck 'name' do
  version '2.1.1'
  port 8080
  cli_password 'password'
  ssh_key '-----BEGIN RSA PRIVATE KEY-----...'
end
```

#### Core attributes

* `node_name` – Name of the Rundeck server node. *(name_attribute)*
* `version` – Version of Rundeck to install. *(default: node['rundeck']['version'])*
* `launcher_url` – Download URL if using the JAR launcher installation method. *(default: node['rundeck']['launcher_url'])*
* `service_name` – Runit service name. Must be unique on the system. *(default: rundeck)*

##### Path attributes

* `path` – Base path for Rundeck data. *(default: node['rundeck']['path'])*
* `config_path` – Path for Rundeck configuration. *(default: node['rundeck']['config_path'])*
* `log_path` – Path for Rundeck log files. *(default: node['rundeck']['log_path'])*

##### Template attributes

* `log4j_config` – Template for log4j.properties. *([template](https://github.com/poise/poise#template-content), default_source: log4j.properties.erb)*
* `jaas_config` – Template for jaas-loginmodule.conf. *([template](https://github.com/poise/poise#template-content), default_source: jaas-loginmodule.conf.erb)*
* `profile_config` – Template for bash profile config. *([template](https://github.com/poise/poise#template-content), default_source: profile.erb)*
* `framework_config` – Template for framework.properties. *([template](https://github.com/poise/poise#template-content), default_source: framework.properties.erb)*
* `rundeck_config` – Template for rundeck-config.properties. *([template](https://github.com/poise/poise#template-content), default_source: rundeck-config.properties.erb)*
* `realm_config` – Template for realm.properties. *([template](https://github.com/poise/poise#template-content), default_source: realm.properties.erb)*
* `enable_default_acls` – Enable default ACLs for admin and cli groups. *(default: true)*

##### Configuration attributes

* `user` – User to run Rundeck as. *(default: node['rundeck']['user'])*
* `group` – Group to run Rundeck as. *(default: node['rundeck']['group'])*
* `jvm_options` – Extra options to pass to the JVM. *(default: node['rundeck']['jvm_options'])*
* `port` – HTTP port for Rundeck. *(default: node['rundeck']['port'])*
* `public_rss` – Enable unauthenticated access to RSS feeds. *(default: node['rundeck']['public_rss'])*
* `logging_level` – Default logging level for jobs. *(default: node['rundeck']['logging_level'])*
* `external_host` – Hostname to use when creating links. *(default: node['rundeck']['external_host'])*
* `external_port` – Port to use when creating links. *(default: node['rundeck']['external_port'])*
* `external_scheme` – Scheme to use when creating links. Set to HTTPS if you are using a TLS proxy. *(default: node['rundeck']['external_scheme'])*
* `email` – Email settings. *(default: node['rundeck']['email'])*

##### CLI attributes

* `cli_user` – Username for Rundeck CLI tools. *(default: cli)*
* `cli_password` – Password for Rundeck CLI tools. *(required, unless cli_user is false)*
* `create_cli_user` – Create Rundeck user for CLI tools. *(default: true)*

##### SSH attributes

* `ssh_user` – Username Rundeck will SSH to remote servers as. *(default: node['rundeck']['ssh_user'])*
* `ssh_key` – SSH key Rundeck will SSH to remote servers with.

#### Providers

##### Chef::Provider::Rundeck::Apt

If you are on a Debian-family platform, by default Rundeck will be installed
from the official Apt repository.

##### Chef::Provider::Rundeck:Yum

If you are on a RHEL-family platform, by default Rundeck will be installed
from the official Yum repository.

##### Chef::Provider::Rundeck

If you are on neither of the above, Rundeck will be installed using the JAR
launcher. In this case, the `version` attribute is required as there is no
way to determine what version is the latest. You can force either of the above
platforms to install using the JAR launcher by manually setting the provider:

```ruby
rundeck 'name'
  provider :rundeck
  ...
end
```

### rundeck_project

The `rundeck_project` resource creates a Rundeck project. It is a subresource
of `rundeck`.

```ruby
rundeck_project 'name' do
  executor 'stub'
  file_copier 'stub'
end
```

* `project_name` – Name of the project. *(name_attribute)*
* `''` – Project template. *([template](https://github.com/poise/poise#template-content), default_source: project.properties.erb)*
* `ssh_authentication` – SSH authentication mode. One of: `privateKey`, `password`. *(default: privateKey)*
* `ssh_key` – SSH key Rundeck will SSH to remote servers with. *(deafault: parent.path/.ssh/id_rsa)*
* `executor` – Execution mode. One of: `jsch-ssh`, `stub`. *(default: jsch-ssh)*
* `file_copier` – File copier mode. One of: `jsch-scp`, `stub`. *(default: jsch-scp)*

### rundeck_node_source_file

The `rundeck_node_source_file` creates a node catalog file for a Rundeck project.
It is a subresource of `rundeck_project`.

```ruby
rundeck_node_source_file 'name' do
  query 'chef_environment:prod AND tags:enabled'
end
```

* `''` – Source properties template. *([template](https://github.com/poise/poise#template-content), default_source: source_file.properties.erb)*
* `resources_xml` – Node catalog template. *([template](https://github.com/poise/poise#template-content), default_source: resources.xml.erb)*
* `query` – Chef search query to generate node catalog. *(default: chef_environment:node.chef_environment)*
* `ssh_user` – Username Rundeck will SSH to remote servers as. *(default: parent.parent.ssh_user)*

### rundeck_job

The `rundeck_job` resource creates a Rundeck job. It is a subresource of
`rundeck_project`.

```ruby
rundeck_job 'name' do
  source 'job.yml.erb'
end
```

* `job_name` – Name of the job. *(name_attribute)*
* `format` – Job format. One of: `xml`, `yaml`. *(default: yaml)*
* `''` – Job template. *([template](https://github.com/poise/poise#template-content), required)*

**NOTE**: XML format support not currently available.

### rundeck_user

The `rundeck_user` resource creates a Rundeck user. These are used to authenticate
to the Rundeck web interface and API. It is a subresource of `rundeck`.

```ruby
rundeck_user 'name' do
  password 'whatmeworry'
end
```

* `username` – User name. *(name_attribute)*
* `password` – Password data. See below for more information. *(required)*
* `format` – Password format. See below for more information. One of: `md5`, `crypt`, `plain`. *(default: md5)*
* `roles` – Array of roles to add the user to.

Thee modes are available for password obfuscation: unsalted MD5, crypt, and
plain text. If you use `format 'md5'` or `format 'crypt'`, you should pass
`password` in plain text and the resource will obfuscate the password before
writing to the file. The recommended way to handle passwords is to MD5-hash
the password yourself and use the `plain` format like so:

```ruby
rundeck_user 'name' do
  format 'plain'
  password 'MD5:'+hash
end
```

You are highly encouraged to store the hash just like you would a password, as
unsalted MD5 is trivially crackable in most cases. [The citadel cookbook](https://github.com/balanced-cookbooks/citadel)
and [chef-vault](https://github.com/Nordstrom/chef-vault) are both good options
for secure storage. Even with this, do not use the same password as you do for
other websites.

### rundeck_acl

The `rundeck_acl` resource creates an ACL configuration for Rundeck. It is a
subresource of `rundeck`.

```ruby
rundeck_acl 'name' do
  source 'myacl.erb'
end
```

* `acl_name` – ACL name. *(name_attribute)*
* `''` – ACL template. *([template](https://github.com/poise/poise#template-content), required)*

Example
-------

An example of a small wrapper cookbook. All you need is three files, the cookbook
metadata, a recipe, and a template for the job.

### metadata.rb

```ruby
name 'mycompany-rundeck'
version '1.0.0'
depends 'rundeck'
depends 'citadel'
```

### recipes/default.rb

```ruby
# Install Rundeck
rundeck node['rundeck']['node_name'] do
  cli_password citadel['rundeck/cli_password']
  ssh_key citadel['deploy_key/deploy.pem']
end

# Create an admin user for ourselves
rundeck_user 'asmithee' do
  format 'plain'
  password 'MD5:'+citadel['rundeck/asmithee_password']
  roles %w{admin user}
end

# Create a project for general purpose jobs
rundeck_project 'mycompany' do
  # Create a node source using all Chef nodes in the same environment
  rundeck_node_source_file 'mycompany'

  # Create a job from a template file
  rundeck_job 'deploy' do
    source 'deploy.yml.erb'
  end

  # Create more jobs here as needed ...
end
```

### templates/default/deploy.yml.erb

```yaml
- loglevel: INFO
  sequence:
    keepgoing: false
    strategy: node-first
    commands:
    - exec: cd /srv/myapp && make deploy
```

See [the Rundeck documentation](http://rundeck.org/docs/man5/job-yaml.html) for
more information about the required data and format for jobs.

License
-------

Copyright 2013-2014, Panagiotis Papadomitsos

Copyright 2014, Balanced, Inc.

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

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

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


text:
using NFixtureFactory.Functions;
using NFixtureFactory.Util;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;

namespace NFixtureFactory
{
	public class TemplateHolder<TType>
	{

		private readonly IDictionary<String, Rule> _rules = new Dictionary<String, Rule>();

		public Type Clazz{ get; private set;}
        public String _label;

		public IDictionary<String,Rule> Rules
		{
			get{ return new Dictionary<String, Rule>(_rules); }
		}

		public TemplateHolder ()
		{
			Clazz = typeof(TType);
		}

        public TemplateHolder<TType> AddTemplate(String label)
        {
            if (_rules.Keys.Contains(label))
                throw new ApplicationException(Resources.EXCEPTION_MESSAGE_EXIST_RULE_LABEL);

            _rules.Add(label, new Rule());
            _label = label;
            return this;
        }

		public TemplateHolder<TType> AddTemplate(String label, Rule rule) {
			if (_rules.Keys.Contains (label))
				throw new ApplicationException (Resources.EXCEPTION_MESSAGE_EXIST_RULE_LABEL);

			_rules.Add(label, rule);
			return this;
		}

        public TemplateHolder<TType> ForMember(Expression<Func<TType, Object>> destinationMember, Object value)
        {
            MemberInfo property = ReflectionUtils.FindProperty(destinationMember);
            _rules[_label].Add(property.Name, value);
            return this;
        }

        public TemplateHolder<TType> ForMember(Expression<Func<TType, Object>> destinationMember, IFunction function)
        {
            MemberInfo property = ReflectionUtils.FindProperty(destinationMember);
            _rules[_label].Add(property.Name, function);
            return this;
        }

		public Rule GetRule(String label)
		{
			return _rules.ContainsKey(label) ? _rules [label] : null;
		}
	}
}


text:
(function () {
    'use strict';

    angular
        .module('wfApp.directives')
        .directive('wfLoading', Loading);

    function Loading() {
        return {
            restrict: 'A',
            link: (scope, elem) => {
                elem.parent().append('');
                elem.addClass('ng-hide');

                elem.on('load', () => {
                    elem.parent().find('i').remove();
                    elem.removeClass('ng-hide');
                });

                elem.on('error', () => {
                    console.log('Error loading image');
                    elem.parent().find('i').remove();
                    elem.parent().append('');
                });
            }
        };
    }

})();


text:
make_config('mysql-pdns-user', 'pdns')

mysql_pdns_password = get_config('password', 'mysql-pdns', 'os')
if mysql_pdns_password.nil?
  mysql_pdns_password = secure_password
end

pdns_admins = (get_head_node_names + [get_bootstrap] + ['admin']).join(',')

chef_vault_secret "mysql-pdns" do
  data_bag 'os'
  raw_data({ 'password' => mysql_pdns_password })
  admins pdns_admins
  search '*:*'
  action :nothing
end.run_action(:create_if_missing)

subnet = node[:bcpc][:management][:subnet]
raise "Did not get a subnet" if not subnet

if node[:bcpc][:management][:vip] and get_nodes_for("mysql").length() > 0

  allnodes = Array.new
  get_all_nodes.each do |nodeobj|
    tempHash = Hash.new
    tempHash['hostname'] = nodeobj.hostname
    tempHash['management_ip'] = nodeobj.bcpc.management.ip
    tempHash['storage_ip'] = nodeobj.bcpc.storage.ip
    tempHash['floating_ip'] = nodeobj.bcpc.floating.ip
    allnodes.push(tempHash)
  end

  if !node[:bcpc][:management][:viphost].nil?
    tempHash = Hash.new
    tempHash['hostname'] = node[:bcpc][:management][:viphost].split('.')[0]
    tempHash['management_ip'] = node[:bcpc][:management][:vip]
    tempHash['floating_ip'] =  node[:bcpc][:floating][:vip]
    tempHash['storage_ip'] =  node[:bcpc][:management][:vip]
    allnodes.push(tempHash)
  end

  node.default['pdns']['authoritative']['package']['backends'] = ['gmysql']
  node.default['pdns']['authoritative']['config']['disable_axfr'] = false
  node.default['pdns']['authoritative']['config']['launch'] = 'gmysql'

  node.default['pdns']['authoritative']['gmysql'].tap do |config|
    config['gmysql-host'] = node[:bcpc][:management][:vip]
    config['gmysql-port'] = 3306
    config['gmysql-user'] = get_config!('mysql-pdns-user')
    config['gmysql-password'] = get_config!('password', 'mysql-pdns', 'os')
    config['gmysql-dbname'] = node['bcpc']['pdns_dbname']
    config['gmysql-dnssec'] = 'no'
  end

  include_recipe 'bcpc::mysql_client'

  mysql_connection_info = lambda do
    {
     :host => node['pdns']['authoritative']['gmysql']['gmysql-host'],
     :port => node['pdns']['authoritative']['gmysql']['gmysql-port'],
     :username => 'root',
     :password => get_config!('password','mysql-root','os')
    }
  end

  mysql_database node['bcpc']['pdns_dbname'] do
    connection lazy { mysql_connection_info.call }
    notifies :run, 'execute[install-pdns-schema]', :immediately
  end

  mysql_database_user get_config!('mysql-pdns-user') do
    connection lazy { mysql_connection_info.call }
    password get_config!('password', 'mysql-pdns', 'os')
    action :create
    notifies :reload, 'service[pdns]'
  end

  mysql_database_user get_config!('mysql-pdns-user') do
    connection lazy { mysql_connection_info.call }
    database_name node['bcpc']['pdns_dbname']
    host '%'
    privileges [:all]
    action :grant
    notifies :reload, 'service[pdns]'
  end

  include_recipe 'pdns::authoritative_package'
  delete_resource(:gem_package, 'mysql2')
  delete_resource(:gem_package, 'sequel')

  #
  # This schema file works great when installed via the mysql CLI, but
  # it fails when Ruby reads it and feeds via a query resource.  This
  # smells like an escaping problem.
  #
  # For now, the query resource has been replaced with an 'execute'
  # resource that invokes the mysql CLI.
  #
  schema_path = '/usr/share/dbconfig-common/data/pdns-backend-mysql/install/mysql'

  mysql_command_string = lambda do
    "/usr/bin/mysql -u root " +
      "--host=#{node['pdns']['authoritative']['config']['gmysql-host']} " +
      "--password='#{get_config!('password','mysql-root','os')}' pdns"
  end

  execute 'install-pdns-schema' do
    command lazy {
      "cat #{schema_path} | " +
      "perl -nle 's/type=Inno/engine=Inno/g; print' | " +
      mysql_command_string.call
    }
    not_if {
      c = Mixlib::ShellOut.new('echo "select id from domains limit 1;" | ' +
                               mysql_command_string.call)
      c.run_command
      c.status.success?
    }
    sensitive true if respond_to?(:sensitive)
    notifies :reload, 'service[pdns]'
  end

end

node.default['pdns']['authoritative']['config']['recursor'] =
  node[:bcpc][:dns_servers][0]

node.default['pdns']['authoritative']['config']['local_address'] = [ node[:bcpc][:floating][:vip] , node[:bcpc][:management][:vip] ]

include_recipe 'pdns::authoritative_package'

reverse_dns_zone = node['bcpc']['networks'][subnet]['floating']['reverse_dns_zone'] || calc_reverse_dns_zone(node['bcpc']['networks'][subnet]['floating']['cidr'])

Chef::Log.info("Reverse DNS zone: #{reverse_dns_zone}")

pdns_domain node[:bcpc][:domain_name] do
  soa_ip node[:bcpc][:floating][:vip]
end

pdns_domain reverse_dns_zone  do
  soa_ip node[:bcpc][:floating][:vip]
end

domain_name = node[:bcpc][:domain_name]
allnodes.each do |server|
  management_ip = server['management_ip']
  floating_ip = server['floating_ip']
  storage_ip = server['storage_ip']
  hostname = server['hostname']

  ruby_block "create-dns-entry-#{hostname}" do
    block do
      # check if we have a float address
      if management_ip != floating_ip then
        float_name = float_host(hostname) + '.' + domain_name

        fwdR = Chef::Resource::PdnsRecord.new(float_name, run_context)
        fwdR.domain(domain_name)
        fwdR.content(floating_ip)
        fwdR.type('A')
        fwdR.ttl(300)
        fwdR.run_action(:create)

        # Create reverse record
        revR = Chef::Resource::PdnsRecord.new(calc_reverse_ip_address(floating_ip),
                                           run_context)
        revR.domain(reverse_dns_zone)
        revR.content(float_name)
        revR.type('PTR')
        revR.ttl(300)
        revR.run_action(:create)
      end

      # check if we have a storage address
      if management_ip != storage_ip then
        storage_name =
          storage_host(hostname) + '.' + domain_name

        fwdR = Chef::Resource::PdnsRecord.new(storage_name, run_context)

        fwdR.domain(domain_name)
        fwdR.content(storage_ip)
        fwdR.type('A')
        fwdR.ttl(300)
        fwdR.run_action(:create)

        # Create reverse record
        revR = Chef::Resource::PdnsRecord.new(calc_reverse_ip_address(storage_ip),
                                           run_context)
        revR.domain(reverse_dns_zone)
        revR.content(storage_name)
        revR.type('PTR')
        revR.ttl(300)
        revR.run_action(:create)
      end

      if management_ip
        # add a record for the management IP
        management_name = hostname + '.' + domain_name
        fwdR = Chef::Resource::PdnsRecord.new(management_name, run_context)
        fwdR.domain(domain_name)
        fwdR.content(management_ip)
        fwdR.type('A')
        fwdR.ttl(300)
        fwdR.run_action(:create)

        # Create reverse record
        revR = Chef::Resource::PdnsRecord.new(calc_reverse_ip_address(management_ip),
                                           run_context)
        revR.domain(reverse_dns_zone)
        revR.content(management_name)
        revR.type('PTR')
        revR.ttl(300)
        revR.run_action(:create)
      else
        Chef::Log.warn("No IP address found for host #{hostname}!")
      end
    end
  end
end


text:
using System;
using System.Text;
using System.Threading.Tasks;
using Swashbuckle.Application;

namespace Swashbuckle.Stardust.Interstellar
{
    public static class SwaggerExtensions
    {
        public static SwaggerDocsConfig ConfigureStardust(this SwaggerDocsConfig swaggerConfig, Action<SwaggerDocsConfig> additionalConfigurations)
        {
            swaggerConfig.OperationFilter(() => new StardustOperationDescriptor());
            return swaggerConfig;
        }

        public static SwaggerDocsConfig ConfigureStardust(this SwaggerDocsConfig swaggerConfig)
        {
            swaggerConfig.OperationFilter(() => new StardustOperationDescriptor());
            return swaggerConfig;
        }
    }
}


text:
package com.intellij.application.options;

import com.intellij.application.options.editor.EditorOptionsProvider;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.openapi.options.BaseConfigurable;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.util.IconLoader;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public class CodeCompletionOptions extends BaseConfigurable implements SearchableConfigurable, EditorOptionsProvider {
  private CodeCompletionPanel myPanel;

  public boolean isModified() {
    return myPanel.isModified();
  }

  public JComponent createComponent() {
    myPanel = new CodeCompletionPanel();
    return myPanel.myPanel;
  }

  public String getDisplayName() {
    return ApplicationBundle.message("title.code.completion");
  }

  public Icon getIcon() {
    return IconLoader.getIcon("/general/configurableCodeCompletion.png");
  }

  public void reset() {
    myPanel.reset();
  }

  public void apply() {
    myPanel.apply();
  }

  public void disposeUIResources() {
    myPanel = null;
  }

  public String getHelpTopic() {
    return "reference.settingsdialog.IDE.editor.code.completion";
  }

  @NotNull
  public String getId() {
    return "editor.preferences.completion";
  }

  @Nullable
  public Runnable enableSearch(String option) {
    return null;
  }

}


text:
package com.gh4a.fragment;

import android.os.Bundle;
import android.support.v4.content.Loader;

import com.gh4a.R;
import com.gh4a.adapter.RootAdapter;
import com.gh4a.adapter.TrendAdapter;
import com.gh4a.holder.Trend;
import com.gh4a.loader.LoaderResult;
import com.gh4a.loader.TrendLoader;
import com.gh4a.utils.IntentUtils;

import java.util.List;
import java.util.Locale;

public class TrendingFragment extends ListDataBaseFragment<Trend> {
    private static final String URL_TEMPLATE =
            "https://www.kimonolabs.com/api/%s?apikey=wZxelPRQ32TprAqJlGzSENFqAnUq6Ftg&kimmodify=1";
    public static final String TYPE_DAILY = "cejoedfo";
    public static final String TYPE_WEEKLY = "571jhjha";
    public static final String TYPE_MONTHLY = "6i48wygc";

    private String mUrl;

    public static TrendingFragment newInstance(String type) {
        if (type == null) {
            return null;
        }

        TrendingFragment f = new TrendingFragment();
        Bundle args = new Bundle();
        args.putString("url", String.format(Locale.US, URL_TEMPLATE, type));
        f.setArguments(args);

        return f;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mUrl = getArguments().getString("url");
    }

    @Override
    protected RootAdapter<Trend> onCreateAdapter() {
        return new TrendAdapter(getActivity());
    }

    @Override
    protected int getEmptyTextResId() {
        return R.string.no_trends_found;
    }

    @Override
    protected void onItemClick(Trend trend) {
        String owner = trend.getRepoOwner();
        String name = trend.getRepoName();
        if (owner != null && name != null) {
            startActivity(IntentUtils.getRepoActivityIntent(getActivity(), owner, name, null));
        }
    }

    @Override
    public Loader<LoaderResult<List<Trend>>> onCreateLoader(int id, Bundle args) {
        return new TrendLoader(getActivity(), mUrl);
    }
}


text:
<project name="tablesorter" default="default" basedir="">

    <!-- SETUP -->
	<property description="Files for parsing etc." name="BUILD_DIR" value="build" />
    <property description="Rhino JS Engine" name="JAR" value="${BUILD_DIR}/js.jar" />

    <!-- Files names for distribution -->
    <property name="TS" value="jquery.tablesorter.js" />
	<property name="TS_MIN" value="jquery.tablesorter.min.js" />

    <!-- MAIN -->
	<target name="min">
        <echo message="Building ${TS_MIN}" />
        <java jar="${JAR}" fork="true">
            <arg value="${BUILD_DIR}/min.js" />
            <arg value="${TS}" />
            <arg value="${TS_MIN}" />
        </java>
        <echo message="${TS_MIN} built." />
    </target>

   <target name="default">
		<antcall target="min"/>
    </target>

</project>


text:
from keystone import assignment
from keystone import auth
from keystone import catalog
from keystone.common import cache
from keystone.contrib import revoke
from keystone import identity
from keystone import policy
from keystone import resource
from keystone import token

def load_backends():

    # Configure and build the cache
    cache.configure_cache_region(cache.REGION)

    # Ensure that the identity driver is created before the assignment manager
    # and that the assignment driver is created before the resource manager.
    # The default resource driver depends on assignment, which in turn
    # depends on identity - hence we need to ensure the chain is available.
    _IDENTITY_API = identity.Manager()
    _ASSIGNMENT_API = assignment.Manager()

    DRIVERS = dict(
        assignment_api=_ASSIGNMENT_API,
        catalog_api=catalog.Manager(),
        identity_api=_IDENTITY_API,
        policy_api=policy.PolicyManager(),
        rule_api=policy.RuleManager(),
        resource_api=resource.Manager(),
        revoke_api=revoke.Manager(),
        role_api=assignment.RoleManager(),
        token_api=token.persistence.Manager(),
        token_provider_api=token.provider.Manager())

    auth.controllers.load_auth_methods()

    return DRIVERS