text:
<!DOCTYPE html>

    <title>Chapter 29: In Which Certain Incidents Are Narrated Which Are Only to be Met with on American Railroads | Around the World in 80 Days | Jules Verne | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

<form action="http://etc.usf.edu/lit2go/search/"><input type="text" name="q" placeholder="Search" value=""></form>

Authors

Books

Genres

Collections

Readability

      Around the World in 80 Days

      by Jules Verne

      Chapter 29: In Which Certain Incidents Are Narrated Which Are Only to be Met with on American Railroads

        Additional Information

            Year Published:
            1873

            Language:
            English

            Country of Origin:
            France

            Source:
            Verne, J. (1873)  Around the World in 80 Days  Paris, France: Routledge

            Readability:

                Flesch–Kincaid Level:
                8.0

            Word Count:
            2,275

            Genre:
            Adventure

            Keywords:
            19th century literature, adventure, french literature

            ✎ Cite This

  Share
  |

Downloads

          Audio

            APA

            MLA

            Chicago

            Verne, J. (1873). Chapter 29: In Which Certain Incidents Are Narrated Which Are Only to be Met with on American Railroads. Around the World in 80 Days (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/55/around-the-world-in-80-days/1074/chapter-29-in-which-certain-incidents-are-narrated-which-are-only-to-be-met-with-on-american-railroads/

            Verne, Jules. "Chapter 29: In Which Certain Incidents Are Narrated Which Are Only to be Met with on American Railroads." Around the World in 80 Days. Lit2Go Edition. 1873. Web. <http://etc.usf.edu/lit2go/55/around-the-world-in-80-days/1074/chapter-29-in-which-certain-incidents-are-narrated-which-are-only-to-be-met-with-on-american-railroads/>. February 15, 2016.

            Jules Verne, "Chapter 29: In Which Certain Incidents Are Narrated Which Are Only to be Met with on American Railroads," Around the World in 80 Days, Lit2Go Edition, (1873), accessed February 15, 2016, http://etc.usf.edu/lit2go/55/around-the-world-in-80-days/1074/chapter-29-in-which-certain-incidents-are-narrated-which-are-only-to-be-met-with-on-american-railroads/.

Back

Next

                  <audio controls style="width:99%;">
            <source src="http://etc.usf.edu/lit2go/audio/mp3/around-the-world-in-80-days-029-chapter-29-in-which-certain-incidents-are-narrated-which-are-only-to-be-met-with-on-american-railroads.1074.mp3" type="audio/mpeg" />
                          <source src="http://etc.usf.edu/lit2go/audio/ogg/around-the-world-in-80-days-029-chapter-29-in-which-certain-incidents-are-narrated-which-are-only-to-be-met-with-on-american-railroads.1074.ogg" type="audio/ogg" />
                        The embedded audio player requires a modern internet browser. You should visit Browse Happy and update your internet browser today!
          </audio>

	The train pursued its course, that evening, without interruption, passing Fort Saunders, crossing Cheyne Pass, and reaching Evans Pass. The road here attained the highest elevation of the journey, eight thousand and ninety–two feet above the level of the sea. The travellers had now only to descend to the Atlantic by limitless plains, levelled by nature. A branch of the "grand trunk" led off southward to Denver, the capital of Colorado. The country round about is rich in gold and silver, and more than fifty thousand inhabitants are already settled there.

	Thirteen hundred and eighty–two miles had been passed over from San Francisco, in three days and three nights; four days and nights more would probably bring them to New York. Phileas Fogg was not as yet behind–hand.

	During the night Camp Walbach was passed on the left; Lodge Pole Creek ran parallel with the road, marking the boundary between the territories of Wyoming and Colorado. They entered Nebraska at eleven, passed near Sedgwick, and touched at Julesburg, on the southern branch of the Platte River.

	It was here that the Union Pacific Railroad was inaugurated on the 23rd of October, 1867, by the chief engineer, General Dodge. Two powerful locomotives, carrying nine cars of invited guests, amongst whom was Thomas C. Durant, vice–president of the road, stopped at this point; cheers were given, the Sioux and Pawnees performed an imitation Indian battle, fireworks were let off, and the first number of the Railway Pioneer was printed by a press brought on the train. Thus was celebrated the inauguration of this great railroad, a mighty instrument of progress and civilisation, thrown across the desert, and destined to link together cities and towns which do not yet exist. The whistle of the locomotive, more powerful than Amphion's lyre, was about to bid them rise from American soil.

	Fort McPherson was left behind at eight in the morning, and three hundred and fifty–seven miles had yet to be traversed before reaching Omaha. The road followed the capricious windings of the southern branch of the Platte River, on its left bank. At nine the train stopped at the important town of North Platte, built between the two arms of the river, which rejoin each other around it and form a single artery, a large tributary, whose waters empty into the Missouri a little above Omaha.

	The one hundred and first meridian was passed.

	Mr. Fogg and his partners had resumed their game; no one—not even the dummy—complained of the length of the trip. Fix had begun by winning several guineas, which he seemed likely to lose; but he showed himself a not less eager whist–player than Mr. Fogg. During the morning, chance distinctly favoured that gentleman. Trumps and honours were showered upon his hands.

	Once, having resolved on a bold stroke, he was on the point of playing a spade, when a voice behind him said, "I should play a diamond."

	Mr. Fogg, Aouda, and Fix raised their heads, and beheld Colonel Proctor.

	Stamp Proctor and Phileas Fogg recognised each other at once.

	"Ah! it's you, is it, Englishman?" cried the colonel; "it's you who are going to play a spade!"

	"And who plays it," replied Phileas Fogg coolly, throwing down the ten of spades.

	"Well, it pleases me to have it diamonds," replied Colonel Proctor, in an insolent tone.

	He made a movement as if to seize the card which had just been played, adding, "You don't understand anything about whist."

	"Perhaps I do, as well as another," said Phileas Fogg, rising.

	"You have only to try, son of John Bull," replied the colonel.

	Aouda turned pale, and her blood ran cold. She seized Mr. Fogg's arm and gently pulled him back. Passepartout was ready to pounce upon the American, who was staring insolently at his opponent. But Fix got up, and, going to Colonel Proctor said, "You forget that it is I with whom you have to deal, sir; for it was I whom you not only insulted, but struck!"

	"Mr. Fix," said Mr. Fogg, "pardon me, but this affair is mine, and mine only. The colonel has again insulted me, by insisting that I should not play a spade, and he shall give me satisfaction for it."

	"When and where you will," replied the American, "and with whatever weapon you choose."

	Aouda in vain attempted to retain Mr. Fogg; as vainly did the detective endeavour to make the quarrel his. Passepartout wished to throw the colonel out of the window, but a sign from his master checked him. Phileas Fogg left the car, and the American followed him upon the platform. "Sir," said Mr. Fogg to his adversary, "I am in a great hurry to get back to Europe, and any delay whatever will be greatly to my disadvantage."

	"Well, what's that to me?" replied Colonel Proctor.

	"Sir," said Mr. Fogg, very politely, "after our meeting at San Francisco, I determined to return to America and find you as soon as I had completed the business which called me to England."

	"Really!"

	"Will you appoint a meeting for six months hence?"

	"Why not ten years hence?"

	"I say six months," returned Phileas Fogg; "and I shall be at the place of meeting promptly."

	"All this is an evasion," cried Stamp Proctor. "Now or never!"

	"Very good. You are going to New York?"

	"No."

	"To Chicago?"

	"No."

	"To Omaha?"

	"What difference is it to you? Do you know Plum Creek?"

	"No," replied Mr. Fogg.

	"It's the next station. The train will be there in an hour, and will stop there ten minutes. In ten minutes several revolver–shots could be exchanged."

	"Very well," said Mr. Fogg. "I will stop at Plum Creek."

	"And I guess you'll stay there too," added the American insolently.

	"Who knows?" replied Mr. Fogg, returning to the car as coolly as usual. He began to reassure Aouda, telling her that blusterers were never to be feared, and begged Fix to be his second at the approaching duel, a request which the detective could not refuse. Mr. Fogg resumed the interrupted game with perfect calmness.

	At eleven o'clock the locomotive's whistle announced that they were approaching Plum Creek station. Mr. Fogg rose, and, followed by Fix, went out upon the platform. Passepartout accompanied him, carrying a pair of revolvers. Aouda remained in the car, as pale as death.

	The door of the next car opened, and Colonel Proctor appeared on the platform, attended by a Yankee of his own stamp as his second. But just as the combatants were about to step from the train, the conductor hurried up, and shouted, "You can't get off, gentlemen!"

	"Why not?" asked the colonel.

	"We are twenty minutes late, and we shall not stop."

	"But I am going to fight a duel with this gentleman."

	"I am sorry," said the conductor; "but we shall be off at once. There's the bell ringing now."

	The train started.

	"I'm really very sorry, gentlemen," said the conductor. "Under any other circumstances I should have been happy to oblige you. But, after all, as you have not had time to fight here, why not fight as we go along?"

	"That wouldn't be convenient, perhaps, for this gentleman," said the colonel, in a jeering tone.

	"It would be perfectly so," replied Phileas Fogg.

	"Well, we are really in America," thought Passepartout, "and the conductor is a gentleman of the first order!"

	So muttering, he followed his master.

	The two combatants, their seconds, and the conductor passed through the cars to the rear of the train. The last car was only occupied by a dozen passengers, whom the conductor politely asked if they would not be so kind as to leave it vacant for a few moments, as two gentlemen had an affair of honour to settle. The passengers granted the request with alacrity, and straightway disappeared on the platform.

	The car, which was some fifty feet long, was very convenient for their purpose. The adversaries might march on each other in the aisle, and fire at their ease. Never was duel more easily arranged. Mr. Fogg and Colonel Proctor, each provided with two six–barrelled revolvers, entered the car. The seconds, remaining outside, shut them in. They were to begin firing at the first whistle of the locomotive. After an interval of two minutes, what remained of the two gentlemen would be taken from the car.

	Nothing could be more simple. Indeed, it was all so simple that Fix and Passepartout felt their hearts beating as if they would crack. They were listening for the whistle agreed upon, when suddenly savage cries resounded in the air, accompanied by reports which certainly did not issue from the car where the duellists were. The reports continued in front and the whole length of the train. Cries of terror proceeded from the interior of the cars.

	Colonel Proctor and Mr. Fogg, revolvers in hand, hastily quitted their prison, and rushed forward where the noise was most clamorous. They then perceived that the train was attacked by a band of Sioux.

	This was not the first attempt of these daring Indians, for more than once they had waylaid trains on the road. A hundred of them had, according to their habit, jumped upon the steps without stopping the train, with the ease of a clown mounting a horse at full gallop.

	The Sioux were armed with guns, from which came the reports, to which the passengers, who were almost all armed, responded by revolver–shots.

	The Indians had first mounted the engine, and half stunned the engineer and stoker with blows from their muskets. A Sioux chief, wishing to stop the train, but not knowing how to work the regulator, had opened wide instead of closing the steam–valve, and the locomotive was plunging forward with terrific velocity.

	The Sioux had at the same time invaded the cars, skipping like enraged monkeys over the roofs, thrusting open the doors, and fighting hand to hand with the passengers. Penetrating the baggage–car, they pillaged it, throwing the trunks out of the train. The cries and shots were constant. The travellers defended themselves bravely; some of the cars were barricaded, and sustained a siege, like moving forts, carried along at a speed of a hundred miles an hour.

	Aouda behaved courageously from the first. She defended herself like a true heroine with a revolver, which she shot through the broken windows whenever a savage made his appearance. Twenty Sioux had fallen mortally wounded to the ground, and the wheels crushed those who fell upon the rails as if they had been worms. Several passengers, shot or stunned, lay on the seats.

	It was necessary to put an end to the struggle, which had lasted for ten minutes, and which would result in the triumph of the Sioux if the train was not stopped. Fort Kearney station, where there was a garrison, was only two miles distant; but, that once passed, the Sioux would be masters of the train between Fort Kearney and the station beyond.

	The conductor was fighting beside Mr. Fogg, when he was shot and fell. At the same moment he cried, "Unless the train is stopped in five minutes, we are lost!"

	"It shall be stopped," said Phileas Fogg, preparing to rush from the car.

	"Stay, monsieur," cried Passepartout; "I will go."

	Mr. Fogg had not time to stop the brave fellow, who, opening a door unperceived by the Indians, succeeded in slipping under the car; and while the struggle continued and the balls whizzed across each other over his head, he made use of his old acrobatic experience, and with amazing agility worked his way under the cars, holding on to the chains, aiding himself by the brakes and edges of the sashes, creeping from one car to another with marvellous skill, and thus gaining the forward end of the train.

	There, suspended by one hand between the baggage–car and the tender, with the other he loosened the safety chains; but, owing to the traction, he would never have succeeded in unscrewing the yoking–bar, had not a violent concussion jolted this bar out. The train, now detached from the engine, remained a little behind, whilst the locomotive rushed forward with increased speed.

	Carried on by the force already acquired, the train still moved for several minutes; but the brakes were worked and at last they stopped, less than a hundred feet from Kearney station.

	The soldiers of the fort, attracted by the shots, hurried up; the Sioux had not expected them, and decamped in a body before the train entirely stopped.

	But when the passengers counted each other on the station platform several were found missing; among others the courageous Frenchman, whose devotion had just saved them.

Back

Next

            This collection of children's literature is a part of the Educational Technology Clearinghouse and is funded by various grants.

            Copyright © 2006—2016 by the Florida Center for Instructional Technology, College of Education, University of South Florida.

License

Credits

FAQ

Giving

This document was downloaded from Lit2Go, a free online collection of stories and poems in Mp3 (audiobook) format published by the Florida Center for Instructional Technology. For more information, including classroom activities, readability data, and original sources, please visit http://etc.usf.edu/lit2go/55/around-the-world-in-80-days/1074/chapter-29-in-which-certain-incidents-are-narrated-which-are-only-to-be-met-with-on-american-railroads/.

Lit2Go: Around the World in 80 Days

Chapter 29: In Which Certain Incidents Are Narrated Which Are Only to be Met with on American Railroads


text:
define(function () {
    var User = function (user) {
        var self = {};

        var dateBD = new Date(user.birthDate),
            dateREG = new Date(user.dateRegistered),
            bdDay = dateBD.getDate(),
            bdMonth = dateBD.getMonth() + 1,
            bdYear = dateBD.getFullYear(),
            regDay = dateREG.getDate(),
            regMonth = dateREG.getMonth() + 1,
            regYear = dateREG.getFullYear();

        self = {
            id: user.id,
            firstName: user.firstName,
            lastName: user.lastName,
            birthdate: bdDay + '.' + bdMonth + '.' + bdYear,
            sex: user.sex,
            dateRegistered: regDay + '.' + regMonth + '.' + regYear,
            noticesPosted: user.noticesPosted,
            email: user.email,
            phone: user.phone,
            address: user.address,
            city: user.city,
            zip: user.zip,
            avatar: user.avatar,
            geolocation: {
                latitude: user.latitude || user.geolocation.latitude,
                longitude: user.longitude || user.geolocation.longitude
            }
        };

        if (user.userSecure) {
            self.userSecure = {
                password: user.userSecure.password || "",
                role: user.userSecure.role || ""
            }
        };
        return self;
    };

    return User;
});

redpajama_set_name: RedPajamaGithub


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingLeft="20dp"
    android:paddingTop="20dp"
    android:paddingRight="20dp">

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/OrderRadioGroup">

        <RadioButton
            android:id="@+id/rdbSaveOrder"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/SaveOrder"/>

        <RadioButton
            android:id="@+id/rdbYear"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/Year"/>

        <RadioButton
            android:id="@+id/rdbValoration"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/Valoration"/>

        <RadioButton
            android:id="@+id/rdbTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/Title"/>
    </RadioGroup>

    <Spinner
        android:id="@+id/orderTypeAD"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:spinnerMode="dropdown" />

</LinearLayout>


text:
using System.Diagnostics.Contracts;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;

namespace System.Reactive.Linq
{
  public static partial class Observable2
  {
    ///
    /// Generates a sequence using the producer/consumer pattern by iteratively calling a consumer function when data is available.
    ///
    /// <typeparam name="TSource">The object that provides notification information.</typeparam>
    /// <typeparam name="TResult">The type of the data in the generated sequence.</typeparam>
    /// <param name="source">Indicates when data becomes available from one or more producers.</param>
    /// <param name="consumeNext">A function that is called iteratively to generate values from out-of-band data.</param>
    /// <remarks>
    /// <para>
    /// The purpose of the <paramref name="source"/> sequence is simply to notify the consumer when data becomes available in
    /// out-of-band storage.  The data in the <paramref name="source"/> sequence provides additional information to the consumer,
    /// but it does not have to be the actual data produced for the consumer.
    /// </para>
    /// <para>
    /// The <paramref name="consumeNext"/> function is called iteratively when data becomes available, until it returns
    /// <see cref="System.Maybe.Empty{TResult}()"/>.  All non-empty values that are returned are concatenated into the generated sequence.
    /// </para>
    /// <para>
    /// <see cref="Consume{TSource,TResult}(IObservable{TSource},Func{TSource,Maybe{TResult}})"/> ensures that there
    /// is always one active iterator over the <paramref name="consumeNext"/> function when the <paramref name="source"/> sequence notifies
    /// that data is available; however, it's not necessarily called for every value in the <paramref name="source"/> sequence.
    /// It is only called if the previous iteration has completed; otherwise, the current notification is ignored.  This ensures that
    /// only one consumer is active at any given time, but it also means that the <paramref name="consumeNext"/> function is not guaranteed
    /// to receive every value in the <paramref name="source"/> sequence; therefore, the <paramref name="consumeNext"/> function must read
    /// data from out-of-band storage instead; e.g., from a shared stream or queue.
    /// </para>
    /// <para>
    /// The <paramref name="consumeNext"/> function may also be called when data is not available.  For example, if the current consuming
    /// iterator completes and additional notifications from the <paramref name="source"/> were received, then <paramref name="consumeNext"/>
    /// is called again to check whether new data was missed.  This avoids a race condition between the <paramref name="source"/> sequence
    /// and <paramref name="consumeNext"/> reading shared data.  If no data is available when <paramref name="consumeNext"/> is called, then
    /// <see cref="System.Maybe.Empty{TResult}()"/> should be returned and <paramref name="consumeNext"/> will not be called again until another
    /// notification is observed from the <paramref name="source"/>.
    /// </para>
    /// <alert type="tip">
    /// Producers and the single active consumer are intended to access shared objects concurrently, yet it remains their responsibility
    /// to ensure thread-safety.  The Consume operator cannot do so without breaking concurrency.  For example, a producer/consumer
    /// implementation that uses an in-memory queue must manually ensure that reads and writes to the queue are thread-safe.
    /// </alert>
    /// <para>
    /// Multiple producers are supported.  Simply create an observable sequence for each producer that notifies when data is generated,
    /// merge them together using the <see cref="Observable.Merge{TSource}(IObservable{IObservable{TSource}})"/> operator, and use the merged
    /// observable as the <paramref name="source"/> argument in the Consume operator.
    /// </para>
    /// <para>
    /// Multiple consumers are supported by calling Consume once and then calling <see cref="IObservable{TSource}.Subscribe"/>
    /// multiple times on the cold observable that is returned.  Just be sure that the <paramref name="source"/> sequence is
    /// hot so that each subscription will consume based on the same producers' notifications.
    /// </para>
    /// </remarks>
    /// <returns>An observable sequence that is the concatenation of the values returned by the <paramref name="consumeNext"/> function.</returns>
    public static IObservable<TResult> Consume<TSource, TResult>(
      this IObservable<TSource> source,
      Func<TSource, Maybe<TResult>> consumeNext)
    {
      Contract.Requires(source != null);
      Contract.Requires(consumeNext != null);
      Contract.Ensures(Contract.Result<IObservable<TResult>>() != null);

      return source.Consume(consumeNext, PlatformSchedulers.Concurrent);
    }

    ///
    /// Generates a sequence using the producer/consumer pattern by iteratively calling a consumer function on the specified
    /// <paramref name="scheduler"/> when data is available.
    ///
    /// <typeparam name="TSource">The object that provides notification information.</typeparam>
    /// <typeparam name="TResult">The type of the data in the generated sequence.</typeparam>
    /// <param name="source">Indicates when data becomes available from one or more producers.</param>
    /// <param name="consumeNext">A function that is called iteratively to generate values from out-of-band data.</param>
    /// <param name="scheduler">An object that schedules iteration over the <paramref name="consumeNext"/> function.</param>
    /// <remarks>
    /// <para>
    /// The purpose of the <paramref name="source"/> sequence is simply to notify the consumer when data becomes available in
    /// out-of-band storage.  The data in the <paramref name="source"/> sequence provides additional information to the consumer,
    /// but it does not have to be the actual data produced for the consumer.
    /// </para>
    /// <para>
    /// The <paramref name="consumeNext"/> function is called iteratively when data becomes available, until it returns
    /// <see cref="System.Maybe.Empty{TResult}()"/>.  All non-empty values that are returned are concatenated into the generated sequence.
    /// </para>
    /// <para>
    /// <see cref="Consume{TSource,TResult}(IObservable{TSource},Func{TSource,Maybe{TResult}},IScheduler)"/> ensures that there
    /// is always one active iterator over the <paramref name="consumeNext"/> function when the <paramref name="source"/> sequence notifies
    /// that data is available; however, it's not necessarily called for every value in the <paramref name="source"/> sequence.
    /// It is only called if the previous iteration has completed; otherwise, the current notification is ignored.  This ensures that
    /// only one consumer is active at any given time, but it also means that the <paramref name="consumeNext"/> function is not guaranteed
    /// to receive every value in the <paramref name="source"/> sequence; therefore, the <paramref name="consumeNext"/> function must read
    /// data from out-of-band storage instead; e.g., from a shared stream or queue.
    /// </para>
    /// <para>
    /// The <paramref name="consumeNext"/> function may also be called when data is not available.  For example, if the current consuming
    /// iterator completes and additional notifications from the <paramref name="source"/> were received, then <paramref name="consumeNext"/>
    /// is called again to check whether new data was missed.  This avoids a race condition between the <paramref name="source"/> sequence
    /// and <paramref name="consumeNext"/> reading shared data.  If no data is available when <paramref name="consumeNext"/> is called, then
    /// <see cref="System.Maybe.Empty{TResult}()"/> should be returned and <paramref name="consumeNext"/> will not be called again until another
    /// notification is observed from the <paramref name="source"/>.
    /// </para>
    /// <alert type="tip">
    /// Producers and the single active consumer are intended to access shared objects concurrently, yet it remains their responsibility
    /// to ensure thread-safety.  The Consume operator cannot do so without breaking concurrency.  For example, a producer/consumer
    /// implementation that uses an in-memory queue must manually ensure that reads and writes to the queue are thread-safe.
    /// </alert>
    /// <para>
    /// Multiple producers are supported.  Simply create an observable sequence for each producer that notifies when data is generated,
    /// merge them together using the <see cref="Observable.Merge{TSource}(IObservable{IObservable{TSource}})"/> operator, and use the merged
    /// observable as the <paramref name="source"/> argument in the Consume operator.
    /// </para>
    /// <para>
    /// Multiple consumers are supported by calling Consume once and then calling <see cref="IObservable{TSource}.Subscribe"/>
    /// multiple times on the cold observable that is returned.  Just be sure that the <paramref name="source"/> sequence is
    /// hot so that each subscription will consume based on the same producers' notifications.
    /// </para>
    /// </remarks>
    /// <returns>An observable sequence that is the concatenation of the values returned by the <paramref name="consumeNext"/> function.</returns>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
      Justification = "All exceptions are sent to observers.")]
    public static IObservable<TResult> Consume<TSource, TResult>(
      this IObservable<TSource> source,
      Func<TSource, Maybe<TResult>> consumeNext,
      IScheduler scheduler)
    {
      Contract.Requires(source != null);
      Contract.Requires(consumeNext != null);
      Contract.Requires(scheduler != null);
      Contract.Ensures(Contract.Result<IObservable<TResult>>() != null);

      return source.Consume(
        value => Observable.Create<TResult>(
          observer => scheduler.Schedule(() =>
          {
            Maybe<TResult> result;

            do
            {
              try
              {
                result = consumeNext(value);
              }
              catch (Exception ex)
              {
                observer.OnError(ex);
                return;
              }

              if (result.HasValue)
              {
                observer.OnNext(result.Value);
              }
            }
            while (result.HasValue);

            observer.OnCompleted();
          })));
    }

    ///
    /// Generates a sequence using the producer/consumer pattern.
    ///
    /// <typeparam name="TSource">The object that provides notification information.</typeparam>
    /// <typeparam name="TResult">The type of the data in the generated sequence.</typeparam>
    /// <param name="source">Indicates when data becomes available from one or more producers.</param>
    /// <param name="consumer">An observable that is generated from out-of-band data.</param>
    /// <remarks>
    /// <para>
    /// The purpose of the <paramref name="source"/> sequence is simply to notify when data becomes available in out-of-band storage.
    /// The data in the <paramref name="source"/> sequence is ignored.
    /// </para>
    /// <para>
    /// <see cref="Consume{TSource,TResult}(IObservable{TSource},IObservable{TResult})"/> ensures that there is always an active
    /// subscription to the <paramref name="consumer"/> sequence when the <paramref name="source"/> sequence notifies that data is
    /// available; however, a new subscription is not necessarily created for every value in the <paramref name="source"/> sequence.
    /// <see cref="IObservable{TResult}.Subscribe"/> is only called if the previous subscription has completed; otherwise, the current
    /// notification is ignored.  This ensures that only one consumer is active at any given time and that all available data has a
    /// chance to be read.
    /// </para>
    /// <para>
    /// A new subscription may also be created when data is not available.  For example, if the current subscription completes and
    /// additional notifications from the <paramref name="source"/> were received, then another subscription is created to check whether
    /// new data was missed.  This avoids a race condition between the <paramref name="source"/> sequence and the consumer's completion
    /// notification.  If no data is available for the new subscription, then an empty sequence should be generated and a new subscription
    /// will not be created again until another notification is observed from the <paramref name="source"/>.
    /// </para>
    /// <alert type="tip">
    /// Producers and the single active consumer are intended to access shared objects concurrently, yet it remains their responsibility
    /// to ensure thread-safety.  The Consume operator cannot do so without breaking concurrency.  For example, a producer/consumer
    /// implementation that uses an in-memory queue must manually ensure that reads and writes to the queue are thread-safe.
    /// </alert>
    /// <para>
    /// Multiple producers are supported.  Simply create an observable sequence for each producer that notifies when data is generated,
    /// merge them together using the <see cref="Observable.Merge{TSource}(IObservable{IObservable{TSource}})"/> operator, and use the merged
    /// observable as the <paramref name="source"/> argument in the Consume operator.
    /// </para>
    /// <para>
    /// Multiple consumers are supported by calling Consume once and then calling <see cref="IObservable{TSource}.Subscribe"/>
    /// multiple times on the cold observable that is returned.  Just be sure that the <paramref name="source"/> sequence is
    /// hot so that each subscription will consume based on the same producers' notifications.
    /// </para>
    /// </remarks>
    /// <returns>An observable sequence that is the concatenation of all subscriptions to the <paramref name="consumer"/> observable.</returns>
    public static IObservable<TResult> Consume<TSource, TResult>(
      this IObservable<TSource> source,
      IObservable<TResult> consumer)
    {
      Contract.Requires(source != null);
      Contract.Requires(consumer != null);
      Contract.Ensures(Contract.Result<IObservable<TResult>>() != null);

      return source.Consume(_ => consumer);
    }

    ///
    /// Generates a sequence using the producer/consumer pattern.
    ///
    /// <typeparam name="TSource">The object that provides notification information.</typeparam>
    /// <typeparam name="TResult">The type of the data in the generated sequence.</typeparam>
    /// <param name="source">Indicates when data becomes available from one or more producers.</param>
    /// <param name="consumerSelector">A function that generates an observable sequence from out-of-band data.</param>
    /// <remarks>
    /// <para>
    /// The purpose of the <paramref name="source"/> sequence is simply to notify the consumer when out-of-band data becomes available.
    /// The data in the <paramref name="source"/> sequence provides additional information to the <paramref name="consumerSelector"/> function,
    /// but it does not have to be the actual data being produced.
    /// </para>
    /// <para>
    /// The <paramref name="consumerSelector"/> function is not necessarily called for every value in the <paramref name="source"/> sequence.
    /// It is only called if the previous consumer's observable has completed; otherwise, the current notification is ignored.  This ensures
    /// that only one consumer is active at any given time, but it also means that the <paramref name="consumerSelector"/> function is not guaranteed
    /// to receive every value in the <paramref name="source"/> sequence; therefore, the <paramref name="consumerSelector"/> function must read
    /// data from out-of-band storage instead; e.g., from a shared stream or queue.
    /// </para>
    /// <para>
    /// The <paramref name="consumerSelector"/> function may also be called when data is not available.  For example, if the current consuming
    /// observable completes and additional notifications from the <paramref name="source"/> were received, then <paramref name="consumerSelector"/>
    /// is called again to check whether new data was missed.  This avoids a race condition between the <paramref name="source"/> sequence
    /// and the consuming observable's completion notification.  If no data is available when <paramref name="consumerSelector"/> is called, then
    /// an empty sequence should be returned and <paramref name="consumerSelector"/> will not be called again until another notification is observed
    /// from the <paramref name="source"/>.
    /// </para>
    /// <alert type="tip">
    /// Producers and the single active consumer are intended to access shared objects concurrently, yet it remains their responsibility
    /// to ensure thread-safety.  The Consume operator cannot do so without breaking concurrency.  For example,
    /// a producer/consumer implementation that uses an in-memory queue must manually ensure that reads and writes to the queue are thread-safe.
    /// </alert>
    /// <para>
    /// Multiple producers are supported.  Simply create an observable sequence for each producer that notifies when data is generated,
    /// merge them together using the <see cref="Observable.Merge{TSource}(IObservable{IObservable{TSource}})"/> operator, and use the merged
    /// observable as the <paramref name="source"/> argument in the Consume operator.
    /// </para>
    /// <para>
    /// Multiple consumers are supported by calling Consume once and then calling <see cref="IObservable{TSource}.Subscribe"/>
    /// multiple times on the cold observable that is returned.  Just be sure that the <paramref name="source"/> sequence is
    /// hot so that each subscription will consume based on the same producers' notifications.
    /// </para>
    /// </remarks>
    /// <returns>An observable sequence that is the concatenation of the sequences returned by <paramref name="consumerSelector"/>.</returns>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
      Justification = "All exceptions are sent to observers.")]
    public static IObservable<TResult> Consume<TSource, TResult>(
      this IObservable<TSource> source,
      Func<TSource, IObservable<TResult>> consumerSelector)
    {
      Contract.Requires(source != null);
      Contract.Requires(consumerSelector != null);
      Contract.Ensures(Contract.Result<IObservable<TResult>>() != null);

      return Observable.Create<TResult>(
        observer =>
        {
          object gate = new object();
          var consumingSubscription = new SerialDisposable();
          var schedule = new SerialDisposable();

          TSource lastSkippedNotification = default(TSource);
          bool hasSkippedNotification = false;
          bool consuming = false;
          bool stopped = false;

          var subscription = source.SubscribeSafe(
            value =>
            {
              lock (gate)
              {
                if (consuming)
                {
                  lastSkippedNotification = value;
                  hasSkippedNotification = true;
                  return;
                }
                else
                {
                  consuming = true;
                  hasSkippedNotification = false;
                }
              }

              var additionalData = value;

              schedule.Disposable = Scheduler.Immediate.Schedule(
                self =>
                {
                  IObservable<TResult> observable;

                  try
                  {
                    observable = consumerSelector(additionalData);
                  }
                  catch (Exception ex)
                  {
                    observer.OnError(ex);
                    return;
                  }

                  consumingSubscription.SetDisposableIndirectly(() =>
                    observable.SubscribeSafe(
                      observer.OnNext,
                      observer.OnError,
                      () =>
                      {
                        bool consumeAgain = false;
                        bool completeNow = false;

                        lock (gate)
                        {
                          /* The hasSkippedNotification field avoids a race condition between source notifications and the consuming observable
                           * calling OnCompleted that could cause data to become available without any active consumer.  The solution is to
                           * check whether additional notifications were skipped before the consuming observable completed.  If so, then we
                           * try to consume once more; and if there isn't any data available, because it was already consumed before the previous
                           * observable completed, then the new observable will be empty.  If no additional notifications are received
                           * from the source before the new observable completes, then hasSkippedNotification will be false the second time
                           * around and there will be no active consumer until the next source notification.
                           *
                           * This behavior reactively mimics typical interactive consumer behavior; e.g., lock and loop if queue.Count > 0.
                           */
                          consuming = hasSkippedNotification;

                          if (consuming)
                          {
                            additionalData = lastSkippedNotification;
                            hasSkippedNotification = false;
                            consumeAgain = true;
                          }
                          else
                          {
                            completeNow = stopped;

                            Contract.Assert(!hasSkippedNotification);
                          }

                          Contract.Assert(!(consumeAgain && completeNow));
                        }

                        if (consumeAgain)
                        {
                          self();
                        }
                        else if (completeNow)
                        {
                          observer.OnCompleted();
                        }
                      }));
                });
            },
            observer.OnError,
            () =>
            {
              bool completeNow;

              lock (gate)
              {
                stopped = true;

                completeNow = !consuming;
              }

              if (completeNow)
              {
                observer.OnCompleted();
              }
            });

          return new CompositeDisposable(consumingSubscription, subscription, schedule);
        });
    }
  }
}


text:
import * as React from "react";

const FormRow = ({ children }) => (

{children}

);

export default FormRow;


text:
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("codestuffers.MvvmCross.Plugins.UserInteraction")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("codestuffers, LLC")]
[assembly: AssemblyProduct("codestuffers.MvvmCross.Plugins.UserInteraction")]
[assembly: AssemblyCopyright("Copyright ©codestuffers, LLC  2014")]
[assembly: AssemblyTrademark("codestuffers, LLC")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]


text:
namespace Fixtures.Azure.AcceptanceTestsPaging.Models
{
    using Fixtures.Azure;
    using Fixtures.Azure.AcceptanceTestsPaging;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Additional parameters for the Paging_GetMultiplePages operation.
    /// </summary>
    public partial class PagingGetMultiplePagesOptionsInner
    {
        /// <summary>
        /// Initializes a new instance of the
        /// PagingGetMultiplePagesOptionsInner class.
        /// </summary>
        public PagingGetMultiplePagesOptionsInner()
        {
          CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// PagingGetMultiplePagesOptionsInner class.
        /// </summary>
        /// <param name="maxresults">Sets the maximum number of items to return
        /// in the response.</param>
        /// <param name="timeout">Sets the maximum time that the server can
        /// spend processing the request, in seconds. The default is 30
        /// seconds.</param>
        public PagingGetMultiplePagesOptionsInner(int? maxresults = default(int?), int? timeout = default(int?))
        {
            Maxresults = maxresults;
            Timeout = timeout;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets sets the maximum number of items to return in the
        /// response.
        /// </summary>
        [JsonProperty(PropertyName = "")]
        public int? Maxresults { get; set; }

        /// <summary>
        /// Gets or sets sets the maximum time that the server can spend
        /// processing the request, in seconds. The default is 30 seconds.
        /// </summary>
        [JsonProperty(PropertyName = "")]
        public int? Timeout { get; set; }

    }
}


text:
/*	$NetBSD: opl_ess.c,v 1.18 2012/04/09 10:18:17 plunky Exp $	*/

/*-
 * Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lennart Augustsson.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: opl_ess.c,v 1.18 2012/04/09 10:18:17 plunky Exp $");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/errno.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/select.h>
#include <sys/audioio.h>
#include <sys/midiio.h>

#include <sys/bus.h>

#include <dev/audio_if.h>
#include <dev/midi_if.h>
#include <dev/ic/oplreg.h>
#include <dev/ic/oplvar.h>

#include <dev/isa/isavar.h>
#include <dev/isa/essvar.h>

extern int	ess_speaker_ctl(void *, int);

int	opl_ess_match(device_t, cfdata_t, void *);
void	opl_ess_attach(device_t, device_t, void *);

CFATTACH_DECL_NEW(opl_ess, sizeof(struct opl_softc),
    opl_ess_match, opl_ess_attach, NULL, NULL);

int
opl_ess_match(device_t parent, cfdata_t match, void *aux)
{
	struct audio_attach_args *aa = (struct audio_attach_args *)aux;
	struct ess_softc *ssc = device_private(parent);

	if (aa->type != AUDIODEV_TYPE_OPL)
		return (0);
	return opl_match(ssc->sc_iot, ssc->sc_ioh, 0);
}

void
opl_ess_attach(device_t parent, device_t self, void *aux)
{
	struct ess_softc *ssc = device_private(parent);
	struct opl_softc *sc = device_private(self);

	sc->dev = self;
	sc->ioh = ssc->sc_ioh;
	sc->iot = ssc->sc_iot;
	sc->offs = 0;
	sc->spkrctl = ess_speaker_ctl;
	sc->spkrarg = ssc;
	sc->lock = &ssc->sc_intr_lock;
	strcpy(sc->syn.name, "ESS ");

	opl_attach(sc);
}


text:
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script.  Only    //
// add custom code in the designated areas or it will be overwritten during  //
// the next update.                                                          //
//-----------------------------------NOTICE----------------------------------//

//--BEGIN FILE HEAD CUSTOM CODE--//

//--END CUSTOM CODE--//

#include "../../include/FixLink.h"
#include "../../include/ObjectRegistry.h"
#include "../../include/NIF_IO.h"
#include "../../include/obj/NiDataStream.h"
#include "../../include/gen/Region.h"
using namespace Niflib;

//Definition of TYPE constant
const Type NiDataStream::TYPE("NiDataStream", &NiObject::TYPE );

NiDataStream::NiDataStream() : usage((DataStreamUsage)0), access((DataStreamAccess)0), numBytes((unsigned int)0), cloningBehavior((CloningBehavior)CLONING_SHARE), numRegions((unsigned int)0), numComponents((unsigned int)0), streamable(1) {
	//--BEGIN CONSTRUCTOR CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

NiDataStream::~NiDataStream() {
	//--BEGIN DESTRUCTOR CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

const Type & NiDataStream::GetType() const {
	return TYPE;
}

NiObject * NiDataStream::Create() {
	return new NiDataStream;
}

void NiDataStream::Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ) {
	//--BEGIN PRE-READ CUSTOM CODE--//

	//--END CUSTOM CODE--//

	NiObject::Read( in, link_stack, info );
	NifStream( usage, in, info );
	NifStream( access, in, info );
	NifStream( numBytes, in, info );
	NifStream( cloningBehavior, in, info );
	NifStream( numRegions, in, info );
	regions.resize(numRegions);
	for (unsigned int i1 = 0; i1 < regions.size(); i1++) {
		NifStream( regions[i1].startIndex, in, info );
		NifStream( regions[i1].numIndices, in, info );
	};
	NifStream( numComponents, in, info );
	componentFormats.resize(numComponents);
	for (unsigned int i1 = 0; i1 < componentFormats.size(); i1++) {
		NifStream( componentFormats[i1], in, info );
	};
	data.resize(numBytes);
	for (unsigned int i1 = 0; i1 < data.size(); i1++) {
		NifStream( data[i1], in, info );
	};
	NifStream( streamable, in, info );

	//--BEGIN POST-READ CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

void NiDataStream::Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const {
	//--BEGIN PRE-WRITE CUSTOM CODE--//

	//--END CUSTOM CODE--//

	NiObject::Write( out, link_map, missing_link_stack, info );
	numComponents = (unsigned int)(componentFormats.size());
	numRegions = (unsigned int)(regions.size());
	numBytes = (unsigned int)(data.size());
	NifStream( usage, out, info );
	NifStream( access, out, info );
	NifStream( numBytes, out, info );
	NifStream( cloningBehavior, out, info );
	NifStream( numRegions, out, info );
	for (unsigned int i1 = 0; i1 < regions.size(); i1++) {
		NifStream( regions[i1].startIndex, out, info );
		NifStream( regions[i1].numIndices, out, info );
	};
	NifStream( numComponents, out, info );
	for (unsigned int i1 = 0; i1 < componentFormats.size(); i1++) {
		NifStream( componentFormats[i1], out, info );
	};
	for (unsigned int i1 = 0; i1 < data.size(); i1++) {
		NifStream( data[i1], out, info );
	};
	NifStream( streamable, out, info );

	//--BEGIN POST-WRITE CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

std::string NiDataStream::asString( bool verbose ) const {
	//--BEGIN PRE-STRING CUSTOM CODE--//

	//--END CUSTOM CODE--//

	stringstream out;
	unsigned int array_output_count = 0;
	out << NiObject::asString();
	numComponents = (unsigned int)(componentFormats.size());
	numRegions = (unsigned int)(regions.size());
	numBytes = (unsigned int)(data.size());
	out << "  Usage:  " << usage << endl;
	out << "  Access:  " << access << endl;
	out << "  Num Bytes:  " << numBytes << endl;
	out << "  Cloning Behavior:  " << cloningBehavior << endl;
	out << "  Num Regions:  " << numRegions << endl;
	array_output_count = 0;
	for (unsigned int i1 = 0; i1 < regions.size(); i1++) {
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
			break;
		};
		out << "    Start Index:  " << regions[i1].startIndex << endl;
		out << "    Num Indices:  " << regions[i1].numIndices << endl;
	};
	out << "  Num Components:  " << numComponents << endl;
	array_output_count = 0;
	for (unsigned int i1 = 0; i1 < componentFormats.size(); i1++) {
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
			break;
		};
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			break;
		};
		out << "    Component Formats[" << i1 << "]:  " << componentFormats[i1] << endl;
		array_output_count++;
	};
	array_output_count = 0;
	for (unsigned int i1 = 0; i1 < data.size(); i1++) {
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			out << "<Data Truncated. Use verbose mode to see complete listing.>" << endl;
			break;
		};
		if ( !verbose && ( array_output_count > MAXARRAYDUMP ) ) {
			break;
		};
		out << "    Data[" << i1 << "]:  " << data[i1] << endl;
		array_output_count++;
	};
	out << "  Streamable:  " << streamable << endl;
	return out.str();

	//--BEGIN POST-STRING CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

void NiDataStream::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info ) {
	//--BEGIN PRE-FIXLINKS CUSTOM CODE--//

	//--END CUSTOM CODE--//

	NiObject::FixLinks( objects, link_stack, missing_link_stack, info );

	//--BEGIN POST-FIXLINKS CUSTOM CODE--//

	//--END CUSTOM CODE--//
}

std::list<NiObjectRef> NiDataStream::GetRefs() const {
	list<Ref<NiObject> > refs;
	refs = NiObject::GetRefs();
	return refs;
}

std::list<NiObject *> NiDataStream::GetPtrs() const {
	list<NiObject *> ptrs;
	ptrs = NiObject::GetPtrs();
	return ptrs;
}

//--BEGIN MISC CUSTOM CODE--//

//--END CUSTOM CODE--//


text: learn me node


text:
namespace boost {

enum one_bit_color_type {
  one_bit_white     = 0,
  one_bit_not_white  = 1
};

template <>
struct color_traits<one_bit_color_type>
{
  static one_bit_color_type white() { return one_bit_white; }
  static one_bit_color_type gray()  { return one_bit_not_white; }
  static one_bit_color_type black() { return one_bit_not_white; }
};

template<typename IndexMap = identity_property_map>
struct one_bit_color_map
{
  BOOST_STATIC_CONSTANT(int, bits_per_char = std::numeric_limits<unsigned char>::digits);
  std::size_t n;
  IndexMap index;
  shared_array<unsigned char> data;

  typedef typename property_traits<IndexMap>::key_type key_type;
  typedef one_bit_color_type value_type;
  typedef void reference;
  typedef read_write_property_map_tag category;

  explicit one_bit_color_map(std::size_t n, const IndexMap& index = IndexMap())
    : n(n), index(index), data(new unsigned char[(n + bits_per_char - 1) / bits_per_char])
  {
    // Fill to white
    std::fill(data.get(), data.get() + (n + bits_per_char - 1) / bits_per_char, 0);
  }
};

template<typename IndexMap>
inline one_bit_color_type
get(const one_bit_color_map<IndexMap>& pm,
    typename property_traits<IndexMap>::key_type key)
{
  BOOST_STATIC_CONSTANT(int, bits_per_char = one_bit_color_map<IndexMap>::bits_per_char);
  typename property_traits<IndexMap>::value_type i = get(pm.index, key);
  assert ((std::size_t)i < pm.n);
  return one_bit_color_type((pm.data.get()[i / bits_per_char] >> (i % bits_per_char)) & 1);
}

template<typename IndexMap>
inline void
put(const one_bit_color_map<IndexMap>& pm,
    typename property_traits<IndexMap>::key_type key,
    one_bit_color_type value)
{
  BOOST_STATIC_CONSTANT(int, bits_per_char = one_bit_color_map<IndexMap>::bits_per_char);
  typename property_traits<IndexMap>::value_type i = get(pm.index, key);
  assert ((std::size_t)i < pm.n);
  assert (value >= 0 && value < 2);
  std::size_t byte_num = i / bits_per_char;
  std::size_t bit_position = (i % bits_per_char);
    pm.data.get()[byte_num] =
      (unsigned char)
        ((pm.data.get()[byte_num] & ~(1 << bit_position))
         | (value << bit_position));
}

template<typename IndexMap>
inline one_bit_color_map<IndexMap>
make_one_bit_color_map(std::size_t n, const IndexMap& index_map)
{
  return one_bit_color_map<IndexMap>(n, index_map);
}

} // end namespace boost

#endif // BOOST_ONE_BIT_COLOR_MAP_HPP

#ifdef BOOST_GRAPH_USE_MPI
#  include <boost/graph/distributed/one_bit_color_map.hpp>
#endif


text:
package org.maptalks.javasdk.featurelayer.common;

import org.maptalks.geojson.*;
import org.maptalks.javasdk.db.Layer;

/**
 * Created by fuzhen on 2015/9/18.
 */
public class TestEnvironment {
    public static String LAYER_TYPE = Layer.TYPE_DB_TABLE;

    public static Geometry[] genAllGeometries() {
        Geometry[] geometries = new Geometry[]{
                genPoint(),
                genPolyline(),
                genPolygon(),
                genMultipoint(),
                genMultiPolyline(),
                genMultiPolygon()
        };
        return geometries;
    }

    //-----生成各种图形的方法-----------------

    /**
     * 生成点数据
     * @return
     */
    public static Point genPoint() {
        final Point geometry = new Point(new double[]{109,32});
        return geometry;
    }

    /**
     * 生成多折线
     * @return
     */
    public static LineString genPolyline() {
        double[][] path = new double[][]{new double[]{109,32},new double[]{109,31}, new double[]{109,30}};
        return new LineString(path);
    }

    /**
     * 生成多边形
     * @return
     */
    public static Geometry genPolygon() {
        double[][][] rings = new double[][][]{
                new double[][]{new double[]{109,32},new double[]{109,31},
                        new double[]{109,30},new double[]{108,30},new double[]{109,32}},
                new double[][]{new double[]{108.5,30.5},new double[]{108.5,30.3},
                        new double[]{108.2,30.3},new double[]{108.5,30.5}}
        };
        return new Polygon(rings);
    }

    /**
     * 生成MultiPoint数据
     * @return
     */
    public static Geometry genMultipoint() {
        double[][] multiPoint = new double[][]{new double[]{109,32},new double[]{109,31}, new double[]{109,30}};
        return new MultiPoint(multiPoint);
    }

    /**
     * 生成MultiPolyline数据
     * @return
     */
    public static Geometry genMultiPolyline() {
        double[][][] multiPath = new double[][][] {
                new double[][]{new double[]{109,32},new double[]{109,31},
                        new double[]{109,30},new double[]{108,30},new double[]{109,32}},
                new double[][]{new double[]{119,32},new double[]{119,31},
                        new double[]{119,30},new double[]{118,30},new double[]{119,32}}
        };
        return new MultiLineString(multiPath);
    }

    /**
     * 生成MultiPolygon数据
     * @return
     */
    public static Geometry genMultiPolygon() {
        double[][][][] multiRings = new double[][][][] {
                //polygon1
                new double[][][] {
                        new double[][]{new double[]{109,32},new double[]{109,31},
                                new double[]{109,30},new double[]{108,30},new double[]{109,32}}
                },
                //polygon2
                new double[][][] {
                        new double[][]{new double[]{119,32},new double[]{119,31},
                                new double[]{119,30},new double[]{118,30},new double[]{119,32}}
                }
        };
        return new MultiPolygon(multiRings);
    }

    /**
     * 生成GeometryCollection数据
     * @return
     */
    public static Geometry genGeometryCollection() {

        Geometry[] geometries = new Geometry[]{
                genPoint(),
                genPolyline(),
                genPolygon(),
                genMultipoint(),
                genMultiPolyline(),
                genMultiPolygon()
        };
        return new GeometryCollection(geometries);
    }
}


text:
package com.izforge.izpack.installer.container.impl;

import java.util.Properties;

import org.picocontainer.MutablePicoContainer;
import org.picocontainer.PicoException;
import org.picocontainer.injectors.ProviderAdapter;
import org.picocontainer.parameters.ComponentParameter;

import com.izforge.izpack.api.container.Container;
import com.izforge.izpack.api.data.InstallData;
import com.izforge.izpack.api.exception.ContainerException;
import com.izforge.izpack.api.exception.InstallerException;
import com.izforge.izpack.api.exception.IzPackException;
import com.izforge.izpack.api.resource.Locales;
import com.izforge.izpack.api.substitutor.VariableSubstitutor;
import com.izforge.izpack.core.container.AbstractContainer;
import com.izforge.izpack.core.container.PlatformProvider;
import com.izforge.izpack.core.data.DefaultVariables;
import com.izforge.izpack.core.factory.DefaultObjectFactory;
import com.izforge.izpack.core.os.RegistryDefaultHandler;
import com.izforge.izpack.core.resource.ResourceManager;
import com.izforge.izpack.core.rules.ConditionContainer;
import com.izforge.izpack.core.substitutor.VariableSubstitutorImpl;
import com.izforge.izpack.installer.base.InstallDataConfiguratorWithRules;
import com.izforge.izpack.installer.container.provider.LocalesProvider;
import com.izforge.izpack.installer.container.provider.RulesProvider;
import com.izforge.izpack.installer.data.UninstallData;
import com.izforge.izpack.installer.data.UninstallDataWriter;
import com.izforge.izpack.installer.event.InstallerListeners;
import com.izforge.izpack.installer.event.ProgressNotifiersImpl;
import com.izforge.izpack.installer.requirement.InstallerRequirementChecker;
import com.izforge.izpack.installer.requirement.JDKChecker;
import com.izforge.izpack.installer.requirement.JavaVersionChecker;
import com.izforge.izpack.installer.requirement.LangPackChecker;
import com.izforge.izpack.installer.requirement.LockFileChecker;
import com.izforge.izpack.installer.requirement.RequirementsChecker;
import com.izforge.izpack.installer.unpacker.FileQueueFactory;
import com.izforge.izpack.installer.unpacker.IUnpacker;
import com.izforge.izpack.merge.MergeManagerImpl;
import com.izforge.izpack.merge.resolve.MergeableResolver;
import com.izforge.izpack.merge.resolve.PathResolver;
import com.izforge.izpack.util.DefaultTargetPlatformFactory;
import com.izforge.izpack.util.Housekeeper;
import com.izforge.izpack.util.Librarian;
import com.izforge.izpack.util.PlatformModelMatcher;
import com.izforge.izpack.util.Platforms;
import com.izforge.izpack.util.TargetFactory;

/**
 * Installer container.
 */
public abstract class InstallerContainer extends AbstractContainer
{

    /**
     * Sets the locale.
     *
     * @param code the locale ISO language code
     * @throws IzPackException if the locale isn't supported
     */
    public void setLocale(String code)
    {
        Locales locales = getComponent(Locales.class);
        locales.setLocale(code);
    }

    /**
     * Invoked by {@link #initialise} to fill the container.
     *
     * @param container the underlying container
     * @throws ContainerException if initialisation fails
     * @throws PicoException      for any PicoContainer error
     */
    @Override
    protected void fillContainer(MutablePicoContainer container)
    {
        registerComponents(container);
        resolveComponents(container);
    }

    /**
     * Registers components with the container.
     *
     * @param pico the container
     * @throws ContainerException if registration fails
     * @throws PicoException      for any PicoContainer error
     */
    protected void registerComponents(MutablePicoContainer pico)
    {
        pico.addAdapter(new ProviderAdapter(new RulesProvider()));
        pico.addAdapter(new ProviderAdapter(new PlatformProvider()));
        pico.addAdapter(new ProviderAdapter(new LocalesProvider()));

        addComponent(InstallDataConfiguratorWithRules.class);
        addComponent(InstallerRequirementChecker.class);
        addComponent(JavaVersionChecker.class);
        addComponent(JDKChecker.class);
        addComponent(LangPackChecker.class);
        addComponent(RequirementsChecker.class);
        addComponent(LockFileChecker.class);
        addComponent(MergeManagerImpl.class);
        addComponent(UninstallData.class);
        addComponent(MutablePicoContainer.class, pico);
        addComponent(ConditionContainer.class);
        addComponent(Properties.class);
        addComponent(DefaultVariables.class);
        addComponent(ResourceManager.class);
        addComponent(UninstallDataWriter.class);
        addComponent(ProgressNotifiersImpl.class);
        addComponent(InstallerListeners.class);
        addComponent(CustomDataLoader.class);
        addComponent(Container.class, this);
        addComponent(RegistryDefaultHandler.class);
        addComponent(Housekeeper.class);
        addComponent(Librarian.class);
        addComponent(FileQueueFactory.class);
        addComponent(TargetFactory.class);
        addComponent(DefaultTargetPlatformFactory.class);
        addComponent(DefaultObjectFactory.class);
        addComponent(PathResolver.class);
        addComponent(MergeableResolver.class);
        addComponent(Platforms.class);
        addComponent(PlatformModelMatcher.class);

        pico.addComponent(VariableSubstitutor.class, VariableSubstitutorImpl.class,
                          new ComponentParameter(DefaultVariables.class));
    }

    /**
     * Resolve components.
     *
     * @param pico the container
     */
    protected void resolveComponents(MutablePicoContainer pico)
    {
        InstallData installData = pico.getComponent(InstallData.class);
        String className = installData.getInfo().getUnpackerClassName();
        Class<IUnpacker> unpackerClass = getClass(className, IUnpacker.class);
        pico.addComponent(IUnpacker.class, unpackerClass);

        CustomDataLoader customDataLoader = pico.getComponent(CustomDataLoader.class);
        try
        {
            customDataLoader.loadCustomData();
        }
        catch (InstallerException exception)
        {
            throw new ContainerException(exception);
        }
    }

}


text:
package org.fxmisc.undo.impl;

import java.util.NoSuchElementException;

public class ZeroSizeChangeQueue<C> implements ChangeQueue<C> {

    private class QueuePositionImpl implements QueuePosition {
        private final long rev;

        QueuePositionImpl(long seq) {
            this.rev = seq;
        }

        @Override
        public boolean isValid() {
            return rev == ZeroSizeChangeQueue.this.revision;
        }

        @Override
        public boolean equals(Object other) {
            if(other instanceof ZeroSizeChangeQueue.QueuePositionImpl) {
                @SuppressWarnings("unchecked")
                QueuePositionImpl otherPos = (QueuePositionImpl) other;
                return getQueue() == otherPos.getQueue() && rev == otherPos.rev;
            } else {
                return false;
            }
        }

        private ZeroSizeChangeQueue<C> getQueue() {
            return ZeroSizeChangeQueue.this;
        }
    }

    private long revision = 0;

    @Override
    public boolean hasNext() {
        return false;
    }

    @Override
    public boolean hasPrev() {
        return false;
    }

    @Override
    public C peekNext() {
        throw new NoSuchElementException();
    }

    @Override
    public C next() {
        throw new NoSuchElementException();
    }

    @Override
    public C peekPrev() {
        throw new NoSuchElementException();
    }

    @Override
    public C prev() {
        throw new NoSuchElementException();
    }

    @Override
    @SafeVarargs
    public final void push(C... changes) {
        ++revision;
    }

    @Override
    public QueuePosition getCurrentPosition() {
        return new QueuePositionImpl(revision);
    }

    @Override
    public void forgetHistory() {
        // there is nothing to forget
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="5dp"
    android:background="@drawable/contentframe"
    >
    <TextView
        android:id="@+id/type"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/type"
        android:textSize="18sp"
        android:textStyle="bold"
        android:padding="5dp"
        android:layout_marginBottom="5dp"

        />
    <TextView
        android:id="@+id/theme"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/theme"
        android:textSize="18sp"
        android:textStyle="bold"
        android:padding="5dp"
        android:layout_alignTop="@id/type"
        android:layout_alignParentRight="true"
        />
    <ImageView
        android:id="@+id/addr"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/addr"
        android:layout_below="@id/type"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginTop="2dp"
        android:scaleType="centerCrop"
        />
    <TextView
        android:id="@+id/place"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/place"
        android:textSize="16sp"
        android:layout_below="@id/type"
        android:layout_toRightOf="@id/addr"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="5dp"
        />
    <ImageView
        android:id="@+id/time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/time"
        android:layout_below="@id/place"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="2dp"
        android:layout_marginRight="5dp"
        />
    <TextView
        android:id="@+id/activityTime"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/activityTime"
        android:textSize="16sp"
        android:layout_below="@id/place"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="5dp"
        android:layout_toRightOf="@id/time"
        />
    <ImageView
        android:id="@+id/moneycost"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/cost"
        android:layout_below="@id/activityTime"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginTop="2dp"
        />
    <TextView
        android:id="@+id/costdesc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/costdesc"
        android:textSize="16sp"
        android:layout_below="@id/activityTime"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="5dp"
        android:layout_toRightOf="@id/moneycost"
        />
    <TextView
        android:id="@+id/cost"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/cost"
        android:textSize="16sp"
        android:layout_alignTop="@id/costdesc"
        android:layout_toRightOf="@id/costdesc"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="5dp"
        />

    <TextView
        android:id="@+id/paymentMethod"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/paymentMethod"
        android:textSize="16sp"
        android:layout_alignTop="@id/costdesc"
        android:layout_alignParentRight="true"
        android:layout_marginRight="5dp"
        android:layout_marginLeft="5dp"
        />
    <TextView
        android:id="@+id/paymentMethoddesc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/paymentMethoddesc"
        android:textSize="16sp"
        android:layout_alignTop="@id/costdesc"
        android:layout_toLeftOf="@id/paymentMethod"
        />

    <ImageView
        android:id="@+id/account"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/account"
        android:layout_below="@id/costdesc"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginTop="2dp"
        />
    <TextView
        android:id="@+id/currentNumberdesc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/currentNumberdesc"
        android:textSize="16sp"
        android:layout_below="@id/costdesc"
        android:layout_marginLeft="5dp"
        android:layout_marginBottom="5dp"
        android:layout_toRightOf="@id/account"
        />
    <TextView
        android:id="@+id/currentNumber"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/currentNumber"
        android:textSize="16sp"
        android:layout_below="@id/costdesc"
        android:layout_toRightOf="@id/currentNumberdesc"
        android:layout_marginLeft="5dp"
        />

    <TextView
        android:id="@+id/totalNumber"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/totalNumber"
        android:textSize="16sp"
        android:layout_alignTop="@id/currentNumberdesc"
        android:layout_alignParentRight="true"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        />

    <TextView
        android:id="@+id/totalNumberdesc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/totalNumberdesc"
        android:textSize="16sp"
        android:layout_alignTop="@id/currentNumberdesc"
        android:layout_toLeftOf="@id/totalNumber"
        />
</RelativeLayout>


text:
<module xmlns="urn:jboss:module:1.1" name="org.postgresql.postgresql">
  <resources>
    <resource-root path="postgresql-@version.postgresql@.jar"/>
  </resources>

  <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api" />
  </dependencies>
</module>


text:
var React = require('react')
var TestUtils = require('react-dom/test-utils')

var Tokeninput = require('../index')

describe('Sanity test', function() {

  it ('renders component', function() {
    var tokeninput = <Tokeninput selected={[]} onSelect={function() {}} onRemove={function() {}} />
    var instance = TestUtils.renderIntoDocument(tokeninput)
    var ul = TestUtils.findRenderedDOMComponentWithTag(instance, 'ul')
    should.exist(ul)
  })

})


text:
namespace bits {

	void set(int* value,int index);

	void clear(int* value,int index);

	bool is_set(int value,int index);
}

namespace reg {

	//int translate_work(char c);

	//const char* translate_work(int idx);

	int translate_stage(char s);

	const char* translate_stage(int id);
}

namespace string {

	void format_duration(int seconds,char* buffer,int max);
}


text:
// Python wrapper to modify model interface.

#include "tensorflow/lite/tools/optimize/modify_model_interface.h"

#include <string>

#include "pybind11/pybind11.h"
#include "tensorflow/lite/schema/schema_generated.h"

namespace pybind11 {

PYBIND11_MODULE(_pywrap_modify_model_interface, m) {
  // An anonymous function that invokes the C++ function
  // after applying transformations to the python function arguments
  m.def("modify_model_interface",
        [](const std::string& input_file, const std::string& output_file,
           const int input_type, const int output_type) -> int {
          return tflite::optimize::ModifyModelInterface(
              input_file, output_file,
              static_cast<tflite::TensorType>(input_type),
              static_cast<tflite::TensorType>(output_type));
        });
}

}  // namespace pybind11


text:
Please sign in to Appian

Use the link below to log into your Appian environment and then Refresh to view your task list in Gmail.

				Go to Appian


text:
/**
 *
 * sortedListToBST.java
 * Dec 19, 2012
 */

/**
 * @author huangsp
 *
 */
public class SortedListToBST {
	private TreeNode sortedListToBST(ListNode head, int len) {
        // Start typing your Java solution below
        // DO NOT write main() function
        if (len == 0)   return null;
        else if (len == 1)	return new TreeNode(head.val);
        else{
            int leftLength = len / 2;
            ListNode leftHead = head;
            ListNode leftTail = getNode(head, leftLength - 1);
            ListNode center = leftTail.next;
            leftTail.next = null;
            ListNode rightHead = center.next;
            center.next = null;
            TreeNode root = new TreeNode(center.val);
            root.left = sortedListToBST(leftHead, leftLength);
            root.right = sortedListToBST(rightHead, len - 1 - leftLength);
            return root;
        }
    }
	public TreeNode sortedListToBST(ListNode head){
		int len = listLength(head);
		return sortedListToBST(head, len);
	}
    private ListNode getNode(ListNode head, int index){
        if (index == 0) return head;
        else{
            int countIndex = 0;
            ListNode current = head;
            while(countIndex < index){
                current = current.next;
                countIndex++;
            }
            return current;
        }
    }
    private int listLength(ListNode head){
        if (head == null)   return 0;
        else{
            int len = 1;
            ListNode current = head;
            while(current.next != null){
                len++;
                current = current.next;
            }
            return len;
        }
    }
    public static void main(String[] args){
    	ListNode head = new ListNode(1);
    	ListNode current = head;
    	for (int index = 2; index < 9; index++){
    		current.next = new ListNode(index);
    		current = current.next;
    	}
    	TreeNode root = new SortedListToBST().sortedListToBST(head);
    	//System.out.println(root);
    	UniqueBST printer = new UniqueBST();
    	printer.treePrintLevel(root);
    }
}


text:
<?php

namespace OrganizationsTest\Paginator;

use PHPUnit\Framework\TestCase;

use Core\Repository\RepositoryService;
use Doctrine\ODM\MongoDB\Query\Builder;
use Interop\Container\ContainerInterface;
use Organizations\Paginator\ListJobPaginatorFactory;
use Organizations\Repository\Filter\ListJobQuery;
use Organizations\Repository\Organization;
use Laminas\Filter\FilterPluginManager;
use Laminas\Paginator\Paginator;

/**
 * Class ListJobPaginatorFactoryTest
 *
 * @author Anthonius Munthi <me@itstoni.com>
 * @package OrganizationsTest\Paginator
 * @since 0.30
 */
class ListJobPaginatorFactoryTest extends TestCase
{
    public function testInvokation()
    {
        $container      = $this->createMock(ContainerInterface::class);
        $filterManager  = $this->createMock(FilterPluginManager::class);
        $filter         = $this->createMock(ListJobQuery::class);
        $repositories   = $this->createMock(RepositoryService::class);
        $repo           = $this->createMock(Organization::class);
        $builder        = $this->createMock(Builder::class);

        $container->expects($this->any())
            ->method('get')
            ->willReturnMap([
                ['FilterManager',$filterManager],
                ['repositories',$repositories]
            ])
        ;

        $repositories->expects($this->once())
            ->method('get')
            ->with('Jobs/Job')
            ->willReturn($repo)
        ;
        $repo->expects($this->once())
            ->method('createQueryBuilder')
            ->willReturn($builder)
        ;
        $filterManager->expects($this->once())
            ->method('get')
            ->with('Organizations/ListJobQuery')
            ->willReturn($filter)
        ;

        $target = new ListJobPaginatorFactory();
        $service = $target($container, 'some-name', array());

        $this->assertInstanceOf(Paginator::class, $service);
    }
}


text:
var buildFormattingTokensRegExp = require('../../_lib/build_formatting_tokens_reg_exp/index.js')

function buildFormatLocale () {
  var months3char = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']
  var monthsFull = ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december']
  var weekdays2char = ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö']
  var weekdays3char = ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör']
  var weekdaysFull = ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag']
  var meridiemFull = ['f.m.', 'e.m.']

  var formatters = {
    // Month: Jan, Feb, ..., Dec
    'MMM': function (date) {
      return months3char[date.getMonth()]
    },

    // Month: January, February, ..., December
    'MMMM': function (date) {
      return monthsFull[date.getMonth()]
    },

    // Day of week: Su, Mo, ..., Sa
    'dd': function (date) {
      return weekdays2char[date.getDay()]
    },

    // Day of week: Sun, Mon, ..., Sat
    'ddd': function (date) {
      return weekdays3char[date.getDay()]
    },

    // Day of week: Sunday, Monday, ..., Saturday
    'dddd': function (date) {
      return weekdaysFull[date.getDay()]
    },

    // a.m., p.m.
    'aa': function (date) {
      return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0]
    }
  }

  formatters.A = formatters.aa
  formatters.a = formatters.aa

  // Generate ordinal version of formatters: M -> Mo, D -> Do, etc.
  var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W']
  ordinalFormatters.forEach(function (formatterToken) {
    formatters[formatterToken + 'o'] = function (date, formatters) {
      return ordinal(formatters[formatterToken](date))
    }
  })

  return {
    formatters: formatters,
    formattingTokensRegExp: buildFormattingTokensRegExp(formatters)
  }
}

function ordinal (number) {
  var rem100 = number % 100
  if (rem100 > 20 || rem100 < 10) {
    switch (rem100 % 10) {
      case 1:
      case 2:
        return number + ':a'
    }
  }
  return number + ':e'
}

module.exports = buildFormatLocale


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright (c) 2010-2017 Evolveum and contributors
  ~
  ~ This work is dual-licensed under the Apache License 2.0
  ~ and European Union Public License. See LICENSE file for details.
  -->
<objectModification
    xmlns='http://midpoint.evolveum.com/xml/ns/public/common/api-types-3'
    xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
    xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3">
    <oid>00000000-8888-6666-0000-100000000005</oid>
    <itemDelta>
        <t:modificationType>add</t:modificationType>
        <t:path>assignment</t:path>
        <t:value>
            <c:targetRef oid="12345678-d34d-b33f-f00d-987987987988" type="c:RoleType"/>
        </t:value>
    </itemDelta>
    <itemDelta>
        <t:modificationType>add</t:modificationType>
        <t:path>assignment</t:path>
        <t:value>
            <c:targetRef oid="12345678-d34d-b33f-f00d-987987987989" type="c:RoleType"/>
        </t:value>
    </itemDelta>
</objectModification>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.lorislab.jbpm</groupId>
    <artifactId>jbpm-workitem</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>jbpm-workitem</name>

    <modules>
        <module>jbpm-workitem-api</module>
        <module>jbpm-workitem-runtime</module>
        <module>jbpm-workitem-handler</module>
        <module>jbpm-workitem-example</module>
    </modules>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>andrej</id>
            <name>Andrej Petras</name>
            <email>andrej@lorislab.org</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <version.jbpm>6.2.0.Final-redhat-4</version.jbpm>
    </properties>

    <!-- Dependency management -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.kie</groupId>
                <artifactId>kie-api</artifactId>
                <scope>provided</scope>
                <version>${version.jbpm}</version>
            </dependency>
            <dependency>
                <groupId>org.drools</groupId>
                <artifactId>drools-core</artifactId>
                <scope>provided</scope>
                <version>${version.jbpm}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
        </plugins>

        <!-- Plugins management -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.kie</groupId>
                    <artifactId>kie-maven-plugin</artifactId>
                    <version>${version.jbpm}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.2</version>
                    <configuration>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12.4</version>
                    <configuration>
                        <skipTests>true</skipTests>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.1.2</version>
                    <inherited>true</inherited>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.8</version>
                    <inherited>true</inherited>
                    <configuration>
                        <aggregate>true</aggregate>
                        <links>
                            <link>http://docs.oracle.com/javase/7/docs/api/</link>
                        </links>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.5</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <repository>
            <id>bintray</id>
            <url>https://api.bintray.com/maven/lorislab/maven/jbpm-workitem</url>
        </repository>
    </distributionManagement>

    <!-- Repositories -->
    <repositories>
        <repository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Maven Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
            <layout>default</layout>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>lorislab</id>
            <url>http://dl.bintray.com/lorislab/maven</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>


text:
file: 'gardener-city'
title: 'Cité de jardiniers'
date: 2014-01-22
license: 'by-sa'
lang_en: '/en/img/gardener-city'
tags:
  - 3D
  - peinture numérique
  - paysage
  - politique
  - écologie
  - bleu
  - vert
made:
  - Blender
  - Krita
  - G'mic
---

Et si, dans un futur pas trop éloigné, ou même aujoud'hui, les jardins s'invitaient dans les villes ?
Essai de brosses à effet sur un rendu de cubes en 3D, qui m'on donné la perspective ;)


text:
require_dependency "social_networking/application_controller"

module SocialNetworking
  # Manage OnTheMindStatements.
  class OnTheMindStatementsController < ApplicationController
    def create
      @on_the_mind_statement = OnTheMindStatement.new(sanitized_params)

      if @on_the_mind_statement.save
        render json: Serializers::OnTheMindStatementSerializer
          .new(@on_the_mind_statement).to_serialized
      else
        render json: { error: model_errors }, status: 400
      end
    end

    private

    def sanitized_params
      {
        participant_id: current_participant.id,
        description: params[:description]
      }
    end

    def model_errors
      @on_the_mind_statement.errors.full_messages.join(", ")
    end
  end
end


text:
@class NSString;

@interface WCLanDeviceTask : NSObject
{
    int m_subTaskId;
    NSString *m_deviceType;
    NSString *m_deviceId;
    long long m_taskId;
    long long m_taskCmd;
}

@property(nonatomic) int m_subTaskId; // @synthesize m_subTaskId;
@property(nonatomic) long long m_taskCmd; // @synthesize m_taskCmd;
@property(nonatomic) long long m_taskId; // @synthesize m_taskId;
@property(retain, nonatomic) NSString *m_deviceId; // @synthesize m_deviceId;
@property(retain, nonatomic) NSString *m_deviceType; // @synthesize m_deviceType;
- (void).cxx_destruct;

@end


text:
<?php
require_once(dirname(__FILE__).'/../utils/GoogleAuthenticator.php');
$auth=new GoogleAuthenticator;
$secret=$auth->createSecret();
?>

secret: <?php echo $secret;?>

<img src="<?php echo $auth->getQRCodeUrl('SimpleDanmakuSite',$secret);?>">


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoLotDAL2.Models;
using System.Data.Entity;

namespace AutoLotDAL2.Repos
{
    public class CarRepo:BaseRepo<Car>,IRepo<Car>
    {
        public CarRepo()
        {
            Table = Context.Inventory;
        }

        public int Delete(int id, byte[] timeStamp)
        {
            Context.Entry(new Car() { CarId = id }).State = EntityState.Deleted;
            return SaveChanges();
        }
        public Task<int> DeleteAsync(int id, byte[] timeStamp)
        {
            Context.Entry(new Car() { CarId = id }).State = EntityState.Deleted;
            return SaveChangesAsync();
        }
    }
}


text:
[CmdletBinding(SupportsShouldProcess)]
Param(
[Parameter()]
[string] $IceLibPath
)
begin
{
  if (! (Test-Path (Join-Path $IceLibPath 'bin')))
  {
    Write-Error "Not a valid IceLib folder (must contain a bin folder)"
    exit 2
  }
  $IceLibPathName = Split-Path $IceLibPath -Leaf
  $IceLibTrace    = (Get-ChildItem "${IceLibPath}\bin" | Where Name -like 'i3trace_dotnet_tracing-w32r-*.dll' | Select -ExpandProperty Name) -replace '.dll',''
  $IceLibVersion  = $IceLibTrace -replace '.*w32r\-', ''

  Write-Output "Updating to IceLib $IceLibPathName"
  Write-Output "  Trace: $IceLibTrace"
}
process
{
  # Find all Visual Studio Project that reference IceLib
  $Projects = Get-ChildItem . -Recurse -Filter '*.csproj' | Select-String 'IceLib' | Group Path | Select -ExpandProperty Name

  Write-Output "Processing $($Projects.Length) projects"
  Foreach ($project in $Projects)
  {
    $ProjectName = Split-Path $Project -Leaf
    Write-Output "Processing project: $ProjectName"
    if ($PSCmdlet.ShouldProcess($Project, "Patching VisualStudio Project"))
    {
      (Get-Content $Project) | Foreach {
        $_ -replace 'IC4_\d{4}_R\d+_P\d+ \(x86\)',            $IceLibPathName `
           -replace 'i3trace_dotnet_tracing\-w32r\-\d+\-\d+', $IceLibTrace
      } | Set-Content $Project
    }
  }

  # Find all Wix scripts that reference IceLib Trace
  $Wixes = Get-ChildItem . -Recurse -Filter '*.wxs' | Select-String 'IceLib' | Group Path | Select -ExpandProperty Name

  Write-Output "Processing $($Wixes.Length) wix scripts"
  Foreach ($wix in $wixes)
  {
    $WixName = Split-Path $Wix -Leaf
    if ($PSCmdlet.ShouldProcess($Wix, "Patching Wix Script"))
    {
      (Get-Content $Wix) | Foreach {
        $_ -replace 'w32r\-\d+\-\d+', "w32r-$IceLibVersion" `
           -replace 'a00r\-\d+\-\d+', "a00r-$IceLibVersion"
      } | Set-Content $Wix
    }
  }
}


text:
using System;
using Windows.UI.Xaml.Documents;

namespace ProgParty.Core.Element.HtmlToRtf
{
    internal sealed class SpanTextContainer : ITextContainer
    {
        private readonly ITextContainer _parent;
        private readonly Span _span;

        public SpanTextContainer(ITextContainer parent, Span span)
        {
            _span = span;
            _parent = parent;
        }

        public void Add(Inline text)
        {
            _span.Inlines.Add(text);
        }

        public Paragraph AddToParentParagraph(Inline text) => _parent.AddToParentParagraph(text);

        public void Add(Block paragraph)
        {
            throw new NotSupportedException();
        }
    }
}


text:
from django.contrib import admin

from code.models import Code, Mark

class CodeAdmin(admin.ModelAdmin):
    list_display = ('id', 'username','title','brush_func', 'cate_id_func', 'date_create')
    search_fields = ['title', 'code']
    list_filter = ['date_create', 'brush', 'cate_id', 'username']

class MarkAdmin(admin.ModelAdmin):
    list_display = ('mid', 'username', 'code_id_func', 'date_create')
    search_fields = ['content']
    list_filter = ['date_create', 'code_id', 'username']

admin.site.register(Code, CodeAdmin)
admin.site.register(Mark, MarkAdmin)