resource mysql_unbuffered_query ( string $query [, resource $link_identifier ] )
mysql_unbuffered_query() sends the SQL query query to MySQL without automatically fetching and buffering the result rows as mysql_query() does. This saves a considerable amount of memory with SQL queries that produce large result sets, and you can start working on the result set immediately after the first row has been retrieved as you don't have to wait until the complete SQL query has been performed. To use mysql_unbuffered_query() while multiple database connections are open, you must specify the optional parameter link_identifier to identify which connection you want to use.
For SELECT, SHOW, DESCRIBE or EXPLAIN statements, mysql_unbuffered_query() returns a resource on success, or FALSE on error. For other type of SQL statements, UPDATE, DELETE, DROP, etc, mysql_unbuffered_query() returns TRUE on success or FALSE on error.


The rising sun pushed its crimson edge above the horizon and sent long shadows down the cobblestone streets of Falme toward the harbor. A sea breeze bent the smoke of breakfast cook fires inland from the chimneys. Only the early risers were already out of doors, their breath making steam in the morning cold. Compared to the crowds that would fill the streets in another hour, the town seemed nearly empty.
 Min sat on a doorstep across the way, swathed in her Seanchan cloak and eating a wrinkled plum, and Elayne in her fleece coat huddled at the edge of an alley just down the street from her. A large sack, pilfered from the docks, lay neatly folded beside Min. My army, Nynaeve thought grimly. But there isn’t anybody else.
She caught sight of a sul’dam and a damane climbing the street, a yellow-haired woman wearing the bracelet and a dark woman the collar, both yawning sleepily. The few Falmen sharing the street with them averted their eyes and gave them a wide berth. As far as she could see down toward the harbor, there was not another Seanchan. She did not turn her head the other way. Instead, she stretched and shrugged as if working cold shoulders before settling back as she had been.
Min tossed her half-eaten plum aside, glanced casually up the street, and leaned back on the doorpost. The way was clear there, too, or she would have put her hands on her knees. Min had started rubbing her hands nervously, and Nynaeve realized that Elayne was now bouncing eagerly on her toes.
If they give us away, I’ll thump both their heads. But she knew if they were discovered, it would be the Seanchan who would say what happened to all three of them. She was all too aware that she had no real notion of whether what she planned would work or not. It could easily be her own failure that would give them away. Once again she resolved that if anything went wrong, she would somehow pull attention to herself while Min and Elayne escaped. She had told them to run if anything went wrong, and let them think she would run, too. What she would do then, she did not know. Except I won’t let them take me alive. Please, Light, not that.
Sul’dam and damane came up the street until they were bracketed by the three waiting women. A dozen Falmen walked wide of the linked pair.
Nynaeve gathered all of her anger. Leashed Ones and Leash Holders.  She had made Min tell her how sul’dam enforced their will. She was sure Min had kept some back, the worst, but what she told was enough to heat Nynaeve to white-hot fury. In an instant a white blossom on a black, thorny branch had opened to light, to saidar, and the One Power filled her. She knew there was a glow around her, for those who could see it. The pale-skinned sul’dam gave a start, and the dark damane’s mouth fell open, but Nynaeve gave them no chance. It was only a trickle of the Power that she channeled, but she cracked it, a whip snapping a dust mote out of the air.
The silver collar sprang open and clattered to the cobblestones. Nynaeve heaved a sigh of relief even as she leaped to her feet.
The sul’dam stared at the fallen collar as if at a poisonous snake. The damane put a shaking hand to her throat, but before the woman in the lightning-marked dress had time to move, the damane turned and punched her in the face; the sul’dam’s knees buckled, and she almost fell.
“Good for you!” Elayne shouted. She was already running forward, too, and so was Min.
Before any of them reached the two women, the damane took one startled look around, then ran as hard as she could.
“We won’t hurt you!” Elayne called after her. “We are friends!”
“Be quiet!” Nynaeve hissed. She produced a handful of rags from her pocket and ruthlessly stuffed them into the gaping mouth of the still staggering sul’dam. Min hastily shook out the sack in a cloud of dust and plunged it over the sul’dam’s head, shrouding the woman to the waist. “We are already attracting too much attention.”
It was true, and yet not entirely true. The four of them stood in a rapidly emptying street, but the people who had decided to be elsewhere were avoiding looking at them. Nynaeve had been counting on that—people doing their best to ignore anything that had to do with Seanchan—to gain them a few moments. They would talk eventually, but in whispers; it might take hours for the Seanchan to learn anything had happened.
The hooded woman began to struggle, making rag-muffled shouts from the sack, but Nynaeve and Min threw their arms around her and wrestled her toward a nearby alley. The leash and collar trailed across the cobblestones behind them, clinking.
“Pick it up,” Nynaeve snapped at Elayne. “It won’t bite you!”
Elayne took a deep breath, then gathered the silver metal gingerly, as if she feared it very well might. Nynaeve felt some sympathy, but not much; everything rested on each of them doing as they had planned.
The sul’dam kicked and tried to throw herself free, but between them, Nynaeve and Min forced her along, down the alley into another, slightly wider passage behind houses, to yet another alley and at last into a rough wooden shed that had apparently once housed two horses, by the stalls. Few could afford to keep horses since the Seanchan came, and in a day of Nynaeve’s watching, no one had gone near it. The interior had a musty dustiness that spoke of abandonment. As soon as they were inside, Elayne dropped the silver leash and wiped her hands on some straw.
Nynaeve channeled another trickle, and the bracelet fell to the dirt floor. The sul’dam squalled and hurled herself about.
“Ready?” Nynaeve asked. The other two nodded, and they yanked the sacking off their prisoner.
The sul’dam wheezed, blue eyes teary from dust, but her red face was red as much from anger as from the sack. She darted for the door, but they caught her in the first step. She was not weak, yet they were three, and when they were done the sul’dam was stripped to her shift and lying in one of the stalls, bound hand and foot with stout cord, with another piece of cord to keep her from forcing the gag out.
Soothing a puffy lip, Min eyed the lightning-paneled dress and soft boots they had laid out. “It might fit you, Nynaeve. It won’t fit Elayne or me.” Elayne was picking straw out of her hair.
“I can see that. You were never a choice anyway, not really. They know you too well.” Nynaeve hurriedly removed her own clothes. She tossed them aside and donned the sul’dam’s dress. Min helped with the buttons.
Nynaeve wiggled her toes in the boots; they were a little tight. The dress was tight, too, across the bosom, and loose elsewhere. The hem hung almost to the ground, lower than sul’dam wore them, but the fit would have been even worse on any of the others. Snatching up the bracelet, she took a deep breath and closed it around her left wrist. The ends merged, and it seemed solid. It did not feel like anything except a bracelet. She had been afraid that it would.
“Get the dress, Elayne.” They had dyed a pair of dresses—one of hers and one of Elayne’s—to the gray damane wore, or as close as they could manage, and hidden them here. Elayne did not move except to stare at the open collar and lick her lips. “Elayne, you have to wear it. Too many of them have seen Min for her to do it. I would have worn it, if this dress had fit you instead.” She thought she would have gone mad if she had had to wear the collar; that was why she could not make her voice sharp with Elayne now.
“I know.” Elayne sighed. “I just wish I knew more of what it does to you.” She drew her red-gold hair out of the way. “Min, help me, please.” Min began undoing the buttons down the back of her dress.
Nynaeve managed to pick up the silver collar without flinching. “There is one way to find out.” With only a moment of hesitation, she bent and snapped it around the neck of the sul’dam. She deserves it if anyone does, she told herself firmly. “She might be able to tell us something useful, anyway.” The blue-eyed woman glanced at the leash trailing from her neck to Nynaeve’s wrist, then glared up at her contemptuously.
“It doesn’t work that way,” Min said, but Nynaeve barely heard.
She was . . . aware . . . of the other woman, aware of what she was feeling, cord digging into her ankles and into her wrists behind her back, the rank fish taste of the rags in her mouth, straw pricking her through the thin cloth of her shift. It was not as if she, Nynaeve, felt these things, but in her head was a lump of sensations that she knew belonged to the sul’dam.
She swallowed, trying to ignore them—they would not go away—and addressed the bound woman. “I won’t hurt you if you answer my questions truthfully. We aren’t Seanchan.  ” She lifted the leash threateningly.
The woman’s shoulders shook, and her mouth curled around the gag in a sneer. It took Nynaeve a moment to realize the sul’dam was laughing.
Her mouth tightened, but then a thought came to her. That bundle of sensation inside her head seemed to be everything physical that the other woman felt. Experimentally, she tried adding to it.
Eyes suddenly bulging out of her head, the sul’dam gave a cry that the gag only partially stopped. Fanning her hands behind her as if trying to ward off something, she humped through the straw in a vain effort to escape.
Nynaeve gaped, and hastily rid herself of the extra feelings she had added. The sul’dam sagged, weeping.
“What . . . What did you . . . do to her?” Elayne asked faintly. Min only stared, her mouth hanging open.
Nynaeve answered gruffly. “The same thing Sheriam did to you when you threw a cup at Marith.” Light, but this is a filthy thing.
Elayne gulped loudly. “Oh.”
“But an a’dam isn’t supposed to work that way,” Min said. “They always claimed it won’t work on any woman who cannot channel.”
“I do not care how it is supposed to work, so long as it does.” Nynaeve seized the silver metal leash right where it joined the collar, and pulled the woman up enough to look her in the eyes. Frightened eyes, she saw. “You listen to me, and listen well. I want answers, and if I don’t get them, I’ll make you think I have had the hide off you.” Stark terror rolled across the woman’s face, and Nynaeve’s stomach heaved as she suddenly realized the sul’dam had taken her literally. If she thinks I can, it’s because she knows. That is what these leashes are for. She took firm hold of herself to stop from clawing the bracelet off her wrist. Instead, she hardened her face. “Are you ready to answer me? Or do you need more convincing?”
The frantic head-shaking was answer enough. When Nynaeve removed the gag, the woman only paused to swallow once before babbling, “I will not report you. I swear it. Only take this from my neck. I have gold. Take it.  “What is your name?”
“Seta. Please. I will answer you, but please take—it—off! If anyone sees it on me . . . ” Seta’s eyes rolled down to stare at the leash, then squeezed shut. “Please?” she whispered.
Nynaeve realized something. She could never make Elayne wear that collar.
“Best we get on with it,” Elayne said firmly. She was down to her shift, too, now. “Give me a moment to put this other dress on, and—”
“Put your own clothes back on,” Nynaeve said.
“Someone has to pretend to be a damane,” Elayne said, “or we will never reach Egwene. That dress fits you, and it cannot be Min. That leaves me.”
“I said put your clothes on. We have somebody to be our Leashed One.” Nynaeve tugged at the leash that held Seta, and the sul’dam gasped.
“No! No, please! If anyone sees me—” She cut off at Nynaeve’s cold stare.
“As far as I am concerned, you are worse than a murderer, worse than a Darkfriend. I can’t think of anything worse than you. The fact that I have to wear this thing on my wrist, to be the same as you for even an hour, sickens me. So if you think there is anything I’ll balk at doing to you, think again.  Good. Neither do we. No one really looks at a damane, though. As long as you keep your head down the way a Leashed One is supposed to, no one will even notice you. But you had better do the best you can to make sure the rest of us aren’t noticed, either.  Do we understand each other?”
“Yes,” Seta said faintly. “I swear it.”
Nynaeve had to remove the bracelet in order for them to slide Elayne’s gray-dyed dress down the leash and over Seta’s head. It did not fit the woman well, being loose at the bosom and tight across the hips, but Nynaeve’s would have been as bad, and too short besides. Nynaeve hoped people really did not look at damane. She put the bracelet back on reluctantly.
Elayne gathered up Nynaeve’s clothes, wrapped the other dyed dress around them, and made a bundle, a bundle for a woman in farm clothes to be carrying as she followed a sul’dam and a damane. “Gawyn will eat his heart out when he hears about this,” she said, and laughed. It sounded forced.
Nynaeve looked at her closely, then at Min. It was time for the dangerous part. “Are you ready?”
Elayne’s smile faded. “I am ready.”
“Ready,” Min said curtly.
 Seta said, quickly adding, “If I may ask?”
“Into the lions’ den,” Elayne told her.
“To dance with the Dark One,” Min said.
Nynaeve sighed and shook her head. “What they are trying to say is, we are going where all the damane are kept, and we intend to free one of them.”
Seta was still gaping in astonishment when they hustled her out of the shed.
Bayle Domon watched the rising sun from the deck of his ship. The docks were already beginning to bustle, though the streets leading up from the harbor stood largely empty. A gull perched on a piling stared at him; gulls had pitiless eyes.
“Are you sure about this, Captain?” Yarin asked. “If the Seanchan wonder what we’re all doing aboard—”
“You just make certain there do be an axe near every mooring line,” Domon said curtly. “And, Yarin? Do any man try to cut a line before those women are aboard, I will split his skull.”
“What if they don’t come, Captain? What if it’s Seanchan soldiers instead?”
“Settle your bowels, man! If soldiers come, I will make a run for the harbor mouth, and the Light have mercy on us all. But until soldiers do come, I mean to wait for those women.
Domon turned back to peering up into the town, toward where the damane were held. His fingers drummed a nervous tattoo on the railing.
The breeze from the sea brought the smell of breakfast cook fires to Rand’s nose, and tried to flap at his moth-eaten cloak, but he held it closed with one hand as Red neared the town. There had not been a coat to fit him in the clothes they had found, and he thought it best to keep the fine silver embroidery on his sleeves and the herons on his collar hidden. The Seanchan attitude toward conquered people carrying weapons might not extend to those with heron-mark swords, either.
The first shadows of morning stretched out ahead of him. He could just see Hurin riding in among the wagon yards and horse lots. Only one or two men moved among the lines of merchant wagons, and they wore the long aprons of wheelwrights or blacksmiths. Ingtar, the first in, was already out of sight. Perrin and Mat followed behind Rand at spaced intervals. He did not look back to check on them. There was not supposed to be anything to connect them; five men coming into Falme at an early hour, but not together.
The horse lots surrounded him, horses already crowding the fences, waiting to be fed. Hurin put his head out from between two stables, their doors still closed and barred, saw Rand and motioned to him before ducking back. Rand turned the bay stallion that way.
Hurin stood holding his horse by the reins. He had on one of the long vests instead of his coat, and despite the heavy cloak that hid his short sword and sword-breaker, he shivered with the cold. “Lord Ingtar’s back there,” he said, nodding down the narrow passage. “He says we’ll leave the horses here and go the rest of the way on foot.” As Rand dismounted, the sniffer added, “Fain went right down that street, Lord Rand. I can almost smell it from here.”
Rand led Red down the way to where Ingtar had already tied his own behind the stable. The Shienaran did not look very much like a lord in a dirty fleece coat with holes worn through the leather in several places, and his sword looked odd belted over it. His eyes had a feverish intensity.
Tying Red alongside Ingtar’s stallion, Rand hesitated over his saddlebags. He had not wanted to leave the banner behind. He did not think any of the soldiers would have gone into the bags, but he could not say the same for Verin, nor predict what she would do if she found the banner. Still, it made him uneasy to have it with him. He decided to leave the saddlebags tied behind his saddle.
Mat joined them, and a few moments later Hurin came with Perrin. Mat wore baggy trousers stuffed into the tops of his boots, and Perrin his too-short cloak. Rand thought they all looked like villainous beggars, but they had all passed largely unnoticed in the villages.
“Now,” Ingtar said, “Let us see what we see.”
They strolled out to the dirt street as if they had no particular destination in mind, talking among themselves, and ambled past the wagon yards onto sloping cobblestone streets. Rand was not sure what he himself said, much less anyone else. Ingtar’s plan had been for them to look like any other group of men walking together, but there were all too few people out-of-doors. Five men made a crowd in those cold morning streets.
They walked in a bunch, but it was Hurin who led them, sniffing the air and turning up this street and down that. The rest turned when he did, as if that was what they had intended all along. “He’s crisscrossed this town,” Hurin muttered, grimacing. “His smell is everywhere, and it stinks so, it’s hard to tell old from new. At least I know he’s still here. Some of it cannot be older than a day or two, I’m sure. I am sure,” he added less doubtfully.
 Two women walked by, headed the other way, one with downcast eyes and a silver collar around her neck, the other, in a dress worked with lightning bolts, holding a coiled silver leash.
Rand’s breath caught; it was an effort not to look back at them.
“Was that . . . ?” Mat’s eyes were open wide, staring out of the hollows of his eye sockets. “Was that a damane?”
“That is the way they were described,” Ingtar said curtly. “Hurin, are we going to walk every street in this Shadowcursed town?”
“He’s been everywhere, Lord Ingtar,” Hurin said. “His stench is everywhere.” They had come into an area where the stone houses were three and four stories high, as big as inns.
They rounded a corner, and Rand was taken aback by the sight of a score of Seanchan soldiers standing guard in front of a big house on one side of the street—and by the sight of two women in lightning-marked dresses talking on the doorsteps of another across from it. A banner flapped in the wind over the house the soldiers protected; a golden hawk clutching lightning bolts. Nothing marked out the house where the women talked except themselves.  Then Rand saw the two big, leathery-skinned shapes crouched among the soldiers and missed a step.
Grolm. There was no mistaking those wedge-shaped heads with their three eyes. They can’t be. Perhaps he was really asleep, and this was all a nightmare. Maybe we haven’t even left for Falme yet.
The others stared at the beasts as they walked past the guarded house.
“What in the name of the Light are they?” Mat asked.
 “Lord Rand, they’re . . . Those are . . . ”
“It doesn’t matter,” Rand said. After a moment, Hurin nodded.
We are here for the Horn,” Ingtar said, “not to stare at Seanchan monsters. Concentrate on finding Fain, Hurin.”
The soldiers barely glanced at them. The street ran straight down to the round harbor. Rand could see ships anchored down there; tall, square-looking ships with high masts, small in that distance.
“He’s been here a lot.”  “The street stinks of layer on layer of him. I think he might have been here as late as yesterday, Lord Ingtar. Maybe last night.”
Mat suddenly clutched his coat with both hands. “It’s in there,” he whispered. He turned arond and walked backwards, peering at the tall house with the banner. “The dagger is in there. I didn’t even notice it before, because of those—those things, but I can feel it.”
Perrin poked a finger in his ribs. “Well stop that before they start wondering why you’re goggling at them like a fool.”
Rand glanced over his shoulder. The officer was looking after them.
Mat turned around sullenly. “Are we just going to keep on walking? It’s in there, I tell you.”
“The Horn is what we are after,” Ingtar growled. “I mean to find Fain and make him tell me where it is.” He did not slow down.
Mat said nothing, but his entire face was a plea.
I have to find Fain, too, Rand thought. I have to. But when he looked at Mat’s face, he said, “Ingtar, if the dagger is in that house, Fain likely is too. I can’t see him letting the dagger or the Horn, either one, far out of his sight.”
Ingtar stopped. After a moment, he said, “It could be, but we will never know from out here.”
“We could watch for him to come out,” Rand said. “If he comes out at this time of the morning, then he spent the night there. And I’ll wager where he sleeps is where the Horn is. If he does come out, we can be back to Verin by midday and have a plan made before nightfall.”
“I do not mean to wait for Verin,” Ingtar said, “and neither will I wait for night. I’ve waited too long already. I mean to have the Horn in my hands before the sun sets again.”
“But we don’t know, Ingtar.”
“I know the dagger is in there,” Mat said.
“And Hurin says Fain was here last night.” Ingtar overrode Hurin’s attempts to qualify that. “It is the first time you have been willing to say anything closer than a day or two. We are going to take back the Horn now. Now!”
“How?” Rand said. The officer was no longer watching them, but there were still at least twenty soldiers in front of the building. And a pair of grolm. This is madness. There can’t be grolm here. Thinking it did not make the beasts disappear, though.
“There seem to be gardens behind all these houses,” Ingtar said, looking around thoughtfully. “If one of those alleys runs by a garden wall . . . Sometimes men are so busy guarding their front, they neglect their back. Come.” He headed straight for the nearest narrow passage between two of the tall houses. Hurin and Mat trotted right after him.
Rand exchanged looks with Perrin—his curly-haired friend gave a resigned shrug—and they followed, too.
The alley was barely wider than their shoulders, but it ran between high garden walls until it crossed another alley big enough for a push-barrow or small cart. That was cobblestoned, too, but only the backs of buildings looked down on it, shuttered windows and expanses of stone, and the high back walls of gardens overtopped by nearly leafless branches.
Ingtar led them along that alley until they were opposite the waving banner. Taking his steel-backed gauntlets from under his coat, he put them on and leaped up to catch the top of the wall, then pulled himself up enough to peek over. He reported in a low monotone. “Trees. Flower beds. Walks. There isn’t a soul to be—Wait! A guard. One man. He isn’t even wearing his helmet. Count to fifty, then follow me.” He swung a boot to the top of the wall and rolled over inside, disappearing before Rand could say a word.
Mat began to count slowly. Rand held his breath. Perrin fingered his axe, and Hurin gripped the hilts of his weapons.
“ . . . fifty.” Hurin scrambled up and over the wall before the word was well out of Mat’s mouth. Perrin went right beside him.
Rand thought Mat might need some help—he looked so pale and drawn—but he gave no sign of it as he scrambled up. The stone wall provided plenty of handholds, and moments later Rand was crouched on the inside with Mat and Perrin and Hurin.
The garden was in the grip of deep autumn, flower beds empty except for a few evergreen shrubs, tree branches nearly bare. The wind that rippled the banner stirred dust across the flagstone walks. For a moment Rand could not find Ingtar. Then he saw the Shienaran, flat against the back wall of the house, motioning them on with sword in hand.
Rand ran in a crouch, more conscious of the windows blankly peering down from the house than of his friends running beside him. It was a relief to press himself against the house beside Ingtar.
Mat kept muttering to himself, “It’s in there. I can feel it.”
“Where is the guard?” Rand whispered.
“Dead,” Ingtar said. “The man was overconfident. He never even tried to raise a cry. I hid his body under one of those bushes.”
Rand stared at him. The Seanchan was overconfident? The only thing that kept him from going back right then was Mat’s anguished murmurs.
“We are almost there.” Ingtar sounded as if he were speaking to himself, too. “Almost there. Come.”
Rand drew his sword as they started up the back steps. He was aware of Hurin unlimbering his short-bladed sword and notched sword-breaker, and Perrin reluctantly drawing his axe from the loop on his belt.
The hallway inside was narrow. A half-open door to their right smelled like a kitchen. Several people were moving about in that room; there was an indistinguishable sound of voices, and occasionally the soft clatter of a pot lid.
Ingtar motioned Mat to lead, and they crept by the door. Rand watched the narrowing opening until they were around the next corner.
A slender young woman with dark hair came out of a door ahead of them, carrying a tray with one cup. They all froze. She turned the other way without looking in their direction. Rand’s eyes widened. Her long white robe was all but transparent. She vanished around another corner.
“Did you see that?” Mat said hoarsely. “You could see right through—”
Ingtar clapped a hand over Mat’s mouth and whispered, “Keep your mind on why we are here. Now find it. Find the Horn for me.”
Mat pointed to a narrow set of winding stairs. They climbed a flight, and he led them toward the front of the house. The furnishings in the hallways were sparse, and seemed all curves. Here and there a tapestry hung on a wall, or a folding screen stood against it, each painted with a few birds on branches, or a flower or two. A river flowed across one screen, but aside from rippling water and narrow strips of riverbank, the rest of it was blank.
All around them Rand could hear the sounds of people stirring, slippers scuffing on the floor, soft murmurs of speech. He did not see anyone, but he could imagine it all too well, someone stepping into the hall to see five slinking men with weapons in their hands, shouting an alarm . . .
“In there,” Mat whispered, pointing to a big pair of sliding doors ahead, carved handholds their only ornamentation. “At least, the dagger is.”
Ingtar looked at Hurin; the sniffer slid the doors open, and Ingtar leaped through with his sword ready. There was no one there. Rand and the others hurried inside, and Hurin quickly closed the doors behind them.
Painted screens hid all the walls and any other doors, and veiled the light coming through windows that had to overlook the street. At one end of the big room stood a tall, circular cabinet. At the other was a small table, the lone chair on the carpet turned to face it. Rand heard Ingtar gasp, but he only felt like heaving a sigh of relief. The curling golden Horn of Valere sat on a stand on the table. Below it, the ruby in the hilt of the ornate dagger caught the light.
Mat darted to the table, snatching Horn and dagger. “We have it,” he crowed, shaking the dagger in his fist. “We have both of them.”
“Not so loud,” Perrin said with a wince. “We don’t have them out of here, yet.” His hands were busy on the haft of his axe; they seemed to want to be holding something else.
“The Horn of Valere.” There was sheer awe in Ingtar’s voice. He touched the Horn hesitantly, tracing a finger along the silver script inlaid around the bell and mouthing the translation, then pulled his hand back with a shiver of excitement. “It is. By the Light, it is! I am saved.”
Hurin was moving the screens that hid the windows. He shoved the last out of his way and peered into the street below. “Those soldiers are all still there, looking like they’ve took root.” He shuddered. “Those . . . things, too.”
Rand went to join him. The two beasts were grolm; there was no denying it. “How did they . . . ” As he lifted his eyes from the street, words died. He was looking over a wall into the garden of the big house across the street. He could see where further walls had been torn down, joining other gardens to it. Women sat on benches there, or strolled along the walks, always in pairs. Women linked, neck to wrist, by silver leashes. One of the women with a collar around her neck looked up. He was too far to make out her face clearly, but for an instant it seemed that their eyes met, and he knew. The blood drained from his face. “Egwene,” he breathed.
“What are you talking about?” Mat said. “Egwene is safe in Tar Valon. I wish I were.”
“She’s here,” Rand said. The two women were turning, walking toward one of the buildings on the far side of the joined gardens. “She is there, right across the street. Oh, Light, she’s wearing one of those collars!”
“Are you sure?” Perrin said. He came to peer from the window. “I don’t see her, Rand. And—and I could recognize her if I did, even at this distance.”
“I am sure,” Rand said. The two women disappeared into one of the houses that faced the next street over. His stomach was twisted into a knot. She is supposed to be safe. She’s supposed to be in the White Tower. “I have to get her out. The rest of you—”
“So!” The slurring voice was as soft as the sound of the doors sliding in their tracks. “You are not who I expected.”
For a brief moment, Rand stared. The tall man with the shaven head who had stepped into the room wore a long, trailing blue robe, and his fingernails were so long that Rand wondered if he could handle anything. The two men standing obsequiously behind him had only half their dark hair shaved, the rest hanging in a dark braid down each man’s right cheek. One of them cradled a sheathed sword in his arms.
It was only a moment he had for staring, then screens toppled to reveal, at either end of the room, a doorway crowded with four or five Seanchan soldiers, bareheaded but armored, and swords in hand.
“You are in the presence of the High Lord Turak,” the man who carried the sword began, staring at Rand and the others angrily, but a brief motion of a finger with a blue-lacquered nail cut him short. The other servant stepped forward with a bow and began undoing Turak’s robe.
“When one of my guards was found dead,” the shaven-headed man said calmly, “I suspected the man who calls himself Fain. I have been suspicious of him since Huon died so mysteriously, and he has always wanted that dagger.” He held out his arms for the servant to remove his robe. Despite his soft, almost-singing voice, hard muscles roped his arms and smooth chest, which was bare to a blue sash holding wide, white trousers that seemed made of hundreds of pleats. He sounded uninterested, and indifferent to the blades in their hands. “And now to find strangers with not only the dagger, but the Horn. It will please me to kill one or two of you for disturbing my morning. Those who survive will tell me of who you are and why you came.” He stretched out a hand without looking—the man with the scabbarded sword laid the hilt in the hand—and drew the heavy, curved blade. “I would not have the Horn damaged.”
Turak gave no other signal, but one of the soldiers stalked into the room and reached for the Horn. Rand did not know whether he should laugh, or not. The man wore armor, but his arrogant face seemed as oblivious to their weapons as Turak was.
Mat put an end to it. As the Seanchan reached out his hand, Mat slashed it with the ruby-hilted dagger. With a curse, the soldier leaped back, looking surprised. And then he screamed. It chilled the room, held everyone where they stood in astonishment.  He opened his mouth wide and howled, clawing at his arm, then his shoulder.  He twitched, choking raggedly, heels drumming, and did not move again. Every bit of his exposed flesh was black as putrid pitch and looked ready to burst at a touch.
Mat licked his lips and swallowed; his grip shifted uneasily on the dagger. Even Turak stared, openmouthed.
“You see,” Ingtar said softly, “we are no easy meat.” Suddenly he leaped over the corpse, toward the soldiers still goggling at what was left of the man who had stood at their shoulders only moments before. “Shinowa!” he cried. “Follow me!” Hurin leaped after him, and the soldiers fell back before them, the sounds of steel on steel rising.
The Seanchan at the other end of the room started forward as Ingtar moved, but then they were falling back, too, before Mat’s thrusting dagger even more than from the axe Perrin swung with wordless snarls.
In the space of heartbeats, Rand stood alone, facing Turak, who held his blade upright before him. His moment of shock was gone. His eyes were sharp on Rand’s face; the black and swollen body of one of his soldiers might as well not have existed. It did not seem to exist for the two servants, either, any more than Rand and his sword existed, or the sounds of fighting, fading now from the rooms to either side out into the house. The servants had begun calmly folding Turak’s robe as soon as the High Lord took his sword, and had not looked up even for the dead soldier’s shrieks; now they knelt beside the door and watched with impassive eyes.
“I suspected it might come to you and me.” Turak spun his blade easily, a full circle one way, then the other, his long-nailed fingers moving delicately on the hilt. His fingernails did not seem to hamper him at all. “You are young. Let us see what is required to earn the heron on this side of the ocean.”
Suddenly Rand saw. Standing tall on Turak’s blade was a heron. With the little training he had, he was face-to-face with a real blademaster. Hastily he tossed the fleece-lined cloak aside, ridding himself of weight and encumbrance. Turak waited.
Rand desperately wanted to seek the void. It was plain he would need every shred of ability he could muster, and even then his chances of leaving the room alive would be small. He had to leave alive. Egwene was almost close enough for him to shout to her, and he had to free her, somehow. But saidin waited in the void. The thought made his heart leap with eagerness at the same time that it turned his stomach. But just as close as Egwene were those other women. Damane. If he touched saidin, and if he could not stop himself channeling, they would know, Verin had told him. Know and wonder. So many, so close. He might survive Turak only to die facing damane, and he could not die before Egwene was free. Rand raised his blade.
Turak glided toward him on silent feet. Blade rang on blade like hammer on anvil.
From the first it was clear to Rand that the man was testing him, pushing only hard enough to see what he could do, then pushing a little harder, then just a little harder still. It was quick wrists and quick feet that kept Rand alive as much as skill. Without the void, he was always half a heartbeat behind. The tip of Turak’s heavy sword made a stinging trench just under his left eye. A flap of coat sleeve hung away from his shoulder, the darker for being wet. Under a neat slash beneath his right arm, precise as a tailor’s cut, he could feel warm dampness spreading down his ribs.
There was disappointment on the High Lord’s face. He stepped back with a gesture of disgust. “Where did you find that blade, boy? Or do they here truly award the heron to those no more skilled than you? No matter. Make your peace. It is time to die.” He came on again.
The void enveloped Rand. Saidin flowed toward him, glowing with the promise of the One Power, but he ignored it. It was no more difficult than ignoring a barbed thorn twisting in his flesh.  He was one with the sword in his hands, one with the floor beneath his feet, one with the walls. One with Turak.
He recognized the forms the High Lord used; they were a little different from what he had been taught, but not enough. The Swallow Takes Flight met Parting the Silk. Moon on the Water met The Wood Grouse Dances. Ribbon in the Air met Stones Falling From the Cliff. They moved about the room as in a dance, and their music was steel against steel.
Disappointment and disgust faded from Turak’s dark eyes, replaced by surprise, then concentration. Sweat appeared on the High Lord’s face as he pressed Rand harder. Lightning of Three Prongs met Leaf on the Breeze.
Rand’s thoughts floated outside the void, apart from himself, hardly noticed. It was not enough. He faced a blademaster, and with the void and every ounce of his skill he was barely managing to hold his own. Barely. He had to end it before Turak finally did. Saidin? No! Sometimes it is necessary to Sheath the Sword in your own flesh. But that would not help Egwene, either. He had to end it now. Now.
Turak’s eyes widened as Rand glided forward. So far he had only defended; now he attacked, all out. The Boar Rushes Down the Mountain. Every movement of his blade was an attempt to reach the High Lord; now all Turak could do was retreat and defend, down the length of the room, almost to the door.
In an instant, while Turak still tried to face the Boar, Rand charged. The River Undercuts the Bank. He dropped to one knee, blade slashing across. He did not need Turak’s gasp, or the feel of resistance to his cut to know. He heard two thumps and turned his head, knowing what he would see. He looked down the length of his blade, wet and red, to where the High Lord lay, sword tumbled from his limp hand, a dark dampness staining the birds woven in the carpet under his body. Turak’s eyes were still open, but already filmed with death.
The void shook. He had faced Trollocs before, faced Shadowspawn. Never before had he confronted a human being with a sword except in practice or bluff. I just killed a man. The void shook, and saidin tried to fill him.
Desperately he clawed free, breathing hard as he looked around. He gave a start when he saw the two servants still kneeling beside the door. He had forgotten them, and now he did not know what to do about them. Neither man appeared armed, yet all they had to do was shout . . .
They never looked at him, or at each other. Instead, they stared silently at the High Lord’s body. They produced daggers from under their robes, and he tightened his grip on the sword, but each man placed the point to his own breast. “From birth to death,” they intoned in unison, “I serve the Blood.” And plunged the daggers into their own hearts. They folded forward almost peacefully, heads to the floor as if bowing deeply to their lord.
Rand stared at them in disbelief. Mad, he thought. Maybe I will go mad, but they already were.
He was getting to his feet shakily when Ingtar and the others came running back. They all bore nicks and cuts; the leather of Ingtar’s coat was stained in more than one place. Mat still had the Horn and his dagger, its blade darker than the ruby in its hilt. Perrin’s axe was red, too, and he looked as if he might be sick at any moment.
“You dealt with them?” Ingtar said, looking at the bodies. “Then we’re done, if no alarm is given. Those fools never cried for help, not once.”
“I will see if the guards heard anything,” Hurin said, and darted for the window.
Mat shook his head. “Rand, these people are crazy. I know I’ve said that before, but these people really are. Those servants . . . ” Rand held his breath, wondering if they had all killed themselves. Mat said, “Whenever they saw us fighting, they fell on their knees, put their faces to the floor, and wrapped their arms around their heads. They never moved, or cried out; never tried to help the soldiers, or give an alarm. They’re still there, as far as I know.”
“I would not count on them staying on their knees,” Ingtar said dryly. “We are leaving now, as fast as we can run.”
“You go,” Rand said. “Egwene—”
“You fool!” Ingtar snapped. “We have what we came for. The Horn of Valere. The hope of salvation. What can one girl count, even if you love her, alongside the Horn, and what it stands for?”
“The Dark One can have the Horn for all I care! What does finding the Horn count if I abandon Egwene to this? If I did that, the Horn couldn’t save me. The Creator couldn’t save me. I would damn myself.”
Ingtar stared at him, his face unreadable. “You mean that exactly, don’t you?”
“Something’s happening out here,” Hurin said urgently. “A man just came running up, and they’re all milling like fish in a bucket. Wait. The officer is coming inside!”
“Go!” Ingtar said. He tried to take the Horn, but Mat was already running. Rand hesitated, but Ingtar grabbed his arm and pulled him into the hall. The others were streaming after Mat; Perrin only gave Rand one pained look before he went. “You cannot save the girl if you stand here and die!”
He ran with them. Part of him hated himself for running, but another part whispered, I’ll come back. I’ll free her somehow.
By the time they reached the bottom of the narrow, winding staircase, he could hear a man’s deep voice raised in the front part of the house, angrily demanding that someone stand up and speak. A serving girl in her nearly transparent robe knelt at the bottom of the stairs, and a gray-haired woman all in white wool, with a long floury apron, knelt by the kitchen door. They were both exactly as Mat had described, faces to the floor and arms wrapped around their heads, and they did not stir a hair as Rand and the others hurried by. He was relieved to see the motions of breathing.
They crossed the garden at a dead run, climbing over the back wall rapidly. Ingtar cursed when Mat tossed the Horn of Valere ahead of him, and tried again to take it when he dropped outside, but Mat snatched it up with a quick, “It isn’t even scratched,” and scampered up the alley.
More shouts rose from the house they had just left; a woman screamed, and someone began tolling a gong.
I will come back for her. Somehow. Rand sped after the others as fast as he could.


-
Developed an API for a platform (SaaS) used to measure, engage and evaluate
through gamification.
- Created reports using SQL.
-
Studied the technical feasibility of new features requested by the product
team.
- Solved users technical issues and fixed bugs.
-
Implemented a Single sign-on mechanism that improved greatly the number of
new accounts created.
- Integrated payment methods with Stripe.
- Monitored API efficiency using New Relic and Sentry.
- Helped and guided interns in their daily assignments.
- Adopted agile methodologies in several projects.
- Worked in an agile squad.
-
Technologies: Node.js – Express.js, MSSQL, Sequelize
ORM, GIT, GitHub, Linux, Docker, Postman and Swagger.


Codehaus XFire
DocumentationQuicklinksDevelopers
Sponsors |
One of XFire's core strengths is how embeddable it is. It is possible for a project to embed xfire and provide soap services without end users having to specify any XFire specific information. All configuration can be programatically driven, and it is possible to define your own service files to define services and any other configuration information. This document will outline a number of typical scenarios for embedding. The first and most basic of these is the need to expose a java class as a service programatically. The steps involved in this are:
DetailsThe ObjectServiceFactory is responsible for creating service objects. It's an implementation of ServiceFactory that is used for POJO (javabean) style classes. The factory will introspect the specified class and expose all the methods available to it. By default, methods inherited from java.lang.Object are excluded (eg, hashCode, toString, and so on, since it doesn't really make sense to incur the overhead of a remote call for them.) So let's create the factory: //first we create a XFire instance, using the default implementation //you can register your own implementation via XFireFactory.registerFactory() XFire xfire = XFireFactory.newInstance().getXFire(); //the default transport manager handles a number of transport mechanisms, //which is good enough for our needs ServiceFactory factory = new ObjectServiceFactory(xfire.getTransportManager()); Having created the factory, the next step is to create a service for our POJO. If our POJO is a service interface, then we need to specify the implementation class. The implementation class must adhere to the javabean contract and have a no-arg constructor. //note that we'd like to specify our own service name, so we use the overloaded //create method instead of the simpler one that just takes in a class name Service service = factory.create(Hello.class, "hi", null, null); //if Hello.class is an interface, then we need to specify the implementation class service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, HelloImpl.class); So at this point, we have a factory with a service object. The next step is to register this service and allow external clients to call it. For our example, we'll expose this service in a web application. XFire provides a good base servlet to subclass. The servlet we create will set up xfire, register our service, and expose it. Having done that, it will delegate requests to the xfire controller to process service requests. Putting together the code above with the rest of servlet code, we have: import org.codehaus.xfire.service.binding.ObjectServiceFactory; import org.codehaus.xfire.service.binding.ObjectInvoker; import org.codehaus.xfire.service.Service; import org.codehaus.xfire.transport.http.XFireServlet; public class SOAPServlet extends XFireServlet { public void init() throws ServletException { super.init(); ObjectServiceFactory factory = new ObjectServiceFactory(getXFire().getTransportManager(), null); //we don't want to expose compareTo factory.addIgnoredMethods("java.lang.Comparable"); Service service = factory.create(Hello.class,"hi", null, null); service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, HelloImpl.class); //we register the service with the controller that handles soap requests getController().getServiceRegistry().register(service); } } Having defined the servlet that handles soap requests, all that remains is to register it in the web application's web.xml: <servlet> <servlet-name>soap</servlet-name> <servlet-class>SOAPServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>soap</servlet-name> <url-pattern>/soap/*</url-pattern> </servlet-mapping> Once the servlet is deployed, you can verify that the service is correctly processing incoming requests by requesting the WSDL, which can be accessed at /soap/hi?wsdl |


I am DJZHAO
, a super simple.
Go beyond yourself rather than beyond others.
DJZHAO
True beauty, No evil
Want to be unique but very ordinary.
Get In Touch
Welcome to connect me.
Address
南京理工大学
南京市玄武区孝陵卫200号, 211100
中国
QQ
894559192
Email
<EMAIL_ADDRESS>Your browser does not support the audio element.


Getting started
This document is an interactive step-by-step guide to tweakflow expressions. Its goal is to give you a feeling for the syntax and expressive capabilities of tweakflow.
Requirements
Tweakflow requires Java 8 or later. Builds are tested against JDK 8, 11, 13, 15, 17.
Getting tweakflow
Download the latest release jar. You can also obtain it from maven central using the following dependency:
<dependency>
<groupId>com.twineworks</groupId>
<artifactId>tweakflow</artifactId>
<version>1.4.3</version>
</dependency>
Starting a REPL
Launch the interactive REPL using:
java -jar tweakflow-1.4.3.jar repl
The repl
argument tells tweakflow to start an interactive session also known as Read-Evaluate-Print-Loop, REPL for short.
You should see a prompt similar to this:
$ java -jar tweakflow-1.4.3.jar repl
tweakflow interactive shell \? for help, \q to quit
std.tf>
The prompt tells you which module context you are in. In our case it is the std.tf module which is the default standard library module that comes with tweakflow. You can quit out of the REPL at any time by entering \q
.
Evaluating expressions
You can now type in expressions, and the REPL will evaluate them, and print the results. If you embed tweakflow in your application, you can empower your users to use these kinds of expressions to communicate values back to your app.
Evaluate some number expressions using conventional operators:
> 1+3
4
> 2*8
16
Evaluate boolean expressions:
> 1 < 5
true
> 2*3 == 6
true
> 2*3 < 3
false
Evaluate strings and use the string concatenation operator:
> "Hello World!"
"Hello World!"
> "Hello " .. "World!"
"Hello World!"
Create some lists, and nest them too:
> [1, 2, "hello"]
[1, 2, "hello"]
> [[1, 2], ["one", "two"]]
[[1, 2], ["one", "two"]]
Create a dictionary:
> {:one 1, :two 2}
{
:one 1,
:two 2
}
Create a datetime value. If you don’t need supply the time, it defaults to midnight UTC time.
> 2017-01-23T
2017-01-23T00:00:00Z@UTC
You can also fully specify a zoned datetime value, complete with date, time, timezone offset and political timezone:
> 2017-01-23T18:23:11+01:00@Europe/Berlin
2017-01-23T18:23:11+01:00@Europe/Berlin
Calling functions
Let’s call some functions from the standard library:
> strings.length("foo")
3
> data.unique([1,1,2,3,3,2,1,2,3])
[1, 2, 3]
> strings.index_of("banana", "nan")
2
You were using positional arguments. Let’s add 100 days to a date, and see where we end up. The function add_period takes multiple parameters. Let’s just supply the start date and days to add using named arguments, and leave the other parameters at their default values.
> time.add_period(start: 2017-01-01T, days: 100)
2017-04-11T00:00:00Z@UTC
You can even start with positional arguments, and switch to named arguments later in the call.
> time.add_period(2017-01-01T, days: 100)
2017-04-11T00:00:00Z@UTC
Variables
The REPL allows you to define ad-hoc variables visible to all expressions in the session. Let’s use that ability to assign a name to a function.
> square: (x) -> x*x
function
> square(5)
25
You can assign any expression to a variable, and the tweakflow REPL will re-evaluate the expression value each time you type in a new definition.
> x: 10
10
> y: 2
2
> z: x*y
20
> y: 4
4
> z
40
You can check your session variable definitions using \v
.
> \v
# 4 interactive variables defined
square: (x) -> x*x
x: 10
y: 4
z: x*y
You can inspect what your session variable values are using \i
.
> \i
# interactive section
square: function
`$`: 40
x: 10
y: 4
z: 40
The REPL defines a special variable $
that it maintains. It is defined as the most recently entered expression.
String interpolation
You can include the values of expressions in double quoted strings using the #{expression}
escape sequence.
> name: "Joe"
"Joe"
> "Hello #{name}"
"Hello Joe"
> "Hello #{strings.upper_case(name)}"
"Hello JOE"
There are other escape sequences like \n
for newlines and \t
for tabs.
Defining functions
Functions are values. You can assign them to variables and pass them around. In fact, many standard library functions accept functions as parameters, or return them as a result.
Functions are written as (parameter list) -> return value
. Let’s define and call a simple function.
> next: (x) -> x+1
function
> next(2)
3
The data.map function from the standard library takes a list and a function, and returns a new list, in which all items have been transformed by the given function.
> data.map([1, 0, 3, -2], next)
[2, 1, 4, -1]
You can write functions inline without naming them. Functions are just values, like strings and numbers.
> data.map([1, 0, 3, -2], (x) -> x*x)
[1, 0, 9, 4]
Local variables
You can define helper variables scoped to an expression using let
:
> let {sq: (x) -> x*x; five: 5;} sq(five)
25
Tweakflow code can be formatted across multiple lines. But the REPL interprets hitting enter as a request to evaluate the current line as an expression, which can make entering multi-line expressions in the REPL impractical.
If you want to format your expression using multiple lines, you can enter multi-line edit mode using \e
and the REPL will accept multiple lines as part of a single expression until you enter \e
again. The REPL indicates you are in multi-line mode by placing a *
in the prompt. You can rewrite the above example in multi-line mode on the REPL like this:
> \e
let {
sq: (x) -> x*x;
five: 5;
}
sq(five)
\e
25
Types
Every value in tweakflow has an associated type. You can determine the types using typeof
:
> typeof "Hello"
"string"
> typeof 2.3
"double"
> typeof []
"list"
> typeof (x) -> x*x
"function"
You can convert between many types automatically. Tweakflow is very conservative about automatic conversion. If there is a greater loss of information than can be expected from the nature of the types, it throws an error.
> "foo" as boolean
true
> 2.3 as string
"2.3"
> "2.3" as double
2.3
> 2.3 as long
2
> "2.3kg" as double
ERROR: {
:message "Cannot cast 2.3kg to double",
:code "CAST_ERROR",
:source "\"2.3kg\" as double"
...
}
Conditionals
Tweakflow supports a standard if
construct to perform conditional calculations.
> parity: (x) -> if x % 2 == 0 then "even" else "odd"
function
> parity(3)
"odd"
> parity(2)
"even"
The syntax is:
if condition then then_expression else else_expression
Both the then_expression
and the else_expression
are mandatory, but the then
and else
keywords are optional, allowing you to write nested conditions that look like a sequence of tests.
Define a function that returns the sign of a number as -1
, 0
, or 1
if the number is negative, zero, or positive:
> \e
sgn: (x) ->
if x > 0 then 1
if x < 0 then -1
else 0
\e
function
> sgn(0)
0
> sgn(-2.3)
-1
> sgn(9.2)
1
Conclusion
You now have a good feeling for the nature of tweakflow expressions. Check out the language reference for more detail. It contains formal syntax information, describes advanced features like list comprehensions and pattern matching, and describes the library and module system.
Check out the embedding guide for details on how to include tweakflow in your JVM application.


| The problem of | Creating a cross-platform 3d game |
| affects | potential gamers, and developers wanting to write high performance real time code |
| the impact of which is | gamers get to play new games, and developers learn how to deal with unique game realted problems |
| a successful solution would be | EigenMaze - a new 3d game writien completly in java, using JOGL bindings. |
This engine would be as crossplatform as is possible - only very specific OS bindings need to be included, and can be packaged neatly and efficently with the jar file.


${CP_ERROR_PLATFORM_NAME} was not able to authorize you
Please contact
${CP_ERROR_PLATFORM_NAME} support team
to request the access
Or
login back to the ${CP_ERROR_PLATFORM_NAME}
if you already own an account


k8sec
Command-line interface tool to manage Kubernetes secrets.
More information: home page
- List all secrets:
k8sec list
- List a specific secret as a base64-encoded string:
k8sec list secret_name --base64
- Set a secret's value:
k8sec set secret_name key=value
- Set a base64-encoded value:
k8sec set --base64 secret_name key=encoded_value
- Unset a secret:
k8sec unset secret_name
- Load secrets from a file:
k8sec load -f path/to/file secret_name
- Dump secrets to a file:
k8sec dump -f path/to/file secret_name


Mindfulness Conversation
Hmmmmm...doing this activity with someone I know very well didn't exactly go per the book.
Because we're very familiar with one anothers idiosyncrasies it was hard to remain neutral while listening and dialoging.
In fact we were both in a heightened state of mindfulness that following the steps to having a mindful, meaningful conversation resulted in long periods of silence, awkward body language then laughter!
In retrospect, this mindful conversation would've been a lot easier with someone less familiar, new even while building trust and friendship.
I look forward to meeting my cohort peers and feel confident in utilizing this technique to bring about a state of whanaungatanga.
Which Technique?
I actively practice Joyful Meditation.
At the core of my joy is a 9yr old girl who means the world to me. I need only think of her when I'm down or struggling to instantly change my thinking.
 It's hard to quantify how emotional motivation works - but it does!
The Open & Focused Attention Techniques come naturally during my daily activity - even during rest.
The dichotomy of this relationship acknowledges a peripheral awareness and mindfulness of the surrounding environment while enabling pinpoint accuracy when required.
If only these techniques were able to merged together and maintained - passive active mindfulness?!
Any New Musings?
This section was particularly insightful and offered lots of techniques to try. It also offered the disclaimer that turning a practice into a habit and subsequently into a routine requires internal and external motivation to be successful.
I'm excited by the notion of "Gradual Effort & Sudden Enlightenment" and that my progression, no matter how small adds up.
Just waiting on the enlightenment part to occur now.
Scroll through each text box above to read more.


The CelesteNet server is down right now. Hopefully being worked on or something.Join the Celeste Discord for status updates.


The experimental period is now over. Your search behaviour will no longer be recorded, but if you haven't already, please
click the button to fill in the feedback questionnaire:
Survey
{% if not request.user.id|divisibleby:2 %}
{% else %}
{% endif %}
{% else %}
Thank you for agreeing to participate in this experiment. For the duration of the experimental period,
please use this site in place of your go-to search engine. All searches are confidential and data related
to queries entered and websites visited will not be recorded by this site and is visible to nobody.
The search engine functions like any other popular search engine. Before you begin searching, please
create your account and fill in the optional short questionnaire.
Please read the Study Information below and tick the boxes to agree to the terms
of this study.
The application is intended to be used in place of your favourite
search engine for the duration of the experiment.
As part of the study you will be asked to complete some optional questionnaires regarding your
demographics and experience with the application.
The experiment will last for 7 days, beginning on the 14th of August, 2014.
Participation in this study is voluntary, and you may withdraw consent to use the information you
provided at any time before the 22nd of August, 2014.
Your name will not appear on any published document in relation to this study.
The time you spend on each query will be recorded for purposes of this experiment. Your search
queries will be converted to hashes so that they cannot be read and will not be recorded, nor will any
URLs visited using this application.
An example of a hashed query is the query 'test', which would be hashed to
'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'
before being recorded to render it unreadable to any individual. URLs visited are hashed in a similar way.
You are able to ask questions at any time before, during or after the experiment using the contact
details available on the About page.


 How long will it take you to transfer a file from your USB drive to your local hard drive? How long will it take to copy a file over your network. This calculator will show the download time for lots of different bandwidths. You can specify the amount of overhead to be taken into account.
|
|
|
X days - HH:MM:SS.d
|
|
|
SIZE
|
|
|
|
SPEED
|
|
|
|
OVERHEAD
|
|
PERCENT COMPLETE
|
|
A simple calculator with which you can calculate download time for a file depending on download speed.
How long time it will take depends on file size, your own download speed and the server's upload speed.
In these calculations it is assumed that your download speed is the bottleneck.
Input the file size and click on "Calculate". Then you will see the result for the different connection types to the right.
You can also enter your own download speed in case the predefined download speeds doesn't match yours.
Free calculator to estimate the time a file will to take to transfer.
|


All of these packages contain images of the Spectrum ROMs, which are required in order for +F to run. These ROMs remain copyright of Amstrad, and Amstrad have kindly given their permission for the redistribution of their copyrighted material but retain that copyright. (Full details here.)
You can read the release notes for +F here.
+F is distributed under an MIT license:
MIT License
Copyright © 2017 Alan Gibson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


---
subject: Email Account Upgrade
---
Hi {firstname},
Someone else was trying to use your XXXXXX ID to sign into Microsoft Sharepoint via a web browser.
Date and Time: 28 October 2018, 1:38 PM
Browser: Firefox
Operating System: Windows
Location: Thailand
If the information above looks familiar, you can disregard this email.
If you have not recently and believe someone may be trying to access your account, you should Click Here http://goo.gl/rk87KW.
Sincerely,
Technical Support Team


WINNER call out Song Min Ho on 'Idol Room'
by germainejWINNER called out fellow member Song Min Ho on 'Idol Room'.
On the November 5th episode, the group members opened up about how they disappointed each other, and Song Min Ho was called out as the king of being late. According to WINNER, Song Min Ho is continuously late for everything, inconveniencing the other members.
Song Min Ho's roommate Kim Jin Woo had something to say as well. He revealed a lamp he loved was lost, and he suspects Song Min Ho was behind the disappearance. Kim Jin Woo also added that Song Min Ho ate his yogurt, and Song Min Ho explained, "Our manager said that he bought some and told me to eat it, so I did."
In other news, WINNER recently made a comeback with "SOSO".


{% extends 'layout.html' %} {% block content %}
Current bikes availability: from low to high availability. You can also select the prediction.


VILLAGE OF THE DAMNED (1995) A film review by James Berardinelli Copyright 1995 James Berardinelli
RATING (0 TO 10): 6.3
U.S. Availability: general release 4/28/95 Running Length: 1:37 MPAA Classification: R (Violence, profanity)
Starring: Christopher Reeve, Kirstie Alley, Linda Kozlowski, Mark Hamill, Michael Pare, Lindsey Haun Director: John Carpenter Producers: Michael Preger and Sandy King Screenplay: David Himmelstein based on THE MIDWICH CUCKOOS by John Wyndham and the 1960 screenplay by Stirling Silliphant, Wolf Rilla, and George Barclay Cinematography: Gary B. Kibbe Music: John Carpenter and Dave Davies Released by Universal Pictures
Despite being an inferior remake, VILLAGE OF THE DAMNED is the most frightening motion picture that John Carpenter has brought to the screen in at least a decade. Following this year's disappointing IN THE MOUTH OF MADNESS, Carpenter has turned to a creepy 1960 English film for inspiration. Adding more than a dose of modernization, a new setting (the British village has become an American town), and a dash of his trademark shock tactics, the director has turned out an enjoyable, if obviously-flawed, amalgamation of horror and science fiction.
VILLAGE OF THE DAMNED opens in the rural community of Midwich, population 2000. After giving perfunctory introductions to the central characters, Carpenter starts the action in a disconcerting fashion. With a noise that sets theater speakers throbbing, a "whispering cloud" moves across the sky, knocking everyone in Midwich unconscious. During this event, at least two men are killed and ten women are mysteriously impregnated. Government officials, led by Dr. Susan Verner (Kirstie Alley) arrive just in time for the town's revival. Lending his aid to Verner's people is Midwich's resident M.D., Alan Chaffee (Christopher Reeve), who was away when the cloud moved in.
After the pregnancies have been diagnosed, Dr. Verner makes it clear that the government will pay stipends to every woman who carries her child to term. Following the requisite nine months, the blessed events occur virtually simultaneously, giving Midwich a group of tiny new residents. But as the children grow, it becomes clear that there's something inhuman about them. With their platinum-blond hair and blank expressions, not only do they look unlike the men and women raising them, but they lack emotion and possess the ability to read and control minds.
For a movie that opens with so much promise, VILLAGE OF THE DAMNED is actually something of a disappointment. The second half isn't as well-paced or intelligently scripted as what precedes it, although the taut climax will hold an interested viewer on seat's edge. As the director has shown many times before (most notably in HALLOWEEN), he can take an overused scene or device and infuse it with unexpected energy. This skill--and little else--keeps VILLAGE OF THE DAMNED entertaining throughout, but the movie is by no means an unqualified success.
Society says that the young are innocent and vulnerable, and therefore must be protected and supported. VILLAGE OF THE DAMNED plays on a parental nightmare: the loss of control over an amoral--or even evil--child. How can any father or mother overcome the nurturing instinct and act against an offspring, regardless of what crimes that child has committed? It's an unsettling consideration. Alas, Carpenter's exploration is somewhat perfunctory. Ultimately, the film is more interested in surface shocks than this sort of deeper psychological horror, but vestiges of the theme still manage to lend a chilling tone to what's on screen.
The cast is interesting, if not top notch. Christopher Reeve is adequate in a role that doesn't require a stretch of his limited dramatic range. Kirstie Alley displays little presence or charisma as the cold-hearted, secretive epidemiologist. And, if Crocodile Dundee's main squeeze (Kozlowski) is difficult to recognize as one of the expectant mothers, what better camouflage could there be for Luke Skywalker than as the local minister?
What differentiates VILLAGE OF THE DAMNED from Carpenter's best work is the lack of character definition. There's no one in Midwich worth caring about. The high number of deaths--some of which are unexpected--leads to a certain unpredictability, but none of the murders has an impact beyond elevating the body count. The result is a movie that's as superficial as it is fun. And, while the director shows he's still very much on top of his craft, a tighter script, with fewer subplots vying for screen time, might have made for a memorable updating of the classic. Instead, all we have is a passable remake.
- James Berardinelli<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


'use strict';
const _ = require('lodash');
// We've supplemented `Events` with a `triggerThen` method to allow for
// asynchronous event handling via promises. We also mix this into the
// prototypes of the main objects in the library.
const Events = require('./base/events');
// All core modules required for the bookshelf instance.
const BookshelfModel = require('./model');
const BookshelfCollection = require('./collection');
const BookshelfRelation = require('./relation');
const Errors = require('./errors');
/**
* @class Bookshelf
* @classdesc
*
* The Bookshelf library is initialized by passing an initialized Knex client
* instance. The knex documentation provides a number of examples for different
* databases.
*
* @constructor
* @param {Knex} knex Knex instance.
*/
function Bookshelf(knex) {
if (!knex || knex.name !== 'knex') {
throw new Error('Invalid knex instance');
}
const bookshelf = {
VERSION: require('../package.json').version
};
const Model = (bookshelf.Model = BookshelfModel.extend(
{
_builder: builderFn,
// The `Model` constructor is referenced as a property on the `Bookshelf`
// instance, mixing in the correct `builder` method, as well as the
// `relation` method, passing in the correct `Model` & `Collection`
// constructors for later reference.
_relation(type, Target, options) {
if (type !== 'morphTo' && !_.isFunction(Target)) {
throw new Error(
'A valid target model must be defined for the ' + _.result(this, 'tableName') + ' ' + type + ' relation'
);
}
return new Relation(type, Target, options);
}
},
{
/**
* @method Model.forge
* @description
*
* A simple helper function to instantiate a new Model without needing `new`.
*
* @param {Object=} attributes Initial values for this model's attributes.
* @param {Object=} options Hash of options.
* @param {string=} options.tableName Initial value for {@linkcode Model#tableName tableName}.
* @param {Boolean=} [options.hasTimestamps=false]
*
* Initial value for {@linkcode Model#hasTimestamps hasTimestamps}.
*
* @param {Boolean} [options.parse=false]
*
* Convert attributes by {@linkcode Model#parse parse} before being
* {@linkcode Model#set set} on the `model`.
*/
forge: function forge(attributes, options) {
return new this(attributes, options);
},
/**
* A simple static helper to instantiate a new {@link Collection}, setting the model it's
* called on as the collection's target model.
*
* @example
* Customer.collection().fetch().then((customers) => {
* // ...
* })
*
* @method Model.collection
* @param {Model[]} [models] Any models to be added to the collection.
* @param {Object} [options] Additional options to pass to the {@link Collection} constructor.
* @param {string|function} [options.comparator]
* If specified this is used to sort the collection. It can be a string representing the
* model attribute to sort by, or a custom function. Check the documentation for {@link
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
* Array.prototype.sort} for more info on how to use a custom comparator function. If this
* options is not specified the collection sort order depends on what the database returns.
* @returns {Collection}
* The newly created collection. It will be empty unless any models were passed as the first
* argument.
*/
collection(models, options) {
return new bookshelf.Collection(models || [], _.extend({}, options, {model: this}));
},
/**
* @method Model.count
* @since 0.8.2
* @description
*
* Gets the number of matching records in the database, respecting any
* previous calls to {@link Model#query query}. If a `column` is provided,
* records with a null value in that column will be excluded from the count.
*
* @param {string} [column='*']
* Specify a column to count - rows with null values in this column will be excluded.
* @param {Object=} options
* Hash of options.
* @returns {Promise<Number>}
* A promise resolving to the number of matching rows.
*/
count(column, options) {
return this.forge().count(column, options);
},
/**
* @method Model.fetchAll
* @description
*
* Simple helper function for retrieving all instances of the given model.
*
* @see Model#fetchAll
* @returns {Promise<Collection>}
*/
fetchAll(options) {
return this.forge().fetchAll(options);
}
}
));
const Collection = (bookshelf.Collection = BookshelfCollection.extend(
{
_builder: builderFn
},
{
/**
* @method Collection.forge
* @description
*
* A simple helper function to instantiate a new Collection without needing
* new.
*
* @param {(Object[]|Model[])=} [models]
* Set of models (or attribute hashes) with which to initialize the
* collection.
* @param {Object} options Hash of options.
*
* @example
*
* var Promise = require('bluebird');
* var Accounts = bookshelf.Collection.extend({
* model: Account
* });
*
* var accounts = Accounts.forge([
* {name: 'Person1'},
* {name: 'Person2'}
* ]);
*
* Promise.all(accounts.invokeMap('save')).then(function() {
* // collection models should now be saved...
* });
*/
forge: function forge(models, options) {
return new this(models, options);
}
}
));
// The collection also references the correct `Model`, specified above, for
// creating new `Model` instances in the collection.
Collection.prototype.model = Model;
Model.prototype.Collection = Collection;
const Relation = BookshelfRelation.extend({Model, Collection});
// A `Bookshelf` instance may be used as a top-level pub-sub bus, as it mixes
// in the `Events` object. It also contains the version number, and a
// `Transaction` method referencing the correct version of `knex` passed into
// the object.
_.extend(bookshelf, Events, Errors, {
/**
* An alias to `{@link http://knexjs.org/#Transactions Knex#transaction}`. The `transaction`
* object must be passed along in the options of any relevant Bookshelf calls, to ensure all
* queries are on the same connection. The entire transaction block is wrapped around a Promise
* that will commit the transaction if it resolves successfully, or roll it back if the Promise
* is rejected.
*
* Note that there is no need to explicitly call `transaction.commit()` or
* `transaction.rollback()` since the entire transaction will be committed if there are no
* errors inside the transaction block.
*
* When fetching inside a transaction it's possible to specify a row-level lock by passing the
* wanted lock type in the `lock` option to {@linkcode Model#fetch fetch}. Available options are
* `lock: 'forUpdate'` and `lock: 'forShare'`.
*
* @example
* var Promise = require('bluebird')
*
* Bookshelf.transaction((t) => {
* return new Library({name: 'Old Books'})
* .save(null, {transacting: t})
* .tap(function(model) {
* return Promise.map([
* {title: 'Canterbury Tales'},
* {title: 'Moby Dick'},
* {title: 'Hamlet'}
* ], (info) => {
* return new Book(info).save({'shelf_id': model.id}, {transacting: t})
* })
* })
* }).then((library) => {
* console.log(library.related('books').pluck('title'))
* }).catch((err) => {
* console.error(err)
* })
*
* @method Bookshelf#transaction
* @param {Bookshelf~transactionCallback} transactionCallback
* Callback containing transaction logic. The callback should return a Promise.
* @returns {Promise}
* A promise resolving to the value returned from
* {@link Bookshelf~transactionCallback transactionCallback}.
*/
transaction() {
return this.knex.transaction.apply(this.knex, arguments);
},
/**
* This is a transaction block to be provided to {@link Bookshelf#transaction}. All of the
* database operations inside it can be part of the same transaction by passing the
* `transacting: transaction` option to {@link Model#fetch fetch}, {@link Model#save save} or
* {@link Model#destroy destroy}.
*
* Note that unless you explicitly pass the `transaction` object along to any relevant model
* operations, those operations will not be part of the transaction, even though they may be
* inside the transaction callback.
*
* @callback Bookshelf~transactionCallback
* @see {@link http://knexjs.org/#Transactions Knex#transaction}
* @see Bookshelf#transaction
*
* @param {Transaction} transaction
* @returns {Promise}
* The Promise will resolve to the return value of the callback, or be rejected with an error
* thrown inside it. If it resolves, the entire transaction is committed, otherwise it is
* rolled back.
*/
/**
* @method Bookshelf#plugin
* @memberOf Bookshelf
* @description
*
* This method provides a nice, tested, standardized way of adding plugins
* to a `Bookshelf` instance, injecting the current instance into the
* plugin, which should be a `module.exports`.
*
* You can add a plugin by specifying a string with the name of the plugin
* to load. In this case it will try to find a module. It will first check
* for a match within the `bookshelf/plugins` directory. If nothing is
* found it will pass the string to `require()`, so you can either require
* an npm dependency by name or one of your own modules by relative path:
*
* bookshelf.plugin('./bookshelf-plugins/my-favourite-plugin');
* bookshelf.plugin('plugin-from-npm');
*
* There are a few built-in plugins already, along with many independently
* developed ones. See [the list of available plugins](#plugins).
*
* You can also provide an array of strings or functions, which is the same
* as calling `bookshelf.plugin()` multiple times. In this case the same
* options object will be reused:
*
* bookshelf.plugin(['registry', './my-plugins/special-parse-format']);
*
* Example plugin:
*
* // Converts all string values to lower case when setting attributes on a model
* module.exports = function(bookshelf) {
* bookshelf.Model = bookshelf.Model.extend({
* set: function(key, value, options) {
* if (!key) return this;
* if (typeof value === 'string') value = value.toLowerCase();
* return bookshelf.Model.prototype.set.call(this, key, value, options);
* }
* });
* }
*
* @param {string|array|Function} plugin
* The plugin or plugins to add. If you provide a string it can
* represent a built-in plugin, an npm package or a file somewhere on
* your project. You can also pass a function as argument to add it as a
* plugin. Finally, it's also possible to pass an array of strings or
* functions to add them all at once.
* @param {mixed} options
* This can be anything you want and it will be passed directly to the
* plugin as the second argument when loading it.
*/
plugin(plugin, options) {
if (_.isString(plugin)) {
try {
require('./plugins/' + plugin)(this, options);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
throw e;
}
if (!process.browser) {
require(plugin)(this, options);
}
}
} else if (Array.isArray(plugin)) {
plugin.forEach((p) => this.plugin(p, options));
} else {
plugin(this, options);
}
return this;
}
});
/**
* @member Bookshelf#knex
* @memberOf Bookshelf
* @type {Knex}
* @description
* A reference to the {@link http://knexjs.org Knex.js} instance being used by Bookshelf.
*/
bookshelf.knex = knex;
function builderFn(tableNameOrBuilder) {
let builder = null;
if (_.isString(tableNameOrBuilder)) {
builder = bookshelf.knex(tableNameOrBuilder);
} else if (tableNameOrBuilder == null) {
builder = bookshelf.knex.queryBuilder();
} else {
// Assuming here that `tableNameOrBuilder` is a QueryBuilder instance. Not
// aware of a way to check that this is the case (ie. using
// `Knex.isQueryBuilder` or equivalent).
builder = tableNameOrBuilder;
}
return builder.on('query', (data) => this.trigger('query', data));
}
// Attach `where`, `query`, and `fetchAll` as static methods.
['where', 'query'].forEach((method) => {
Model[method] = Collection[method] = function() {
const model = this.forge();
return model[method].apply(model, arguments);
};
});
return bookshelf;
}
module.exports = Bookshelf;


Hacker News is no different from most of today's web in emphasizing what's new. When you're following a bunch of feeds, it's easy to forget that the web is the greatest library in the history of the world—and that a good library doesn't just have a rack of newspapers, it has a vast collection of books and archives: the stacks.
Here, then, are the gems that occasionally surface on news.yc when a good patron goes diving into the stacks. You can see how this page is built on Github.


alerts/alerts.service.ts
Properties |
|
Methods |
|
Accessors |
constructor(userSettingsService: UserSettingsWebService, searchService: SearchService, modalService: ModalService, alertComponents: AlertComponents, window: Window)
|
||||||||||||||||||
|
Defined in alerts/alerts.service.ts:123
|
||||||||||||||||||
|
Parameters :
|
| Public alert | ||||||
alert(name: string)
|
||||||
|
Defined in alerts/alerts.service.ts:189
|
||||||
|
Parameters :
Returns :
Alert | undefined
an alert with the given name or undefined if it does not exist |
| Public createAlert | ||||||||
createAlert(alert: Alert)
|
||||||||
|
Defined in alerts/alerts.service.ts:214
|
||||||||
|
Creates a new alert unless it already exists. Emits an Alert event. Update the data on the server.
Parameters :
Returns :
boolean
true if alert was created |
| Public createAlertModal |
createAlertModal()
|
|
Defined in alerts/alerts.service.ts:355
|
|
Opens a dialog allowing a user to create a new alert. the result is true if the alert was created.
Returns :
Promise<boolean>
a boolean promise resolved when the user closes the dialog the result is true if the alert was created. |
| Public deleteAlert | ||||||
deleteAlert(alert: Alert)
|
||||||
|
Defined in alerts/alerts.service.ts:284
|
||||||
|
Deletes the given alert (based on its name) Emits an Alert event. Update the data on the server.
Parameters :
Returns :
boolean
true if alert was deleted |
| Public editAlertModal | ||||||||||||||||
editAlertModal(alert: Alert, noUpdate?: boolean, searchRoute?: string)
|
||||||||||||||||
|
Defined in alerts/alerts.service.ts:404
|
||||||||||||||||
|
Opens a dialog allowing a user to edit an existing alert. the result is true if the alert was updated.
Parameters :
Returns :
Promise<boolean>
a boolean promise resolved when the user closes the dialog the result is true if the alert was updated. |
| Public manageAlertsModal | ||||||
manageAlertsModal(searchRoute?: string)
|
||||||
|
Defined in alerts/alerts.service.ts:453
|
||||||
|
Opens a dialog allowing a user to reorganize and edit the list of alerts. the result is true is the list was updated.
Parameters :
Returns :
Promise<boolean>
a boolean promise resolved when the user closes the dialog the result is true is the list was updated. |
| ngOnDestroy |
ngOnDestroy()
|
|
Defined in alerts/alerts.service.ts:467
|
|
Returns :
void
|
| Public searchAlert | |||||||||
searchAlert(alert: Alert, path?: string)
|
|||||||||
|
Defined in alerts/alerts.service.ts:339
|
|||||||||
|
Uses the SearchService to perform a search returning all the documents matching this alert.
Parameters :
Returns :
Promise<boolean>
the search service promise |
| Public setAlertToCurrentQuery | ||||||
setAlertToCurrentQuery(alert: Alert)
|
||||||
|
Defined in alerts/alerts.service.ts:307
|
||||||
|
Sets this alert to the current search context, using the search service
Parameters :
Returns :
void
|
| Public updateAlert | ||||||||||||
updateAlert(alert: Alert, index: number)
|
||||||||||||
|
Defined in alerts/alerts.service.ts:239
|
||||||||||||
|
Update the alert at the given index, unless an alert with the same name already exists in the list of alerts. Emits an Alert event. Update the data on the server.
Parameters :
Returns :
boolean
true if alert was updated |
| Public updateAlerts | ||||||||||||
updateAlerts(alerts: Alert[], auditEvents?: AuditEvents)
|
||||||||||||
|
Defined in alerts/alerts.service.ts:270
|
||||||||||||
|
Updates the full list of alerts. Emits an Alert event. Update the data on the server.
Parameters :
Returns :
boolean
|
| Public alertComponents |
Type : AlertComponents
|
Decorators :
@Inject(ALERT_COMPONENTS)
|
|
Defined in alerts/alerts.service.ts:129
|
| Public modalService |
Type : ModalService
|
|
Defined in alerts/alerts.service.ts:128
|
| Public searchService |
Type : SearchService
|
|
Defined in alerts/alerts.service.ts:127
|
| Public userSettingsService |
Type : UserSettingsWebService
|
|
Defined in alerts/alerts.service.ts:126
|
| alerts |
getalerts()
|
|
Defined in alerts/alerts.service.ts:153
|
|
Returns the list of this user's alerts. The list is stored in the user settings (this is a redirection). Using this service creates the list of alerts if it does not already exist.
Returns :
Alert[]
|
| events |
getevents()
|
|
Defined in alerts/alerts.service.ts:165
|
|
Triggers any event among AlertChangeEvent (use for fine-grained control of alerts workflow)
Returns :
Subject<AlertChangeEvent>
|
| changes |
getchanges()
|
|
Defined in alerts/alerts.service.ts:174
|
|
Triggers when events affect the list of alerts (use to refresh alert menus) Cf. CHANGE_EVENTS list
Returns :
Subject<AlertChangeEvent>
|
| hasAlert |
gethasAlert()
|
|
Defined in alerts/alerts.service.ts:181
|
|
Returns :
boolean
|
import {Injectable, InjectionToken, Inject, Type, OnDestroy} from "@angular/core";
import {Subject} from "rxjs";
import {UserSettingsWebService, AuditEvents, AuditEvent} from "@sinequa/core/web-services";
import {ModalService, ModalResult} from "@sinequa/core/modal";
import {Query} from "@sinequa/core/app-utils";
import {Utils} from "@sinequa/core/base";
import {SearchService} from "@sinequa/components/search";
// From core/models/usersettings
export namespace Alert {
export enum Frequency {
Daily,
Hourly,
Immediate,
Weekly,
Monthly
}
export enum Days {
None = 0x00,
Monday = 0x01,
Tuesday = 0x02,
Wednesday = 0x04,
Thursday = 0x08,
Friday = 0x10,
Saturday = 0x20,
Sunday = 0x40,
AllDays = (Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday),
WeekDays = (Monday | Tuesday | Wednesday | Thursday | Friday)
}
}
export interface Alert {
name: string;
description?: string;
query: Query;
timezone: string;
timezoneOffset?: string;
frequency: Alert.Frequency;
days: Alert.Days;
interval: number; // every "n"...
index: number; // day of month
times: string; //times: number[]; // offsets from 00:00 in milliseconds
active: boolean;
combine: boolean;
respectTabSelection: boolean;
appQueryUrl?: string; // the URL reference the query of the Alert in the SBA.
}
// from core/models/audit
export const enum AlertEventType {
Loaded = "Alert_Loaded",
Patched = "Alert_Patched",
Add = "Alert_Add",
Delete = "Alert_Delete",
DeleteAll = "Alert_DeleteAll",
Update = "Alert_Update",
Search_AlertQuery = "Search_AlertQuery",
}
// Types of events triggering a change event
export const ALERT_CHANGE_EVENTS = [
AlertEventType.Loaded,
AlertEventType.Add,
AlertEventType.Delete,
AlertEventType.Update
];
// CRUD Events
export interface AlertChangeEvent {
type: AlertEventType;
alert?: Alert;
}
// Model expected by the ManageAlerts Modal.
export interface ManageAlertsModel {
alerts: Alert[];
auditEvents?: AuditEvent[];
searchRoute?: string;
}
/**
* The modal types are unknown to this service.
* The module using this service must provide these components
* in their forRoot() method
*
* Example below:
*
* public static forRoot(): ModuleWithProviders<AlertsModule> {
return {
ngModule: AlertsModule,
providers: [
{
provide: ALERT_COMPONENTS,
useValue: {
editAlertModal: EditAlert,
manageAlertsModal: ManageAlerts
}
},
AlertsService
]
};
}
*
*/
export interface AlertComponents {
editAlertModal: Type<any>;
manageAlertsModal: Type<any>;
}
export const ALERT_COMPONENTS = new InjectionToken<AlertComponents>('ALERT_COMPONENTS');
export const WINDOW = new InjectionToken('WindowToken');
@Injectable({
providedIn: 'root',
})
export class AlertsService implements OnDestroy {
private readonly _events = new Subject<AlertChangeEvent>();
private readonly _changes = new Subject<AlertChangeEvent>();
constructor(
public userSettingsService: UserSettingsWebService,
public searchService: SearchService,
public modalService: ModalService,
@Inject(ALERT_COMPONENTS) public alertComponents: AlertComponents,
@Inject(WINDOW) private window : Window
){
// Listen to the user settings
this.userSettingsService.events.subscribe(event => {
// E.g. new login occurs
// ==> Menus need to be rebuilt
this.events.next({type: AlertEventType.Loaded});
});
// Listen to own events, to trigger change events
this._events.subscribe(event => {
if(ALERT_CHANGE_EVENTS.indexOf(event.type) !== -1){
this.changes.next(event);
}
});
}
// GETTERS
/**
* Returns the list of this user's alerts.
* The list is stored in the user settings (this is a redirection).
* Using this service creates the list of alerts if it does not already exist.
*/
public get alerts() : Alert[]{
if(!this.userSettingsService.userSettings)
this.userSettingsService.userSettings = {};
if(!this.userSettingsService.userSettings["alerts"])
this.userSettingsService.userSettings["alerts"] = [];
return <Alert[]> (<unknown>this.userSettingsService.userSettings["alerts"]);
} // TODO: remove cast when UserSettings is updated
/**
* Triggers any event among AlertChangeEvent
* (use for fine-grained control of alerts workflow)
*/
public get events() : Subject<AlertChangeEvent> {
return this._events;
}
/**
* Triggers when events affect the list of alerts
* (use to refresh alert menus)
* Cf. CHANGE_EVENTS list
*/
public get changes() : Subject<AlertChangeEvent> {
return this._changes;
}
/**
* @returns true if there is at least one alert
*/
public get hasAlert(): boolean {
return this.alerts.length > 0;
}
/**
* @returns an alert with the given name or undefined if it does not exist
* @param name
*/
public alert(name: string): Alert | undefined {
const i = this.alertIndex(name);
return i>= 0? this.alerts[i] : undefined;
}
private alertIndex(name: string): number {
for (let i = 0, ic = this.alerts.length; i < ic; i++) {
const alert = this.alerts[i];
if (alert && alert.name === name) {
return i;
}
}
return -1;
}
// CRUD
/**
* Creates a new alert unless it already exists.
* Emits an Alert event.
* Update the data on the server.
* @param alert the alert to create
* @returns true if alert was created
*/
public createAlert(alert: Alert) : boolean {
if(this.alertIndex(alert.name) >= 0)
return false; // This alert already exists
this.alerts.unshift(alert);
this.events.next({type : AlertEventType.Add, alert: alert});
this.patchAlerts([{
type: AlertEventType.Add,
detail: {
alert: alert.name
}
}]);
return true;
}
/**
* Update the alert at the given index, unless an alert with the same name
* already exists in the list of alerts.
* Emits an Alert event.
* Update the data on the server.
* @param alert the alert to update
* @param index the index at which to update the alert
* @returns true if alert was updated
*/
public updateAlert(alert: Alert, index : number) : boolean {
const prevIndex = this.alertIndex(alert.name);
if(prevIndex !== -1 && index !== prevIndex)
return false; // An alert with the same name exists at a different index
if(index >= 0 && index < this.alerts.length){
this.alerts.splice(index, 1, alert);
this.events.next({type : AlertEventType.Update, alert: alert});
this.patchAlerts([
{
type: AlertEventType.Update,
detail: {
alert: alert.name
}
}
]);
return true;
}
return false; // This alert does not exist
}
/**
* Updates the full list of alerts.
* Emits an Alert event.
* Update the data on the server.
* @param alerts the new list of alerts
* @param auditEvents the list of audit events to log
*/
public updateAlerts(alerts : Alert[], auditEvents?: AuditEvents) : boolean {
Utils.arraySet(this.alerts, alerts);
this.events.next({type : AlertEventType.Update});
this.patchAlerts(auditEvents);
return true;
}
/**
* Deletes the given alert (based on its name)
* Emits an Alert event.
* Update the data on the server.
* @param alert
* @returns true if alert was deleted
*/
public deleteAlert(alert: Alert) : boolean {
const index = this.alertIndex(alert.name);
if(index === -1)
return false; // Nothing to delete
this.alerts.splice(index, 1);
this.events.next({type : AlertEventType.Delete, alert: alert});
this.patchAlerts([
{
type: AlertEventType.Delete,
detail: {
alert: alert.name
}
}
]);
return true;
}
/**
* Sets this alert to the current search context, using the search service
*/
public setAlertToCurrentQuery(alert: Alert){
alert.query = Query.copy(this.searchService.query);
}
/**
* Updates Alerts in User settings.
* @param auditEvents : Audit Events to be triggered
* @returns an Observable which can be used to trigger further events
*/
private patchAlerts(auditEvents?: AuditEvents) {
return this.userSettingsService.patch({alerts: this.alerts}, auditEvents)
.subscribe(
next => {
this.events.next({type: AlertEventType.Patched});
},
error => {
console.error("Could not patch Alerts!", error);
}
);
}
// EVENT HANDLERS (Menus)
/**
* Uses the SearchService to perform a search returning all
* the documents matching this alert.
* @param alert
* @returns the search service promise
*/
public searchAlert(alert: Alert, path?: string) : Promise<boolean> {
this.searchService.setQuery(Utils.extend(this.searchService.makeQuery(), Utils.copy(alert.query)));
this.events.next({type: AlertEventType.Search_AlertQuery, alert: alert});
return this.searchService.search( {path: path}, {
type: AlertEventType.Search_AlertQuery,
detail: {
alert: alert.name
}
});
}
/**
* Opens a dialog allowing a user to create a new alert.
* @returns a boolean promise resolved when the user closes the dialog
* the result is true if the alert was created.
*/
public createAlertModal() : Promise<boolean> {
const alert: Alert = {
name: "",
description: "",
timezone: this.userSettingsService.timezone,
query: Query.copy(this.searchService.query),
frequency: Alert.Frequency.Daily,
days: Alert.Days.WeekDays,
interval: 1,
index: 1,
times: "9:00",
active: true,
combine: true,
respectTabSelection: false
};
const queryUrl = this.window.location.href;
return this.modalService.open(this.alertComponents.editAlertModal, {model: { alert: alert }})
.then((result) => {
if (result === ModalResult.OK) {
const index = this.alertIndex(alert.name);
if (index !== -1) {
return this.modalService.yesNo("msg#alerts.alertAlreadyExists")
.then((result) => {
if (result === ModalResult.Yes) {
alert.appQueryUrl = queryUrl;
return this.updateAlert(alert, index);
}
return false;
});
} else {
alert.appQueryUrl = queryUrl;
return this.createAlert(alert);
}
}
return false;
});
}
/**
* Opens a dialog allowing a user to edit an existing alert.
* @param alert: The alert to edit
* @param noUpdate: if true, will not update the server after the edit
* @param searchRoute: the route to use when replaying the alert's query
* @returns a boolean promise resolved when the user closes the dialog
* the result is true if the alert was updated.
*/
public editAlertModal(alert: Alert, noUpdate?: boolean, searchRoute?: string) : Promise<boolean> {
const prevName = alert.name;
const queryUrl = this.window.location.href;
return this.modalService.open(this.alertComponents.editAlertModal, {model: { alert: alert, searchRoute: searchRoute }})
.then((result) => {
if (result === ModalResult.OK) {
if(noUpdate) return true;
const prevIndex = this.alertIndex(prevName);
if(prevIndex === -1) return false; // this alert did not exist
const index = this.alertIndex(alert.name);
if (index !== -1 && index !== prevIndex) { // An alert with the same (new) name exists
return this.modalService.yesNo("msg#alerts.alertAlreadyExists")
.then((result) => {
if (result === ModalResult.Yes) {
const prevAlert = this.alert(prevName);
if (prevAlert) {
this.deleteAlert(prevAlert); // Remove the alert with old name
}
alert.appQueryUrl = queryUrl;
return this.updateAlert(alert, this.alertIndex(alert.name)); // Update the alert with new name (index might have changed due to delete of old name)
}
return false;
});
} else {
alert.appQueryUrl = queryUrl;
return this.updateAlert(alert, prevIndex); // Update this alert
}
}
return false;
});
}
/**
* Opens a dialog allowing a user to reorganize and edit the
* list of alerts.
* @returns a boolean promise resolved when the user closes the dialog
* the result is true is the list was updated.
*/
public manageAlertsModal(searchRoute?: string) : Promise<boolean> {
const model: ManageAlertsModel = { alerts: Utils.copy(this.alerts), searchRoute: searchRoute };
return this.modalService.open(this.alertComponents.manageAlertsModal, {model})
.then((result) => {
if (result === ModalResult.OK) {
return this.updateAlerts(model.alerts, model.auditEvents);
}
return false;
});
}
ngOnDestroy() {
this.events.complete();
this.changes.complete();
}
}


✆ Call Aaron today:<PHONE_NUMBER>1
A.M Digger & Landscaping
Home
Services
Contact Us
Potfolio
Portfolio
Home
Portfolio