Egwene balanced on the heeling deck as the River Queen sped down the wide Erinin under cloud-dark skies, sails full-bellied, White Flame banner whipping furiously at the mainmast. The wind had risen as soon as the last of them was aboard the ships, back in Medo, and it had not failed or flagged for an instant since, day or night. The river had begun to race in flood, as it still did, slapping the ships about while it drove them onward. Wind and river had not slowed, and neither had the ships, all clustered together. The River Queen led, only right for the vessel that carried the Amyrlin Seat.
The helmsman held his tiller grimly, feet planted and spread, and sailors padded barefoot at their work, intent on what they did; when they glanced at the sky or the river, they tore their eyes away with low mutters. A village was just fading from view behind, and a boy raced along the bank; he had kept up with the ships for a short distance, but now they were leaving him behind. When he vanished, Egwene made her way below.
In the small cabin they shared, Nynaeve glared up at her from her narrow bed. “They say we’ll reach Tar Valon today. The Light help me, but I’ll be glad to put foot on land again even if it is in Tar Valon.” The ship lurched with wind and current, and Nynaeve swallowed. “I’ll never step on a boat again,” she said breathlessly.
Egwene shook the river spray out of her cloak and hung it on a peg by the door. It was not a big cabin—there were no big cabins on the ship, it seemed, not even the one the Amyrlin had taken over from the captain, though that was larger than the rest. With its two beds built into the walls, shelves beneath them and cabinets above, everything lay close to hand.
Except for keeping her balance, the movements of the ship did not bother her the way they did Nynaeve; she had given up offering Nynaeve food after the third time the Wisdom threw the bowl at her. “I’m worried about Rand,” she said.
“I’m worried about all of them,” Nynaeve replied dully. After a moment, she said, “Another dream last night? The way you’ve been staring at nothing since you got up . . . ”
Egwene nodded. She had never been very good at keeping things from Nynaeve, and she had not tried with the dreams. Nynaeve had tried to dose her at first, until she heard one of the Aes Sedai was interested; then she began to believe. “It was like the others. Different, but the same. Rand is in some kind of danger. I know it. And it is getting worse.  ” She dropped down on her bed and leaned toward the other woman. “I just wish I could make some sense of it.”
“Channeling?” Nynaeve said softly.
Despite herself, Egwene looked around to see if anyone was there to hear. They were alone, with the door closed, but still she spoke just as softly. “I don’t know. Maybe.” There was no telling what Aes Sedai could do—she had seen enough already to make her believe every story of their powers—and she would not risk eavesdropping. I won’t risk Rand. If I did right, I’d tell them, but Moiraine knows, and she hasn’t said anything. And it’s Rand! I can’t. “I don’t know what to do.”
“Has Anaiya said anything more about these dreams?” Nynaeve seemed to make it a point never to add the honorific Sedai, even when the two of them were alone. Most of the Aes Sedai appeared not to care, but the habit had earned a few strange looks, and some hard ones; she was going to train in the White Tower, after all.
“ ‘The Wheel weaves as the Wheel wills,’ ” Egwene quoted Anaiya. “ ‘The boy is far away, child, and there’s nothing we can do until we know more. I will see to testing you myself once we reach the White Tower, child.’ Aaagh! She knows there is something in these dreams. I can tell she does. I like the woman, Nynaeve; I do. But she won’t tell me what I want to know. And I can’t tell her everything. Maybe if I could . . . ”
“The man in the mask again?”
Egwene nodded. Somehow, she was sure it was better not to tell Anaiya about him. She could not imagine why, but she was sure.  He always wore a mask across his face; sometimes she could see his eyes, and sometimes she could only see fire where they should be. “He laughed at me. It was so . . . contemptuous. As though I were a puppy he was going to have to push out of his way with his foot. It frightens me. He frightens me.”
“Are you sure it has anything to do with the other dreams, with Rand? Sometimes a dream is just a dream.”
Egwene threw up her hands. “And sometimes, Nynaeve, you sound just like Anaiya Sedai!” She put a special emphasis on the title, and was pleased to see Nynaeve grimace.
  She was alone, for a wonder; she seldom left her cabin, and then always with Leane at her side, and maybe another of the Aes Sedai.
Egwene sprang to her feet. The room was a little crowded, with three of them in it.
“Both of you feeling well?” the Amyrlin said cheerily. She tilted her head at Nynaeve. “Eating well, too, I trust? In good temper?”
Nynaeve struggled to a sitting position, with her back against the wall. “My temper is just fine, thank you.”
“We are honored, Mother,” Egwene began, but the Amyrlin waved her to silence.
“It’s good to be on the water again, but it grows boring as a mill pond after a while with nothing to do.” The ship heeled, and she shifted her balance without seeming to notice. “I will give you your lesson today.” She folded herself onto the end of Egwene’s bed, feet tucked under her. “Sit, child.”
Egwene sat, but Nynaeve began trying to push herself to her feet. “I think I will go on deck.”
“I said, sit!” The Amyrlin’s voice cracked like a whip, but Nynaeve kept rising, wavering. She still had both hands on the bed, but she was almost upright. Egwene held herself ready to catch her when she fell.
Closing her eyes, Nynaeve slowly lowered herself back to the bed. “Perhaps I will stay. It is no doubt windy up there.”
The Amyrlin barked a laugh.  Some of them, child, say you’d do well for some time as a novice, no matter how old you are. I say, if you have the ability I hear of, you deserve to be one of the Accepted.” She gave another laugh. “I always believe in giving people what they deserve. Yes. I suspect you will learn a great deal once you reach the White Tower.”
“I’d rather one of the Warders taught me how to use a sword,” Nynaeve growled. She swallowed convulsively, and opened her eyes. “There is someone I’d like to use it on.” Egwene looked at her sharply; did Nynaeve mean the Amyrlin—which was stupid, and dangerous besides—or Lan? She snapped at Egwene every time Lan was mentioned.
“A sword?” the Amyrlin said. “I never thought swords were much use—even if you have the skill, child, there are always men who have as much, and a deal more strength—but if you want a sword . . .  With blade and hilt of an odd bluish white, it looked somehow . . . cold. “Made from the air, child, with Air. It’s as good as most steel blades, better than most, but still not much use.” The sword became a paring knife. There was no shrinking; it just was one thing, then the other. “This, now, is useful.” The paring knife turned to mist, and the mist faded away. The Amyrlin put her empty hand back in her lap. “But either takes more effort than it is worth. Better, easier, simply to carry a good knife with you. You have to learn when to use your ability, as well as how, and when it’s better to do things the way any other woman would. Let a blacksmith make knives for gutting fish. Use the One Power too often and too freely, and you can come to like it too much. That way lies danger. You begin to want more of it, and sooner or later you run the risk of drawing more than you’ve learned to handle. And that can burn you out like a guttered candle, or—”
“If I must learn all this,” Nynaeve broke in stiffly, “I would as soon learn something useful. All this—this . . . ‘Make the air stir, Nynaeve. Light the candle, Nynaeve. Now put it out. Light it again.’ Paah!”
Egwene closed her eyes for a moment. Please, Nynaeve. Please keep a check on your temper. She bit her lip to keep from saying it out loud.
The Amyrlin was silent for a moment. “Useful,” she said at last. “Something useful. You wanted a sword. Suppose a man came at me with a sword. What would I do? Something useful, you can be sure. This, I think.”
For an instant, Egwene thought she saw a glow around the woman at the other end of her bed. Then the air seemed to thicken; nothing changed that Egwene could see, but she could surely feel it. She tried to lift her arm; it did not budge any more than if she were buried to her neck in thick jelly. Nothing could move except her head.
“Release me!” Nynaeve grated. Her eyes glared, and her head jerked from side to side, but the rest of her sat as rigidly as a statue. Egwene realized that she was not the only one held. “Let me go!”
“Useful, wouldn’t you say? And it is nothing but Air.” The Amyrlin spoke in a conversational tone, as if they were all chatting over tea. “Big man, with his muscles and his sword, and the sword does him as much good as the hair on his chest.”
“Let me go, I say!”
“And if I don’t like where he is, why, I can pick him up.”  The Amyrlin smiled. “I’ve often wished I could use this to fly. The records say Aes Sedai could fly, in the Age of Legends, but they aren’t clear on how, exactly. Not this way, though. It doesn’t work like that. You might reach out with your hands and pick up a chest that weighs as much as you do; you look strong. But take hold of yourself however you will, you cannot pick yourself up.”
Nynaeve’s head jerked furiously, but not another muscle of her twitched.
Egwene swallowed hard and hoped she was not also to be lifted.
“So,” the Amyrlin continued, “big, hairy man, and so forth. He can do nothing to me, while I can do anything at all to him. Why, if I had a mind to”—she leaned forward, her eyes intent on Nynaeve; suddenly her smile did not seem very friendly—“I could turn him upside down and paddle his bottom. Just like—” Suddenly the Amyrlin flew backwards so hard her head rebounded from the wall, and there she stayed, as if something were pressing against her.
Egwene stared, her mouth dry. This isn’t happening. It isn’t.
“They were right,” the Amyrlin said. Her voice sounded strained, as though she found it hard to breathe. “They said you learned quickly. And they said it took your temper burning to get to the heart of what you can do.” She took a struggling breath. “Shall we release each other together, child?”
Nynaeve, floating in the air with her eyes ablaze, said, “You let me go right now, or I’ll—” Abruptly a look of amazement came over her face, a look of loss. Her mouth worked slently.
The Amyrlin sat up, working her shoulders. “You don’t know everything yet, do you, child? Not the hundredth part of everything.  You can still feel it there, but you can’t touch it any more than a fish can touch the moon. When you learn enough to be raised to full sisterhood, no one woman will be able to do that to you. The stronger you become, the more Aes Sedai it will take to shield you against your will.   The Amyrlin sighed.  But you will get what you deserve.”
Nynaeve’s eyes widened, and she had just time to start a yell before she dropped, hitting her bed with a loud thud. Egwene winced; the mattresses were thin, and the wood beneath hard. Nynaeve’s face stayed frozen as she shifted the way she sat, just a fraction.
“And now,” the Amyrlin said firmly, “unless you would like further demonstration, we will get on with your lesson. Continue your lesson, we might say.”
“Mother?” Egwene said faintly. She still could not twitch below her chin.
The Amyrlin looked at her questioningly, then smiled. “Oh. I am sorry, child. Your friend was occupying my attention, I’m afraid.” Suddenly Egwene could move again; she raised her arms, just to convince herself that she could. “Are you both ready to learn?”
“Yes, Mother,” Egwene said quickly.
The Amyrlin raised an eyebrow at Nynaeve.
After a moment, Nynaeve said in a tight voice, “Yes, Mother.”
Egwene heaved a sigh of relief.
“Good. Now, then. Empty your thoughts of everything but a flower bud.”
Egwene was sweating by the time the Amyrlin left. She had thought some of the other Aes Sedai had been hard teachers, but that smiling, plain-faced woman coaxed out every last drop of effort, drew it out, and when there was nothing left, she seemed to reach into you and pulled it out. It had gone well, though. As the door closed behind the Amyrlin, Egwene raised one hand; a tiny flame sprang to life, balanced a hairbreadth above the tip of her forefinger, then danced from fingertip to fingertip. She was not supposed to do this without a teacher—one of the Accepted, at the very least—to watch over her, but she was too excited at her progress to pay any mind to that.
Nynaeve bounded to her feet and threw her pillow at the closing door. “That—that vile, contemptible, miserable—hag! The Light burn her! I’d like to feed her to the fish. I’d like to dose her with things that would turn her green for the rest of her life!  ” Her teeth ground so loudly that Egwene jumped.
 She wished she could think of a way to sneak out of the room without catching Nynaeve’s eye.
The lesson had not gone well for Nynaeve, because she had held her temper on a tight lead until the Amyrlin was gone. She never could do very much unless she was angry, and then it all burst out of her. After failure upon failure, the Amyrlin had done everything she could to rouse her again. Egwene wished Nynaeve could forget she had been there to see or hear any of it.
Nynaeve stalked stiffly to her bed and stood staring at the wall behind it, her fist clenched at her side. Egwene looked longingly at the door.
“It was not your fault,” Nynaeve said, and Egwene gave a start.
“Nynaeve, I—”
Nynaeve turned to look down at her. “It was not your fault,” she repeated, sounding unconvinced. “But if you ever breathe one word, I’ll—I’ll . . .
“Not a word,” Egwene said quickly.
Nynaeve stared at her a moment longer, then nodded. Abruptly she grimaced. “Light, I did not think anything tasted worse than raw sheepstongue root. I’ll remember that, the next time you act the goose, so watch yourself.”
Egwene winced. That had been the first thing the Amyrlin had done trying to rouse Nynaeve’s anger. A dark glob of something that glistened like grease and smelled vile had suddenly appeared and, while the Amyrlin held Nynaeve with the Power, had been forced into the Wisdom’s mouth. The Amyrlin had even held her nose to make her swallow. And Nynaeve remembered things, if she had seen them done once. Egwene did not think there was any way of stopping her if she took it into her mind to do it; for all her own success in making a flame dance, she could never have held the Amyrlin against a wall.
Nynaeve grunted, then gave a short, sharp laugh. “I’m too angry to be sick.” With another mirthless laugh, she shook her head. “I’m too miserable to be sick. Light, I feel as if I’ve been dragged through a knothole backwards. If that is what novice training is like, you will have incentive to learn quickly.”
Egwene scowled at her knees. Compared to Nynaeve, the Amyrlin had only coaxed her, smiled at her successes, sympathized with her failures, then coaxed again. But all the Aes Sedai had said things would be different in the White Tower; harder, though they would not say how. If she had to go through what Nynaeve had, day after day, she did not think she could stand it.
Something changed in the motion of the ship. The rocking eased, and feet thumped on the deck above their heads. A man shouted something Egwene could not quite make out.
She looked up at Nynaeve. “Do you think . . . Tar Valon?”
“There is only one way to find out,” Nynaeve replied, and determinedly took her cloak from its peg.
When they reached the deck, sailors were running everywhere, heaving at lines, shortening sail, readying long sweeps. The wind had died to a breeze, and the clouds were scattering, now.
Egwene rushed to the rail. “It is! It is Tar Valon!” Nynaeve joined her with an expressionless face.
The island was so big it looked more as if the river split in two than contained a bit of land. Bridges that seemed to be made of lace arched from either bank to the island, crossing marshy ground as well as the river. The walls of the city, the Shining Walls of Tar Valon, glistened white as the sun broke through the clouds. And on the west bank, its broken top leaking a thin wisp of smoke, Dragonmount reared black against the sky, one mountain standing among flat lands and rolling hills. Dragonmount, where the Dragon had died. Dragonmount, made by the Dragon’s dying.
Egwene wished she did not think of Rand when she looked at the mountain. A man channeling. Light, help him.
The River Queen passed through a wide opening in a tall, circular wall that thrust out into the river. Inside, one long wharf surrounded a round harbor. Sailors furled the last sails and used sweeps alone to move the ship stern-first to its docking. Around the long wharf, the other ships that had come downriver were now being snugged into their berths among the ships already there. The White Flame banner set workers scurrying along the already busy wharf.
The Amyrlin came on deck before the shore lines were tied off, but dockworkers ran a gangplank aboard as soon as she appeared. Leane walked at her side, flame-tipped staff in hand, and the other Aes Sedai on the ship followed them ashore. None of them so much as glanced at Egwene or Nynaeve. On the wharf a delegation greeted the Amyrlin—shawled Aes Sedai, bowing formally, kissing the Amyrlin’s ring. The wharf bustled, between ships unloading and the Amyrlin Seat arriving; soldiers formed up on disembarking, men set booms for cargo; trumpet flourishes rang from the walls, competing with cheers from the onlookers.
Nynaeve gave a loud sniff. “It seems they’ve forgotten us. Come along. We’ll see to ourselves.”
Egwene was reluctant to leave her first sight of Tar Valon, but she followed Nynaeve below to gather their things. When they came back topside, bundles in their arms, soldiers and trumpets were gone—and Aes Sedai, too. Men were swinging back hatches along the deck and lowering cables into the holds.
On the deck, Nynaeve caught a dockman’s arm, a burly fellow in a coarse brown shirt with no sleeves. “Our horses,” she began.
“I’m busy,” he growled, pulling free. “Horses’ll all be took to the White Tower.” He looked them up and down. “If you’ve business with the Tower, best you take yourselves on. Aes Sedai don’t hold with newlings being tardy.” Another man, wrestling with a bale being swung out of the hold on a cable, shouted to him, and he left the women without a backwards glance.
Egwene exchanged looks with Nynaeve. It seemed they really were on their own.
Nynaeve stalked off the ship with grim determination on her face, but Egwene made her way dejectedly down the gangplank and through the tarry smell that hung over the wharf. All that talk about wanting us here, and now they don’t seem to care.
Broad stairs led up from the dock to a wide arch of dark redstone. On reaching it, Egwene and Nynaeve stopped to stare.
Every building seemed a palace, though most of those close to the arch seemed to contain inns or shops, from the signs over the doors. Fanciful stonework was everywhere, and the lines of one structure seemed designed to complement and set off the next, leading the eye along as if everything were part of one vast design. Some structures did not look like buildings at all, but like gigantic waves breaking, or huge shells, or fanciful, windsculpted cliffs. Right in front of the arch lay a broad square, with a fountain and trees, and Egwene could see another square further on. Above everything rose the towers, tall and graceful, some with sweeping bridges between them, high in the sky. And over all rose one tower, higher and wider than all the rest, as white as the Shining Walls themselves.
“Fair takes the breath at first sight,” said a woman’s voice behind them. “At tenth sight, for that. And at hundredth.”
Egwene turned. The woman was Aes Sedai; Egwene was sure of it, though she wore no shawl. No one else had that ageless look; and she held herself with an assurance, a confidence that seemed to confirm it. A glance at her hand showed the golden ring, the serpent biting its own tail. The Aes Sedai was a little plump, with a warm smile, and one of the oddest-appearing women Egwene had ever seen. Her plumpness could not hide high cheekbones, her eyes had a tilt to them and were the clearest, palest green, and her hair was almost the color of fire. Egwene barely stopped herself from goggling at that hair, those slightly slanted eyes.
“Ogier built, of course,” the Aes Sedai went on, “and their best work ever, some say. One of the first cities built after the Breaking. There weren’t half a thousand people here altogether then—no more than twenty sisters—but they built for what would be needed.”
“It is a lovely city,” Nynaeve said. “We are supposed to go to the White Tower. We came here for training, but no one seems to care if we go or stay.”
“They care,” the woman said, smiling. “I came here to meet you, but I was delayed speaking with the Amyrlin. I am Sheriam, the Mistress of Novices.”
“I am not to be a novice,” Nynaeve said in a firm voice, but a little too quickly. “The Amyrlin herself said I was to be one of the Accepted.”
“So I was told.” Sheriam sounded amused. “I have never heard of it being done so before, but they say you are . . . exceptional. Remember, though, even one of the Accepted can be called to my study. It requires more breaking of the rules than for a novice, but it has been known to happen.” She turned to Egwene as if she had not seen Nynaeve frown. “And you are our new novice. It is always good to see a novice come. We have too few, these days. You will make forty . . . Only forty. And no more than eight or nine of those will be raised to the Accepted. Though I don’t think you will have to worry about that too much, if you work hard and apply yourself. The work is hard, and even for one with the potential they tell me you have, it will not be made any easier. If you cannot stick to it, no matter how hard it is, or if you will break under the strain, better we find it out now, and let you go on your way, than wait until you are a full sister and others are depending on you. An Aes Sedai’s life is not easy. Here, we will prepare you for it, if you have in you what is required.”
Egwene swallowed. Break under the strain? “I will try, Sheriam Sedai,” she said faintly. And I will not break.
Nynaeve looked at her worriedly. “Sheriam . . . ” She stopped and took a deep breath. “Sheriam Sedai”—she seemed to force the honorific out—“does it have to be so hard on her? Flesh and blood can only take so much. I know . . . something . . . of what novices must go through. Surely there’s no need to try to break her just to find out how strong she is.”
“You mean what the Amyrlin did to you today?” Nynaeve’s back stiffened; Sheriam looked as though she were trying to keep amusement from her face. “I told you I spoke with the Amyrlin. Rest your worries for your friend. Novice training is hard, but not that hard. That is for the first few weeks of being one of the Accepted.”  “To catch the few who might have slipped through novice training when they should not have. We cannot risk having one of our number—a full Aes Sedai—who will break under the stress of the world outside.” The Aes Sedai gathered them both up, an arm around the shoulders of each. Nynaeve hardly seemed to realize where she was going. “Come,” Sheriam said, “I will see you settled in your rooms. The White Tower awaits.”


#include <sysc/datatypes/int/sc_signed.h>
Definition at line 1014 of file sc_signed.h.
| sc_dt::sc_signed_subref::sc_signed_subref | ( | const sc_signed_subref & | a | ) | [inline] |
Definition at line 1030 of file sc_signed.h.
| virtual void sc_dt::sc_signed_subref::concat_set | ( | uint64 | src, | |
| int | low_i | |||
| ) | [virtual] |
Reimplemented from sc_dt::sc_value_base.
| virtual void sc_dt::sc_signed_subref::concat_set | ( | const sc_unsigned & | src, | |
| int | low_i | |||
| ) | [virtual] |
Reimplemented from sc_dt::sc_value_base.
| virtual void sc_dt::sc_signed_subref::concat_set | ( | const sc_signed & | src, | |
| int | low_i | |||
| ) | [virtual] |
Reimplemented from sc_dt::sc_value_base.
| virtual void sc_dt::sc_signed_subref::concat_set | ( | int64 | src, | |
| int | low_i | |||
| ) | [virtual] |
Reimplemented from sc_dt::sc_value_base.
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_uint_base & | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_int_base & | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | double | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | int64 | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | uint64 | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | int | a | ) | [inline] |
Definition at line 1058 of file sc_signed.h.
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | unsigned int | a | ) | [inline] |
Definition at line 1055 of file sc_signed.h.
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | long | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | unsigned long | a | ) |
| const sc_signed_subref & sc_dt::sc_signed_subref::operator= | ( | const char * | a | ) | [inline] |
Definition at line 2322 of file sc_signed.h.
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_generic_base< T > & | a | ) | [inline] |
Definition at line 1045 of file sc_signed.h.
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_unsigned & | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_unsigned_subref_r & | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_signed & | a | ) |
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_signed_subref & | a | ) |
Reimplemented from sc_dt::sc_signed_subref_r.
| const sc_signed_subref& sc_dt::sc_signed_subref::operator= | ( | const sc_signed_subref_r & | a | ) |
| void sc_dt::sc_signed_subref::scan | ( | ::std::istream & | is = ::std::cin |
) |
friend class sc_core::sc_vpool< sc_signed_subref > [friend] |
Definition at line 1018 of file sc_signed.h.
friend class sc_signed [friend] |
Reimplemented from sc_dt::sc_signed_subref_r.
Definition at line 1017 of file sc_signed.h.
sc_core::sc_vpool<sc_signed_subref> sc_dt::sc_signed_subref::m_pool [static, protected] |
Definition at line 1079 of file sc_signed.h.


--- layout: page title: From GraphDB To Enterprise Application date: 2015-07-30 22:22:13.000000000 -04:00 type: page parent_id: '' published: true status: publish categories: [] tags: [] meta: {} author: ---
Iterating quickly might mean the difference between meeting your market window and permanently missing an opportunity. You might be grappling with large amounts of data that make development unwieldy. You have the idea that you can structure your data in a graph, but how?
Using the XN Framework helps you get business logic into your data, structure it, and develop functioning applications—quickly.


Wales prop Francis to miss start of Six Nations
Wales prop Tomas Francis needs surgery to repair a shoulder injury he suffered at the Rugby World Cup, Exeter Chiefs boss Rob Baxter has said, ruling him out of the start of Wales' Six nations title defence.
REUTERS: Wales prop Tomas Francis needs surgery to repair a shoulder injury he suffered at the Rugby World Cup, Exeter Chiefs boss Rob Baxter has said, ruling him out of the start of Wales' Six nations title defence.
The 27-year-old sustained the injury during their semi-final defeat to South Africa in Japan and is likely to be out of action for up to four months.
"After two or three scans it became clear that Tom needs an operation to repair the shoulder injury he picked up with Wales at the World Cup," Baxter said in a statement https://www.exeterchiefs.co.uk/news/prop-pieretto-signs-for-the-chiefs.
He added that they signed Argentina's Enrique Pieretto until the end of the season as cover.
Wales, who won the Grand Slam earlier this year, begin their Six Nations campaign against Italy on Feb. 1.
(Reporting by Rohith Nair in Bengaluru; Editing by Peter Rutherford)


We help you keep track of your fitness!
Sign in here
Sign in
Log in with Facebook
Register an account here
Register


PhoediX 1.0.0 will be the very first release of PhoediX. So what's new? Well... Everything!
Visit the Download page to get PhoediX 1.0.0 now.
Be sure to see below for planned future improvements for the next version.
Planned new features of PhoediX 1.1.0
● New Edit - Unsharp Mask
● New Edit - Image Denoising
● Creating and applying presets
● Printing directly from PhoediX


Current Event: {{current_event$.name}}
This will display:
- Name of the home team and basic competition info
- Current Event and our stats in it
- Upcoming matches for the current event with teammates and opponents ranked
- Short list of the this year's past events


speakers
World Class Speakers
Joining us from all around the world are over twenty fantastic speakers, here to share their stories.
schedule
Three Insoiring Day
Enjoy three inspiring and action-packed days of talks, gatherings, and all-around good times
VENUE
The Chicago Theatre
Within the heart of downtown Chicago, The Chicago Theatre will provide a beautiful conference venue.


The LZ family of algorithms
Abraham Lempel and Jacob Ziv published two compression algorithms: LZ77 in 1977 and LZ78 in 1978.
Terry Welch published the LZW algorithm in 1984 as an improvement of LZ78.
LZW is just one of the original LZ algorithms' many derivatives, the more famous ones being LZSS (used in RAR), LZMA (used in 7z), and Deflate (used in ZIP).
This article is about LZW because:
- it's easy to understand and to code, yet
- it offers decent compression ratios and speed, and
- its patents have expired
Goal
The goal is to implement an LZW file compressor, and gradually improve it.
Alpha versions:
- Version 1 [ Jump ] [ Download ]
Straightforward but slow implementation. The encoder uses a plain map. The decoder uses a string vector.
- Version 2 [ Jump ] [ Download ]
Faster compression. The encoder uses a hash map. The decoder is reused from Version 1.
- Version 3 [ Jump ] [ Download ]
Faster compression and decompression. Both the encoder and the decoder do pair mapping, instead of string mapping.
- Version 4 [ Jump ] [ Download ]
Faster compression and very fast decompression. The encoder uses a custom memory allocator. The decoder is optimized.
- Version 5 [ Jump ] [ Download ]
Very fast compression and decompression. The encoder uses a vector-based binary search tree. The decoder is reused from Version 4.
Beta versions:
- Version 6 [ Jump ] [ Download ]
Uses variable width codes. Compared to Version 5, it's significantly slower but compresses better.
The above programs are command-line utilities. Their source code is attached to this article as ZIP archives.
Notes:
- The programs perform better if compiled with optimizations turned on.
- I currently use MinGW (GCC 4.7.2) and compile by running:
g++ -Wall -Wextra -pedantic -std=c++11 -O3 lzw_vX.cpp -o lzw_vX.exe
Language
The source code is written in C++11, the 2011 version of the C++ language's standard.
Your C++ compiler must support lambda functions, range-based
for()
loops, and initializer lists, for to successfully compile the source code snippets in this article, and the full programs attached.
Lossless compression versus expansion
Given data D of size S
D, the intent is to encode it as data E of size S
E, such that:
- SE < SD
- E can be decoded as D
If S
E is less than S
D, compression was achieved.
If, in addition, the original data D can be reconstructed from E, the compression is lossless.
Notes:
- The compression ratio is computed with SE / SD.
Expansion is the opposite of compression, with S
E > S
D.
Expansion occurs because it is mathematically impossible for a lossless compression algorithm to compress all files. This is proven with the counting argument, which you can learn more about by following the designated link at the bottom of this article.
A simplified, crude example:
Suppose we have a lossless compression algorithm LCA that can compress all files.
For simplicity, let's consider that the files to be compressed are made of bits.
A bit can only hold either 1 or 0.
Let's take all files consisting of at most two bits:
"" (empty file)
"00"
"01"
"10"
"11"
"0"
"1"
Now let's compress them:
LCA("") = "" // the empty file naturally compresses to itself
LCA("00") = "0" // successfully compressed!
LCA("01") = "1" // successfully compressed!
LCA("10") = // uh-oh
LCA("11") = // uh-oh
LCA("0") = // major uh-oh
LCA("1") = // major uh-oh
|
The example above shows that, because a lossless compression algorithm needs to produce a distinct encoded file for each data file, not all data files can be compressed -- and in fact, some of them will be expanded.
For instance, what can
"0"
be compressed to? We cannot reuse the outputs for
""
, or
"00"
, or
"01"
because then how will the decoder know which file to decode?
This is the crux of the counting argument: if
all files can be compressed, the total number of unique compressed files will be less than the number of uncompressed files, which means there's no one-to-one correspondence between them, which means the compression algorithm is not lossless.
Entropy, and dictionary coders
For our purposes,
entropy is a measurement of the unpredictability of data. Data with low entropy tends to have repeating sequences. Data with high entropy tends to be random.
A
dictionary coder is a lossless compression algorithm that takes advantage of low entropy. It associates sequences of data with codes (which use up less space) in a "dictionary". Compression is achieved by substituting repeating sequences with their corresponding codes. The longer the sequences replaced, and the higher their frequency, the better the compression.
Notes:
- Text files tend to have low entropy.
- Multimedia data files and archives tend to have high entropy.
The LZW algorithm
LZW is a dictionary coder. It starts with a dictionary that has entries for all one-byte sequences, associating them with codes. The dictionary is updated with multiple byte sequences, as the data file DF is read. The encoded file EF will consist entirely of codes.
For simplicity, byte sequences will be referred to as "strings".
The type used to store codes will be
CodeType
.
Notes:
- In the C++ language,
char
is defined to be a byte.
- On most computers, a byte has a width of eight bits.
- A bit can hold a value of either 1, or 0.
- The
CodeType
can be anything wider than a byte.
- A map is a data structure that associates a value, "key", with another value, "element".
- Arrays are a special case of map, where a numerical code (index) is associated with an element, e.g.:
dictionary[14] == "cat"
- The encoder's dictionary is a map that associates a string with a numerical code, e.g.:
dictionary["cat"] == 14
Encoder pseudocode:
dictionary : map of string to CodeType
S : empty string
c : byte
DF : the data file
EF : the encoded file
dictionary = entries for all strings consisting of a single, unique byte
while ( could read a new byte from DF into c )
{
S = S + c // append c to S
if ( dictionary doesn't contain S )
{
dictionary[S] = next unused code
// if the dictionary had entries for codes 0 to 17,
// this would add an entry for code 18, with the key S
S = S - $ // remove last byte from S
write dictionary[S] to EF
S = c // S now contains only c
}
}
if ( S isn't empty )
write dictionary[S] to EF
|
Simplified run of the encoder:
dictionary["a"] = 0
dictionary["b"] = 1
DF: "abababab"
while() begins
read 'a', S = "a", -
read 'b', S = "ab", dictionary["ab"] = 2, S = "a", EF: {0}, S = "b"
read 'a', S = "ba", dictionary["ba"] = 3, S = "b", EF: {0 1}, S = "a"
read 'b', S = "ab", -
read 'a', S = "aba", dictionary["aba"] = 4, S = "ab", EF: {0 1 2}, S = "a"
read 'b', S = "ab", -
read 'a', S = "aba", -
read 'b', S = "abab", dictionary["abab"] = 5, S = "aba", EF: {0 1 2 4}, S = "b"
while() ends
EF: {0 1 2 4 1}
dictionary["a"] = 0
dictionary["b"] = 1
dictionary["ab"] = 2
dictionary["ba"] = 3
dictionary["aba"] = 4
dictionary["abab"] = 5
|
It stands to reason that the decoder must use the same dictionary that the encoder had used, otherwise DF cannot be recovered from EF. To solve this problem, DF is encoded incrementally, the encoder thereby ensuring that the decoder will have enough information to rebuild the dictionary.
Decoder pseudocode:
dictionary : array of string (equivalent to: map of CodeType to string)
S : empty string
k : CodeType
DF : the data file
EF : the encoded file
dictionary = entries for all strings consisting of a single byte
while ( could read a new CodeType from EF into k )
{
if ( k > dictionary size )
cannot decode!
else
if ( k == dictionary size ) // special case
dictionary[next unused code] = S + S[0]
else
if ( S isn't empty )
dictionary[next unused code] = S + dictionary[k][0]
write dictionary[k] to DF
S = dictionary[k]
}
|
Simplified run of the decoder:
dictionary[0] = "a"
dictionary[1] = "b"
EF: {0 1 2 4 1}
while() begins
read 0, -, -, -, DF = "a", S = "a"
read 1, -, -, dictionary[2] = "ab", DF = "ab", S = "b"
read 2, -, -, dictionary[3] = "ba", DF = "abab", S = "ab"
read 4, -, dictionary[4] = "aba", DF = "abababa", S = "aba" // special case
read 1, -, -, dictionary[5] = "abab", DF = "abababab", S = "b"
while() ends
DF: "abababab"
dictionary[0] = "a"
dictionary[1] = "b"
dictionary[2] = "ab"
dictionary[3] = "ba"
dictionary[4] = "aba"
dictionary[5] = "abab"
|
The decoder first has to deal with bad input. Because DF is encoded incrementally, a valid code can never exceed the dictionary's current size. Therefore if such a code was read, the decoder must give up.
Then the decoder has to deal with the special case, of being given the code for the very string it's supposed to add in the dictionary.
This artifact only occurs when the encoder deals with the pattern
cScSc, where
c is a byte and
S is a string, and the encoder already has
cS in the dictionary. The code for
cS will be written to EF, and
cSc will be added to the dictionary, and in the next iteration the code for
cSc will be written to EF. The decoder deals with this situation as shown in the pseudocode: an entry is added for
cS + c, where
cS is the previously decoded string and
c is its first byte.
Version 1
The pseudocode above paves the way for a straightforward implementation. There is, however, one missing detail: what type should
CodeType
be? The only remark so far was that it must be wider than a byte. The reason for this is that the dictionary still has to be able to grow, after it is filled with codes for all strings consisting of a single byte (256 entries). If
CodeType
were a byte, the dictionary could hold exactly 256 entries, all of which would be filled in at the beginning, and then the dictionary couldn't grow.
A sensible type to use is one with a width of 16 bits, such as
unsigned short int
, or
uint16_t
for clarity. Now the dictionary can accommodate a total of 65,536 entries, out of which 65,536 - 256 = 65,280 are new entries.
One may be tempted to use a 32-bit (or a 64-bit) type such as
uint32_t
(
uint64_t
), which would allow the dictionary to store a humongous number of entries. In practice, this degrades compression because each code written to EF would require 32 (or 64) bits to store, and a lot of those bits wouldn't be used anyway. In addition, the dictionary would keep growing until it used up all of the computer's memory.
Speaking of dictionary growth, at some point the 16-bit dictionary will become full. This can be dealt with by resetting it to its initial state of the first 256 entries. The encoder and decoder are merely added a check at the beginning:
if ( dictionary is full )
reset dictionary
|
In the C++ source, the resetting is done by a named lambda function (they are usually anonymous). The reason behind using a lambda function, embedded into the encoder, is that the dictionary reset function must be custom made for the dictionary, and will never be used outside the encoder.
[
Download Version 1 ]
Version 2
The first version has a performance issue: it takes too long to compress and decompress big files.
Let's assume that the cause of the slowdown is input and output, that is, file reading and writing. C++ file streams are already buffered internally, so let's assume that the buffers are not large enough. Because the streams allow custom buffers to be used, we proceed to use two 1 MB buffers, one for the input file, the other for the output file.
Example code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
#include <cstddef>
#include <fstream>
#include <ios>
#include <memory>
// ...
const std::size_t one_mb {1024 * 1024}; // one megabyte (or "mebibyte", more accurately)
const std::unique_ptr<char[]> custom_buffer(new char[one_mb]);
std::fstream f; // must set the custom buffer before opening the file
f.rdbuf()->pubsetbuf(custom_buffer.get(), one_mb);
f.open("file.txt", std::ios_base::in | std::ios_base::binary);
| |
This indeed has the effect of reading and writing files in 1 MB chunks, greatly decreasing the total number of reads and writes. However, the program remains slow. It appears that the original assumption was wrong, and I/O isn't the bottleneck.
Due to the simplicity of the program, it can be deduced that the slowdown occurs in the encoder and decoder.
Both the encoder and decoder make heavy use of strings. Appending bytes to a string is likely to trigger memory reallocation and the subsequent copying of data to the new location.
The encoder can be improved by using something other than
std::map
. The C++11 standard added
std::unordered_map
, which behaves like
std::map
, with the exception that it hashes the key (which is what makes it a "hash table"). Hashing can be summarized as follows: transform something (in our case, the string) into a hash code (a number) unique to it.
When a hash function obtains the same hash code for two different inputs, that is called a hash collision. Good hash functions have few collisions, bad hash functions has many collisions, and perfect hash functions have no collisions. The latter are outside our reach, because each possible string encountered must turn into its own unique hash code, and we can't use a hash code type wide enough to accommodate for that.
The purpose of the previous paragraph was to serve as a prelude to saying that this version of the program can theoretically corrupt data. Although the 16-bit dictionary's limit of 65,536 entries should make collisions very unlikely, they are still possible. What we get in return for this is faster code retrieval, which means faster compression.
Before we can use
std::unordered_map
, a hash functor must be written to handle
std::vector<char>
.
Fortunately, there already exists an
std::hash
functor to deal with
std::basic_string<char>
(more commonly known as
std::string
), that can be reused. The rest of the code remains unchanged.
Example code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
#include <cstddef>
#include <functional>
#include <string>
#include <vector>
struct HashCharVector {
std::size_t operator () (const std::vector<char> &vc) const
{
return std::hash<std::string>()(std::string(vc.cbegin(), vc.cend()));
}
};
// ...
#include <unordered_map>
std::unordered_map<std::vector<char>, CodeType, HashCharVector> dictionary;
| |
[
Download Version 2 ]
Version 3
So far, not much was done for the encoder, and nothing at all was done for the decoder. Clearly, it's time for a change; if the algorithm and the associated data structures produce a slow program, what's the point in trying to optimize the program?
Let us consider what we've learned so far:
- The encoder isn't required to store the actual strings in the dictionary.
- The LZW encoder pseudocode shows that any new string added is the result of appending a byte to an already existing string.
Plain English translation: goodbye strings!
The plan is as follows: the encoder's dictionary will no longer map a string to a
CodeType
. It will map a pair (
CodeType
, byte) to a
CodeType
instead.
The initial single-byte strings will be represented as a pair of an invalid
CodeType
and the given byte. That "invalid" code must be a value that can never appear in EF. A fine choice is the dictionary size limit, which in the source is
globals::dms. Because the dictionary is reset when it reaches that size, an entry mapping to that code will never be generated.
Encoder pseudocode:
dictionary : map of pair (CodeType, byte) to CodeType
c : byte
i : CodeType
DF : the data file
EF : the encoded file
i = invalid_code
reset_dictionary : lambda function {
dictionary = entries for all pairs consisting of the invalid_code and a unique byte
}
while ( could read a new byte from DF into c )
{
if ( dictionary is full )
reset_dictionary()
if ( dictionary doesn't contain pair (i, c) )
{
dictionary[pair (i, c)] = next unused code
write i to EF
i = dictionary[pair (invalid_code, c)]
}
else
i = dictionary[pair (i, c)]
}
if ( i != invalid_code )
write i to EF
|
On most computers, this pair-based algorithm will run faster than the previous string-based ones.
Now we have two choices with regards to the decoder.
- leave it as it is
- try to remove strings from it as well
The first option is possible because all three programs so far generate an identical EF out of the same DF (and vice versa). So the decoder could be left as it is, and the program would still decompress files correctly. However, the promise of faster decompression speeds is tempting.
We start with an array consisting of all the pairs of
invalid_code and a unique byte, which will be the dictionary. As EF is read, new entries will be added, consisting of a valid code and a byte, the code representing the existing string to which the new byte is appended.
At this point it should be obvious that to reconstruct the strings, we will use the code information to chain together the attached bytes. This is done by a new lambda function named
rebuild_string()
.
Simplified dictionary mechanics:
// `i_c' is an alias for `invalid_code'
0 1 2 3 4 5 6 7
dictionary = {(i_c, 'b'), (i_c, 'c'), (0, 'l'), (1, 'o'), (3, 'w'), (2, 'u'), (5, 'e'), (4, 's')}
rebuild_string(6) == "blue"
rebuild_string(7) == "cows"
|
Notice that the rebuilt strings will be reversed.
Decoder pseudocode:
dictionary : array of pair (CodeType, byte)
i : CodeType
k : CodeType
DF : the data file
EF : the encoded file
i = invalid_code
reset_dictionary : lambda function {
dictionary = entries for all pairs consisting of the invalid_code and a unique byte
}
rebuild_string(CodeType k) : lambda function {
build the string S by chaining all bytes starting at k and ending at invalid_code
}
while ( could read a new CodeType from EF into k )
{
if ( dictionary is full )
reset_dictionary()
if ( k > dictionary size )
cannot decode!
else
if ( k == dictionary size )
dictionary[next unused code] = pair (i, rebuild_string(i)[0])
else
if ( i != invalid_code )
dictionary[next unused code] = pair (i, rebuild_string(k)[0])
write rebuild_string(k) to DF
i = k
}
|
The source code for the above decoder is structured differently in the actual program, because a string variable was introduced, to ensure that the
k string is only "rebuilt" once.
[
Download Version 3 ]
Version 4
The decoder is still slow because the string that the
rebuild_string()
lambda function produces is passed by value. This means the
s variable has to be allocated space for, as it copies the contents of whatever string the lambda function returns.
The optimization in the decoder becomes clear:
s becomes a string pointer, and
rebuild_string()
returns the memory address of the now
static
string it produces internally. The only thing that's copied is the string's memory address (basically a number), which is a very cheap operation.
Because of this change, the decoder becomes extremely fast, and personally, I feel it's finally optimal.
The encoder, however, still has a long way to go. In its current form, the best that can be done is to try and cut down on
std::map
's repeated internal memory allocations. This is achieved by using a custom memory pool allocator.
An allocator is a class that manages memory. Containers such as
std::map
normally use the default built-in allocator, but can be given a custom one to use instead.
The goal is to allocate memory as rarely as possible. An allocator with this goal would get a big chunk of memory (the pool), then give out smaller chunks of this pre-allocated memory when the container requests them, instead of actually getting new memory.
Writing our own allocator is no picnic, and pretty soon we'd be in deep, trying to optimize
it.
So we'll just use a ready-made allocator instead.
FSBAllocator by Juha Nieminen is an excellent choice (see the links for more information).
Version 4 bundles this library so a separate download isn't required.
[
Download Version 4 ]
Version 5
In
Version 4, the custom allocator alleviates the performance penalty induced by memory allocation. Therefore, if the program is still slow, it can only be that
std::map
is still slow.
The standard library's
std::map
served us well, but if encoding speed is to become optimal, a custom dictionary data structure has to be coded, designed for the LZW algorithm.
There's nothing wrong with the actual encoder algorithm. What we set out to do is write an
EncoderDictionary
class that functions faster than the current
std::map<std::pair<CodeType, char>, CodeType>
.
The encoder can be simplified by adding extra functionality to the
EncoderDictionary
class. Two obvious improvements would be:
- Make it so that the dictionary resets itself automatically.
- Search for and insert a new element in a single pass.
Thus, the encoder pseudocode is much simplified:
ed : EncoderDictionary // custom dictionary type
i : CodeType
temp : CodeType // will be used to temporarily save i
c : byte
DF : the data file
EF : the encoded file
i = invalid_code
while ( could read a new byte from DF into c )
{
temp = i
i = ed.search_and_insert(c, i)
if ( i == invalid_code )
{
write temp to EF
i = ed.search(c, invalid_value)
}
//
// else
// i = ed.search(c, i)
//
}
if ( i != invalid_code )
write i to EF
|
The above algorithm should look familiar because it's based on the pair encoder of
Version 4.
The commented
else
branch isn't needed because
ed.search_and_insert()
already updates
i to the index of (c, i) if the pair was found, otherwise sets
i to
invalid_code.
The new dictionary also initializes itself and resets when full, so the lambda function
reset_dictionary()
isn't needed anymore, either.
With this out of the way, we can focus on implementing
EncoderDictionary
.
Everybody seems to be using binary search trees to improve the performance of their LZW encoder. I've attempted an index-based solution (no searching, at the price of greater memory consumption), but I was disappointed with the performance, although it was still faster than
Version 4.
In the end, I decided to implement
EncoderDictionary
as a vector-based unbalanced binary search tree, with much inspiration from Juha Nieminen's article.
A binary search tree (BST) is a data structure which consists of linked nodes. Any node has one parent node, and at most two children nodes. (The root node is the exception, in that it doesn't have a parent.)
A node contains data, in our case a byte. The left child node will contain a byte of lesser value than the parent node's. The right child node will contain a byte of higher value.
The tree is unbalanced if its branches vary in depth with more than one level. This degrades search performance in big trees, which is why usually an extra effort is made to balance the tree. In our case, the tree will be too small for the performance to significantly worsen.
Finally, being vector-based means that nodes are stored in an
std::vector
which pre-allocates the needed memory, as opposed to the nodes spawning their children via dynamic memory allocation. The effect is comparable to using
FSBAllocator in
std::map
.
Figure of an unbalanced BST:
Notice how all the left-hand descendants (left subtree) of a node contain lesser values, and the right-hand descendants (right subtree) contain higher values, than that of their ascendent node.
Let's search the tree for the value 65.
start at root, 65 > 32, go right
65 > 35, go right
65 < 70, go left
65 > 60, go right
65 == 65, found it!
|
It took 5 comparisons to find a value in a tree that has 10 nodes. On such a small scale it's hard to see the search speed improvement, but it will become very obvious when we'll use the program on multi-megabyte files.
Figure of a balanced BST:
This is how the unbalanced tree could look if it was balanced. Notice the depth of the branches (levels).
To reiterate, balancing the tree is an extra effort in our case, it is not truly warranted and will therefore not be pursued.
Back to
EncoderDictionary
, it's obvious that the member function
search_and_insert()
is very important. It has three chores:
- If the vector of nodes is full, reset it.
- If the pair (c, i) was found, return its index.
- If the pair (c, i) wasn't found, add it to the vector of nodes and return invalid_code.
The vector of nodes is an
std::vector<Node>
where
Node
is a structure defined inside
EncoderDictionary
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
struct Node {
///
/// @brief Default constructor.
/// @param c byte that the Node will contain
///
explicit Node(char c): first(globals::dms), c(c), left(globals::dms), right(globals::dms)
{
}
CodeType first; ///< Code of first child string.
char c; ///< Byte.
CodeType left; ///< Code of child node with byte < `c`.
CodeType right; ///< Code of child node with byte > `c`.
};
| |
The comment for
first may be misleading, as it doesn't refer to children nodes, but to the index of the first node to use the current node's data as a prefix string.
Remember how in
Version 4, a pair (
CodeType
, byte) was mapped to a
CodeType
? This is what happens here as well, with the twist that the codes are linked to each other by the nodes, which increases the search speed.
EncoderDictionary::search_and_insert() code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
CodeType search_and_insert(CodeType i, char c)
{
// dictionary's maximum size was reached
if (vn.size() == globals::dms)
reset();
if (i == globals::dms)
return search_initials(c);
const CodeType vn_size = vn.size();
CodeType ci {vn[i].first}; // Current Index
if (ci != globals::dms)
{
while (true)
if (c < vn[ci].c)
{
if (vn[ci].left == globals::dms)
{
vn[ci].left = vn_size;
break;
}
else
ci = vn[ci].left;
}
else
if (c > vn[ci].c)
{
if (vn[ci].right == globals::dms)
{
vn[ci].right = vn_size;
break;
}
else
ci = vn[ci].right;
}
else // c == vn[ci].c
return ci;
}
else
vn[i].first = vn_size;
vn.push_back(Node(c));
return globals::dms;
}
| |
It should be obvious what
reset()
does.
search_initials(c)
is essentially an optimized equivalent of a possible
search(c, globals::dms)
function, returning the index of initial one-byte strings.
[
Download Version 5 ]
Version 6
A decent compression rate (speed) was attained in
Version 5. Now the focus will shift on improving the compression ratio.
Theoretically, if we allow the dictionary to hold more than 64 Ki entries, we'll get better compression. But then
CodeType
will need to be widened from 16 bits in order to access those entries.
Let's remember why we settled for a 16-bit code type in the previous five versions (which will be called "alpha versions" from now on). The reason was that the codes written to EF would waste more space than they'd save, and thereby worsen compression. Space would be wasted because the codes would be wider than needed, leaving bits unused.
To illustrate this, consider the encoding of a
CodeType
with the value 375:
375 in base 10 == 101110111 in base 2
CodeType = 8 bits: not enough bits
CodeType = 16 bits: 00000001 01110111
CodeType = 32 bits: 00000000 00000000 00000001 01110111
|
Technical accuracy disclaimer:
- Endianness isn't the topic of this article.
Notice that while 8 bits can't store the value 375, a
CodeType
of 16 bits would waste 7 bits, and a
CodeType
of 32 bits would waste 23 bits. The ideal width to store the value 375 is obviously 9 bits.
The plan is as follows: use a 32-bit
CodeType
, and a dictionary holding at most 16 Mi (16 * 1024 * 1024) entries, while at the same time only reading and writing as many bits as needed for the codes.
Notes:
- A dictionary holding 16 Mi entries will use more than 16 MiB.
- The reason for this is that an entry consists of more than a mere byte.
- The encoder will use about 256 MiB, if
sizeof (Node)
== 16 bytes.
- The decoder will use about 128 MiB, if
sizeof (std::pair<CodeType, char>)
== 8 bytes.
This approach of using variable width codes is feasible because we can we can always verify how many bits are needed to encode the largest code in the dictionary, and adjust the code input/output width accordingly.
The tricky part will be implementing the custom I/O system, on top of the old one which only understands bytes and things that you get by putting bytes together.
The goal is writing custom
CodeWriter
and
CodeReader
components, that the encoder and the decoder will be adapted to use instead of bare
std::ostream
and
std::istream
.
A few days pass, as I struggle with the custom I/O system, and it struggles with me.
Reading and writing variable width codes is a fair amount of work, which involves shifting and masking bits, and saving the current incomplete byte until enough bits are read/written.
I had to choose between two code splitting layouts: LSB-First (least significant bit first) and MSB-First (most significant bit first). See the Wikipedia article on LZW for more information on packing order.
Notes:
- MSB-First is easier to visualize and is more intuitive.
- LSB-First is less intuitive but I found it can run faster than MSB-First, and it seemed easier to implement.
There's no reason to list the source code of
CodeWriter
and
CodeReader
here. The classes are ugly, cryptic, and just barely work. They also uglify the
compress()
and
decompress()
functions, because of the extra code that is needed to synchronize the bit widths.
The essence of
CodeWriter
and
CodeReader
is that they can write and read codes of variable binary width, ranging from a minimum of 9 bits up to a theoretical maximum of 32 bits, which will never be reached because of the dictionary limit.
The plan involving the huge dictionary had changed. Nobody stops you from changing
globals::dms
back to 16 Mi, but if you want my advice, 16 Mi is too much.
A big dictionary can degrade the compression ratio, which might seem illogical, yet is expectable if code widths grow so much that it becomes cheaper to use shorter codes from a smaller dictionary.
Using a big dictionary will give better results for files with high entropy, but in that usage scenario the given file will most likely be expanded anyway.
I have decided that a sensible dictionary entry limit is that of 512 Ki (512 * 1024). The program remains reasonably fast, although is obviously slower than
Version 5, while almost always providing better compression ratios. At least this version can finally compress
license.txt in case you didn't notice that the alpha versions can't.
You are welcome to try different limits. Obviously, a low limit such as 64 Ki will create a program that consumes roughly twice as much memory as
Version 5, while being quite fast. Reverting to a 16-bit
CodeType
and using a limit below 64 Ki will further improve speeds, but worsen compression.
In my tests,
Version 6 with a 32 Ki dictionary limit and 16-bit
CodeType
outperformed
Version 5 in both compression speed and ratio.
A higher dictionary limit will slow down the program, yet it doesn't mean that better compression will
always be achieved, although it
usually is. It all revolves around the nature of the file to be compressed.
Notes:
- Should you experiment with different dictionary sizes, please remember that for an encoded file EF you should decompress it with the same program that you used to compress it.
- Otherwise, decompression will probably fail.
[
Download Version 6 ]
Ending notes
I apologize that toward the end, this article became wordy. I intend to keep updating it, and to add new versions, while compacting the text.
Remember that these programs are merely toys which will misbehave for data with high entropy (such as compressed archives, MP3s, AVIs, and other media). In fact, one should expect the resulting archive to be much larger than the original file, in this usage scenario. Best compression ratios are usually achieved for text files.
The programs compile with nuwen's MinGW distro 9.5 (GCC 4.7.2), see the links below for download.
The attached ZIP archives bundle the program's source code and its Doxygen documentation.
Please let me know (via PM) if you find bugs, spot mistakes, or otherwise have suggestions for improving this article and the attached programs. Thank you.
Useful links
LZW and compression in general
The counting argument
C++11
Software
Miscellaneous
Thanks go to
Attachments:
[lzw_v1.zip]
[lzw_v2.zip]
[lzw_v3.zip]
[lzw_v4.zip]
[lzw_v5.zip]
[lzw_v6.zip]


--- layout: default post_class: author-template --- Home Subscribe John O'Nolan's Picture {{ site.name }} {{ site.bio }} {% include social.html %}
{{ site.bio }}


← Back to all examples.
You can integrate xiangqiboard.js with the xiangqi.js library to play against random moves.


Start playing a video with preloading enabled, do a seek near the end and check multiple buffered timeranges have been created.


XStream is a simple library to serialize objects to XML and back again.
Features
- Ease of use. A high level facade is supplied that simplifies common use cases.
- No mappings required. Most objects can be serialized without need for specifying mappings.
- Performance. Speed and low memory footprint are a crucial part of the design, making it suitable for
large object graphs or systems with high message throughput.
- Clean XML. No information is duplicated that can be obtained via reflection. This results
in XML that is easier to read for humans and more compact than native Java serialization.
- Requires no modifications to objects. Serializes internal fields, including private and
final. Supports non-public and inner classes. Classes are not required to have default constructor.
- Full object graph support. Duplicate references encountered in the object-model will
be maintained. Supports circular references.
- Integrates with other XML APIs. By implementing an interface, XStream can serialize
directly to/from any tree structure (not just XML).
- Customizable conversion strategies. Strategies can be registered allowing customization of how
particular types are represented as XML.
- Error messages. When an exception occurs due to malformed XML, detailed diagnostics are provided
to help isolate and fix the problem.
- Alternative output format. The modular design allows other output formats. XStream ships currently
with JSON support and morphing.
Typical Uses
- Transport
- Persistence
- Configuration
- Unit Tests
Known Limitations
If using the enhanced mode, XStream can re-instantiate classes that do not have a default constructor.
However, if using a different JVM like an old JRockit version, a JDK 1.4 or you have restrictions because of a
SecurityManager, a default constructor is required.
The enhanced mode is also necessary to restore final fields for any JDK < 1.5. This implies deserialization of
instances of an inner class.
Auto-detection of annotations may cause race conditions. Preprocessing annotations is safe though.
Getting Started
Latest News
Aug 6, 2011 XStream 1.4 released
Finally - XStream 1.4 is ready for delivery. A lot of things have changed and improved, new features added.
Nevertheless we have maintain compatibility to the old versions:
- Detection of Java 7 and Android i.e. enabled enhanced mode and annotations for both environments out of the box
- Direct support of XmlPullParser factory and alternate kXML2 implementation
- Explicit drivers to select the StAX implementation
- New separate Hibernate module to support those managed instances (special thanks to Jaime Metcher)
- Support of implicit arrays and maps additionally to already existing implicit collection support
- Performance improvements (special thanks to Keith Kowalczykowski)
- Some new converters (for URI and one to write all fields but one as attributes)
- A lot of other enhancements and bug fixes
View the complete change log and download.
Thanks to this impressive list of contributors.
Note, that with version 1.4 the default parser has been changed from
Xpp3 to kXML2.
Note, that JDK 1.3 support has been officially dropped. Nothing special has been done to
enforce this, but there is no longer any support.
Note, to support a representation of null values in some way, it is absolutely necessary that each converter can handle a null
value in its marshalling methods. If you have implemented your own custom converters, try to handle such a case also to prevent incompatibilities
in case XStream will provide such values with its next major version.


Notes for 1.1
Web is made of of html documents which are the
glue of web
Notes for 1.2
*All visible elements are rectangles
*Dig deep enough into code so you can read all text on one pass
*DOM stands for Document Object Model which refers to tee like structure of page HTML is most basic part of language is tag
*CSS allows you to change how elements look


An exact-match query is:
Returning a record that falls within a range is called a range query.
There are many database queries that are not exact-match queries.
Whether a search is efficient or not has nothing to do with whether it is an exact-match query or not.
A query to find the record that matches a unique identifier is called an exact-match query.


Combining fullPage.js with your own CSS styles and animations, you will be able to create something remarkable.
Just a demo
This is, of course, just a demo. I didn't want to spend much time on it.
Don't expect it to work perfectly in all kind of screens.
It has been designed to work on 1180px width or over on modern browsers with CSS3.


Incoming Links are welcome :)
Please add a link to the bottom of this file. Try to do that in the
following form:
- [name](link) - optional awesomness statement.
-
Machine Learning: Current Status and Future
-
http://www.rubylab.io/2015/03/18/simple-neural-network-implenentation-in-ruby/
- http://leopard.in.ua/presentations/ml_ruby_2017/
-
https://medium.com/@ryanflach/basic-machine-learning-in-ruby-9cce4a67b40b
-
https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-algorithm-cheat-sheet
- https://github.com/febeling/rb-libsvm
- https://github.com/tomz/libsvm-ruby-swig/tree/master
- https://github.com/andreaseger/jrb-libsvm
- http://www.csie.ntu.edu.tw/~cjlin/libsvm/
-
https://www.amazon.de/Programming-Collective-Intelligence-Building-Applications/dp/0596529325/ref=sr_1_1?ie=UTF8&qid=1493746433&sr=8-1&keywords=collective+intelligence
- https://github.com/alexandru/stuff-classifier
- https://www.youtube.com/watch?v=cO26TjhQWvA
-
https://www.slideshare.net/igrigorik/intelligent-ruby-machine-learning
- https://github.com/aws/aws-sdk-ruby
- http://slides.com/arnab_deka/ml-with-ruby#/
-
https://medium.com/@ryanflach/basic-machine-learning-in-ruby-9cce4a67b40b
- http://www.rubylab.io/2015/04/28/denoising-autoencoder-tutorial/
-
Predictor - Fast
and efficient recommendations and predictions using Redis.
-
http://abinoam.tl1n.com/400x-faster-matrix-multiplication-for-ruby/
- https://github.com/mstuefer/data_mining
- https://github.com/arrigonialberto86/ruby-band
-
data-modeler
- Train models based on your data using Machine Learning (work in
progress)
- https://github.com/ConsultingMD/factree
-
http://davidkariuki.com/blog/2014/05/25/k-means-clustering-with-ruby
- https://github.com/Tcom242242/t_learn
- https://github.com/piroor/tiny-classifier
- https://github.com/josephwilk/tlearn-rb
- https://github.com/xuanxu/nimbus
- https://github.com/yoshoku/LibSVMLoader
- https://github.com/IBM-ATAT/ibm-ml-ruby
-
https://medium.com/@oem_83498/linear-regression-in-ruby-a170f9a892e5
- https://github.com/cardmagic/classifier
-
fast_forward -
Fast predictions with neural networks in Ruby
- https://github.com/ankane/tensorflow
- https://github.com/ankane/libmf
- https://github.com/ankane/ngt
- https://github.com/ankane/xlearn
- https://github.com/ankane/scs
- https://github.com/ankane/osqp
- https://github.com/ankane/fasttext
- https://github.com/ankane/npy
- https://github.com/ankane/onnxruntime
- https://github.com/ankane/vowpalwabbit
- https://github.com/ankane/thundersvm
- https://github.com/ankane/gslr
- https://github.com/ankane/disco
- https://github.com/ankane/libmf


{% from 'atoms/checkbox.html' import render as render_checkbox with context %}
{% from 'input.html' import render as render_input with context %}
How long does it take to get to your destination?
{{
render_checkbox({
'class': 'u-js-only block block__sub-micro',
'label': "I'm not sure, add this to my to-do list to look up later ",
'disabled': true,
'name': "timeToActionPlan"
})
}}


CITY HOSPITAL
DASHBOARD
LOG OUT
PATIENT'S DATA
PATIENT'S NAME :
GENDER :
MALE
FEMALE
OTHER
BLOOD GROUP :
A+
A-
AB+
AB-
B+
B-
O+
O-
PATIENT'S HEALTH STATUS :
RECOVERED
RECOVERED (Home Quarantine)
NOT RECOVERED
DATE OF COVID-19 TEST
VENTILATOR NEEDED ? :
YES
NO
BED NO.
DOCTOR ASSIGNED :
MR. BHAVENDRA
MS. CANDIDA
MR. RONALD
MR. VIBHAV
CURRENT COVID SYMPTOMS :
None
Fever
Dry Cough
Shortness Of Breath
Chest Pain
Diarrhoea
Sore throat
Loss of Taste
Head Ache
Body Ache and Pain
UPDATE DETAILS


--- layout: wcolumns title: Previous Lives subtitle: Resume permalink: /resume/ ---
Click here, to download a PDF version of my resume...


Top 14 waiver-wire pickups for Week 13 of fantasy football
by Tyler Lauletta, Business Insider US- Heading into the home stretch of the NFL season, it’s time to start finalizing your lineups for a playoff push.
- On Sunday, a few players emerged as potential replacements for any fantasy player in desperate need of filling a hole in their lineup before the postseason begins.
- Here are 14 waiver-wire targets for fantasy players looking to fill in any gaps in their rosters.
- Visit Business Insider’s homepage for more stories.
As we head into the home stretch of the NFL season, fantasy players are ready to work the waiver wire as they prepare for the postseason.
For many players, Week 13 is the final week of the fantasy regular season, leaving one make-or-break matchup with a spot in the playoffs or a first-round bye on the line.
Below, we’ve collected 14 waiver-wire targets for fantasy players looking to add some depth to their rosters, going position by position to give you the best chance of earning a win in this crucial week of the fantasy season.
All ownership percentages come from ESPN with their standard points-per-reception scoring format.
Sam Darnold, QB, New York Jets
ESPN fantasy ownership: 18%
Week 12 stats: 315 passing yards, two touchdowns, one rushing touchdown – 28.2 fantasy points
One thing to know: This week’s list of waiver targets is full of Jets thanks to their favorable schedule moving forward, but no player may have as much potential promise than quarterback Sam Darnold. Darnold has averaged more than 25 points per game in his last three outings and gets his shot at the Bengals and Dolphins over the next two weeks. If you need a fantasy miracle heading into the final weeks of the season, Darnold might be your QB.
Baker Mayfield, QB, Cleveland Browns
ESPN fantasy ownership: 59.8%
Week 12 stats: 327 passing yards, three touchdowns – 23.6 fantasy points
One thing to know: The Cleveland Browns also have a favorable schedule through the final stretch of the season, giving Baker Mayfield a chance to live up to the sky-high expectations. Mayfield’s ownership has dropped off since the start of the year, but with games against the Steelers, Bengals, and Cardinals next on the schedule, it’s time to pick him up if he’s available.
Jonathan Williams, RB, Indianapolis Colts
ESPN fantasy ownership: 29.2%
Week 12 stats: 104 rushing yards, three receptions, 17 receiving yards, one touchdown – 21.1 fantasy points
One thing to know: Jonathan Williams was our top-priority pickup last week in this column and rewarded owners who were paying attention with a 21-point performance on Thursday night. The Colts looked happy to rely on Williams, and he should remain a viable fantasy starter as long as he’s the top man in Indianapolis.
Bo Scarbrough, RB, Detroit Lions
ESPN fantasy ownership: 44.7%
Week 12 stats: 98 rushing yards – 7.8 fantasy points
One thing to know: Bo Scarbrough looked comfortable as the Lions’ top running back on Sunday against Washington, taking his 18 carries for 98 yards in the road loss. While he didn’t find the end zone, Scarbrough showed enough that he’ll have value in your lineup in the coming weeks.
Rashaad Penny, RB, Seattle Seahawks
ESPN fantasy ownership: 29.1%
Week 12 stats: 129 rushing yards, one touchdown – 18.9 fantasy points
One thing to know: Rashaad Penny played the game of his life on Sunday against the Eagles, taking advantage of some extra opportunities after fellow running back Chris Carson fumbled twice to earn a trip to the bench. Penny showed he’s more than capable of filling up the stat sheet when given the opportunity. With Carson’s ball security an ongoing question, Penny could see his playing time continue to trend upward.
Benny Snell, RB, Pittsburgh Steelers
ESPN fantasy ownership: 2.7%
Week 12 stats: 98 rushing yards, one reception, five receiving yards – 11.3 fantasy points
One thing to know: The Steelers offense has been managing its way around injuries since the start of the season, and Benny Snell is the latest player to step up for Pittsburgh in a pinch. With James Conner out with injury and Jaylen Samuels ceding ground, Snell currently is playing as the top back for the Steelers and should retain value as long as the depth chart is in flux.
A.J. Brown, WR, Tennessee Titans
ESPN fantasy ownership: 16%
Week 12 stats: Four receptions, 135 receiving yards, one touchdown – 23.5 fantasy points
One thing to know: A.J. Brown had a breakout day on Sunday, torching the Jaguars defense for 135 yards and a score. He’s been a boom-or-bust player for fantasy owners this year, with two huge performances and two so-so days sprinkled through his 11 starts, but if you’re in need of a big day from a long-shot, he could be heating up at the right time for you.
James Washington, WR, Pittsburgh Steelers
ESPN fantasy ownership: 20.9%
Week 12 stats: Three receptions, 98 receiving yards, one touchdown – 18.8 fantasy points
One thing to know: James Washington got a bit of a spark when the Steelers benched quarterback Mason Rudolph in favor of Devlin “Duck” Hodges, breaking out for a 79-yard score in the third quarter that proved enough to beat the Bengals. Should Hodges hold on to the starting job moving forward, Washington should be a solid value.
Cole Beasley, WR, Buffalo Bills
ESPN fantasy ownership: 23.8%
Week 12 stats: Six receptions, 76 receiving yards, one touchdown – 19.6 fantasy points
One thing to know: Cole Beasley has been as reliable a receiver as you can hope for in fantasy over the past few weeks, putting up at least nine points in five of his last six games and scoring in four games during that same stretch. For anyone looking for some consistency out of a volatile position, chances are Beasley is available in your league.
DeVante Parker, WR, Miami Dolphins
ESPN fantasy ownership: 57.8%
Week 12 stats: Six receptions, 91 receiving yards – 15.1 fantasy points
One thing to know: DeVante Parker is another stalwart of consistency in fantasy this year, having hit 11 or more points for fantasy players in every game since Week 3. He’s owned in more than half of ESPN leagues, but he should be in all of them.
Robby Anderson, WR, New York Jets
ESPN fantasy ownership: 46.3%
Week 12 stats: Four receptions, 86 receiving yards, one touchdown – 18.6 fantasy points
One thing to know: Robby Anderson is another Jets player who could have a huge run at the end of the season and should be a good play against the Bengals and Dolphins defenses over the next two weeks. With Anderson playing for a contract next year, expect him to leave it all on the field in the final games of the year.
Mike Gesicki, TE, Miami Dolphins
ESPN fantasy ownership: 8.7%
Week 12 stats: Three receptions, 28 receiving yards, one touchdown – 11.8 fantasy points
One thing to know: Mike Gesicki has scored 15 points in two of his past four games, and will get to play the Jets, Giants, and Bengals during the fantasy playoffs. If your spot in the fantasy postseason is secure, consider grabbing him for your lineup, or at least to prevent him from going against you.
Ryan Griffin, TE, New York Jets
ESPN fantasy ownership: 22.1%
Week 12 stats: Three receptions, 13 receiving yards, one touchdown – 10.3 fantasy points
One thing to know: Ryan Griffin continues to be a top fantasy tight end through the second half of the year, and shares the favorable matchups as the rest of his Jets teammates heading into the final weeks of the season. With touchdowns in two straight games and four scores in his last five outings, it’s more than a flash in the pan.
New York Jets defense
ESPN fantasy ownership: 25.6%
Week 12 stats: One sack, one interception, one fumble recovery, one touchdown, three points allowed – 17 fantasy points
One thing to know: Along with quarterback Sam Darnold, it’s possible no fantasy add from the Jets is more important than the team’s defense, who have averaged more than 15 points per game over the past three weeks and are set to feast on the feeble offenses of Cincinnati and Miami over their next two games. If you’ve been streaming defenses all year, this is a good one to lock in for the final postseason push.
- Read more:


about
We’re building an open marketplace that helps customers make better decisions about what they eat, and assists restaurants by improving all aspects of their operations.
Feel good about food
We’re building an open marketplace that helps customers make better decisions about what they eat, and assists restaurants by improving all aspects of their operations.


Colombia Leather Collective is a curator of the highest quality leather goods in the world. We specifically partner with Colombian leatherworkers to help them gain access to the new markets where there is demand for intricately designed, handcrafted leather goods.
Products are often designed to fail after a specific amount of time to create recurring revenue for businesses. We believe this is wrong and unsustainable. Colombia Leather Collective strives to be a counterpoint to this business practice, procuring leather goods which are designed to last a lifetime, helping contribute to a more sustainable buying economy.
There is not enough effort on the side of businesses to inform consumers of the full supply chain of their products. This has led to an economy where we no longer understand where our possesions come from. We aim to inform our customers of the full supply chain of our leather products, so that they individually know the origin story of their leather goods.
We believe that creating a personal connection between suppliers, vendors, and consumers leads to a more informed economy, and a more authentic, less manufactured buying process. Colombia Leather Collective is in the people business, we just happen to sell leather goods.
Our goal is to sustainably scale into a business that relies on individual producers in both Colombia and the United States, rather than building our business model around mass-producers. We believe that the path towards sustainability is by being deliberate about supporting local economies, businesses, and entrepreneurs.
Learn about how we are working towards becoming a personal, sustainable business in the leather industry.
DownloadFind us on social media, or reach out to us by sending an email. We look forward to hearing from you.


Plugins
Pathom allows a parser to have a collection of plugins that modify its behavior. Plugins is a top-level option when creating the parser, and the value is a vector of plugins:
(def parser (p/parser {::p/plugins [...]}))
Built-in plugins
Pathom provides some common usage plugins:
-
elide-special-outputs-plugin
-
env-plugin
-
env-wrap-plugin
-
pre-process-parser-plugin
-
post-process-parser-plugin
-
raise-mutation-result-plugin
Plugin Skeleton
In this section we’ll be using a few plugins to make our lives easier.
Plugins set code that wraps some of pathom operations, a plugin is a map where you bind
keys from event names to functions. They work on wrap
fashion, kind like ring
wrappers.
Here is what a plugin looks like:
(ns pathom-docs.plugin-example
(:require [com.wsscode.pathom.core :as p]))
(def my-plugin
; the ::p/wrap-parser entry point wraps the entire parser,
; this means it wraps the operation that runs once on each
; query that runs with the parser
{::p/wrap-parser
(fn [parser]
; here you can initialize stuff that runs only once per
; parser, like a durable cache across requests
(fn [env tx]
; here you could initialize per-request items, things
; that needs to be set up once per query as we do on
; request cache, or the error atom to accumulate errors
; in this case, we are doing nothing, just calling the
; previous parser, a pass-through wrapper if you may
(parser env tx)))
; this wraps the read function, meaning it will run once for
; each recursive parser call that happens during your query
::p/wrap-read
(fn [reader]
(fn [env]
; here you can wrap the parse read, in pathom we use this
; on the error handler to do the try/catch per node, also
; the profiler use this point to calculate the time spent
; on a given node
; this is also a good point to inject custom read keys if
; you need to, the profile plugin, for example, can capture
; the key ::p.profile/profile and export the current profile
; information
(reader env)))
;; during the connect processing, while the wrap-read will work around
;; the entire attribute, this wraps each individual resolver call (excluding cache hits)
::pc/wrap-resolve
(fn [resolve]
(fn [env input]
(resolve env input)))
::p/wrap-mutate
; mutation wrappers require a slightly different pattern
; as the actual mutation comes on an ':action' key
(fn [mutate]
(fn [env k params]
; inject custom mutation keys, etc here
(let [out (mutate env k params)]
(cond-> out
(:action out)
(update :action
(fn [action]
(fn []
(action))))))))})
The plugin engine replaces the old process-reader
in a much more powerful way. If you want to check a real example look for the source for the built-in plugins, they are quite small and yet powerful tools (grep for -plugin
on the repository to find all of them).
Example: Shard switch
For a more practical example, let’s say we are routing in a micro-service architecture
and our parser needs to be shard-aware. Let’s write a plugin that anytime it sees a :shard
param on a query; and it will update the :shard
attribute on the environment and send
it down, providing that shard information for any node downstream.
(ns pathom-docs.plugin-shard
(:require [com.wsscode.pathom.core :as p]))
; a reader that just flows, until it reaches a leaf
(defn flow-reader [{:keys [query] :as env}]
(if query
(p/join env)
:leaf))
(def shard-reader
; Clojure neat tricks, let's just fetch the shard
; from the environment when :current-shard is asked
{:current-shard :shard})
(def shard-plugin
{::p/wrap-read
(fn [reader]
(fn [env]
; try to get a new shard from the query params
(let [new-shard (get-in env [:ast :params :shard])]
(reader (cond-> env new-shard (assoc :shard new-shard))))))})
(def parser
(p/parser {::p/plugins [(p/env-plugin {::p/reader [shard-reader flow-reader]})
; use our shard plugin
shard-plugin]}))
(parser {:shard "global"}
'[:a :b :current-shard
{(:go-s1 {:shard "s1"})
; notice it flows down
[:x :current-shard {:y [:current-shard]}]}
:c
{(:go-s2 {:shard "s2"})
[:current-shard
; we can override at any point
{(:now-s3 {:shard "s3"})
[:current-shard]}]}])
; =>
; {:a :leaf
; :b :leaf
; :current-shard "global"
; :go-s1 {:x :leaf :current-shard "s1" :y {:current-shard "s1"}}
; :c :leaf
; :go-s2 {:current-shard "s2" :now-s3 {:current-shard "s3"}}}


Dialogue Editor
- An Expand All button has been added.
- You can now type stage IDs into stage dropdowns.
Bug Fixes
- Filtering cases by target has been fixed.
- Filter (+) has been removed from the menus. Use the Filter submenu to pick a specific filter type.
- Target Tag now converts to a target filter with that tag.
- Mint Chocolate now has a hover effect for menus in the condition editor.
- When adding a Target, Also Playing, or Opponent filter, focus will jump to the Character field rather than the Filter field so that you can immediately select a character.
- Adding multiple Self or Target filters now works out of the box without needing the cumbersome workaround of adding an Anyone filter and changing it to Self or Target.
- Ranges can now be specified for specific character filters, for targeting whether 0 or multiple of that character is present.
- Stop directives on looped camera and fade animations now appropriately stop those animations during the preview.
- Since 5.2, cases were getting a redundant tag attribute. These will be stripped away now.


On this page you'll find archived releases of:
-
{{ range $category := sort (index .Site.Data "release-categories") ".order" }}
- Apache {{ $category.name }} {{ end }}
{{ partial "header.html" . }}
On this page you'll find archived releases of:
{{ range $category := sort (index .Site.Data "release-categories") ".order" }}


Hello World
Web page by Simmy
Web page is about Butterflies
Butterflies are beautiful, flying-insects. Flowers and bright colors attract different types of butterflies. Butterflies have a life-cycle like most other insects.
Butterflies have a life-cycle like most other insects.
1.Hatch from eggs, first are catterpillars.
2.Once full grown catterpillar, hides in a chrysalis or pupa, until formed.
3.Breaks out in butterfly form.
4.Adult Butterfly produces more eggs.
This life-cycle will go on forever.
This picture is of a Karner Blue Butterfly. The Karner Blue Butterfly is a small, blue butterfly that has a wingspan of about 1 inch. It lives in oak savannas and pine barrens.


It's common to include a data file in your app and then have the app load that data into the database the first time it runs. The app can then use and extend that initial dataset.
This example demonstrates how to load a data file that contains XML data from the app's package, parse it, and store the data in IndexedDB tables. You can use similar techniques to store JSON-formatted data files or data retrieved from the web via XMLHttpRequest.


Profile 中文
FirstName：King
LastName：Xu
Birthday：1992/2/24
<EMAIL_ADDRESS>Phone：13603043209
Education：Bachelor
University：Dalian University
Majors：Electronic information Engineering
Working life：5 years
Introduction：
A Engineer Loving Open-Source and OOP。
- 5+ years in developing，3+ years in architecture designing
- c# and go is major, but also be experienced in java/c++/vb/js
- 2+years in leading team of front-end, be skilled in vue/angular/webpack and common web performance optimizing
- 3+ years in distributed architecture and 2+ years in micro service
- skilled in most of infrastructure and open-source projects(cache/mq/background)
- high learning ability
- good at sharing and driving the team atmosphere
- ability to use Japanese and English for basic work communication
Skills
-
Golang
-
.Net
-
JavaScript/Html/Css/MVVM/Webpack/Nodejs
-
Java
-
Python/Lua
-
C++
-
VB
-
Infrastructure(rabbitmq/redis/activemq/memcached/etc.)
-
Db(mysql/sqlserver/mongodb/progres/oracle/sqlite)
-
Basic Tools(git/svn/tfs/vs/eclipse/idea)
WorkExperience
FollowMeLimited
2018/3 - Now
Senior Software Engineer
Forex Finance
1，Spend two months learning Golang and its ecology, and propose aggregation services to solve the problem of slow and cross-service query of legacy systems, which plummeted from the first 30 seconds to 1.2 seconds, while the stability was greatly improved
2，While building aggregation services, good precipitation has been done for Golang infrastructure, such as Golang's build mirroring and dependency management, and the new build mechanism has increased the build speed by more than 10 times times
3，The coordination team uses DDD to complete the distinction between the remaining microservice boundaries, introducing the Apigateway model to bring together the decentralized application responsibilities
4，Refactoring legacy User Services, unifying the database to solve distributed transaction problems, while bringing business recovery to service autonomy, greatly improving delivery quality and delivery speed
5，Technology sharing of technical staff in the group to drive team members ' interest in design and stay only on the technical surface
Juding medical Equipment Co., Ltd.
2016/9-2018/3
Senior Software Engineer
Medical devices
1，Take over the Web group for three months, leading colleagues in the group to complete the technical transformation of static page +jq->mvc->vue+webpack, resulting in an average increase in development efficiency by nearly twice times
2，Eight months in charge of the lead front and rear design, in collaboration with the back-end colleagues to complete the rewriting of the core project, the bug rate is greatly reduced, and then until the departure has not been re-iteration
3，Lack of relevant personnel in the group, take one months to learn Windows network programming, wrote LSP Traffic interceptor Program
4，Organize colleagues to refine common components and share them with other R & amp; d groups, resulting in a significant increase in R & amp; d efficiency and quality throughout the C # system, with a 60% reduction in defect rates and a 274% increase in development efficiency in quality reviews
5，The implementation of DDD and unit testing within the group improves the working ability and delivery quality of the entire team, and studies a unique DDD single process landing scheme
AbeamSystem
2014/9-2016/9
c# Developer
Software
1，Half a month mastering C # and putting it to work
2，One weeks of learning VB and writing a large VBA batch for customers
3，Two days to learn C + + and MFC to help field customers modify defects
ProjectExperience
User System Ecosystem
2018/10 - Now
The service lies in the accumulation of active values according to the behavior of the company's users in the circle of friends, such as Weibo, likes, comments, collections, concerns, etc., and the issuance of a certain internal currency according to the user's active value at 22 points per day, the currency can be used to redeem the goods
- Split the business area, split into the mall, active value, f coin three fields
- Active value service uses an event-driven design that accesses the MQ signal of the user's behavior buried point and uses MongoDB as the event library to store
- The F Coin Service and the mall service use the traditional DDD design, using the traditional MySQL relational database
- Use pipeline mode to design active value attenuation of duplicate user behavior and correction of reverse operation
- Use DSL to simplify complex logic when docking MQ signals
Micro Service Gateway
2018/09 - Now
Based on the open source Project Kong, the service has developed customized plug-ins on top of it to solve the problem that basic functionality cannot be reused in the company's historical architecture. At the same time, unnecessary code is reduced because the previous work was done by node.
- Research and complete routing configuration for each nuanced service
- Configure JWT authentication Plug-ins
- Development of OIDC-based SSO authentication plug-ins
- Configure the fuse and current limiting features of some interfaces
- Seal the configured Kong into a new image for easy release.
Account Services
2018/04 - Now
The service is based on the go language and is the core service of the entire forex trading social circle, responsible for all business related to the user and the user's trading account.
- Maintain the daily needs of the service
- Data migration from MSSQL to MySQL completed during the period of responsibility
- Use DDD to split the original service into User services and account services for easy iteration and maintenance
- Added dependency management (based on DEP) to the service to enable subsequent developers to build the environment more quickly
- Upgraded infrastructure, from micro to GRPC, and developed consul Resolver for GRPC
- Using makefile instead of DevOps scripts on drone greatly accelerates the mirroring packaging process
CRM Report Services
2018/04 - Now
Based on the go language, the service is responsible for pulling data from various decentralized business databases and establishing a data mart for CRM queries.
- All design and coding work
- Data migration from MSSQL to MySQL completed during the period of responsibility
- Use DDD to split the original service into User services and account services for easy iteration and maintenance
- Added dependency management (based on DEP) to the service to enable subsequent developers to build the environment more quickly
- Upgraded infrastructure, from micro to GRPC, and developed consul Resolver for GRPC
- Refine a set of work models based on task, including dashboard, click here to access
Full-court API Gateway
2017/09 - 2018/02
Based on the OAUTH2.0 protocol, the gateway is developed using CSHARP to provide external interface authorization for the whole hospital system.
- All design and coding work
- Using DDD breaks down internal business boundaries, and each business domain runs under the gateway as a plug-in, making it easy to plug in.
- To understand the decoupling business boundaries, message middleware was developed: serviceant
- In order to facilitate client access, Java and C # clients have been developed
EcardSystem
2017/10 - 2018/04
This project is as the company's main product support products, hospital customer information (currently the core is Payment) to integrate, the ultimate goal is to achieve regional medical conjoined.
Front End:
1. Separation of front and rear end of project, quick construction of spa program using Vuejs+elementui
2, front-end communication using RESTFULAPI, with OAUTH2 protocol to ensure security
3, front end using Vuex management token and user login information
4, Axios-based interceptors complete token automatic injection and return status validation when back-end API calls
5, encapsulates a large number of common component and custom instructions to improve development efficiency
7, using Webpack Modular project code and building packaging
8, using Webpack asynchronous load with the asynchronous component provided by Vue to implement on-demand loading
Backend:
1, the use of the. Net Framewokr4.5.2-based ABP framework for transformation, the application layer based on the dynamic generation of WEBAPI and integration of OAUTH2 client and password mode to ensure interface security
2, with the plug-in module dynamic loading way with the DDD limit context of the initial complete landing ddd
3, loosely coupled design, did a lot of unit testing to ensure the quality of the code and future maintainability.
4, based on Oauth2.0 protocol to expand three authentication methods to deal with different scenarios of API Access security control
5, the use of Jekins to complete CI and automatic packaging, greatly reducing the probability of product errors and save costs
6, the project involved in the Eventbus open source to GitHub, address: https://github.com/ShiningRush/ServiceAnt
- Front end and Backend architecture design, and base demo code landing
- Participate in domain modeling analysis and build domain models
- Technical pre-research, as well as solving performance problems met by the R & amp; d process
Full-court self-service system
2016/09 - 2017/10
The whole hospital self-service system is the company's core products, mainly in solving hospital on-site printing reports difficult, human consumption is large, manual differentiation of error-prone problems.
The front end uses MVC and jquery, the service side in order to ensure the high availability of the system, the adoption of SOA architecture, and the separation of the server and terminal and Web management background, to ensure that iterative development can be parallel operations to improve development efficiency.
Led the team through the following transformation in the product iteration process:
1, leading the team to incorporate the front-end code into the MVC framework and add Jquery+easyui
2. Leverage the features provided by MVC to encapsulate a large number of common components to improve development efficiency
3, some automatic calibration of the JS framework has been developed
4. Packaging and compressing code and resource files using the bundle features provided by MVC background
Combing requirements, pre-research related technology, architecture design, and implementation to code implementation.
- Front and rear architecture design, and base demo code landing
- Participate in domain modeling analysis and build domain models
- Technical pre-research, as well as solving performance problems met by the R & amp; d process


Hide Page | Reload Cached
The goal of this page is to show how monotype fonts load in a child iframe.
You must use "localhost" when testing monotype fonts.


[1]
used it yesterday and my unit works fine.
[2]
used it yesterday and accurate even load in your doing and operation.