18 September.--I drove at once to Hillingham and arrived early. Keeping my cab at the gate, I went up the avenue alone. I knocked gently and rang as quietly as possible, for I feared to disturb Lucy or her mother, and hoped to only bring a servant to the door. After a while, finding no response, I knocked and rang again, still no answer. I cursed the laziness of the servants that they should lie abed at such an hour, for it was now ten o'clock, and so rang and knocked again, but more impatiently, but still without response. Hitherto I had blamed only the servants, but now a terrible fear began to assail me. Was this desolation but another link in the chain of doom which seemed drawing tight round us? Was it indeed a house of death to which I had come, too late? I know that minutes, even seconds of delay, might mean hours of danger to Lucy, if she had had again one of those frightful relapses, and I went round the house to try if I could find by chance an entry anywhere.
I could find no means of ingress. Every window and door was fastened and locked, and I returned baffled to the porch. As I did so, I heard the rapid pit-pat of a swiftly driven horse's feet. They stopped at the gate, and a few seconds later I met Van Helsing running up the avenue. When he saw me, he gasped out, "Then it was you, and just arrived. How is she? Are we too late? Did you not get my telegram?"
I answered as quickly and coherently as I could that I had only got his telegram early in the morning, and had not a minute in coming here, and that I could not make any one in the house hear me. He paused and raised his hat as he said solemnly, "Then I fear we are too late. God's will be done!"
With his usual recuperative energy, he went on, "Come. If there be no way open to get in, we must make one. Time is all in all to us now."
We went round to the back of the house, where there was a kitchen window. The Professor took a small surgical saw from his case, and handing it to me, pointed to the iron bars which guarded the window. I attacked them at once and had very soon cut through three of them. Then with a long, thin knife we pushed back the fastening of the sashes and opened the window. I helped the Professor in, and followed him. There was no one in the kitchen or in the servants' rooms, which were close at hand. We tried all the rooms as we went along, and in the dining room, dimly lit by rays of light through the shutters, found four servant women lying on the floor. There was no need to think them dead, for their stertorous breathing and the acrid smell of laudanum in the room left no doubt as to their condition.
Van Helsing and I looked at each other, and as we moved away he said, "We can attend to them later." Then we ascended to Lucy's room. For an instant or two we paused at the door to listen, but there was no sound that we could hear. With white faces and trembling hands, we opened the door gently, and entered the room.
How shall I describe what we saw? On the bed lay two women, Lucy and her mother. The latter lay farthest in, and she was covered with a white sheet, the edge of which had been blown back by the drought through the broken window, showing the drawn, white, face, with a look of terror fixed upon it. By her side lay Lucy, with face white and still more drawn. The flowers which had been round her neck we found upon her mother's bosom, and her throat was bare, showing the two little wounds which we had noticed before, but looking horribly white and mangled. Without a word the Professor bent over the bed, his head almost touching poor Lucy's breast. Then he gave a quick turn of his head, as of one who listens, and leaping to his feet, he cried out to me, "It is not yet too late! Quick! Quick! Bring the brandy!"
I flew downstairs and returned with it, taking care to smell and taste it, lest it, too, were drugged like the decanter of sherry which I found on the table. The maids were still breathing, but more restlessly, and I fancied that the narcotic was wearing off. I did not stay to make sure, but returned to Van Helsing.  He said to me, "I can do this, all that can be at the present. You go wake those maids. Flick them in the face with a wet towel, and flick them hard. Make them get heat and fire and a warm bath. This poor soul is nearly as cold as that beside her. She will need be heated before we can do anything more."
I went at once, and found little difficulty in waking three of the women. The fourth was only a young girl, and the drug had evidently affected her more strongly so I lifted her on the sofa and let her sleep.
The others were dazed at first, but as remembrance came back to them they cried and sobbed in a hysterical manner. I was stern with them, however, and would not let them talk. I told them that one life was bad enough to lose, and if they delayed they would sacrifice Miss Lucy.  Fortunately, the kitchen and boiler fires were still alive, and there was no lack of hot water. We got a bath and carried Lucy out as she was and placed her in it. Whilst we were busy chafing her limbs there was a knock at the hall door. One of the maids ran off, hurried on some more clothes, and opened it. Then she returned and whispered to us that there was a gentleman who had come with a message from Mr. Holmwood. I bade her simply tell him that he must wait, for we could see no one now. She went away with the message, and, engrossed with our work, I clean forgot all about him.
I never saw in all my experience the Professor work in such deadly earnest. I knew, as he knew, that it was a stand-up fight with death, and in a pause told him so. He answered me in a way that I did not understand, but with the sternest look that his face could wear.
"If that were all, I would stop here where we are now, and let her fade away into peace, for I see no light in life over her horizon." He went on with his work with, if possible, renewed and more frenzied vigour.
Presently we both began to be conscious that the heat was beginning to be of some effect. Lucy's heart beat a trifle more audibly to the stethoscope, and her lungs had a perceptible movement. Van Helsing's face almost beamed, and as we lifted her from the bath and rolled her in a hot sheet to dry her he said to me, "The first gain is ours! Check to the King!"
We took Lucy into another room, which had by now been prepared, and laid her in bed and forced a few drops of brandy down her throat. I noticed that Van Helsing tied a soft silk handkerchief round her throat. She was still unconscious, and was quite as bad as, if not worse than, we had ever seen her.
Van Helsing called in one of the women, and told her to stay with her and not to take her eyes off her till we returned, and then beckoned me out of the room.
"We must consult as to what is to be done," he said as we descended the stairs. In the hall he opened the dining room door, and we passed in, he closing the door carefully behind him. The shutters had been opened, but the blinds were already down, with that obedience to the etiquette of death which the British woman of the lower classes always rigidly observes. The room was, therefore, dimly dark. It was, however, light enough for our purposes. Van Helsing's sternness was somewhat relieved by a look of perplexity. He was evidently torturing his mind about something, so I waited for an instant, and he spoke.
"What are we to do now? Where are we to turn for help? We must have another transfusion of blood, and that soon, or that poor girl's life won't be worth an hour's purchase. You are exhausted already. I am exhausted too. I fear to trust those women, even if they would have courage to submit. What are we to do for some one who will open his veins for her?"
"What's the matter with me, anyhow?"
The voice came from the sofa across the room, and its tones brought relief and joy to my heart, for they were those of Quincey Morris.
Van Helsing started angrily at the first sound, but his face softened and a glad look came into his eyes as I cried out, "Quincey Morris!" and rushed towards him with outstretched hands.
"What brought you here?" I cried as our hands met.
"I guess Art is the cause."
He handed me a telegram.--'Have not heard from Seward for three days, and am terribly anxious. Cannot leave. Father still in same condition. Send me word how Lucy is. Do not delay.--Holmwood.'
"I think I came just in the nick of time. You know you have only to tell me what to do."
Van Helsing strode forward, and took his hand, looking him straight in the eyes as he said, "A brave man's blood is the best thing on this earth when a woman is in trouble. You're a man and no mistake. Well, the devil may work against us for all he's worth, but God sends us men when we want them."
Once again we went through that ghastly operation. I have not the heart to go through with the details. Lucy had got a terrible shock and it told on her more than before, for though plenty of blood went into her veins, her body did not respond to the treatment as well as on the other occasions. Her struggle back into life was something frightful to see and hear. However, the action of both heart and lungs improved, and Van Helsing made a sub-cutaneous injection of morphia, as before, and with good effect. Her faint became a profound slumber. The Professor watched whilst I went downstairs with Quincey Morris, and sent one of the maids to pay off one of the cabmen who were waiting.
I left Quincey lying down after having a glass of wine, and told the cook to get ready a good breakfast. Then a thought struck me, and I went back to the room where Lucy now was. When I came softly in, I found Van Helsing with a sheet or two of note paper in his hand. He had evidently read it, and was thinking it over as he sat with his hand to his brow. There was a look of grim satisfaction in his face, as of one who has had a doubt solved. He handed me the paper saying only, "It dropped from Lucy's breast when we carried her to the bath."
When I had read it, I stood looking at the Professor, and after a pause asked him, "In God's name, what does it all mean?  I was so bewildered that I did not know what to say more. Van Helsing put out his hand and took the paper, saying,
"Do not trouble about it now. Forget it for the present. You shall know and understand it all in good time, but it will be later. And now what is it that you came to me to say?" This brought me back to fact, and I was all myself again.
"I came to speak about the certificate of death. If we do not act properly and wisely, there may be an inquest, and that paper would have to be produced. I am in hopes that we need have no inquest, for if we had it would surely kill poor Lucy, if nothing else did. I know, and you know, and the other doctor who attended her knows, that Mrs. Westenra had disease of the heart, and we can certify that she died of it. Let us fill up the certificate at once, and I shall take it myself to the registrar and go on to the undertaker."
"Good, oh my friend John! Well thought of! Truly Miss Lucy, if she be sad in the foes that beset her, is at least happy in the friends that love her. One, two, three, all open their veins for her, besides one old man. Ah, yes, I know, friend John. I am not blind! I love you all the more for it! Now go."
In the hall I met Quincey Morris, with a telegram for Arthur telling him that Mrs. Westenra was dead, that Lucy also had been ill, but was now going on better, and that Van Helsing and I were with her. I told him where I was going, and he hurried me out, but as I was going said,
"When you come back, Jack, may I have two words with you all to ourselves?" I nodded in reply and went out. I found no difficulty about the registration, and arranged with the local undertaker to come up in the evening to measure for the coffin and to make arrangements.
When I got back Quincey was waiting for me. I told him I would see him as soon as I knew about Lucy, and went up to her room. She was still sleeping, and the Professor seemingly had not moved from his seat at her side. From his putting his finger to his lips, I gathered that he expected her to wake before long and was afraid of fore-stalling nature. So I went down to Quincey and took him into the breakfast room, where the blinds were not drawn down, and which was a little more cheerful, or rather less cheerless, than the other rooms.
When we were alone, he said to me, "Jack Seward, I don't want to shove myself in anywhere where I've no right to be, but this is no ordinary case. You know I loved that girl and wanted to marry her, but although that's all past and gone, I can't help feeling anxious about her all the same. What is it that's wrong with her? The Dutchman, and a fine old fellow he is, I can see that, said that time you two came into the room, that you must have another transfusion of blood, and that both you and he were exhausted. Now I know well that you medical men speak in camera, and that a man must not expect to know what they consult about in private. But this is no common matter, and whatever it is, I have done my part. Is not that so?"
"That's so," I said, and he went on.
"I take it that both you and Van Helsing had done already what I did today. Is not that so?"
"That's so."
"And I guess Art was in it too. When I saw him four days ago down at his own place he looked queer. I have not seen anything pulled down so quick since I was on the Pampas and had a mare that I was fond of go to grass all in a night. One of those big bats that they call vampires had got at her in the night, and what with his gorge and the vein left open, there wasn't enough blood in her to let her stand up, and I had to put a bullet through her as she lay. Jack, if you may tell me without betraying confidence, Arthur was the first, is not that so?"
As he spoke the poor fellow looked terribly anxious. He was in a torture of suspense regarding the woman he loved, and his utter ignorance of the terrible mystery which seemed to surround her intensified his pain. His very heart was bleeding, and it took all the manhood of him, and there was a royal lot of it, too, to keep him from breaking down. I paused before answering, for I felt that I must not betray anything which the Professor wished kept secret, but already he knew so much, and guessed so much, that there could be no reason for not answering, so I answered in the same phrase.
"That's so."
"And how long has this been going on?"
"About ten days."
"Ten days! Then I guess, Jack Seward, that that poor pretty creature that we all love has had put into her veins within that time the blood of four strong men. Man alive, her whole body wouldn't hold it." Then coming close to me, he spoke in a fierce half-whisper. "What took it out?"
I shook my head. "That," I said, "is the crux. Van Helsing is simply frantic about it, and I am at my wits' end. I can't even hazard a guess. There has been a series of little circumstances which have thrown out all our calculations as to Lucy being properly watched. But these shall not occur again. Here we stay until all be well, or ill."
Quincey held out his hand. "Count me in," he said. "You and the Dutchman will tell me what to do, and I'll do it."
When she woke late in the afternoon, Lucy's first movement was to feel in her breast, and to my surprise, produced the paper which Van Helsing had given me to read. The careful Professor had replaced it where it had come from, lest on waking she should be alarmed. Her eyes then lit on Van Helsing and on me too, and gladdened. Then she looked round the room, and seeing where she was, shuddered.
We both understood what was meant, that she had realized to the full her mother's death. So we tried what we could to comfort her. Doubtless sympathy eased her somewhat, but she was very low in thought and spirit, and wept silently and weakly for a long time. We told her that either or both of us would now remain with her all the time, and that seemed to comfort her. Towards dusk she fell into a doze. Here a very odd thing occurred. Whilst still asleep she took the paper from her breast and tore it in two. Van Helsing stepped over and took the pieces from her. All the same, however, she went on with the action of tearing, as though the material were still in her hands. Finally she lifted her hands and opened them as though scattering the fragments. Van Helsing seemed surprised, and his brows gathered as if in thought, but he said nothing.
19 September.--All last night she slept fitfully, being always afraid to sleep, and something weaker when she woke from it. The Professor and I took in turns to watch, and we never left her for a moment unattended. Quincey Morris said nothing about his intention, but I knew that all night long he patrolled round and round the house.
When the day came, its searching light showed the ravages in poor Lucy's strength. She was hardly able to turn her head, and the little nourishment which she could take seemed to do her no good. At times she slept, and both Van Helsing and I noticed the difference in her, between sleeping and waking. Whilst asleep she looked stronger, although more haggard, and her breathing was softer. Her open mouth showed the pale gums drawn back from the teeth, which looked positively longer and sharper than usual. When she woke the softness of her eyes evidently changed the expression, for she looked her own self, although a dying one. In the afternoon she asked for Arthur, and we telegraphed for him. Quincey went off to meet him at the station.
When he arrived it was nearly six o'clock, and the sun was setting full and warm, and the red light streamed in through the window and gave more colour to the pale cheeks. When he saw her, Arthur was simply choking with emotion, and none of us could speak. In the hours that had passed, the fits of sleep, or the comatose condition that passed for it, had grown more frequent, so that the pauses when conversation was possible were shortened. Arthur's presence, however, seemed to act as a stimulant. She rallied a little, and spoke to him more brightly than she had done since we arrived. He too pulled himself together, and spoke as cheerily as he could, so that the best was made of everything.
It is now nearly one o'clock, and he and Van Helsing are sitting with her. I am to relieve them in a quarter of an hour, and I am entering this on Lucy's phonograph. Until six o'clock they are to try to rest. I fear that tomorrow will end our watching, for the shock has been too great. The poor child cannot rally. God help us all.
LETTER MINA HARKER TO LUCY WESTENRA
(Unopened by her)
17 September
My dearest Lucy,
"It seems an age since I heard from you, or indeed since I wrote. You will pardon me, I know, for all my faults when you have read all my budget of news. Well, I got my husband back all right. When we arrived at Exeter there was a carriage waiting for us, and in it, though he had an attack of gout, Mr. Hawkins. He took us to his house, where there were rooms for us all nice and comfortable, and we dined together. After dinner Mr. Hawkins said,
"'My dears, I want to drink your health and prosperity, and may every blessing attend you both. I know you both from children, and have, with love and pride, seen you grow up. Now I want you to make your home here with me. I have left to me neither chick nor child. All are gone, and in my will I have left you everything.' I cried, Lucy dear, as Jonathan and the old man clasped hands. Our evening was a very, very happy one.
"So here we are, installed in this beautiful old house, and from both my bedroom and the drawing room I can see the great elms of the cathedral close, with their great black stems standing out against the old yellow stone of the cathedral, and I can hear the rooks overhead cawing and cawing and chattering and chattering and gossiping all day, after the manner of rooks--and humans. I am busy, I need not tell you, arranging things and housekeeping. Jonathan and Mr. Hawkins are busy all day, for now that Jonathan is a partner, Mr. Hawkins wants to tell him all about the clients.
 I wish I could run up to town for a day or two to see you, dear, but I dare not go yet, with so much on my shoulders, and Jonathan wants looking after still. He is beginning to put some flesh on his bones again, but he was terribly weakened by the long illness. Even now he sometimes starts out of his sleep in a sudden way and awakes all trembling until I can coax him back to his usual placidity. However, thank God, these occasions grow less frequent as the days go on, and they will in time pass away altogether, I trust. And now I have told you my news, let me ask yours. When are you to be married, and where, and who is to perform the ceremony, and what are you to wear, and is it to be a public or private wedding? Tell me all about it, dear, tell me all about everything, for there is nothing which interests you which will not be dear to me. Jonathan asks me to send his 'respectful duty', but I do not think that is good enough from the junior partner of the important firm Hawkins & Harker. And so, as you love me, and he loves me, and I love you with all the moods and tenses of the verb, I send you simply his 'love' instead. Goodbye, my dearest Lucy, and blessings on you.
"Yours,
"Mina Harker"
REPORT FROM PATRICK HENNESSEY, MD, MRCSLK, QCPI, ETC, ETC, TO JOHN SEWARD, MD
20 September
My dear Sir:
"In accordance with your wishes, I enclose report of the conditions of everything left in my charge. With regard to patient, Renfield, there is more to say. He has had another outbreak, which might have had a dreadful ending, but which, as it fortunately happened, was unattended with any unhappy results. This afternoon a carrier's cart with two men made a call at the empty house whose grounds abut on ours, the house to which, you will remember, the patient twice ran away. The men stopped at our gate to ask the porter their way, as they were strangers.
"I was myself looking out of the study window, having a smoke after dinner, and saw one of them come up to the house. As he passed the window of Renfield's room, the patient began to rate him from within, and called him all the foul names he could lay his tongue to. The man, who seemed a decent fellow enough, contented himself by telling him to 'shut up for a foul-mouthed beggar', whereon our man accused him of robbing him and wanting to murder him and said that he would hinder him if he were to swing for it. I opened the window and signed to the man not to notice, so he contented himself after looking the place over and making up his mind as to what kind of place he had got to by saying, 'Lor' bless yer, sir, I wouldn't mind what was said to me in a bloomin' madhouse. I pity ye and the guv'nor for havin' to live in the house with a wild beast like that.'
"Then he asked his way civilly enough, and I told him where the gate of the empty house was. He went away followed by threats and curses and revilings from our man. I went down to see if I could make out any cause for his anger, since he is usually such a well-behaved man, and except his violent fits nothing of the kind had ever occurred. I found him, to my astonishment, quite composed and most genial in his manner. I tried to get him to talk of the incident, but he blandly asked me questions as to what I meant, and led me to believe that he was completely oblivious of the affair. It was, I am sorry to say, however, only another instance of his cunning, for within half an hour I heard of him again. This time he had broken out through the window of his room, and was running down the avenue. I called to the attendants to follow me, and ran after him, for I feared he was intent on some mischief. My fear was justified when I saw the same cart which had passed before coming down the road, having on it some great wooden boxes. The men were wiping their foreheads, and were flushed in the face, as if with violent exercise. Before I could get up to him, the patient rushed at them, and pulling one of them off the cart, began to knock his head against the ground. If I had not seized him just at the moment, I believe he would have killed the man there and then.  It was a horrible blow, but he did not seem to mind it, but seized him also, and struggled with the three of us, pulling us to and fro as if we were kittens. You know I am no lightweight, and the others were both burly men. At first he was silent in his fighting, but as we began to master him, and the attendants were putting a strait waistcoat on him, he began to shout, 'I'll frustrate them! They shan't rob me! They shan't murder me by inches! I'll fight for my Lord and Master!' and all sorts of similar incoherent ravings. It was with very considerable difficulty that they got him back to the house and put him in the padded room. One of the attendants, Hardy, had a finger broken. However, I set it all right, and he is going on well.
"The two carriers were at first loud in their threats of actions for damages, and promised to rain all the penalties of the law on us. Their threats were, however, mingled with some sort of indirect apology for the defeat of the two of them by a feeble madman. They said that if it had not been for the way their strength had been spent in carrying and raising the heavy boxes to the cart they would have made short work of him. They gave as another reason for their defeat the extraordinary state of drouth to which they had been reduced by the dusty nature of their occupation and the reprehensible distance from the scene of their labors of any place of public entertainment. I quite understood their drift, and after a stiff glass of strong grog, or rather more of the same, and with each a sovereign in hand, they made light of the attack, and swore that they would encounter a worse madman any day for the pleasure of meeting so 'bloomin' good a bloke' as your correspondent. I took their names and addresses, in case they might be needed. They are as follows: Jack Smollet, of Dudding's Rents, King George's Road, Great Walworth, and Thomas Snelling, Peter Farley's Row, Guide Court, Bethnal Green. They are both in the employment of Harris & Sons, Moving and Shipment Company, Orange Master's Yard, Soho.
"I shall report to you any matter of interest occurring here, and shall wire you at once if there is anything of importance.
"Believe me, dear Sir,
"Yours faithfully,
"Patrick Hennessey."
LETTER, MINA HARKER TO LUCY WESTENRA (Unopened by her)
18 September
"My dearest Lucy,
"Such a sad blow has befallen us. Mr. Hawkins has died very suddenly. Some may not think it so sad for us, but we had both come to so love him that it really seems as though we had lost a father. I never knew either father or mother, so that the dear old man's death is a real blow to me. Jonathan is greatly distressed. It is not only that he feels sorrow, deep sorrow, for the dear, good man who has befriended him all his life, and now at the end has treated him like his own son and left him a fortune which to people of our modest bringing up is wealth beyond the dream of avarice, but Jonathan feels it on another account. He says the amount of responsibility which it puts upon him makes him nervous. He begins to doubt himself. I try to cheer him up, and my belief in him helps him to have a belief in himself. But it is here that the grave shock that he experienced tells upon him the most. Oh, it is too hard that a sweet, simple, noble, strong nature such as his, a nature which enabled him by our dear, good friend's aid to rise from clerk to master in a few years, should be so injured that the very essence of its strength is gone. Forgive me, dear, if I worry you with my troubles in the midst of your own happiness, but Lucy dear, I must tell someone, for the strain of keeping up a brave and cheerful appearance to Jonathan tries me, and I have no one here that I can confide in. I dread coming up to London, as we must do that day after tomorrow, for poor Mr. Hawkins left in his will that he was to be buried in the grave with his father. As there are no relations at all, Jonathan will have to be chief mourner. I shall try to run over to see you, dearest, if only for a few minutes. Forgive me for troubling you. With all blessings,
"Your loving
"Mina Harker"
DR. SEWARD'S DIARY
20 September.--Only resolution and habit can let me make an entry tonight. I am too miserable, too low spirited, too sick of the world and all in it, including life itself, that I would not care if I heard this moment the flapping of the wings of the angel of death. And he has been flapping those grim wings to some purpose of late, Lucy's mother and Arthur's father, and now… Let me get on with my work.
I duly relieved Van Helsing in his watch over Lucy. We wanted Arthur to go to rest also, but he refused at first. It was only when I told him that we should want him to help us during the day, and that we must not all break down for want of rest, lest Lucy should suffer, that he agreed to go.
Van Helsing was very kind to him. "Come, my child," he said. "Come with me. You are sick and weak, and have had much sorrow and much mental pain, as well as that tax on your strength that we know of. You must not be alone, for to be alone is to be full of fears and alarms. Come to the drawing room, where there is a big fire, and there are two sofas. You shall lie on one, and I on the other, and our sympathy will be comfort to each other, even though we do not speak, and even if we sleep."
 She lay quite still, and I looked around the room to see that all was as it should be. I could see that the Professor had carried out in this room, as in the other, his purpose of using the garlic. The whole of the window sashes reeked with it, and round Lucy's neck, over the silk handkerchief which Van Helsing made her keep on, was a rough chaplet of the same odorous flowers.
Lucy was breathing somewhat stertorously, and her face was at its worst, for the open mouth showed the pale gums. Her teeth, in the dim, uncertain light, seemed longer and sharper than they had been in the morning. In particular, by some trick of the light, the canine teeth looked longer and sharper than the rest.
I sat down beside her, and presently she moved uneasily. At the same moment there came a sort of dull flapping or buffeting at the window. I went over to it softly, and peeped out by the corner of the blind. There was a full moonlight, and I could see that the noise was made by a great bat, which wheeled around, doubtless attracted by the light, although so dim, and every now and again struck the window with its wings. When I came back to my seat, I found that Lucy had moved slightly, and had torn away the garlic flowers from her throat. I replaced them as well as I could, and sat watching her.
Presently she woke, and I gave her food, as Van Helsing had prescribed. She took but a little, and that languidly. There did not seem to be with her now the unconscious struggle for life and strength that had hitherto so marked her illness. It struck me as curious that the moment she became conscious she pressed the garlic flowers close to her. It was certainly odd that whenever she got into that lethargic state, with the stertorous breathing, she put the flowers from her, but that when she waked she clutched them close. There was no possibility of making any mistake about this, for in the long hours that followed, she had many spells of sleeping and waking and repeated both actions many times.
At six o'clock Van Helsing came to relieve me. Arthur had then fallen into a doze, and he mercifully let him sleep on. When he saw Lucy's face I could hear the hissing indraw of breath, and he said to me in a sharp whisper. "Draw up the blind. I want light!" Then he bent down, and, with his face almost touching Lucy's, examined her carefully. He removed the flowers and lifted the silk handkerchief from her throat. As he did so he started back and I could hear his ejaculation, "Mein Gott!" as it was smothered in his throat. I bent over and looked, too, and as I noticed some queer chill came over me. The wounds on the throat had absolutely disappeared.
For fully five minutes Van Helsing stood looking at her, with his face at its sternest. Then he turned to me and said calmly, "She is dying. It will not be long now. It will be much difference, mark me, whether she dies conscious or in her sleep. Wake that poor boy, and let him come and see the last. He trusts us, and we have promised him."
I went to the dining room and waked him. He was dazed for a moment, but when he saw the sunlight streaming in through the edges of the shutters he thought he was late, and expressed his fear. I assured him that Lucy was still asleep, but told him as gently as I could that both Van Helsing and I feared that the end was near.  I took him by the hand and raised him up. "Come," I said, "my dear old fellow, summon all your fortitude. It will be best and easiest for her."
When we came into Lucy's room I could see that Van Helsing had, with his usual forethought, been putting matters straight and making everything look as pleasing as possible. He had even brushed Lucy's hair, so that it lay on the pillow in its usual sunny ripples. When we came into the room she opened her eyes, and seeing him, whispered softly, "Arthur! Oh, my love, I am so glad you have come!"
He was stooping to kiss her, when Van Helsing motioned him back. "No," he whispered, "not yet! Hold her hand, it will comfort her more."
So Arthur took her hand and knelt beside her, and she looked her best, with all the soft lines matching the angelic beauty of her eyes. Then gradually her eyes closed, and she sank to sleep.
And then insensibly there came the strange change which I had noticed in the night.  In a sort of sleep-waking, vague, unconscious way she opened her eyes, which were now dull and hard at once, and said in a soft, voluptuous voice, such as I had never heard from her lips, "Arthur! Oh, my love, I am so glad you have come! Kiss me!"
Arthur bent eagerly over to kiss her, but at that instant Van Helsing, who, like me, had been startled by her voice, swooped upon him, and catching him by the neck with both hands, dragged him back with a fury of strength which I never thought he could have possessed, and actually hurled him almost across the room.
"Not on your life!" he said, "not for your living soul and hers!" And he stood between them like a lion at bay.
Arthur was so taken aback that he did not for a moment know what to do or say, and before any impulse of violence could seize him he realized the place and the occasion, and stood silent, waiting.
I kept my eyes fixed on Lucy, as did Van Helsing, and we saw a spasm as of rage flit like a shadow over her face. The sharp teeth clamped together. Then her eyes closed, and she breathed heavily.
Very shortly after she opened her eyes in all their softness, and putting out her poor, pale, thin hand, took Van Helsing's great brown one, drawing it close to her, she kissed it. "My true friend," she said, in a faint voice, but with untellable pathos, "My true friend, and his! Oh, guard him, and give me peace!"
"I swear it!" he said solemnly, kneeling beside her and holding up his hand, as one who registers an oath. Then he turned to Arthur, and said to him, "Come, my child, take her hand in yours, and kiss her on the forehead, and only once."
Their eyes met instead of their lips, and so they parted. Lucy's eyes closed, and Van Helsing, who had been watching closely, took Arthur's arm, and drew him away.
And then Lucy's breathing became stertorous again, and all at once it ceased.
"It is all over," said Van Helsing. "She is dead!"
I took Arthur by the arm, and led him away to the drawing room, where he sat down, and covered his face with his hands, sobbing in a way that nearly broke me down to see.
I went back to the room, and found Van Helsing looking at poor Lucy, and his face was sterner than ever. Some change had come over her body. Death had given back part of her beauty, for her brow and cheeks had recovered some of their flowing lines. Even the lips had lost their deadly pallor. It was as if the blood, no longer needed for the working of the heart, had gone to make the harshness of death as little rude as might be.
"We thought her dying whilst she slept, and sleeping when she died."
I stood beside Van Helsing, and said, "Ah well, poor girl, there is peace for her at last. It is the end!"
He turned to me, and said with grave solemnity, "Not so, alas! Not so. It is only the beginning!"
When I asked him what he meant, he only shook his head and answered, "We can do nothing as yet. Wait and see."


Source code for silk_ml.classification
import pandas as pd
from .features import features_metrics
from .plots import plot_corr, plot_mainfold, plot_roc_cross_val
from .train import cross_validation
from .imbalanced import resample
[docs]class Classifier:
""" General tasks for classification and data analysis
Args:
target (str or None): Categorical variable to classify
filename (str or None): Name with path for reading a csv file
target_name (str or None): Target name for reports
"""
def __init__(self, target=None, filename=None, target_name=None):
pd.set_option('display.max_columns', None)
self._target = target
self.target_name = target_name
if filename and target:
self.read_csv(target, filename)
@property
def target(self):
return self._target
@target.setter
def target(self, target):
""" Sets the target variable and if the data value exists,
the X and Y values are setted as well
Args:
target (str): Categorical variable to classify
"""
self._target = target
if self.data is not None:
self.Y = self.data[target]
self.X = self.data.drop(columns=[target])
[docs] def read_csv(self, target, filename):
""" Reads a CSV file and separate the X and Y variables
Args:
target (str): Categorical variable to classify
filename (str): Name with path for reading a csv file
Returns:
list(pd.DataFrame): `X`, `Y`, and `data` values
"""
self.data = pd.read_csv(filename)
self.target = target
return self.X, self.Y, self.data
[docs] def standardize(self, normalizer, scaler):
""" Applies a normalizer and scaler preprocessing steps
Args:
normalizer (Class.fit_transform): Class that centers the data
scaler (Class.fit_transform): Class that modifies the data boundaries
"""
normalized = normalizer.fit_transform(self.X).transpose()
# Check if in the normalization any data get lost
for i, column in enumerate(self.X.columns.tolist()):
if normalized[i].var() <= 1e-10:
normalized[i] = self.X[column]
return scaler.fit_transform(normalized.transpose())
[docs] def features_metrics(self, plot=None):
""" Checks for each variable the probability of being splited
Args:
plot ('all' or 'categorical' or 'numerical' or None): Plots the
variables, showing the difference in the classes
Returns:
pd.DataFrame: Table of variables and their classification tests
"""
return features_metrics(self.X, self.Y, self.target_name, plot)
[docs] def remove_features(self, features):
""" Remove features from the X values
Args:
features (list(str)): Column's names to remove
"""
self.X = self.X.drop(columns=features)
[docs] def resample(self, rate=0.9, strategy='hybrid'):
""" Sampling based methods to balance dataset
Args:
rate (float): Ratio of the number of samples in the minority class
over the number of samples in the majority class after
resampling
strategy ('hybrid' or 'over_sampling' or 'under_sampling'): Strategy
to balance the dataset
"""
self.X, self.Y = resample(self.X, self.Y, rate, strategy)
[docs] def cross_validation(self, models, scores, folds=30):
""" Validates several models and scores
Args:
models (list(tuple)): Models to evaluate
scores (list(tuple)): Scores to measure the models
folds (int): Number of folds in a (Stratified)KFold
"""
return cross_validation(self.X, self.Y, models, scores, folds)
[docs] def plot_corr(self, values=True):
""" Plots the correlation matrix
Args:
values (bool): Shows each of the correlation values
"""
plot_corr(self.data, values)
[docs] def plot_mainfold(self, method):
""" Plots the reduced space using a mainfold transformation
Args:
method (Class.fit_transform): Mainfold transformation method
"""
plot_mainfold(method, self.data, self.target_name)
[docs] def plot_roc_cross_val(self, models):
""" Plots all the models with their ROC
Args:
models (list(tuple)): Models to evaluate
"""
plot_roc_cross_val(self.X, self.Y, models)


(Deprecated API)
(Deprecated API)
(Deprecated API)
Includes enterprise licensing and support
Note: The Google Mapplets API has been officially deprecated as of May 19, 2010. Existing Mapplets will continute to be supported, but no new Mapplets will be accepted into the Mapplets Gallery.
Overlays are objects on the map that are tied to latitude/longitude coordinates, so they move when you drag or zoom the map. Overlays reflect objects that you "add" to the map to designate points, lines, or areas.
The Mapplets API has several types of overlays:
GMarker
and may make use of the GIcon
type.GPolyline
.GLatLngBounds
).GTileLayerOverlay
.GInfoWindow
attached to a map.Overlays can be added to a map using the GMap2.addOverlay()
method and removed using the GMap2.removeOverlay()
method. (Note that
the info window is added by default to the map.)
Markers identify points on the map. By default, they use use
G_DEFAULT_ICON
, though you can specify a custom icon. The
GMarker
constructor takes a GLatLng
and an
optional GMarkerOptions
object as arguments.
Markers are designed to be interactive. By default, they
receive "click"
events, for example, and are often
used with event listeners to bring up info windows.
This example displays 10 markers at random locations.
var map = new GMap2(); map.getBoundsAsync(function(bounds) { var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); for (var i = 0; i < 10; i++) { var point = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(new GMarker(point)); } });
Run this example (marker-simple.xml)
Markers are interactive objects that can be clicked on and dragged to a new location.
In this example, we place a draggable marker on the map, and listen to a few of its
simpler events. Draggable markers implement several kinds of events: click
,
dragstart
, and dragend
to indicate their drag status. (We don't
generate drag
events as we do in the Maps API during the drag as it would
flood the mapplet queue with too many event requests.) By default, markers are clickable
but not draggable, so they need to be initialized with the
additional marker option draggable
set to true. Draggable markers are
also bouncy by default. If you don't like this behavior, just set the
bouncy
option to false and it will drop down gracefully.
var map = new GMap2(); var center = new GLatLng(37.4419, -122.1419); map.setCenter(center, 13); var marker = new GMarker(center, {draggable: true, bouncy: true}); map.addOverlay(marker); GEvent.addListener(marker, "dragstart", function() { map.closeInfoWindow(); }); GEvent.addListener(marker, "dragend", function() { marker.openInfoWindowHtml("Just bouncing along..."); });
Run this example (marker-drag.xml)
Markers may define an icon to show in place of the default icon.
Defining an icon is complex because of the number of different images
that make up a single icon in the Maps API. At a minimum, an icon
must define the foreground image, the size (of type GSize
),
and an icon offset to position the icon.
The simplest icons are based on the G_DEFAULT_ICON
type. Creating an icon based on this type allows you to quickly
change the default icon by modifying only a few properties.
In the example below, we create an icon using the
G_DEFAULT_ICON
type, and then modify it to
use a different image. (Be careful using different images,
as they need to be set up as the correct size as the default image
to display properly.)
var map = new GMap2(); map.addControl(new GSmallMapControl()); map.setCenter(new GLatLng(37.4419, -122.1419), 13); // Create our "tiny" marker icon var blueIcon = new GIcon(G_DEFAULT_ICON); blueIcon.image = "http://maps.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png"; // Set up our GMarkerOptions object markerOptions = { icon:blueIcon }; // Add 10 markers to the map at random locations var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); for (var i = 0; i < 10; i++) { var point = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(new GMarker(point, markerOptions)); }
Run this example (icon-simple.xml)
Most icons contain a foreground image and a shadow image. The shadow image should be created at a 45 degree angle (upward and to the right) from the foreground image, and the bottom left corner of the shadow image should align with the bottom-left corner of the icon foreground image.
This example creates a new type of icon, using the
Google Ride Finder "mini" markers
as an example. We have to specify the foreground image, the shadow image, and the points at
which we anchor the icon to the map and anchor the info window to the icon. Note that
the icon is passed in options defined in the GMarkerOptions
object.
var map = new GMap2(); // Create our "tiny" marker icon var tinyIcon = new GIcon(); tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; tinyIcon.iconSize = new GSize(12, 20); tinyIcon.shadowSize = new GSize(22, 20); tinyIcon.iconAnchor = new GPoint(6, 20); tinyIcon.infoWindowAnchor = new GPoint(5, 1); // Add 10 markers to the map at random locations map.getBoundsAsync(function(bounds) { var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); for (var i = 0; i < 10; i++) { var point = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(new GMarker(point, {icon:tinyIcon})); } });
Run this example (icon-complex.xml)
GIcon
objects also have several other properties
that you should set to get maximum browser compatibility and
functionality from your icons. For example, the imageMap
property specifies the shape of the non-transparent parts of the
icon image. If you do not set this property in your icon, the entire
icon image (including the transparency) will be clickable in
Firefox/Mozilla. See the GIcon class
reference for more information.
In many cases, your icons may have different foregrounds, but the same shape
and shadow. The easiest way to achieve this behavior is to use the copy constructor
for the GIcon
class, which copies all the properties over to a new icon
which you can then customize.
var map = new GMap2(); // Create a base icon for all of our markers that specifies the // shadow, icon dimensions, etc. var baseIcon = new GIcon(); baseIcon.shadow = "http://maps.google.com/mapfiles/shadow50.png"; baseIcon.iconSize = new GSize(20, 34); baseIcon.shadowSize = new GSize(37, 34); baseIcon.iconAnchor = new GPoint(9, 34); baseIcon.infoWindowAnchor = new GPoint(9, 2); baseIcon.infoShadowAnchor = new GPoint(18, 25); // Creates a marker whose info window displays the letter corresponding // to the given index. function createMarker(point, index) { // Create a lettered icon for this point using our icon class var letter = String.fromCharCode("A".charCodeAt(0) + index); var letterIcon = new GIcon(baseIcon); letterIcon.image = "http://maps.google.com/mapfiles/marker" + letter + ".png"; return new GMarker(point, {icon:letterIcon}); } // Add markers A - J to the map at random locations map.getBoundsAsync(function(bounds) { var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); for (var i = 0; i < 10; i++) { var point = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(createMarker(point, i)); } });
Run this example (icon-custom.xml)
GPolyline
objects create a linear overlay on the map. A
GPolyline
consists of a series of points and creates a series
of line segments that connect those points in an ordered sequence.
Polylines are drawn as a series of straight segments on the map. You can specify
custom colors, weights, and opacities for the line. Colors should be in hexadecimal
numeric HTML style, e.g., use #ff0000
instead of red
.
GPolyline
does not understand named colors.
GPolyline
objects use the vector drawing capabilities
of the browser, if available. In Internet Explorer, Google Maps uses
VML (see XHTML and VML) to draw polylines;
in other browsers SVG is used if available. In all other circumstances, we request an
image of the line from Google servers and overlay that image on the
map, refreshing the image as necessary as the map is zoomed and dragged around.
This example displays a polyline with 5 random points. The polyline is red, 5 pixels thick, and has 70% opacity.
var map = new GMap2(); map.getBoundsAsync(function(bounds) { var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); var points = []; for (var i = 0; i < 5; i++) { points.push(new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random())); } map.addOverlay(new GPolyline(points, "#ff0000", 5, 0.7)); });
Run this example (polyline-simple.xml)
Polylines represented on the map are straight lines conforming to the
current projection. That is, they appear straight on the map, but may in fact
not properly account for the curvature of the earth. If you instead wish
to draw a geodesic (a segment of a "great circle" representing the shortest
distance between two points on the surface of the earth), you
will need to pass geodesic:true
in the GPolylineOptions
argument of the GPolyline
.
The GPolylineOptions
object is an example of an object literal.
With object literals, you don't construct an object. Instead, you pass
the arguments as a series of name/value pairs within curly brackets.
Object literals are used often in those cases where instantiating an
object is unnecessary.
var map = new GMap2(); map.setCenter(new GLatLng(45.828799,-105.292969), 2); // Create GPolylineOptions argument as an object literal. // Note that we don't use a constructor. var polyOptions = {geodesic:true}; var polyline = new GPolyline([ new GLatLng(40.65642, -73.7883), new GLatLng(61.1699849, -149.944496) ], "#ff0000", 10, 1, polyOptions); map.addOverlay(polyline);
Run this example (polyline-geodesic.xml)
GPolygon
objects are similar to GPolyline
objects
in that they consist of a series of points in an ordered sequence. However,
instead of being open-ended, polygons are designed to define regions within a
closed loop. As with polylines, you can define custom colors, weights, and
opacities for the edge of the polygon (the "line") and custom colors and
opacities for the fill area within the enclosed region. Colors should be
in hexadecimal numeric HTML style.
GPolygon
objects, like GPolyline
objects, use
the vector drawing capabilities of the browser, if available.
This example displays a polygon with 3 random vertices. The outline is is red, 5 pixels thick, and has 70% opacity. The polygon is filled with blue with 40% opacity.
var map = new GMap2(); map.getBoundsAsync(function(bounds) { var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); var points = []; for (var i = 0; i < 3; i++) { points.push(new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random())); } points.push(points[0]); // Close the polygon map.addOverlay(new GPolygon(points, "#ff0000", 5, 0.7, "#0000ff", 0.4)); });
Run this example (polygon-simple.xml)
Polygons are useful overlays to represent arbitrarily-sized areas, but they
cannot display images. If you have an image that you wish to place on a map,
you can use a GGroundOverlay
object. The constructor for a
GGroundOverlay
takes a URL of an image and the GLatLngBounds
of the image
as parameters.
The following example places an antique map of Newark, NJ on the map as an overlay:
var map = new GMap2(); map.setCenter(new GLatLng(40.740, -74.18), 12); // ground overlay var boundaries = new GLatLngBounds(new GLatLng(40.716216,-74.213393), new GLatLng(40.765641,-74.139235)); var oldmap = new GGroundOverlay("http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg", boundaries); map.addOverlay(oldmap);
Run this example (groundoverlay-simple.xml)
Mapplets also may wish to display their own custom tiles over the main map. If the image is a single image, you would use a ground overlay, but you may wish to show many images at different zoom levels. In that case, you may wish to use a tile layer overlay similar to how the main maps tiles are displayed on Google Maps.
Creating a proper set of tile layer overlays involves creating a set of tiles for each zoom level you wish to have them displayed, and then defining a scheme to organize them and display based on the current viewport. Creating such a scheme requires an understanding of Google Maps Coordinates. If you are unfamiliar with Google Maps coordinates, consult that section before proceeding.
Implementing a tile overlay for other than a few simple zoom levels can
be an onerous task, as you would need to add logic to determine which
particular tile image to serve. Mapplets provides a way to
construct GTileLayer
s based on a template system, passing arguments
to the template as an object literal. The tileUrlTemplate
property
maps tile requests to URLs based on tile coordinates. The constructor for an
overlay looks something like this:
var tileLayerOverlay = new GTileLayerOverlay( new GTileLayer(null, null, null, { tileUrlTemplate: 'http://domain.com/myimage_{Z}_{X}_{Y}.png', isPng:true, opacity:1.0 }) ); map.addOverlay(tileLayerOverlay);
This template scheme allows you to address a collection of tile images named using tile coordinates as they are done within Google Maps.
Continue on to Mapplet Services.


{% extends 'base.html' %}
{% block body_block %}
eDreams ODIGEO, Barcelona
Sales Lodging Specialist
June 2018 –
- Source, contact and convince the hotels to use our
platform ODIGEO Connect in order to facilitate their
distribution and increase their online visibility
- Offer a high-quality service, customer oriented:
Assist the hotels by explaining how to use our
extranet, facilitate the connectivity with their channel
manager
- Achieve the monthly targets set by our managers
Voyageurs du Monde, Paris
Product Manager Portugal, Tailor Made Travel Designer
2014-2018
- Build and sell high-end tailor-made travels. Top seller
in the Southern Europe Dpt with a sales revenue of
813 000 € in 2017 and a success rate of 42,97% in a
higly competitive environment.
- “Luxury Attitude” referent worker : Provide the best
service and the best experiences to our customers.
- Train 4 new travel agents on selling technics and
constructing itineraries.
- Source and contract new hotels and providers,
maintaining an excellent relationship with them by
frequently visiting them in Portugal and Spain.
{% endblock body_block %}


Customer – Opens the Customer List. Refer to the document “Customer Management”.
Designer - Opens the Designer List. Refer to the document “Designer Commissions”.


Handling files as single "lumps" of data: strings or arrays.
// read a file as a string
$string = file_get_contents($filename)
// create a file from a string
file_put_contents($filename, $string)
// make a copy of a file
copy($source, $destination)
// move a file
rename($oldname, $newname)
// delete a file
unlink($filename)
Directory Operations
Directories can be created, removed, moved, or scanned for their contents.
// create a directory
mkdir($path)
// delete a directory
rmdir($path)
// move a directory
rename($oldname, $newname)
// scans a directory for its contents
scandir($path)
Resources
A primitive PHP data type
Resource variables references external resource
Resource variables created and destroyed by specialised functions
Resources are not objects
About 120 resource types
Well over 1000 functions for handling resources
One resource type: streams
Streams
A stream is a resource type with streamable behaviour:
Linear sequence of data – a start, middle and end
No structure inherent in the stream data
You progress through a stream, with a pointer tracking where you are
Some streams allow you to rewind or seek to arbitrary points
A stream may be readable/writable/seekable
You choose how to open the stream – read/write/both
A stream maps onto a file, providing access to that file
Advantages of Streams
Good for memory (with enormous files)
Rich set of functions (nearly 50)
Can read enormous directories
Can append to files
Stream Operations
// open a path as a stream
fopen($filename, $mode)
// write a string to a stream
fputs($handle)
// read bytes from a stream
fread($handle, $length)
// jump to a location in a stream (moves the file pointer)
fseek($handle, offset)
// close a stream and destroy the resource
fclose($handle)
// Similar for directories:
opendir(); readdir(); closedir();
// and a bunch of stream_*() functions for manipulating streams
Stream Wrappers (1)
aka Protocol Handlers
Every stream is handled by a wrapper
The wrapper is specified at the start of the path as a scheme: scheme://target
Schemes include: file, ftp, http, php, phar, and more
Default scheme is file://
php:// wrapper gives access to stdin, stdout, memory
Stream Wrappers (2)
All wrappers can be used in whole-file operations we looked at earlier readfile('http://phpne.org.uk/about')
Custom wrappers can be created
Custom Stream Wrappers
Register Your Stream Wrapper
// Register the class
stream_wrapper_register('mywrapper', 'MyStreamProtocol');
// Use the wrapper
$fp = fopen('mywrapper://some/path/to/a/data/source', 'r');
readfile(fp);
fclose($fp);
Custom Stream Wrappers
Define Your Stream Wrapper (1)
class MyStreamProtocol {
// Open a stream
function stream_open($path, $mode, $options, &$opened_path) {...};
function stream_close() {...};
function stream_read() {...};
function stream_write() {...};
function stream_eof() {...};
function stream_tell() {...};
function stream_seek() {...};
...
}
Custom Stream Wrappers
Define Your Stream Wrapper (2)
class MyStreamProtocol {
...
// File-based operations for use with touch(), unlink(), rename(), stat()
function unlink() {...};
function rename() {...};
function rmdir() {...};
function url_stat() {...};
...
}
Custom Stream Wrappers
Define Your Stream Wrapper (3)
class MyStreamProtocol {
...
// Directory-based operations for use with mkdir(), rmdir(), opendir()
function mkdir() {...};
function rmdir() {...};
function dir_opendir() {...};
function dir_readdir() {...};
function dir_closedir() {...};
}
Stream Filters and Options
Filters can be added to streams
Custom filters can be created
Options can be passed to wrappers (called "contexts")
Options are specific to each wrapper
Put it all Together
Why Abstract?
Since the stream wrappers already seem to abstract everything, why abstract more?
One interface for handling files anywhere
Remote storage complexities hidden from the application logic; loose coupling
Swapping storage should be simple and quick; less lock-in
Testing - emulate a filesystem easily
Introducing Flysytem
Composer/packagist installation
Extendable using the adapter pattern
Works on PHP5.3, tested to PHP5.6
Supports streaming and whole files
Caching built-in (DI)
Copy files across different filesystems
Installing
composer install
{
"require": {
"league/flysystem": "0.2.*"
}
}
What is Flysystem
"Flysystem is a filesystem abstraction which allows you to easily swap out a local filesystem for a remote one."
// The filesystem class and the adapter.
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local as Adapter;
// Create a local file filesystem object.
$filesystem = new Filesystem(new Adapter('path/to/root'));
// Get the content of a file.
$file_content = $filesystem->read('sub_dir/myfile.txt');
FTP
Other adapters can be dropped into the constructor:
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Ftp as Adapter;
$filesystem = new Filesystem(new Adapter(array(
'host' => 'ftp.example.com',
'username' => 'username',
'password' => 'password',
)));
Dropbox
Some adapters need external libraries to be included:
use Dropbox\Client;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Dropbox as Adapter;
$client = new Client($token, $appName);
$filesystem = new Filesystem(new Adapter($client, 'optional/path/prefix'));
The Dropbox library in turn needs OAuth and its libraries.
It is all nicely handled by DI.
Operations (1)
Writing complete files:
$fs = new Filesystem($adapter);
// Create a new file (including directories) and set permissions
$fs->write($filename, $content)
// Overwrite the contents of an existing file
$fs->update($filename, $content)
// Write or put, depending if file exists
$fs->put($filename, $content)
// Apend to a file?
Operations (2)
Reading complete files:
$fs = new Filesystem($adapter);
// Read the complete contents of a file as a string
$fs->read($filename)
// Tells us if the file exists
$fs->has($filename)
Operations (3)
File operations:
$fs = new Filesystem($adapter);
// Delete a file
$fs->delete($filename)
// Rename or move a file
$fs->rename($filename)
// Copy a file?
Operations (4)
Directory operations:
$fs = new Filesystem($adapter);
// Create a directory (to any number of levels)
$fs->createDir($path)
// Remove a directory
$fs->deleteDir($path)
// Move a directory? Same as renaming a file
$fs->rename($path)
Metadata
Minimum supported metadata for all adapters:
$fs = new Filesystem($adapter);
// Get the Mimetype for a file
$fs->getMimetype($filename)
// Get the last update time for a file
$fs->getTimestamp($filename)
// Get the size of a file in bytes
$fs->getSize($filename)
File Visibility (1)
The visibility of a file: can it be seen by others or just the current user?
// Two states allowed
AdapterInterface::VISIBILITY_PRIVATE // 'private'
AdapterInterface::VISIBILITY_PUBLIC // 'public'
File Visibility (2)
The visibility can be:
set globally, for all new files to take on
set for each file creating operation (write)
applied to existing files
// New files
$fs->write($filename, 'contents', ['visibility' => $visibility]
// Existing files
$fs->getVisibility($filename)
$fs->setVisibility($filename, $visibility)
// Or set globally when instantiating the Filesystem
$fs = new League\Flysystem\Filesystem($adapter, $cache, [
'visibility' => AdapterInterface::VISIBILITY_PRIVATE
]);
File Visibility (3)
Implementation example, for local files
public: 0644 (owner=rw, group=r, other=r)
private: 0600 (owner=rw)
Listing directories (1)
// List the contents of a directory, recursively if required
$fs->listContents($path [, bool $recurse])
Returns an array of arrays
Each item is a "file" or a "dir"
A basename (e.g. myfile.txt) and a path for each item
Any other metadata requested and cached for this item
Any metadata the adapter wants to return
Listing directories (2)
Custom metadata is very useful
$fs->listPaths($path [, bool $recurse])
Return just a list of paths
$fs->listWith($keys, $path [, bool $recurse])
Make sure metadata is requested (fields listed in $keys)
Flysystem and Streams (1)
Use streams instead of strings to read and write files
// Create a file from a stream
$fs->writeStream($filename, $stream)
// Update a file from a stream
$fs->updateStream($filename, $stream)
// Return a file as a stream
resource $fs->readStream($filename)
Flysystem and Streams (2)
There is no copy operation in Flysystem; few if any remote storages support it.
Instead, put two streams back-to-back:
// Copy one file to a new file
$fs->writeStream(
'destination.txt',
$fs->readStream('source.txt')
);
Flysystem and Streams (3)
So far no support for returning a stream to an open file for writing.
Some remote storage would support this, and some would not.
// This would be useful (but not implemented):
$stream = $fs->openWriteStream('destination.txt', 'a');
fputs($stream, 'foo');
fclose($stream);
Alternative Abstractions (1)
php-resource offers a comprehensive OPP wrapper for resources.
shesek offers a simpler OOP wrapper for resources.
KnpLabs/Gaufrette takes a similar approach, and has been around for a couple of years.
discordier/php-filesystem tries to get to some raw file access methods, though seems to have stopped development before many adapters were written. Implements filesystem iterators, which many other libraries do not.
zikula has abstracted the filesystem and is worth looking at for its coverage of operations.
Enhancements - Adapters
Some interesting adapters
BBC iPlayer
Flickr (finish off)
PDO/MySQL
IMAP
Google Cloud Storage
Test adapter skeleton
Enhancements - Features
Support for paged files (using streams)
Writeable streams
Directory listings (and files) as objects
Directory listings as streams
find() operation
Extend permissions
copy() operation
Flyception - Flyserver apdapter that uses a custom stream wrapper that calls the Flyserver adapter for its functionality
Summary
PHP file handling is flexible and powerful
PHP provides some abstraction already
We like to abstract files, directories and streams
Flysystem brings file abstraction into the OOP world
Flysystem makes it easier to swap remote storage in and out
Flysystem is still young, and will develop further
Conclusions
We can no longer assume files will just be written to the local filesystem
An OO wrapper for file access will makes switching storage destinations easier
An agreed interface would be good for portability (PSR?)
Streams and stream wrappers are underused and underappreciated
Streams are still a core part of file handling, and will be for a long time
Flysystem is gaining momentum and is worth checking out...
...but be aware it is still finding its feet
Demo (1)
An adapter to access some of Flickr as an abstract filesystem
Uses OAuth to log into Flickr
Directory structure is emulated, as are the files
Metadata includes various Flickr properties of the images
Demo does not write images at this time, but it would be simple
Demo (2)
The demo architecture
Demo (3)
The demo fetches the contents of a "path" on Flickr
// $app['flickrapi'] is a DI container for the Flickr API
// FlyAdapter is a custom adapter that adstracts Flickr
$filesystem = new Filesystem(
new Academe\Flickr\FlyAdapter($app['flickrapi'])
);
// Get the path from the user.
$path = $request->get('path', '');
// Get the items on Flickr at that path
$items = $filesystem->listContents($flickr_path);
Demo (4)
If a file is selected, then fetch it for display or download
// Filename selected by user
$file = $request->get('file', '');
if (!empty($selected_file)) {
// Get metadata for the file.
$file_metadata = $filesystem->getWithMetadata("$path/$file", array());
// Get the content of the file.
$file_content = $filesystem->read("$path/$file", array());
// The file_content can be streamed, or displayed inline
// depending on its mimetype
}


Use the mouse wheel to zoom in/out, left button to pan within plot/axes, and shift+left button to select region in plot/axes.
Number of points:
Update
Upload blast output:
Reset zoom


Ape signals description
In the following tables you will a description and some illustrations of the ape signals (gestures, body signals, vocalizations, facial expressions) included in the template. These lists are not exhaustive but include all the signals that have been observed and analyzed for the purpose our different studies.
Ape gestures
Gestures in the following table were illustrated by Sidney Maffini.
(see Byrne et al. 20171 for a comparison of gesture repertoires across ape species)
| Gesture | Modality A=audible T=tactile |
Description | Illustration |
|---|---|---|---|
| Beckoning arm | S | Stretching arm toward another, followed by a sideways sweeping movement of the arm toward the self and ending with a twirl of the wrist from palm upward to downward, indicates invitation to approach and follow | |
| Beckoning head | S | Head jerking movement on side indicating a direction to follow | |
| Beckoning shoulder | S | Exaggerated movement of shoulder and arm when standing up or turning to walk away, indicates direction of travel movement, accompanied by recipient monitoring (look back), invitation to follow | Coming soon |
| Big loud scratch | A | Loud exaggerated scratching movement on own body (supposedly intentional to indicate location of desired grooming) | Coming soon |
| Clap hands | A | Tapping both palms of hands against each other | Coming soon |
| Clap feet | A | Tapping both sole of feet against each other | |
| Climb-on | S | Sweeping movement of the arm over own opposite shoulder, invitation to climb on back | |
| Directional Hand-on | T | Touching other’s body part (usually back) with palm of hand and maintaining touch for more than 2 s to orient other in a desired direction | |
| Directional push | T | Gentle push on another’s body part with hand(s), arm(s), feet or head, to orient partner’s body in desired direction | |
| Drum_other | A/T | Drumming other’s body part with fists or palms | |
| Drum object | A | Drumming an object with fists | Coming soon |
| Embrace | T | Signaller wraps arm(s) around recipient and maintains physical contact | |
| Fingers flex | S | Stretching hand out toward another with rapid alternation of stretching and bending movements of fingers | |
| Flap | S | Raising one arm and hand and making a downward slapping movement of the arm in front of another, in the air | TO ADD |
| Flap leg | S | Sitting with knees bent, one or both legs opened and closed to the side (single or repeated) | |
| Flap with object | S | Raising one arm and hand and making a downward slapping movement of the arm in front of another with object held in hand, in the air | Coming soon |
| Grab | T | Grabbing gently another’’s body part with closed hand(s) | |
| Grab-pull | T | Grabbing gently another ‘s body part with closed hand(s) and pulling towards self | |
| Hand on | T | Touching head (or other body part) of another with palm(s) of hand(s) and maintaining touch for more than 2 s | |
| Head bob | S | Bobbing head up and down | |
| Head jerk | S | Throwing chin upwards abruptly | |
| Head nod | S | Nodding head up and down in the body x axis | |
| Head butt | T | Touching head (or other body part) of another with head and maintaining touch for more than 2 s | Coming soon |
| Hide | S | Hidding own body part, (e.g. face, genitals,…) with hand(s) or arm(s) | Coming soon |
| Hit with object | T | Hitting another with object held in hand | Coming soon |
| Hit object | A | Hitting object with closed fist | Coming soon |
| Hit object with object | A | Hitting object with object held in hand | Coming soon |
| Kick | T | Kicking another’s body with foot | Coming soon |
| Knock object | A | Hitting an object forcefully and multiply with fist or wrist | Coming soon |
| Leaf clip | A | Strips are torn from a leaf/leaves using hand or mouth, making a conspicuous rhythmic sound | Coming soon |
| Move object | S | Grabbing an object with hand (s) and moving it away or pulling it | Coming soon |
| Out arm | S | Raising one (both) arm(s) laterally on side of body at about shoulder level | |
| Out leg | S | Raising one leg at hip level (like a dog peeing) | |
| Poke | T | Touching firmly and briefly another’s body part with finger, may be repetitive | |
| Punch | T | Hitting another forcefully and singly with fist(s) or wrist(S) | Coming soon |
| Push | T | Pushing away gently another with hand(s) or arm(s) | |
| Raise arm | S | Raising one (both) arm(s) above head level | |
| Raise leg | S | Raising one leg above hip level | Coming soon |
| Rap object | A | Rapping object on the ground back and forth repetitively | Coming soon |
| Reach hand | S | Holding a hand toward another by extending the arm and hand | |
| Reach leg | S | Holding a foot toward another by extending the leg and foot | Coming soon |
| Shake arm | S | Shaking loosely one (both) arm(s) from shoulder joint | |
| Shake feet | S | Shaking feet vigorously and loosely from ankle joint | |
| Shake hand | S | Shaking hand vigorously and loosely from wrist joint | |
| Shake head | S | Shaking head from side to side on horizontal axis | Coming doon |
| Shake object | S | Shaking fixed object forcefully with one or both hands | |
| Shake other | T | Shaking other’s body part with one or both hands | Coming soon |
| Shoo (Hand wave off) | S | Raising hand and waving it away from self | |
| Slap | T | Slapping forcefully and singly another with palm of hand | Coming soon |
| Slap object | A | Slapping forcefully and singly object with palm of hand | |
| Stomp single | A | Stamping ground forcefully with sole of foot | |
| Stomp rhytmic | A | Stamping ground forcefully and alternatively with one foot then the other very rapidly | |
| Stretch over | S | Stretching and raising arm till about head level with the palm facing downwards, like embracing another’s body without touching, sexual invitation | |
| Stroke | T | Stroking another individual’s body with gentle back and forth movement of palm of hand or fingers | |
| Swing arm | S | Swinging arm back and forth on side of body, either once or repetitively | |
| Swing leg | S | Swinging leg(s) back and forth on side of body, either once or repetitively | Coming soon |
| Swing under arm | S | Swinging arm back and forth from front of body to between legs | |
| Tap | T | Tapping repetitively another with palm of hand, with firm short contact of the fingers to the other’s body (may include rhythmic repetition or single movement) | |
| Tap object | A | Tapping an object repetitively with palm of hand | |
| Throw object | S | Throwing an object in direction of another | |
| Throw threat | S | Grabbing an object and performing a forward and forceful movement but the object is not released | |
| Touch | T | Touching gently another individual’s body part with palm of hand, for under 2s | |
| Wave arm | S | Waving arm(s) raised above shoulder level with large back and forth movements |
Ape body signals
| Body signal | Modality A=audible T=tactile |
Description | Illustration |
|---|---|---|---|
| Bite | T | Holding another’s body part between lips or teeth without pressure (mock bite) | Coming soon |
| Bounce | S | Standing on four relaxed limbs and performing rapid up and down movements | Coming soon |
| Bow | S | Bending forward upper body according to the body x axis while standing on two legs | Coming soon |
| Dangle | S | Hangs from arm(s) above another, may shake feet/legs, typically audible with movement in trees | Coming soon |
| Dragging object | A | Dragging object held in hand along side of body (usually branch) while moving forward, charging display | Coming soon |
| Gallop | A | Exaggerated running with forelegs playfully and forcefully stamping the ground (similar to a child imitating a horse galloping | Coming soon |
| Gallop stiff | S | Running with stiff forelegs | Coming soon |
| Jump | S | Both feet leave ground simultaneously with horizontal displacement | Coming soon |
| Look | S | Holding eye-contact with another lasting >2s | Coming soon |
| Open arm | S | Subtle opening of the arm, invitation to body contact | Coming soon |
| Open leg | S | Subtle opening of the leg, invitation to body contact | Coming soon |
| Pirouette | S | Twirling movement of whole body around the body y axis while standing on four legs. Progressive forward movement in space | Coming soon |
| Pounce | T | Displacing through air to land quadrupedally on the body of another | Coming soon |
| Present bipedal | S | Standing bipedally in front of another with arms spread apart, sexual invitation | Coming soon |
| Present concave back | S | Sitting in front of another with arched back to expose genitals with legs spread apart, sexual invitation | Coming soon |
| Present rump | S | Standing quadrupedally in front of another with dorsal side up to expose hindquarters, while looking back at recipient, sexual invitation | Coming soon |
| Present ventral | S | Lying on back in front of another with legs spread apart to expose genitals | Coming soon |
| Present body part | S | Presenting body part by stretching body to deliberately expose an area of own body to another’s attention, usually to be groomed or invitation to climb-on | Coming soon |
| Push object | A | Pushing away forcefully an object with hand usually with body hunched over and accompanying a charging display | Coming soon |
| Rock | S | Rocking movement of whole body while seated | Coming soon |
| Rock bipedal | S | Rocking movement of whole body while standing bipedally | Coming soon |
| Roll over | S | Signaller rolls onto back exposing stomach, can be accompanied by repeated movements of arms and/or legs | Coming soon |
| Side roulade | S | Body is rotated around the head-feet axis while lying on the ground | Coming soon |
| Somersault | S | Twirling forward movement of whole body around the body x axis | Coming soon |
| Stiff stance | S | Standing rigidly with stiff limbs and forelimbs held tight | Coming soon |
| Swagger bipedal | S | Lateral swaying of the upper body | Coming soon |
| Walk stiff | S | Walking with rigid forelegs, with a slow exaggerated movement | Coming soon |
| Walk tandem | T | Placing arm over the body of another and both walk forward while maintaining position | Coming soon |
Ape vocalisations
| Vocalisation | Description | Context of production | Illustration |
|---|---|---|---|
| Peeps | High-frequency, closed mouth vocalization. Short in duration and characterised by a simple, flat acoustic form composed of several harmonics that are generally un-modulated | Produced across a large array of contexts, especially common during feeding events and travel | (Clay et al.2015)2 |
| High hoots | High-pitched long-distance call, like a ‘waah’ | Long distance communication, can be used to communicate between parties and given in response to external disturbance or excitement (e.g. food arrival) | |
| Contest hoots | Call sequences consisting of an introductory phase (modulated inverted u-shape form), an escalation phase composed of several stereotyped units (unmodulated inverted u-shape), and a let-down phase | Used by males to challenge another individual and display status to others | (Genty et al. 2014)3 |
| Victim screams | High-pitched, with shrill and rasping sounds given at full vocal strength, large number of harmonics and long in duration, accompanied by teeth-baring (complete lip retraction, exposing both teeth and gums, the mouth may be wide open) | Used by victim after conflict or during tantrums | |
| Copulation screams | Single or succession of high-frequency squeaks and screams | Used by females during mating events | (Clay and Zuberbühler, 2011)4 |
| Pant laughter | Voiceless, jerky breathing which sounds like coarse low-pitched grunting, rather soft, accompanied by play-face | Used during socio-positive interactions, play, chase-play. Mostly given by subordinate to dominant | |
| Laughter | Full laughter, sounds like a ‘ah-ah-ah’ | Triggered by physical contact (tickle, bite) | |
| Pant grunts (greeting grunts) | A rhythmic series of brief, grunt-like, vocalized air expulsion sounding like a ‘eh-eh-eh’ | Close-range vocalisation, uttered during approaches from subordinates to dominants in agonistic situations | |
| Alarm peep | Same as Peeps | Given in response to the discovery of a minor threat, or response to surprise | |
| Pout moan (or Whimpers) | Low-pitched, melodious call sounding like a whining “hoo-hoo”27, accompanied by pout face (lips are pursed forward and curled outward in front resulting in circular opening). | Used by infants for requests, used by adults during sexual initiations, food begging, or as a appeasement signal in agonistic interactions. Also used as a request to stop current activity | (Genty, 2019)5 |
| Threat Barks | Same as barks | Used during aggressive attacks, or if bothered by another individual approach or behaviour | |
| Wieew bark | A single, very loud bark, accompanied by facial expression of wide open mouth. Difficult to distinguish from high hoots | Given in response to alarm or hostility rather than excitement. | |
| Raspberry | Voiceless sounds, air is pressed through the lips, like a ‘prrrrr’ | Used during grooming, or food begging |
Ape facial expressions
| Description | Context of production | Illustration | |
|---|---|---|---|
| Silent bare-teeth | Retraction of the lips resulting in partial or complete exposure of the teeth and gums, with mouth practically closed and without vocalization | Displayed in agonistic and approach-retreat interactions, during sexual interactions. Performed by both subordinate and dominant individuals, expression of fear, nervousness, or hesitation. Demonstrates non-hostile intentions, function as appeasement and reassurance signal. | ©Emilie Genty |
| Tense mouth | Lips show strong horizontal tension. They are either drawn inward or slightly bar- ing the teeth. The mouth may be opened but never widely. No vocaliza- tions accompany the display | Aggressive expression, before or during display behaviours. Displayed also in food competition situations | |
| Pout face | Lips are pursed forward and curled outward in front resulting in a circular opening. The lips are pressed together at the mouthcorners | Displayed to request for food or request physical contact. Sometimes displayed during grooming. Can express disappointment | ©Emilie Genty |
| Play-face | Mouth is opened with the lips either a) in a relaxed position covering the upper teeth completely and the lower teeth partially, or b) retracted, without however pulling back the mouth resulting in baring of both the upper and lower and frontal teeth | Displayed during play invitation or play bouts | ©Emilie Genty |
-
Byrne R.W., Cartmill E. Genty E., Graham K. E., Hobaiter, C.,Tanner J (2017). Great ape gestures: Intentional communication with a rich set of innate signals. Animal Cognition. 20, 755–769 (2017). ↩
-
Clay Z., Archbold J. Zuberbühler K. (2015). Functional flexibility in wild bonobo vocal behaviour. PeerJ 3, e1124. ↩
-
Genty E., Clay Z., Hobaiter C., & Zuberbühler K. (2014). Multi-modal use of a socially directed call in bonobos. PloS one, 9(1), e84738. ↩
-
Clay Z, Zuberbuhler K (2011) The structure of bonobo copulation calls during reproductive & non-reproductive sex. Ethology 117: 1158–1169. ↩
-
Genty E. (2019). Vocal–gestural combinations in infant bonobos: new insights into signal functional specificity. (2019). Animal Cognition 22, 505–518 https://doi.org/10.1007/s10071-019-01267-0. ↩


{% extends 'wl/base.html' %} {% load static %} {% load users %} {% load application_filters %} {% block requirements %} require(['js/entry/navigation'], function(navigation) { navigation.init('Warning: any information entered into the form will be lost if not saved as draft.', {{ application.id }}, 'a, :button', '#breadcrumbsContainer, #contentContainer', "{{ csrf_token }}"); }); {% endblock %} {% block breadcrumbs %}
{% endblock %} {% block intro_title %}With this type of licence you are eligible for a senior discount if you are the holder of a Senior Card. If you have a scanned or photographed image of it, please upload it here.
Note: You must upload a Senior card document before lodging your application to be granted the senior discount.
This type of licence requires photographic identification. You can upload a scanned or photographed image of a valid Australian driver’s licence, passport, or proof-of-age card.
If you cannot provide identification at this point, you can skip this step of the application process. You can then, at any time, upload your photo ID by selecting the Manage ID option under the Options menu on the menu bar. Alternatively, you can present your photo ID in person at the Wildlife Licensing office, 17 Dick Perry Avenue, Kensington.
Note: your application will not be approved until identification has been submitted.
If you are the holder of a Senior Card and you cannot provide a digital version of it, please contact the Wildlife Licensing office on 9219 9831 before lodging your application.
{% endblock %} {% block content %}


The files for all the vehicle models can be found in the models folder on the GitHub repository.
Car Model
The rearwheel kinematic car is one of the models used in testing the 2D scenarios. The dynamics for the car are given by the following.
\[ \dot{q} = \begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} \cos(\theta) & 0 \\ \sin(\theta) & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} v \\ w \end{bmatrix} \]
The error for the car are given by the following.
\[ \begin{bmatrix} e_x \\ e_y \\ e_{\theta} \end{bmatrix} = \begin{bmatrix} \cos(\theta) & \sin(\theta) & 0 \\ -\sin(\theta) & \cos(\theta) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x_{ref} - x \\ y_{ref} - y \\ \theta_{ref} - \theta \end{bmatrix} \]
The error dynamics are given by the following.
\[ \begin{bmatrix} \dot{e}_x \\ \dot{e}_y \\ \dot{e}_{\theta} \end{bmatrix} = \begin{bmatrix} \omega e_y - v + v_{ref} \cos(e_{\theta}) \\ -\omega e_x + v_{ref} \sin(e_{\theta}) \\ \omega_{ref} - \omega \end{bmatrix} \]
The following control law is proposed:
\[ v = v_{ref} \cos(e_{\theta}) + k_1 e_x \]
\[ \omega = \omega_{ref} + v_{ref}(k_2 e_y + k_3 \sin(e_{\theta})) \]
Substituting this control law, the error dynamics become:
\[ \begin{bmatrix} \dot{e}_x \\ \dot{e}_y \\ \dot{e}_{\theta} \end{bmatrix} = \begin{bmatrix} (\omega_{ref} + v_{ref}(k_2 e_y + k_3 \sin(e_{\theta}))) e_y - k_1 e_x \\ -(\omega_{ref} + v_{ref}(k_2 e_y + k_3 \sin(e_{\theta}))) e_x + v_{ref} \sin(e_{\theta}) \\ \omega_{ref} - \omega \end{bmatrix} \]
A candidate Lyapunov function for the system is given below.
\[ V = \frac{1}{2} (e_x^2 + e_y^2) + \frac{1 - \cos(e_{\theta})}{k_2} \]
The time derivative of this Lyapunov function is:
\[ \dot{V} = -k_1 e_x^2 - \frac{v_{ref} k_3 \sin^2(e_{\theta})}{k_2} \]
The Lyapunov function is positive semi-definite and its time derivative is negative semi-definite, meaning it is a valid Lyapunov function. The \( \frac{1 - \cos(e_{\theta})}{k_2} \) term can be upper bounded by \( \frac{2}{k_2} \). Initially \( V(e(0)) \leq \frac{\ell^2}{2} + \frac{2}{k_2} \) where \( \ell^2 = e_x^2 + e_y^2 \). Then, for all time \( V(e(t)) \leq \frac{\ell^2}{2} + \frac{2i}{k_2} \) for the \( i^{th} \) segment. Therefore, the error of the car is upper bounded by \( \sqrt{( \ell^2 + \frac{4i}{k_2})} \) .
Appendix A from Fast and Guaranteed Safe Controller Synthesis
A.1 Robot Model
The robot is one of the models used in testing the 2D scenarios. The kinematics for a robot are given by
\[ \dot{q} = \begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} \cos(\theta) & 0 \\ \sin(\theta) & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} v \\ \omega \end{bmatrix} \]
The model can be made bijective by using the states \( s = \sin(\theta) \) and \( c = \cos(\theta) \) in place of \( \theta \). The kinematic equation becomes
\[ \dot{q} = \begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{s} \\ \dot{c} \end{bmatrix} = \begin{bmatrix} c & 0 \\ s & 0 \\ 0 & c \\ 0 & s \end{bmatrix} \begin{bmatrix} v \\ \omega \end{bmatrix} \]
When a reference trajectory is introduced, the error states are given by
\[ e_x = c(x_{ref} - x) + s(y_{ref} - y) \]
\[ e_y = -s(x_{ref} - x) + c(y_{ref} - y) \]
\[ e_s = \sin(\theta_{ref} - \theta) = s_{ref}c - c_{ref}s \]
\[ e_c = \cos(\theta_{ref} - \theta) = c_{ref}c + s_{ref}s -1 \]
From 5, the following Lyapunov function is proposed:
\[ V = \frac{k}{2} (e_x^2 + e_y^2) + \frac{1}{2(1 + \frac{e_c}{a})} (e_s^2 + e_c^2) \]
where \( k > 0 \) and \( a > 0 \) are constants. The range of \( e_c \) is \( [-2, 0] \) and therefore \( 0 < \frac{a - 2}{a} \leq 1 + \frac{e_c}{a} \leq 1 \) and \( 1 \leq \frac{1}{1 + \frac{e_c}{a}} \leq \frac{a}{a-2} \) . The Lyapunov function has the derivative
\[ \dot{V} = -ke_x v_b + e_s \left( k v_{ref} e_y - \frac{\omega_b}{(1 + \frac{e_c}{a})^2} \right) \]
which is negative semi-definite with the control law
\[ v_b = k_x e_x \]
\[ \omega_b = k v_{ref} e_y (1 + \frac{e_c}{a})^2 + k_s e_s \left[ \left( 1 + \frac{e_c}{a} \right)^2 \right]^n \]
It can be checked that \( e_s^2 + e_c^2 = -2 e_c \in [0, 4] \). The term \( \frac{1}{2(1 + \frac{e_c}{a})}(e_s^2 + e_c^2) \) in \( V \) can also be bounded with \( \frac{1}{2(1 + \frac{e_c}{a})}(e_s^2 + e_c^2) \in [2, \frac{2a}{a-2}] \).
A.2 Autonomous Underwater Vehicle (AUV) Model
The autonomous underwater vehicle (AUV) is one of the models used for testing the 3D scenarios. The position of the AUV is \( \textbf{x} = \begin{bmatrix} x & y & z \end{bmatrix}^T \), and the Euler angles (roll, pitch, and yaw respectively) are \( \boldsymbol{\theta} = \begin{bmatrix} \phi & \theta & \psi \end{bmatrix}^T \). The equations of motion for the position and Euler angles are given by
\[ \begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{z} \end{bmatrix} = \begin{bmatrix} \cos{\psi} \cos{\theta} \\ \sin{\psi} \cos{\theta} \\ \sin{\theta} \end{bmatrix} v \]
\[ \begin{bmatrix} \dot{\phi} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} =
\begin{bmatrix} 1 & \sin{\phi} \tan{\theta} & \cos{\phi} \tan{\theta} \\
0 & \cos{\phi} & -\sin{\phi} \\
0 & \sin{\phi} \sec{\theta} & \cos{\phi} \sec{\theta} \end{bmatrix}
\begin{bmatrix} \omega_x \\ \omega_y \\ \omega_z \end{bmatrix} \]
The angular acceleration \( \boldsymbol{\omega} = \begin{bmatrix} \omega_x & \omega_y & \omega_z \end{bmatrix} \) is given in the local frame. By combining the equations of motion for the position and Euler angles, the total kinematis are given by
\[ \begin{bmatrix} \dot{\bf x} \\ \dot{\boldsymbol{\theta}} \end{bmatrix} =
\begin{bmatrix} {\bf b_1} & 0_{3 \times 3} \\ 0_{1 \times 3} & {\bf B_2} \end{bmatrix}
\begin{bmatrix} u_1 \\ {\bf u_2} \end{bmatrix} \]
where the \( m \times n\) zero matrix is denoted by \( 0_{m \times n} \) and
\[ \begin{gathered}
{\bf b_1} = \begin{bmatrix} \cos{\psi} \cos{\theta} \\ \sin{\psi} \cos{\theta} \\ -\sin{\theta} \end{bmatrix} \\
{\bf B_2} = \begin{bmatrix} 1 & \sin{\phi} \tan{\theta} & \cos{\phi} \tan{\theta} \\ 0 & \cos{\phi} & -\sin{\phi} \\ 0 & \sin{\phi} \sec{\theta} & \cos{\phi} \sec{\theta} \end{bmatrix}
\end{gathered} \]
The error is defined as
\[ {\bf x_e} = {\bf R}^\top ({\bf x_{ref}} - {\bf x}) \]
\[ \boldsymbol{\theta}_e = \boldsymbol{\theta}_{ref} - \boldsymbol{\theta} \]
where \( {\bf R} \) is the rotation matrix
\[ {\bf R} = \begin{bmatrix} c\psi c\theta & c\psi s\theta s\phi - s\psi c\phi & c\psi s\theta c\phi + s\psi s\phi \\ s\psi c\theta & s\psi s\theta s\phi + c\psi c\phi & s\psi s\theta c\phi - c\psi s\phi \\ -s\theta & c\theta s\phi & c\theta c\phi \end{bmatrix} \]
Note that \( c_{\theta} \) and \( s_{\theta} \) denote \( \cos(\theta) \) and \( \sin(\theta) \) respectively. Consider the Lyapunov function:
\[ V = \dfrac{1}{2} {\bf x_e}^T {\bf x_e} + {\bf k}^T {\bf f}(\boldsymbol{\theta}_e) \]
where \( {\bf k} = \begin{bmatrix} k_1 & k_2 & k_3 \end{bmatrix}^T \) is the controller gains vector and \( {\bf f}(\boldsymbol{\theta}_e) = \begin{bmatrix} 1-\cos{\phi_e} & 1-\cos{\theta_e} & 1-\cos{\psi_e} \end{bmatrix}^T \)
is a vector-valued function. The time derivative of the Lyapunov function is
\[ \dot{V} = {\bf x_e}^T \dot{\bf x}_e + {\bf k}^T \dfrac{d{\bf f}}{d \boldsymbol{\theta}_e}\dot{\boldsymbol{\theta}}_e \]
The error dynamics are given as
\[ \begin{gathered} \dot{\bf x}_e = {\bf b}_{1e} u_{1d} - {\bf R}^T {\bf b}_1 u_1 - \boldsymbol{\omega} \times {\bf x}_e \\ \dot{\boldsymbol{\theta}}_e = \dot{\boldsymbol{\theta}}_{ref} - \dot{\boldsymbol{\theta}} = {\bf B}_{2ref} {\bf u}_2d - {\bf B}_2 {\bf u}_2 \end{gathered} \]
When the error dynamics are substituted into \( \dot{V} \), it becomes
\[ \dot{V} = {\bf p_e}^\top \{ {\bf q} + ({\bf B_{2ref}} - {\bf B_2}){\bf u_{2ref}} - {\bf B_2}{\bf u_{2ref}} \} \\ + {\bf x_e} \{v_{ref} (\cos{\psi_e} \cos{\theta_e} - 1) - v_b \} \]
The feedback control law is chosen to be
\[ \begin{gathered} u_1 = v_{ref} + v_b \\ {\bf u_2} = {\bf u_{2ref}} + {\bf u_{2b}} \end{gathered} \]
where the subscript \( b \) denotes the feedback terms. The feedback terms are chosen to be
\[ \begin{gathered} v_b = v_{ref} (\cos{\psi_e} \cos{\theta_e} - 1) + \gamma^2 x_e \\ {\bf u_{2b}} = {\bf B_2}^{-1} \{ {\bf q} + ({\bf B_{2ref}} - {\bf B_2}) {\bf u_{2ref}} + {\bf p_e} \} \end{gathered} \]
where \( \gamma \) is a chosen constant, \( x_e \) is the error in the local \( x \) position, \( {\bf q} = \begin{bmatrix} 0 & -z_e v_{ref} / k_2 & y_e v_{ref} \cos{\theta_e} / k_3 \end{bmatrix} ^T \), and \( {\bf p_e} = \begin{bmatrix} k_1 \sin{\phi_e} & k_2 \sin{\theta_e} & k_3 \sin{\psi_e} \end{bmatrix} ^T \). When the inputs are substituted into \( \dot{V} \), the time derivative becomes
\[ \dot{V} = {\bf p}_e^T {\bf p}_e - \gamma^2 x_e^2 \]
which is negative semi-definite. We could also see that term \( {\bf k}^T {\bf f}(\boldsymbol{\theta}_e) \in [0,2(k_1+k_2+k_3)] \) for any \( \boldsymbol{\theta}_e \).
A.3 hovercraft Model
The hovercraft is one of the models used in testing the 3D scenarios. The \( x \), \( y \), \( z \) and \( \theta \) states are the same as the car. A fourth state is added to allow the car to hover. The kinematics for the hovercraft are given by
\[ \dot{q} = \begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{z} \\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} \cos(\theta) & 0 & 0 \\ \sin(\theta) & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} v \\ v_z \\ \omega \end{bmatrix} \]
where \( v \) is the velocity in the xy-plane, \( v_z \) is the velocity along the z-axis, and \( \omega \) is the rate of turning. When a reference trajectory is introduced, the error states are given by
\[ e_x = \cos(\theta) (x_{ref} - x) + \sin(\theta) (y_{ref} - y) \]
\[ e_y = -\sin(\theta) (x_{ref} - x) + \cos(\theta) (y_{ref} - y) \]
\[ e_z = z_{ref} - z \]
\[ e_{\theta} = \theta_{ref} - \theta \]
The following Lyapunov function is proposed:
\[ V = \frac{1}{2}(e_x^2 + e_y^2 + e_z^2) + \frac{1 - \cos(e_{\theta})}{k_2} \]
with the time derivative
\[ \dot{V} = -k_1 e_x^2 - k_4 e_z^2 - \frac{v_{ref} k_3 \sin^2(e_{\theta})}{k_2} \]
This time derivative is negative semi-definite when \( k_1, k_2, k_3, k_4 > 0 \) and the control law is given by:
\[ v = v_{ref} \cos(e_{\theta}) + k_1 e_x \]
\[ \omega = \omega_{ref} + v_{ref} (k_2 e_y + k_3 \sin(e_{\theta})) \]
\[ v_z = v_{z,{ref}} + k_4 e_z \]
We can also see that the term \( \frac{1 - \cos(e_{\theta})}{k_2} \in [0, \frac{2}{k_2}] \) for any \( e_{\theta} \).


A comprehensive set of tools to illustrate the core concepts of evolutionary game theory, such as evolutionary stability or various evolutionary dynamics, for teaching and academic research.
| Version: | 0.1.0 |
| Imports: | deSolve (≥ 1.14), geometry (≥ 0.3-6), ggplot2 (≥ 2.2.1), grDevices (≥ 3.2.2), interp (≥ 1.0-29), MASS (≥ 7.3-43), reshape2 (≥ 1.4.2), rgl (≥ 0.95.1201) |
| Suggests: | knitr, rmarkdown |
| Published: | 2017-11-27 |
| Author: | Daniel Gebele [aut, cph], Jochen Staudacher [aut, cre, cph] |
| Maintainer: | Jochen Staudacher <jochen.staudacher at hs-kempten.de> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| CRAN checks: | EvolutionaryGames results |
| Reference manual: | EvolutionaryGames.pdf |
| Vignettes: |
Vignette Title |
| Package source: | EvolutionaryGames_0.1.0.tar.gz |
| Windows binaries: | r-devel: EvolutionaryGames_0.1.0.zip, r-release: EvolutionaryGames_0.1.0.zip, r-oldrel: EvolutionaryGames_0.1.0.zip |
| OS X binaries: | r-release: EvolutionaryGames_0.1.0.tgz, r-oldrel: EvolutionaryGames_0.1.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=EvolutionaryGames to link to this page.


--- layout: install ---
Download the stable release of 3D Slicer from the Slicer Download Page according to your operating system.
To learn more about 3D slicer and get familiar with its basics check out the 3D Slicer training and tutorials page.


Free shipping on all order at HCM City.
High-School-Uniform
Uniform
Company Uniform
Restaurant Uniform
Le Hong Phong High-School-Uniform
Le Quy Don High-School-Uniform
Minh Khai High-School-Uniform
Thu Duc High-School-Uniform
Duckies
Elle
Heartsoul
Cherokee
Reebok
Fila


Corporate website design
Client is one of China’s largest investment bank, though it lacked a modern and international brand presence. They were looking to raise the brand’s digital presence globally.
Understanding the complex landscape of China’s financial market along with the key competitive set to identify the points of differentiation for the client. These salient points were then developed into a creative concept and complex digital platform.
2.1 Research & Structure Revamp
We review the old website and conducted UX researches to find the best practice in the market. Through research, we drafted a list of important sections we would like to improve in our future website design. To clear understand the website structure, we firstly drafted a site map based on the old website.
To have better understand of the business requirements, we scheduled several round conversation with the stakeholders in client's different departments as well. After that, we revamped the website structure, and created new sitemap. We use different colors to distinguish pages in different levels and used various labels to mark different types of pages.
2.2 Wireframe Design
We created wireframes for both desktop and mobile to display the basic structure of the website, and lay out the content and functionality throughout the site.
2.3 UI Design
Responsive design on desktop, tablet and mobile.
2.4 UAT & CMS Training
We supported as QA in UAT stage, and also created a CMS manual and provided 2 sessions of CMS training for different departments to manage the content on new website.
The updated look of the website represents the modern and global footprint that the business is taking. The website helps to reposition the brand in the international market as a modern, forward-thinking and credible financial institution.